window.decidimBulletinBoard = /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@apollo/client/cache/core/cache.js": /*!*********************************************************!*\ !*** ./node_modules/@apollo/client/cache/core/cache.js ***! \*********************************************************/ /*! namespace exports */ /*! export ApolloCache [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ApolloCache": () => /* binding */ ApolloCache /* harmony export */ }); /* harmony import */ var optimism__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! optimism */ "./node_modules/optimism/lib/bundle.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); ; var ApolloCache = (function () { function ApolloCache() { this.getFragmentDoc = (0,optimism__WEBPACK_IMPORTED_MODULE_0__.wrap)(_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.getFragmentQueryDocument); } ApolloCache.prototype.recordOptimisticTransaction = function (transaction, optimisticId) { this.performTransaction(transaction, optimisticId); }; ApolloCache.prototype.transformDocument = function (document) { return document; }; ApolloCache.prototype.identify = function (object) { return; }; ApolloCache.prototype.gc = function () { return []; }; ApolloCache.prototype.modify = function (options) { return false; }; ApolloCache.prototype.transformForLink = function (document) { return document; }; ApolloCache.prototype.readQuery = function (options, optimistic) { if (optimistic === void 0) { optimistic = false; } return this.read({ rootId: options.id || 'ROOT_QUERY', query: options.query, variables: options.variables, optimistic: optimistic, }); }; ApolloCache.prototype.readFragment = function (options, optimistic) { if (optimistic === void 0) { optimistic = false; } return this.read({ query: this.getFragmentDoc(options.fragment, options.fragmentName), variables: options.variables, rootId: options.id, optimistic: optimistic, }); }; ApolloCache.prototype.writeQuery = function (options) { return this.write({ dataId: options.id || 'ROOT_QUERY', result: options.data, query: options.query, variables: options.variables, broadcast: options.broadcast, }); }; ApolloCache.prototype.writeFragment = function (options) { return this.write({ dataId: options.id, result: options.data, variables: options.variables, query: this.getFragmentDoc(options.fragment, options.fragmentName), broadcast: options.broadcast, }); }; return ApolloCache; }()); //# sourceMappingURL=cache.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/core/types/Cache.js": /*!***************************************************************!*\ !*** ./node_modules/@apollo/client/cache/core/types/Cache.js ***! \***************************************************************/ /*! namespace exports */ /*! export Cache [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Cache": () => /* binding */ Cache /* harmony export */ }); var Cache; (function (Cache) { })(Cache || (Cache = {})); //# sourceMappingURL=Cache.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/core/types/common.js": /*!****************************************************************!*\ !*** ./node_modules/@apollo/client/cache/core/types/common.js ***! \****************************************************************/ /*! namespace exports */ /*! export MissingFieldError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "MissingFieldError": () => /* binding */ MissingFieldError /* harmony export */ }); var MissingFieldError = (function () { function MissingFieldError(message, path, query, clientOnly, variables) { this.message = message; this.path = path; this.query = query; this.clientOnly = clientOnly; this.variables = variables; } return MissingFieldError; }()); //# sourceMappingURL=common.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/index.js": /*!****************************************************!*\ !*** ./node_modules/@apollo/client/cache/index.js ***! \****************************************************/ /*! namespace exports */ /*! export ApolloCache [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/core/cache.js .ApolloCache */ /*! export Cache [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/core/types/Cache.js .Cache */ /*! export InMemoryCache [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/inmemory/inMemoryCache.js .InMemoryCache */ /*! export MissingFieldError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/core/types/common.js .MissingFieldError */ /*! export cacheSlot [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/inmemory/reactiveVars.js .cacheSlot */ /*! export default [not provided] [no usage info] [missing usage info prevents renaming] */ /*! export defaultDataIdFromObject [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/inmemory/policies.js .defaultDataIdFromObject */ /*! export isReference [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .isReference */ /*! export makeReference [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .makeReference */ /*! export makeVar [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/inmemory/reactiveVars.js .makeVar */ /*! other exports [maybe provided (runtime-defined)] [no usage info] -> ./node_modules/@apollo/client/cache/inmemory/types.js */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.n, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ApolloCache": () => /* reexport safe */ _core_cache_js__WEBPACK_IMPORTED_MODULE_0__.ApolloCache, /* harmony export */ "Cache": () => /* reexport safe */ _core_types_Cache_js__WEBPACK_IMPORTED_MODULE_1__.Cache, /* harmony export */ "MissingFieldError": () => /* reexport safe */ _core_types_common_js__WEBPACK_IMPORTED_MODULE_2__.MissingFieldError, /* harmony export */ "isReference": () => /* reexport safe */ _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.isReference, /* harmony export */ "makeReference": () => /* reexport safe */ _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.makeReference, /* harmony export */ "InMemoryCache": () => /* reexport safe */ _inmemory_inMemoryCache_js__WEBPACK_IMPORTED_MODULE_4__.InMemoryCache, /* harmony export */ "makeVar": () => /* reexport safe */ _inmemory_reactiveVars_js__WEBPACK_IMPORTED_MODULE_5__.makeVar, /* harmony export */ "cacheSlot": () => /* reexport safe */ _inmemory_reactiveVars_js__WEBPACK_IMPORTED_MODULE_5__.cacheSlot, /* harmony export */ "defaultDataIdFromObject": () => /* reexport safe */ _inmemory_policies_js__WEBPACK_IMPORTED_MODULE_6__.defaultDataIdFromObject /* harmony export */ }); /* harmony import */ var _core_cache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/cache.js */ "./node_modules/@apollo/client/cache/core/cache.js"); /* harmony import */ var _core_types_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core/types/Cache.js */ "./node_modules/@apollo/client/cache/core/types/Cache.js"); /* harmony import */ var _core_types_common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core/types/common.js */ "./node_modules/@apollo/client/cache/core/types/common.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _inmemory_inMemoryCache_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inmemory/inMemoryCache.js */ "./node_modules/@apollo/client/cache/inmemory/inMemoryCache.js"); /* harmony import */ var _inmemory_reactiveVars_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./inmemory/reactiveVars.js */ "./node_modules/@apollo/client/cache/inmemory/reactiveVars.js"); /* harmony import */ var _inmemory_policies_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./inmemory/policies.js */ "./node_modules/@apollo/client/cache/inmemory/policies.js"); /* harmony import */ var _inmemory_types_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./inmemory/types.js */ "./node_modules/@apollo/client/cache/inmemory/types.js"); /* harmony import */ var _inmemory_types_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_inmemory_types_js__WEBPACK_IMPORTED_MODULE_7__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _inmemory_types_js__WEBPACK_IMPORTED_MODULE_7__) if(["default","ApolloCache","Cache","MissingFieldError","isReference","makeReference","InMemoryCache","makeVar","cacheSlot","defaultDataIdFromObject"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _inmemory_types_js__WEBPACK_IMPORTED_MODULE_7__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/entityStore.js": /*!*******************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/entityStore.js ***! \*******************************************************************/ /*! namespace exports */ /*! export EntityStore [provided] [no usage info] [missing usage info prevents renaming] */ /*! export supportsResultCaching [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "EntityStore": () => /* binding */ EntityStore, /* harmony export */ "supportsResultCaching": () => /* binding */ supportsResultCaching /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var optimism__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! optimism */ "./node_modules/optimism/lib/bundle.esm.js"); /* harmony import */ var _wry_equality__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wry/equality */ "./node_modules/@wry/equality/lib/equality.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@apollo/client/cache/inmemory/helpers.js"); ; var DELETE = Object.create(null); var delModifier = function () { return DELETE; }; var INVALIDATE = Object.create(null); var EntityStore = (function () { function EntityStore(policies, group) { var _this = this; this.policies = policies; this.group = group; this.data = Object.create(null); this.rootIds = Object.create(null); this.refs = Object.create(null); this.getFieldValue = function (objectOrReference, storeFieldName) { return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.maybeDeepFreeze)((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(objectOrReference) ? _this.get(objectOrReference.__ref, storeFieldName) : objectOrReference && objectOrReference[storeFieldName]); }; this.canRead = function (objOrRef) { return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(objOrRef) ? _this.has(objOrRef.__ref) : typeof objOrRef === "object"; }; this.toReference = function (objOrIdOrRef, mergeIntoStore) { if (typeof objOrIdOrRef === "string") { return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.makeReference)(objOrIdOrRef); } if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(objOrIdOrRef)) { return objOrIdOrRef; } var id = _this.policies.identify(objOrIdOrRef)[0]; if (id) { var ref = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.makeReference)(id); if (mergeIntoStore) { _this.merge(id, objOrIdOrRef); } return ref; } }; } EntityStore.prototype.toObject = function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, this.data); }; EntityStore.prototype.has = function (dataId) { return this.lookup(dataId, true) !== void 0; }; EntityStore.prototype.get = function (dataId, fieldName) { this.group.depend(dataId, fieldName); if (_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(this.data, dataId)) { var storeObject = this.data[dataId]; if (storeObject && _helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(storeObject, fieldName)) { return storeObject[fieldName]; } } if (fieldName === "__typename" && _helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(this.policies.rootTypenamesById, dataId)) { return this.policies.rootTypenamesById[dataId]; } if (this instanceof Layer) { return this.parent.get(dataId, fieldName); } }; EntityStore.prototype.lookup = function (dataId, dependOnExistence) { if (dependOnExistence) this.group.depend(dataId, "__exists"); return _helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(this.data, dataId) ? this.data[dataId] : this instanceof Layer ? this.parent.lookup(dataId, dependOnExistence) : void 0; }; EntityStore.prototype.merge = function (dataId, incoming) { var _this = this; var existing = this.lookup(dataId); var merged = new _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.DeepMerger(storeObjectReconciler).merge(existing, incoming); this.data[dataId] = merged; if (merged !== existing) { delete this.refs[dataId]; if (this.group.caching) { var fieldsToDirty_1 = Object.create(null); if (!existing) fieldsToDirty_1.__exists = 1; Object.keys(incoming).forEach(function (storeFieldName) { if (!existing || existing[storeFieldName] !== merged[storeFieldName]) { fieldsToDirty_1[(0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName)] = 1; if (merged[storeFieldName] === void 0 && !(_this instanceof Layer)) { delete merged[storeFieldName]; } } }); Object.keys(fieldsToDirty_1).forEach(function (fieldName) { return _this.group.dirty(dataId, fieldName); }); } } }; EntityStore.prototype.modify = function (dataId, fields) { var _this = this; var storeObject = this.lookup(dataId); if (storeObject) { var changedFields_1 = Object.create(null); var needToMerge_1 = false; var allDeleted_1 = true; var sharedDetails_1 = { DELETE: DELETE, INVALIDATE: INVALIDATE, isReference: _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference, toReference: this.toReference, canRead: this.canRead, readField: function (fieldNameOrOptions, from) { return _this.policies.readField(typeof fieldNameOrOptions === "string" ? { fieldName: fieldNameOrOptions, from: from || (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.makeReference)(dataId), } : fieldNameOrOptions, { store: _this }); }, }; Object.keys(storeObject).forEach(function (storeFieldName) { var fieldName = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName); var fieldValue = storeObject[storeFieldName]; if (fieldValue === void 0) return; var modify = typeof fields === "function" ? fields : fields[storeFieldName] || fields[fieldName]; if (modify) { var newValue = modify === delModifier ? DELETE : modify((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.maybeDeepFreeze)(fieldValue), (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, sharedDetails_1), { fieldName: fieldName, storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) })); if (newValue === INVALIDATE) { _this.group.dirty(dataId, storeFieldName); } else { if (newValue === DELETE) newValue = void 0; if (newValue !== fieldValue) { changedFields_1[storeFieldName] = newValue; needToMerge_1 = true; fieldValue = newValue; } } } if (fieldValue !== void 0) { allDeleted_1 = false; } }); if (needToMerge_1) { this.merge(dataId, changedFields_1); if (allDeleted_1) { if (this instanceof Layer) { this.data[dataId] = void 0; } else { delete this.data[dataId]; } this.group.dirty(dataId, "__exists"); } return true; } } return false; }; EntityStore.prototype.delete = function (dataId, fieldName, args) { var _a; var storeObject = this.lookup(dataId); if (storeObject) { var typename = this.getFieldValue(storeObject, "__typename"); var storeFieldName = fieldName && args ? this.policies.getStoreFieldName({ typename: typename, fieldName: fieldName, args: args }) : fieldName; return this.modify(dataId, storeFieldName ? (_a = {}, _a[storeFieldName] = delModifier, _a) : delModifier); } return false; }; EntityStore.prototype.evict = function (options) { var evicted = false; if (options.id) { if (_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(this.data, options.id)) { evicted = this.delete(options.id, options.fieldName, options.args); } if (this instanceof Layer) { evicted = this.parent.evict(options) || evicted; } if (options.fieldName || evicted) { this.group.dirty(options.id, options.fieldName || "__exists"); } } return evicted; }; EntityStore.prototype.clear = function () { this.replace(null); }; EntityStore.prototype.replace = function (newData) { var _this = this; Object.keys(this.data).forEach(function (dataId) { if (!(newData && _helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(newData, dataId))) { _this.delete(dataId); } }); if (newData) { Object.keys(newData).forEach(function (dataId) { _this.merge(dataId, newData[dataId]); }); } }; EntityStore.prototype.retain = function (rootId) { return this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1; }; EntityStore.prototype.release = function (rootId) { if (this.rootIds[rootId] > 0) { var count = --this.rootIds[rootId]; if (!count) delete this.rootIds[rootId]; return count; } return 0; }; EntityStore.prototype.getRootIdSet = function (ids) { if (ids === void 0) { ids = new Set(); } Object.keys(this.rootIds).forEach(ids.add, ids); if (this instanceof Layer) { this.parent.getRootIdSet(ids); } else { Object.keys(this.policies.rootTypenamesById).forEach(ids.add, ids); } return ids; }; EntityStore.prototype.gc = function () { var _this = this; var ids = this.getRootIdSet(); var snapshot = this.toObject(); ids.forEach(function (id) { if (_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(snapshot, id)) { Object.keys(_this.findChildRefIds(id)).forEach(ids.add, ids); delete snapshot[id]; } }); var idsToRemove = Object.keys(snapshot); if (idsToRemove.length) { var root_1 = this; while (root_1 instanceof Layer) root_1 = root_1.parent; idsToRemove.forEach(function (id) { return root_1.delete(id); }); } return idsToRemove; }; EntityStore.prototype.findChildRefIds = function (dataId) { if (!_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(this.refs, dataId)) { var found_1 = this.refs[dataId] = Object.create(null); var workSet_1 = new Set([this.data[dataId]]); var canTraverse_1 = function (obj) { return obj !== null && typeof obj === 'object'; }; workSet_1.forEach(function (obj) { if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(obj)) { found_1[obj.__ref] = true; } else if (canTraverse_1(obj)) { Object.values(obj) .filter(canTraverse_1) .forEach(workSet_1.add, workSet_1); } }); } return this.refs[dataId]; }; EntityStore.prototype.makeCacheKey = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return this.group.keyMaker.lookupArray(args); }; return EntityStore; }()); var CacheGroup = (function () { function CacheGroup(caching) { this.caching = caching; this.d = null; this.keyMaker = new optimism__WEBPACK_IMPORTED_MODULE_0__.KeyTrie(_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.canUseWeakMap); this.d = caching ? (0,optimism__WEBPACK_IMPORTED_MODULE_0__.dep)() : null; } CacheGroup.prototype.depend = function (dataId, storeFieldName) { if (this.d) { this.d(makeDepKey(dataId, storeFieldName)); } }; CacheGroup.prototype.dirty = function (dataId, storeFieldName) { if (this.d) { this.d.dirty(makeDepKey(dataId, storeFieldName)); } }; return CacheGroup; }()); function makeDepKey(dataId, storeFieldName) { return (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName) + '#' + dataId; } (function (EntityStore) { var Root = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(Root, _super); function Root(_a) { var policies = _a.policies, _b = _a.resultCaching, resultCaching = _b === void 0 ? true : _b, seed = _a.seed; var _this = _super.call(this, policies, new CacheGroup(resultCaching)) || this; _this.storageTrie = new optimism__WEBPACK_IMPORTED_MODULE_0__.KeyTrie(_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.canUseWeakMap); _this.sharedLayerGroup = new CacheGroup(resultCaching); if (seed) _this.replace(seed); return _this; } Root.prototype.addLayer = function (layerId, replay) { return new Layer(layerId, this, replay, this.sharedLayerGroup); }; Root.prototype.removeLayer = function () { return this; }; Root.prototype.getStorage = function (idOrObj, storeFieldName) { return this.storageTrie.lookup(idOrObj, storeFieldName); }; return Root; }(EntityStore)); EntityStore.Root = Root; })(EntityStore || (EntityStore = {})); var Layer = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(Layer, _super); function Layer(id, parent, replay, group) { var _this = _super.call(this, parent.policies, group) || this; _this.id = id; _this.parent = parent; _this.replay = replay; _this.group = group; replay(_this); return _this; } Layer.prototype.addLayer = function (layerId, replay) { return new Layer(layerId, this, replay, this.group); }; Layer.prototype.removeLayer = function (layerId) { var _this = this; var parent = this.parent.removeLayer(layerId); if (layerId === this.id) { if (this.group.caching) { Object.keys(this.data).forEach(function (dataId) { if (_this.data[dataId] !== parent.lookup(dataId)) { _this.delete(dataId); } }); } return parent; } if (parent === this.parent) return this; return parent.addLayer(this.id, this.replay); }; Layer.prototype.toObject = function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, this.parent.toObject()), this.data); }; Layer.prototype.findChildRefIds = function (dataId) { var fromParent = this.parent.findChildRefIds(dataId); return _helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(this.data, dataId) ? (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent; }; Layer.prototype.getStorage = function (idOrObj, storeFieldName) { return this.parent.getStorage(idOrObj, storeFieldName); }; return Layer; }(EntityStore)); function storeObjectReconciler(existingObject, incomingObject, property) { var existingValue = existingObject[property]; var incomingValue = incomingObject[property]; return (0,_wry_equality__WEBPACK_IMPORTED_MODULE_1__.equal)(existingValue, incomingValue) ? existingValue : incomingValue; } function supportsResultCaching(store) { return !!(store instanceof EntityStore && store.group.caching); } //# sourceMappingURL=entityStore.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/fixPolyfills.js": /*!********************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/fixPolyfills.js ***! \********************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: */ /***/ (() => { //# sourceMappingURL=fixPolyfills.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/helpers.js": /*!***************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/helpers.js ***! \***************************************************************/ /*! namespace exports */ /*! export TypeOrFieldNameRegExp [provided] [no usage info] [missing usage info prevents renaming] */ /*! export fieldNameFromStoreName [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getTypenameFromStoreObject [provided] [no usage info] [missing usage info prevents renaming] */ /*! export hasOwn [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isFieldValueToBeMerged [provided] [no usage info] [missing usage info prevents renaming] */ /*! export makeProcessedFieldsMerger [provided] [no usage info] [missing usage info prevents renaming] */ /*! export selectionSetMatchesResult [provided] [no usage info] [missing usage info prevents renaming] */ /*! export storeValueIsStoreObject [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "hasOwn": () => /* binding */ hasOwn, /* harmony export */ "getTypenameFromStoreObject": () => /* binding */ getTypenameFromStoreObject, /* harmony export */ "TypeOrFieldNameRegExp": () => /* binding */ TypeOrFieldNameRegExp, /* harmony export */ "fieldNameFromStoreName": () => /* binding */ fieldNameFromStoreName, /* harmony export */ "selectionSetMatchesResult": () => /* binding */ selectionSetMatchesResult, /* harmony export */ "storeValueIsStoreObject": () => /* binding */ storeValueIsStoreObject, /* harmony export */ "isFieldValueToBeMerged": () => /* binding */ isFieldValueToBeMerged, /* harmony export */ "makeProcessedFieldsMerger": () => /* binding */ makeProcessedFieldsMerger /* harmony export */ }); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); ; var hasOwn = Object.prototype.hasOwnProperty; function getTypenameFromStoreObject(store, objectOrReference) { return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.isReference)(objectOrReference) ? store.get(objectOrReference.__ref, "__typename") : objectOrReference && objectOrReference.__typename; } var TypeOrFieldNameRegExp = /^[_a-z][_0-9a-z]*/i; function fieldNameFromStoreName(storeFieldName) { var match = storeFieldName.match(TypeOrFieldNameRegExp); return match ? match[0] : storeFieldName; } function selectionSetMatchesResult(selectionSet, result, variables) { if (result && typeof result === "object") { return Array.isArray(result) ? result.every(function (item) { return selectionSetMatchesResult(selectionSet, item, variables); }) : selectionSet.selections.every(function (field) { if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.isField)(field) && (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.shouldInclude)(field, variables)) { var key = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.resultKeyNameFromField)(field); return hasOwn.call(result, key) && (!field.selectionSet || selectionSetMatchesResult(field.selectionSet, result[key], variables)); } return true; }); } return false; } function storeValueIsStoreObject(value) { return value !== null && typeof value === "object" && !(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.isReference)(value) && !Array.isArray(value); } function isFieldValueToBeMerged(value) { var field = value && value.__field; return field && (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.isField)(field); } function makeProcessedFieldsMerger() { return new _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.DeepMerger(reconcileProcessedFields); } var reconcileProcessedFields = function (existingObject, incomingObject, property) { var existing = existingObject[property]; var incoming = incomingObject[property]; if (isFieldValueToBeMerged(existing)) { existing.__value = this.merge(existing.__value, isFieldValueToBeMerged(incoming) ? incoming.__value : incoming); return existing; } if (isFieldValueToBeMerged(incoming)) { incoming.__value = this.merge(existing, incoming.__value); return incoming; } return this.merge(existing, incoming); }; //# sourceMappingURL=helpers.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/inMemoryCache.js": /*!*********************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/inMemoryCache.js ***! \*********************************************************************/ /*! namespace exports */ /*! export InMemoryCache [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "InMemoryCache": () => /* binding */ InMemoryCache /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _fixPolyfills_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fixPolyfills.js */ "./node_modules/@apollo/client/cache/inmemory/fixPolyfills.js"); /* harmony import */ var _fixPolyfills_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_fixPolyfills_js__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var optimism__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! optimism */ "./node_modules/optimism/lib/bundle.esm.js"); /* harmony import */ var _core_cache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/cache.js */ "./node_modules/@apollo/client/cache/core/cache.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _readFromStore_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./readFromStore.js */ "./node_modules/@apollo/client/cache/inmemory/readFromStore.js"); /* harmony import */ var _writeToStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./writeToStore.js */ "./node_modules/@apollo/client/cache/inmemory/writeToStore.js"); /* harmony import */ var _entityStore_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./entityStore.js */ "./node_modules/@apollo/client/cache/inmemory/entityStore.js"); /* harmony import */ var _reactiveVars_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./reactiveVars.js */ "./node_modules/@apollo/client/cache/inmemory/reactiveVars.js"); /* harmony import */ var _policies_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./policies.js */ "./node_modules/@apollo/client/cache/inmemory/policies.js"); /* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@apollo/client/cache/inmemory/helpers.js"); ; var defaultConfig = { dataIdFromObject: _policies_js__WEBPACK_IMPORTED_MODULE_8__.defaultDataIdFromObject, addTypename: true, resultCaching: true, typePolicies: {}, }; var InMemoryCache = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__extends)(InMemoryCache, _super); function InMemoryCache(config) { if (config === void 0) { config = {}; } var _this = _super.call(this) || this; _this.watches = new Set(); _this.typenameDocumentCache = new Map(); _this.makeVar = _reactiveVars_js__WEBPACK_IMPORTED_MODULE_7__.makeVar; _this.txCount = 0; _this.maybeBroadcastWatch = (0,optimism__WEBPACK_IMPORTED_MODULE_1__.wrap)(function (c, fromOptimisticTransaction) { return _this.broadcastWatch.call(_this, c, !!fromOptimisticTransaction); }, { makeCacheKey: function (c) { var store = c.optimistic ? _this.optimisticData : _this.data; if ((0,_entityStore_js__WEBPACK_IMPORTED_MODULE_6__.supportsResultCaching)(store)) { var optimistic = c.optimistic, rootId = c.rootId, variables = c.variables; return store.makeCacheKey(c.query, c.callback, JSON.stringify({ optimistic: optimistic, rootId: rootId, variables: variables })); } } }); _this.watchDep = (0,optimism__WEBPACK_IMPORTED_MODULE_1__.dep)(); _this.config = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, defaultConfig), config); _this.addTypename = !!_this.config.addTypename; _this.policies = new _policies_js__WEBPACK_IMPORTED_MODULE_8__.Policies({ cache: _this, dataIdFromObject: _this.config.dataIdFromObject, possibleTypes: _this.config.possibleTypes, typePolicies: _this.config.typePolicies, }); _this.data = new _entityStore_js__WEBPACK_IMPORTED_MODULE_6__.EntityStore.Root({ policies: _this.policies, resultCaching: _this.config.resultCaching, }); _this.optimisticData = _this.data; _this.storeWriter = new _writeToStore_js__WEBPACK_IMPORTED_MODULE_5__.StoreWriter(_this, _this.storeReader = new _readFromStore_js__WEBPACK_IMPORTED_MODULE_4__.StoreReader({ cache: _this, addTypename: _this.addTypename, })); return _this; } InMemoryCache.prototype.restore = function (data) { if (data) this.data.replace(data); return this; }; InMemoryCache.prototype.extract = function (optimistic) { if (optimistic === void 0) { optimistic = false; } return (optimistic ? this.optimisticData : this.data).toObject(); }; InMemoryCache.prototype.read = function (options) { var store = options.optimistic ? this.optimisticData : this.data; if (typeof options.rootId === 'string' && !store.has(options.rootId)) { return null; } return this.storeReader.diffQueryAgainstStore({ store: store, query: options.query, variables: options.variables, rootId: options.rootId, config: this.config, returnPartialData: false, }).result || null; }; InMemoryCache.prototype.write = function (options) { try { ++this.txCount; return this.storeWriter.writeToStore({ store: this.data, query: options.query, result: options.result, dataId: options.dataId, variables: options.variables, }); } finally { if (!--this.txCount && options.broadcast !== false) { this.broadcastWatches(); } } }; InMemoryCache.prototype.modify = function (options) { if (_helpers_js__WEBPACK_IMPORTED_MODULE_9__.hasOwn.call(options, "id") && !options.id) { return false; } var store = options.optimistic ? this.optimisticData : this.data; try { ++this.txCount; return store.modify(options.id || "ROOT_QUERY", options.fields); } finally { if (!--this.txCount && options.broadcast !== false) { this.broadcastWatches(); } } }; InMemoryCache.prototype.diff = function (options) { return this.storeReader.diffQueryAgainstStore({ store: options.optimistic ? this.optimisticData : this.data, rootId: options.id || "ROOT_QUERY", query: options.query, variables: options.variables, returnPartialData: options.returnPartialData, config: this.config, }); }; InMemoryCache.prototype.watch = function (watch) { var _this = this; this.watches.add(watch); if (watch.immediate) { this.maybeBroadcastWatch(watch); } return function () { _this.watches.delete(watch); _this.watchDep.dirty(watch); _this.maybeBroadcastWatch.forget(watch); }; }; InMemoryCache.prototype.gc = function () { return this.optimisticData.gc(); }; InMemoryCache.prototype.retain = function (rootId, optimistic) { return (optimistic ? this.optimisticData : this.data).retain(rootId); }; InMemoryCache.prototype.release = function (rootId, optimistic) { return (optimistic ? this.optimisticData : this.data).release(rootId); }; InMemoryCache.prototype.identify = function (object) { return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.isReference)(object) ? object.__ref : this.policies.identify(object)[0]; }; InMemoryCache.prototype.evict = function (options) { if (!options.id) { if (_helpers_js__WEBPACK_IMPORTED_MODULE_9__.hasOwn.call(options, "id")) { return false; } options = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, options), { id: "ROOT_QUERY" }); } try { ++this.txCount; return this.optimisticData.evict(options); } finally { if (!--this.txCount && options.broadcast !== false) { this.broadcastWatches(); } } }; InMemoryCache.prototype.reset = function () { this.data.clear(); this.optimisticData = this.data; this.broadcastWatches(); return Promise.resolve(); }; InMemoryCache.prototype.removeOptimistic = function (idToRemove) { var newOptimisticData = this.optimisticData.removeLayer(idToRemove); if (newOptimisticData !== this.optimisticData) { this.optimisticData = newOptimisticData; this.broadcastWatches(); } }; InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { var _this = this; var perform = function (layer) { var _a = _this, data = _a.data, optimisticData = _a.optimisticData; ++_this.txCount; if (layer) { _this.data = _this.optimisticData = layer; } try { transaction(_this); } finally { --_this.txCount; _this.data = data; _this.optimisticData = optimisticData; } }; var fromOptimisticTransaction = false; if (typeof optimisticId === 'string') { this.optimisticData = this.optimisticData.addLayer(optimisticId, perform); fromOptimisticTransaction = true; } else if (optimisticId === null) { perform(this.data); } else { perform(); } this.broadcastWatches(fromOptimisticTransaction); }; InMemoryCache.prototype.transformDocument = function (document) { if (this.addTypename) { var result = this.typenameDocumentCache.get(document); if (!result) { result = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.addTypenameToDocument)(document); this.typenameDocumentCache.set(document, result); this.typenameDocumentCache.set(result, result); } return result; } return document; }; InMemoryCache.prototype.broadcastWatches = function (fromOptimisticTransaction) { var _this = this; if (!this.txCount) { this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c, fromOptimisticTransaction); }); } }; InMemoryCache.prototype.broadcastWatch = function (c, fromOptimisticTransaction) { this.watchDep.dirty(c); this.watchDep(c); var diff = this.diff({ query: c.query, variables: c.variables, optimistic: c.optimistic, }); if (c.optimistic && fromOptimisticTransaction) { diff.fromOptimisticTransaction = true; } c.callback(diff); }; return InMemoryCache; }(_core_cache_js__WEBPACK_IMPORTED_MODULE_2__.ApolloCache)); //# sourceMappingURL=inMemoryCache.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/policies.js": /*!****************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/policies.js ***! \****************************************************************/ /*! namespace exports */ /*! export Policies [provided] [no usage info] [missing usage info prevents renaming] */ /*! export defaultDataIdFromObject [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "defaultDataIdFromObject": () => /* binding */ defaultDataIdFromObject, /* harmony export */ "Policies": () => /* binding */ Policies /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var optimism__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! optimism */ "./node_modules/optimism/lib/bundle.esm.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@apollo/client/cache/inmemory/helpers.js"); /* harmony import */ var _reactiveVars_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reactiveVars.js */ "./node_modules/@apollo/client/cache/inmemory/reactiveVars.js"); ; function argsFromFieldSpecifier(spec) { return spec.args !== void 0 ? spec.args : spec.field ? (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.argumentsObjectFromField)(spec.field, spec.variables) : null; } var defaultDataIdFromObject = function (_a, context) { var __typename = _a.__typename, id = _a.id, _id = _a._id; if (typeof __typename === "string") { if (context) { context.keyObject = id !== void 0 ? { id: id } : _id !== void 0 ? { _id: _id } : void 0; } if (id === void 0) id = _id; if (id !== void 0) { return __typename + ":" + ((typeof id === "number" || typeof id === "string") ? id : JSON.stringify(id)); } } }; var nullKeyFieldsFn = function () { return void 0; }; var simpleKeyArgsFn = function (_args, context) { return context.fieldName; }; var mergeTrueFn = function (existing, incoming, _a) { var mergeObjects = _a.mergeObjects; return mergeObjects(existing, incoming); }; var mergeFalseFn = function (_, incoming) { return incoming; }; var Policies = (function () { function Policies(config) { this.config = config; this.typePolicies = Object.create(null); this.supertypeMap = new Map(); this.fuzzySubtypes = new Map(); this.rootIdsByTypename = Object.create(null); this.rootTypenamesById = Object.create(null); this.usingPossibleTypes = false; this.config = (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({ dataIdFromObject: defaultDataIdFromObject }, config); this.cache = this.config.cache; this.setRootTypename("Query"); this.setRootTypename("Mutation"); this.setRootTypename("Subscription"); if (config.possibleTypes) { this.addPossibleTypes(config.possibleTypes); } if (config.typePolicies) { this.addTypePolicies(config.typePolicies); } } Policies.prototype.identify = function (object, selectionSet, fragmentMap) { var typename = selectionSet && fragmentMap ? (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getTypenameFromResult)(object, selectionSet, fragmentMap) : object.__typename; if (typename === this.rootTypenamesById.ROOT_QUERY) { return ["ROOT_QUERY"]; } var context = { typename: typename, selectionSet: selectionSet, fragmentMap: fragmentMap, }; var id; var policy = this.getTypePolicy(typename, false); var keyFn = policy && policy.keyFn || this.config.dataIdFromObject; while (keyFn) { var specifierOrId = keyFn(object, context); if (Array.isArray(specifierOrId)) { keyFn = keyFieldsFnFromSpecifier(specifierOrId); } else { id = specifierOrId; break; } } id = id && String(id); return context.keyObject ? [id, context.keyObject] : [id]; }; Policies.prototype.addTypePolicies = function (typePolicies) { var _this = this; Object.keys(typePolicies).forEach(function (typename) { var existing = _this.getTypePolicy(typename, true); var incoming = typePolicies[typename]; var keyFields = incoming.keyFields, fields = incoming.fields; if (incoming.queryType) _this.setRootTypename("Query", typename); if (incoming.mutationType) _this.setRootTypename("Mutation", typename); if (incoming.subscriptionType) _this.setRootTypename("Subscription", typename); existing.keyFn = keyFields === false ? nullKeyFieldsFn : Array.isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) : typeof keyFields === "function" ? keyFields : existing.keyFn; if (fields) { Object.keys(fields).forEach(function (fieldName) { var existing = _this.getFieldPolicy(typename, fieldName, true); var incoming = fields[fieldName]; if (typeof incoming === "function") { existing.read = incoming; } else { var keyArgs = incoming.keyArgs, read = incoming.read, merge = incoming.merge; existing.keyFn = keyArgs === false ? simpleKeyArgsFn : Array.isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) : typeof keyArgs === "function" ? keyArgs : existing.keyFn; if (typeof read === "function") existing.read = read; existing.merge = typeof merge === "function" ? merge : merge === true ? mergeTrueFn : merge === false ? mergeFalseFn : existing.merge; } if (existing.read && existing.merge) { existing.keyFn = existing.keyFn || simpleKeyArgsFn; } }); } }); }; Policies.prototype.setRootTypename = function (which, typename) { if (typename === void 0) { typename = which; } var rootId = "ROOT_" + which.toUpperCase(); var old = this.rootTypenamesById[rootId]; if (typename !== old) { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant)(!old || old === which, "Cannot change root " + which + " __typename more than once"); if (old) delete this.rootIdsByTypename[old]; this.rootIdsByTypename[typename] = rootId; this.rootTypenamesById[rootId] = typename; } }; Policies.prototype.addPossibleTypes = function (possibleTypes) { var _this = this; this.usingPossibleTypes = true; Object.keys(possibleTypes).forEach(function (supertype) { _this.getSupertypeSet(supertype, true); possibleTypes[supertype].forEach(function (subtype) { _this.getSupertypeSet(subtype, true).add(supertype); var match = subtype.match(_helpers_js__WEBPACK_IMPORTED_MODULE_3__.TypeOrFieldNameRegExp); if (!match || match[0] !== subtype) { _this.fuzzySubtypes.set(subtype, new RegExp(subtype)); } }); }); }; Policies.prototype.getTypePolicy = function (typename, createIfMissing) { if (typename) { return this.typePolicies[typename] || (createIfMissing && (this.typePolicies[typename] = Object.create(null))); } }; Policies.prototype.getFieldPolicy = function (typename, fieldName, createIfMissing) { var typePolicy = this.getTypePolicy(typename, createIfMissing); if (typePolicy) { var fieldPolicies = typePolicy.fields || (createIfMissing && (typePolicy.fields = Object.create(null))); if (fieldPolicies) { return fieldPolicies[fieldName] || (createIfMissing && (fieldPolicies[fieldName] = Object.create(null))); } } }; Policies.prototype.getSupertypeSet = function (subtype, createIfMissing) { var supertypeSet = this.supertypeMap.get(subtype); if (!supertypeSet && createIfMissing) { this.supertypeMap.set(subtype, supertypeSet = new Set()); } return supertypeSet; }; Policies.prototype.fragmentMatches = function (fragment, typename, result, variables) { var _this = this; if (!fragment.typeCondition) return true; if (!typename) return false; var supertype = fragment.typeCondition.name.value; if (typename === supertype) return true; if (this.usingPossibleTypes && this.supertypeMap.has(supertype)) { var typenameSupertypeSet = this.getSupertypeSet(typename, true); var workQueue_1 = [typenameSupertypeSet]; var maybeEnqueue_1 = function (subtype) { var supertypeSet = _this.getSupertypeSet(subtype, false); if (supertypeSet && supertypeSet.size && workQueue_1.indexOf(supertypeSet) < 0) { workQueue_1.push(supertypeSet); } }; var needToCheckFuzzySubtypes = !!(result && this.fuzzySubtypes.size); var checkingFuzzySubtypes = false; for (var i = 0; i < workQueue_1.length; ++i) { var supertypeSet = workQueue_1[i]; if (supertypeSet.has(supertype)) { if (!typenameSupertypeSet.has(supertype)) { if (checkingFuzzySubtypes) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant.warn("Inferring subtype " + typename + " of supertype " + supertype); } typenameSupertypeSet.add(supertype); } return true; } supertypeSet.forEach(maybeEnqueue_1); if (needToCheckFuzzySubtypes && i === workQueue_1.length - 1 && (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.selectionSetMatchesResult)(fragment.selectionSet, result, variables)) { needToCheckFuzzySubtypes = false; checkingFuzzySubtypes = true; this.fuzzySubtypes.forEach(function (regExp, fuzzyString) { var match = typename.match(regExp); if (match && match[0] === typename) { maybeEnqueue_1(fuzzyString); } }); } } } return false; }; Policies.prototype.getStoreFieldName = function (fieldSpec) { var typename = fieldSpec.typename, fieldName = fieldSpec.fieldName; var policy = this.getFieldPolicy(typename, fieldName, false); var storeFieldName; var keyFn = policy && policy.keyFn; if (keyFn && typename) { var context = { typename: typename, fieldName: fieldName, field: fieldSpec.field || null, variables: fieldSpec.variables, }; var args = argsFromFieldSpecifier(fieldSpec); while (keyFn) { var specifierOrString = keyFn(args, context); if (Array.isArray(specifierOrString)) { keyFn = keyArgsFnFromSpecifier(specifierOrString); } else { storeFieldName = specifierOrString || fieldName; break; } } } if (storeFieldName === void 0) { storeFieldName = fieldSpec.field ? (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.storeKeyNameFromField)(fieldSpec.field, fieldSpec.variables) : (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getStoreKeyName)(fieldName, argsFromFieldSpecifier(fieldSpec)); } return fieldName === (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName) ? storeFieldName : fieldName + ":" + storeFieldName; }; Policies.prototype.readField = function (options, context) { var objectOrReference = options.from; if (!objectOrReference) return; var nameOrField = options.field || options.fieldName; if (!nameOrField) return; if (options.typename === void 0) { var typename = context.store.getFieldValue(objectOrReference, "__typename"); if (typename) options.typename = typename; } var storeFieldName = this.getStoreFieldName(options); var fieldName = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName); var existing = context.store.getFieldValue(objectOrReference, storeFieldName); var policy = this.getFieldPolicy(options.typename, fieldName, false); var read = policy && policy.read; if (read) { var readOptions = makeFieldFunctionOptions(this, objectOrReference, options, context, context.store.getStorage((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(objectOrReference) ? objectOrReference.__ref : objectOrReference, storeFieldName)); return _reactiveVars_js__WEBPACK_IMPORTED_MODULE_4__.cacheSlot.withValue(this.cache, read, [existing, readOptions]); } return existing; }; Policies.prototype.hasMergeFunction = function (typename, fieldName) { var policy = this.getFieldPolicy(typename, fieldName, false); return !!(policy && policy.merge); }; Policies.prototype.applyMerges = function (existing, incoming, context, storageKeys) { var _a; var _this = this; if ((0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.isFieldValueToBeMerged)(incoming)) { var field = incoming.__field; var fieldName = field.name.value; var merge = this.getFieldPolicy(incoming.__typename, fieldName, false).merge; incoming = merge(existing, incoming.__value, makeFieldFunctionOptions(this, void 0, { typename: incoming.__typename, fieldName: fieldName, field: field, variables: context.variables }, context, storageKeys ? (_a = context.store).getStorage.apply(_a, storageKeys) : Object.create(null))); } if (Array.isArray(incoming)) { return incoming.map(function (item) { return _this.applyMerges(void 0, item, context); }); } if ((0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.storeValueIsStoreObject)(incoming)) { var e_1 = existing; var i_1 = incoming; var firstStorageKey_1 = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(e_1) ? e_1.__ref : typeof e_1 === "object" && e_1; var newFields_1; Object.keys(i_1).forEach(function (storeFieldName) { var incomingValue = i_1[storeFieldName]; var appliedValue = _this.applyMerges(context.store.getFieldValue(e_1, storeFieldName), incomingValue, context, firstStorageKey_1 ? [firstStorageKey_1, storeFieldName] : void 0); if (appliedValue !== incomingValue) { newFields_1 = newFields_1 || Object.create(null); newFields_1[storeFieldName] = appliedValue; } }); if (newFields_1) { return (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, i_1), newFields_1); } } return incoming; }; return Policies; }()); function makeFieldFunctionOptions(policies, objectOrReference, fieldSpec, context, storage) { var storeFieldName = policies.getStoreFieldName(fieldSpec); var fieldName = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName); var variables = fieldSpec.variables || context.variables; var _a = context.store, getFieldValue = _a.getFieldValue, toReference = _a.toReference, canRead = _a.canRead; return { args: argsFromFieldSpecifier(fieldSpec), field: fieldSpec.field || null, fieldName: fieldName, storeFieldName: storeFieldName, variables: variables, isReference: _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference, toReference: toReference, storage: storage, cache: policies.cache, canRead: canRead, readField: function (fieldNameOrOptions, from) { var options = typeof fieldNameOrOptions === "string" ? { fieldName: fieldNameOrOptions, from: from, } : (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, fieldNameOrOptions); if (void 0 === options.from) { options.from = objectOrReference; } if (void 0 === options.variables) { options.variables = variables; } return policies.readField(options, context); }, mergeObjects: function (existing, incoming) { if (Array.isArray(existing) || Array.isArray(incoming)) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_1__.InvariantError("Cannot automatically merge arrays"); } if (existing && typeof existing === "object" && incoming && typeof incoming === "object") { var eType = getFieldValue(existing, "__typename"); var iType = getFieldValue(incoming, "__typename"); var typesDiffer = eType && iType && eType !== iType; var applied = policies.applyMerges(typesDiffer ? void 0 : existing, incoming, context); if (typesDiffer || !(0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.storeValueIsStoreObject)(existing) || !(0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.storeValueIsStoreObject)(applied)) { return applied; } return (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, existing), applied); } return incoming; } }; } function keyArgsFnFromSpecifier(specifier) { return function (args, context) { return args ? context.fieldName + ":" + JSON.stringify(computeKeyObject(args, specifier)) : context.fieldName; }; } function keyFieldsFnFromSpecifier(specifier) { var trie = new optimism__WEBPACK_IMPORTED_MODULE_0__.KeyTrie(_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.canUseWeakMap); return function (object, context) { var aliasMap; if (context.selectionSet && context.fragmentMap) { var info = trie.lookupArray([ context.selectionSet, context.fragmentMap, ]); aliasMap = info.aliasMap || (info.aliasMap = makeAliasMap(context.selectionSet, context.fragmentMap)); } var keyObject = context.keyObject = computeKeyObject(object, specifier, aliasMap); return context.typename + ":" + JSON.stringify(keyObject); }; } function makeAliasMap(selectionSet, fragmentMap) { var map = Object.create(null); var workQueue = new Set([selectionSet]); workQueue.forEach(function (selectionSet) { selectionSet.selections.forEach(function (selection) { if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isField)(selection)) { if (selection.alias) { var responseKey = selection.alias.value; var storeKey = selection.name.value; if (storeKey !== responseKey) { var aliases = map.aliases || (map.aliases = Object.create(null)); aliases[storeKey] = responseKey; } } if (selection.selectionSet) { var subsets = map.subsets || (map.subsets = Object.create(null)); subsets[selection.name.value] = makeAliasMap(selection.selectionSet, fragmentMap); } } else { var fragment = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentFromSelection)(selection, fragmentMap); if (fragment) { workQueue.add(fragment.selectionSet); } } }); }); return map; } function computeKeyObject(response, specifier, aliasMap) { var keyObj = Object.create(null); var prevKey; specifier.forEach(function (s) { if (Array.isArray(s)) { if (typeof prevKey === "string") { var subsets = aliasMap && aliasMap.subsets; var subset = subsets && subsets[prevKey]; keyObj[prevKey] = computeKeyObject(response[prevKey], s, subset); } } else { var aliases = aliasMap && aliasMap.aliases; var responseName = aliases && aliases[s] || s; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant)(_helpers_js__WEBPACK_IMPORTED_MODULE_3__.hasOwn.call(response, responseName), "Missing field '" + responseName + "' while computing key fields"); keyObj[prevKey = s] = response[responseName]; } }); return keyObj; } //# sourceMappingURL=policies.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/reactiveVars.js": /*!********************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/reactiveVars.js ***! \********************************************************************/ /*! namespace exports */ /*! export cacheSlot [provided] [no usage info] [missing usage info prevents renaming] */ /*! export makeVar [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "cacheSlot": () => /* binding */ cacheSlot, /* harmony export */ "makeVar": () => /* binding */ makeVar /* harmony export */ }); /* harmony import */ var _wry_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wry/context */ "./node_modules/@wry/context/lib/context.esm.js"); /* harmony import */ var optimism__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! optimism */ "./node_modules/optimism/lib/bundle.esm.js"); ; var varDep = (0,optimism__WEBPACK_IMPORTED_MODULE_1__.dep)(); var cacheSlot = new _wry_context__WEBPACK_IMPORTED_MODULE_0__.Slot(); function consumeAndIterate(set, callback) { var items = []; set.forEach(function (item) { return items.push(item); }); set.clear(); items.forEach(callback); } function makeVar(value) { var caches = new Set(); var listeners = new Set(); var rv = function (newValue) { if (arguments.length > 0) { if (value !== newValue) { value = newValue; varDep.dirty(rv); caches.forEach(broadcast); consumeAndIterate(listeners, function (listener) { return listener(value); }); } } else { var cache = cacheSlot.getValue(); if (cache) caches.add(cache); varDep(rv); } return value; }; rv.onNextChange = function (listener) { listeners.add(listener); return function () { listeners.delete(listener); }; }; return rv; } function broadcast(cache) { if (cache.broadcastWatches) { cache.broadcastWatches(); } } //# sourceMappingURL=reactiveVars.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/readFromStore.js": /*!*********************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/readFromStore.js ***! \*********************************************************************/ /*! namespace exports */ /*! export StoreReader [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "StoreReader": () => /* binding */ StoreReader /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var optimism__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! optimism */ "./node_modules/optimism/lib/bundle.esm.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _entityStore_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entityStore.js */ "./node_modules/@apollo/client/cache/inmemory/entityStore.js"); /* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@apollo/client/cache/inmemory/helpers.js"); /* harmony import */ var _core_types_common_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/types/common.js */ "./node_modules/@apollo/client/cache/core/types/common.js"); ; ; function missingFromInvariant(err, context) { return new _core_types_common_js__WEBPACK_IMPORTED_MODULE_5__.MissingFieldError(err.message, context.path.slice(), context.query, context.clientOnly, context.variables); } var StoreReader = (function () { function StoreReader(config) { var _this = this; this.config = config; this.executeSelectionSet = (0,optimism__WEBPACK_IMPORTED_MODULE_0__.wrap)(function (options) { return _this.execSelectionSetImpl(options); }, { keyArgs: function (options) { return [ options.selectionSet, options.objectOrReference, options.context, ]; }, makeCacheKey: function (selectionSet, parent, context) { if ((0,_entityStore_js__WEBPACK_IMPORTED_MODULE_3__.supportsResultCaching)(context.store)) { return context.store.makeCacheKey(selectionSet, (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(parent) ? parent.__ref : parent, context.varString); } } }); this.knownResults = new WeakMap(); this.executeSubSelectedArray = (0,optimism__WEBPACK_IMPORTED_MODULE_0__.wrap)(function (options) { return _this.execSubSelectedArrayImpl(options); }, { makeCacheKey: function (_a) { var field = _a.field, array = _a.array, context = _a.context; if ((0,_entityStore_js__WEBPACK_IMPORTED_MODULE_3__.supportsResultCaching)(context.store)) { return context.store.makeCacheKey(field, array, context.varString); } } }); this.config = (0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)({ addTypename: true }, config); } StoreReader.prototype.diffQueryAgainstStore = function (_a) { var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? 'ROOT_QUERY' : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c; var policies = this.config.cache.policies; variables = (0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)({}, (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getDefaultValues)((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getQueryDefinition)(query))), variables); var execResult = this.executeSelectionSet({ selectionSet: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getMainDefinition)(query).selectionSet, objectOrReference: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.makeReference)(rootId), context: { store: store, query: query, policies: policies, variables: variables, varString: JSON.stringify(variables), fragmentMap: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.createFragmentMap)((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentDefinitions)(query)), path: [], clientOnly: false, }, }); var hasMissingFields = execResult.missing && execResult.missing.length > 0; if (hasMissingFields && !returnPartialData) { throw execResult.missing[0]; } return { result: execResult.result, missing: execResult.missing, complete: !hasMissingFields, }; }; StoreReader.prototype.isFresh = function (result, parent, selectionSet, context) { if ((0,_entityStore_js__WEBPACK_IMPORTED_MODULE_3__.supportsResultCaching)(context.store) && this.knownResults.get(result) === selectionSet) { var latest = this.executeSelectionSet.peek(selectionSet, parent, context); if (latest && result === latest.result) { return true; } } return false; }; StoreReader.prototype.execSelectionSetImpl = function (_a) { var _this = this; var selectionSet = _a.selectionSet, objectOrReference = _a.objectOrReference, context = _a.context; if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(objectOrReference) && !context.policies.rootTypenamesById[objectOrReference.__ref] && !context.store.has(objectOrReference.__ref)) { return { result: {}, missing: [missingFromInvariant( false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_1__.InvariantError("Dangling reference to missing " + objectOrReference.__ref + " object"), context)], }; } var variables = context.variables, policies = context.policies, store = context.store; var objectsToMerge = []; var finalResult = { result: null }; var typename = store.getFieldValue(objectOrReference, "__typename"); if (this.config.addTypename && typeof typename === "string" && !policies.rootIdsByTypename[typename]) { objectsToMerge.push({ __typename: typename }); } function getMissing() { return finalResult.missing || (finalResult.missing = []); } function handleMissing(result) { var _a; if (result.missing) (_a = getMissing()).push.apply(_a, result.missing); return result.result; } var workSet = new Set(selectionSet.selections); workSet.forEach(function (selection) { var _a; if (!(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.shouldInclude)(selection, variables)) return; if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isField)(selection)) { var fieldValue = policies.readField({ fieldName: selection.name.value, field: selection, variables: context.variables, from: objectOrReference, }, context); var resultName = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.resultKeyNameFromField)(selection); context.path.push(resultName); var wasClientOnly = context.clientOnly; context.clientOnly = wasClientOnly || !!(selection.directives && selection.directives.some(function (d) { return d.name.value === "client"; })); if (fieldValue === void 0) { if (!_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.addTypenameToDocument.added(selection)) { getMissing().push(missingFromInvariant( false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_1__.InvariantError("Can't find field '" + selection.name.value + "' on " + ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(objectOrReference) ? objectOrReference.__ref + " object" : "object " + JSON.stringify(objectOrReference, null, 2))), context)); } } else if (Array.isArray(fieldValue)) { fieldValue = handleMissing(_this.executeSubSelectedArray({ field: selection, array: fieldValue, context: context, })); } else if (!selection.selectionSet) { if (true) { assertSelectionSetForIdValue(context.store, selection, fieldValue); (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.maybeDeepFreeze)(fieldValue); } } else if (fieldValue != null) { fieldValue = handleMissing(_this.executeSelectionSet({ selectionSet: selection.selectionSet, objectOrReference: fieldValue, context: context, })); } if (fieldValue !== void 0) { objectsToMerge.push((_a = {}, _a[resultName] = fieldValue, _a)); } context.clientOnly = wasClientOnly; (0,ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant)(context.path.pop() === resultName); } else { var fragment = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentFromSelection)(selection, context.fragmentMap); if (fragment && policies.fragmentMatches(fragment, typename)) { fragment.selectionSet.selections.forEach(workSet.add, workSet); } } }); finalResult.result = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.mergeDeepArray)(objectsToMerge); if (true) { Object.freeze(finalResult.result); } this.knownResults.set(finalResult.result, selectionSet); return finalResult; }; StoreReader.prototype.execSubSelectedArrayImpl = function (_a) { var _this = this; var field = _a.field, array = _a.array, context = _a.context; var missing; function handleMissing(childResult, i) { if (childResult.missing) { missing = missing || []; missing.push.apply(missing, childResult.missing); } (0,ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant)(context.path.pop() === i); return childResult.result; } if (field.selectionSet) { array = array.filter(context.store.canRead); } array = array.map(function (item, i) { if (item === null) { return null; } context.path.push(i); if (Array.isArray(item)) { return handleMissing(_this.executeSubSelectedArray({ field: field, array: item, context: context, }), i); } if (field.selectionSet) { return handleMissing(_this.executeSelectionSet({ selectionSet: field.selectionSet, objectOrReference: item, context: context, }), i); } if (true) { assertSelectionSetForIdValue(context.store, field, item); } (0,ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant)(context.path.pop() === i); return item; }); if (true) { Object.freeze(array); } return { result: array, missing: missing }; }; return StoreReader; }()); function assertSelectionSetForIdValue(store, field, fieldValue) { if (!field.selectionSet) { var workSet_1 = new Set([fieldValue]); workSet_1.forEach(function (value) { if (value && typeof value === "object") { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant)(!(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(value), "Missing selection set for object of type " + (0,_helpers_js__WEBPACK_IMPORTED_MODULE_4__.getTypenameFromStoreObject)(store, value) + " returned for query field " + field.name.value); Object.values(value).forEach(workSet_1.add, workSet_1); } }); } } //# sourceMappingURL=readFromStore.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/types.js": /*!*************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/types.js ***! \*************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: */ /***/ (() => { //# sourceMappingURL=types.js.map /***/ }), /***/ "./node_modules/@apollo/client/cache/inmemory/writeToStore.js": /*!********************************************************************!*\ !*** ./node_modules/@apollo/client/cache/inmemory/writeToStore.js ***! \********************************************************************/ /*! namespace exports */ /*! export StoreWriter [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "StoreWriter": () => /* binding */ StoreWriter /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _wry_equality__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wry/equality */ "./node_modules/@wry/equality/lib/equality.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@apollo/client/cache/inmemory/helpers.js"); ; ; var StoreWriter = (function () { function StoreWriter(cache, reader) { this.cache = cache; this.reader = reader; } StoreWriter.prototype.writeToStore = function (_a) { var query = _a.query, result = _a.result, dataId = _a.dataId, store = _a.store, variables = _a.variables; var operationDefinition = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getOperationDefinition)(query); var merger = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.makeProcessedFieldsMerger)(); variables = (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getDefaultValues)(operationDefinition)), variables); var ref = this.processSelectionSet({ result: result || Object.create(null), dataId: dataId, selectionSet: operationDefinition.selectionSet, context: { store: store, written: Object.create(null), merge: function (existing, incoming) { return merger.merge(existing, incoming); }, variables: variables, varString: JSON.stringify(variables), fragmentMap: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.createFragmentMap)((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentDefinitions)(query)), }, }); if (!(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(ref)) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Could not identify object " + JSON.stringify(result)); } store.retain(ref.__ref); return ref; }; StoreWriter.prototype.processSelectionSet = function (_a) { var _this = this; var dataId = _a.dataId, result = _a.result, selectionSet = _a.selectionSet, context = _a.context, _b = _a.out, out = _b === void 0 ? { shouldApplyMerges: false, } : _b; var policies = this.cache.policies; var _c = policies.identify(result, selectionSet, context.fragmentMap), id = _c[0], keyObject = _c[1]; dataId = dataId || id; if ("string" === typeof dataId) { var sets = context.written[dataId] || (context.written[dataId] = []); var ref = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.makeReference)(dataId); if (sets.indexOf(selectionSet) >= 0) return ref; sets.push(selectionSet); if (this.reader && this.reader.isFresh(result, ref, selectionSet, context)) { return ref; } } var mergedFields = Object.create(null); if (keyObject) { mergedFields = context.merge(mergedFields, keyObject); } var typename = (dataId && policies.rootTypenamesById[dataId]) || (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getTypenameFromResult)(result, selectionSet, context.fragmentMap) || (dataId && context.store.get(dataId, "__typename")); if ("string" === typeof typename) { mergedFields.__typename = typename; } var workSet = new Set(selectionSet.selections); workSet.forEach(function (selection) { var _a; if (!(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.shouldInclude)(selection, context.variables)) return; if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isField)(selection)) { var resultFieldKey = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.resultKeyNameFromField)(selection); var value = result[resultFieldKey]; if (typeof value !== 'undefined') { var storeFieldName = policies.getStoreFieldName({ typename: typename, fieldName: selection.name.value, field: selection, variables: context.variables, }); var incomingValue = _this.processFieldValue(value, selection, context, out); if (policies.hasMergeFunction(typename, selection.name.value)) { incomingValue = { __field: selection, __typename: typename, __value: incomingValue, }; out.shouldApplyMerges = true; } mergedFields = context.merge(mergedFields, (_a = {}, _a[storeFieldName] = incomingValue, _a)); } else if (policies.usingPossibleTypes && !(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.hasDirectives)(["defer", "client"], selection)) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Missing field '" + resultFieldKey + "' in " + JSON.stringify(result, null, 2).substring(0, 100)); } } else { var fragment = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentFromSelection)(selection, context.fragmentMap); if (fragment && policies.fragmentMatches(fragment, typename, result, context.variables)) { fragment.selectionSet.selections.forEach(workSet.add, workSet); } } }); if ("string" === typeof dataId) { var entityRef_1 = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.makeReference)(dataId); if (out.shouldApplyMerges) { mergedFields = policies.applyMerges(entityRef_1, mergedFields, context); } if (true) { Object.keys(mergedFields).forEach(function (storeFieldName) { var fieldName = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName); if (!policies.hasMergeFunction(typename, fieldName)) { warnAboutDataLoss(entityRef_1, mergedFields, storeFieldName, context.store); } }); } context.store.merge(dataId, mergedFields); return entityRef_1; } return mergedFields; }; StoreWriter.prototype.processFieldValue = function (value, field, context, out) { var _this = this; if (!field.selectionSet || value === null) { return false ? 0 : (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(value); } if (Array.isArray(value)) { return value.map(function (item) { return _this.processFieldValue(item, field, context, out); }); } return this.processSelectionSet({ result: value, selectionSet: field.selectionSet, context: context, out: out, }); }; return StoreWriter; }()); var warnings = new Set(); function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) { var getChild = function (objOrRef) { var child = store.getFieldValue(objOrRef, storeFieldName); return typeof child === "object" && child; }; var existing = getChild(existingRef); if (!existing) return; var incoming = getChild(incomingObj); if (!incoming) return; if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.isReference)(existing)) return; if ((0,_wry_equality__WEBPACK_IMPORTED_MODULE_1__.equal)(existing, incoming)) return; if (Object.keys(existing).every(function (key) { return store.getFieldValue(incoming, key) !== void 0; })) { return; } var parentType = store.getFieldValue(existingRef, "__typename") || store.getFieldValue(incomingObj, "__typename"); var fieldName = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_3__.fieldNameFromStoreName)(storeFieldName); var typeDotName = parentType + "." + fieldName; if (warnings.has(typeDotName)) return; warnings.add(typeDotName); var childTypenames = []; if (!Array.isArray(existing) && !Array.isArray(incoming)) { [existing, incoming].forEach(function (child) { var typename = store.getFieldValue(child, "__typename"); if (typeof typename === "string" && !childTypenames.includes(typename)) { childTypenames.push(typename); } }); } false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.warn("Cache data may be lost when replacing the " + fieldName + " field of a " + parentType + " object.\n\nTo address this problem (which is not a bug in Apollo Client), " + (childTypenames.length ? "either ensure all objects of type " + childTypenames.join(" and ") + " have IDs, or " : "") + "define a custom merge function for the " + typeDotName + " field, so InMemoryCache can safely merge these objects:\n\n existing: " + JSON.stringify(existing).slice(0, 1000) + "\n incoming: " + JSON.stringify(incoming).slice(0, 1000) + "\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"); } //# sourceMappingURL=writeToStore.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/ApolloClient.js": /*!**********************************************************!*\ !*** ./node_modules/@apollo/client/core/ApolloClient.js ***! \**********************************************************/ /*! namespace exports */ /*! export ApolloClient [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ApolloClient": () => /* binding */ ApolloClient /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _link_core_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../link/core/index.js */ "./node_modules/@apollo/client/link/core/index.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../version.js */ "./node_modules/@apollo/client/version.js"); /* harmony import */ var _link_http_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../link/http/index.js */ "./node_modules/@apollo/client/link/http/index.js"); /* harmony import */ var _QueryManager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./QueryManager.js */ "./node_modules/@apollo/client/core/QueryManager.js"); /* harmony import */ var _LocalState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./LocalState.js */ "./node_modules/@apollo/client/core/LocalState.js"); ; var hasSuggestedDevtools = false; var ApolloClient = (function () { function ApolloClient(options) { var _this = this; this.defaultOptions = {}; this.resetStoreCallbacks = []; this.clearStoreCallbacks = []; var uri = options.uri, credentials = options.credentials, headers = options.headers, cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, connectToDevTools = options.connectToDevTools, _c = options.queryDeduplication, queryDeduplication = _c === void 0 ? true : _c, defaultOptions = options.defaultOptions, _d = options.assumeImmutableResults, assumeImmutableResults = _d === void 0 ? false : _d, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version; var link = options.link; if (!link) { link = uri ? new _link_http_index_js__WEBPACK_IMPORTED_MODULE_3__.HttpLink({ uri: uri, credentials: credentials, headers: headers }) : _link_core_index_js__WEBPACK_IMPORTED_MODULE_1__.ApolloLink.empty(); } if (!cache) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("To initialize Apollo Client, you must specify a 'cache' property " + "in the options object. \n" + "For more information, please visit: https://go.apollo.dev/c/docs"); } this.link = link; this.cache = cache; this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; this.queryDeduplication = queryDeduplication; this.defaultOptions = defaultOptions || {}; this.typeDefs = typeDefs; if (ssrForceFetchDelay) { setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay); } this.watchQuery = this.watchQuery.bind(this); this.query = this.query.bind(this); this.mutate = this.mutate.bind(this); this.resetStore = this.resetStore.bind(this); this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); var defaultConnectToDevTools = true && typeof window !== 'undefined' && !window.__APOLLO_CLIENT__; if (typeof connectToDevTools === 'undefined' ? defaultConnectToDevTools : connectToDevTools && typeof window !== 'undefined') { window.__APOLLO_CLIENT__ = this; } if (!hasSuggestedDevtools && "development" !== 'production') { hasSuggestedDevtools = true; if (typeof window !== 'undefined' && window.document && window.top === window.self) { if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { if (window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('Chrome') > -1) { console.debug('Download the Apollo DevTools ' + 'for a better development experience: ' + 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); } } } } this.version = _version_js__WEBPACK_IMPORTED_MODULE_6__.version; this.localState = new _LocalState_js__WEBPACK_IMPORTED_MODULE_5__.LocalState({ cache: cache, client: this, resolvers: resolvers, fragmentMatcher: fragmentMatcher, }); this.queryManager = new _QueryManager_js__WEBPACK_IMPORTED_MODULE_4__.QueryManager({ cache: this.cache, link: this.link, queryDeduplication: queryDeduplication, ssrMode: ssrMode, clientAwareness: { name: clientAwarenessName, version: clientAwarenessVersion, }, localState: this.localState, assumeImmutableResults: assumeImmutableResults, onBroadcast: function () { if (_this.devToolsHookCb) { _this.devToolsHookCb({ action: {}, state: { queries: _this.queryManager.getQueryStore(), mutations: _this.queryManager.mutationStore.getStore(), }, dataWithOptimisticResults: _this.cache.extract(true), }); } }, }); } ApolloClient.prototype.stop = function () { this.queryManager.stop(); }; ApolloClient.prototype.watchQuery = function (options) { if (this.defaultOptions.watchQuery) { options = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.compact)(this.defaultOptions.watchQuery, options); } if (this.disableNetworkFetches && (options.fetchPolicy === 'network-only' || options.fetchPolicy === 'cache-and-network')) { options = (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_7__.__assign)({}, options), { fetchPolicy: 'cache-first' }); } return this.queryManager.watchQuery(options); }; ApolloClient.prototype.query = function (options) { if (this.defaultOptions.query) { options = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.compact)(this.defaultOptions.query, options); } false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + 'client.query can only return a single result. Please use client.watchQuery ' + 'to receive multiple results from the cache and the network, or consider ' + 'using a different fetchPolicy, such as cache-first or network-only.'); if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { options = (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_7__.__assign)({}, options), { fetchPolicy: 'cache-first' }); } return this.queryManager.query(options); }; ApolloClient.prototype.mutate = function (options) { if (this.defaultOptions.mutate) { options = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_2__.compact)(this.defaultOptions.mutate, options); } return this.queryManager.mutate(options); }; ApolloClient.prototype.subscribe = function (options) { return this.queryManager.startGraphQLSubscription(options); }; ApolloClient.prototype.readQuery = function (options, optimistic) { if (optimistic === void 0) { optimistic = false; } return this.cache.readQuery(options, optimistic); }; ApolloClient.prototype.readFragment = function (options, optimistic) { if (optimistic === void 0) { optimistic = false; } return this.cache.readFragment(options, optimistic); }; ApolloClient.prototype.writeQuery = function (options) { this.cache.writeQuery(options); this.queryManager.broadcastQueries(); }; ApolloClient.prototype.writeFragment = function (options) { this.cache.writeFragment(options); this.queryManager.broadcastQueries(); }; ApolloClient.prototype.__actionHookForDevTools = function (cb) { this.devToolsHookCb = cb; }; ApolloClient.prototype.__requestRaw = function (payload) { return (0,_link_core_index_js__WEBPACK_IMPORTED_MODULE_1__.execute)(this.link, payload); }; ApolloClient.prototype.resetStore = function () { var _this = this; return Promise.resolve() .then(function () { return _this.queryManager.clearStore(); }) .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); }) .then(function () { return _this.reFetchObservableQueries(); }); }; ApolloClient.prototype.clearStore = function () { var _this = this; return Promise.resolve() .then(function () { return _this.queryManager.clearStore(); }) .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); }); }; ApolloClient.prototype.onResetStore = function (cb) { var _this = this; this.resetStoreCallbacks.push(cb); return function () { _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; }); }; }; ApolloClient.prototype.onClearStore = function (cb) { var _this = this; this.clearStoreCallbacks.push(cb); return function () { _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; }); }; }; ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { return this.queryManager.reFetchObservableQueries(includeStandby); }; ApolloClient.prototype.extract = function (optimistic) { return this.cache.extract(optimistic); }; ApolloClient.prototype.restore = function (serializedState) { return this.cache.restore(serializedState); }; ApolloClient.prototype.addResolvers = function (resolvers) { this.localState.addResolvers(resolvers); }; ApolloClient.prototype.setResolvers = function (resolvers) { this.localState.setResolvers(resolvers); }; ApolloClient.prototype.getResolvers = function () { return this.localState.getResolvers(); }; ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { this.localState.setFragmentMatcher(fragmentMatcher); }; ApolloClient.prototype.setLink = function (newLink) { this.link = this.queryManager.link = newLink; }; return ApolloClient; }()); //# sourceMappingURL=ApolloClient.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/LocalState.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/core/LocalState.js ***! \********************************************************/ /*! namespace exports */ /*! export LocalState [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "LocalState": () => /* binding */ LocalState /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! graphql */ "./node_modules/graphql/language/visitor.mjs"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _cache_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../cache/index.js */ "./node_modules/@apollo/client/cache/index.js"); ; var LocalState = (function () { function LocalState(_a) { var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher; this.cache = cache; if (client) { this.client = client; } if (resolvers) { this.addResolvers(resolvers); } if (fragmentMatcher) { this.setFragmentMatcher(fragmentMatcher); } } LocalState.prototype.addResolvers = function (resolvers) { var _this = this; this.resolvers = this.resolvers || {}; if (Array.isArray(resolvers)) { resolvers.forEach(function (resolverGroup) { _this.resolvers = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.mergeDeep)(_this.resolvers, resolverGroup); }); } else { this.resolvers = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.mergeDeep)(this.resolvers, resolvers); } }; LocalState.prototype.setResolvers = function (resolvers) { this.resolvers = {}; this.addResolvers(resolvers); }; LocalState.prototype.getResolvers = function () { return this.resolvers || {}; }; LocalState.prototype.runResolvers = function (_a) { var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b; return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_c) { if (document) { return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return ((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, remoteResult), { data: localResult.result })); })]; } return [2, remoteResult]; }); }); }; LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { this.fragmentMatcher = fragmentMatcher; }; LocalState.prototype.getFragmentMatcher = function () { return this.fragmentMatcher; }; LocalState.prototype.clientQuery = function (document) { if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.hasDirectives)(['client'], document)) { if (this.resolvers) { return document; } } return null; }; LocalState.prototype.serverQuery = function (document) { return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.removeClientSetsFromDocument)(document); }; LocalState.prototype.prepareContext = function (context) { var cache = this.cache; return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, context), { cache: cache, getCacheKey: function (obj) { return cache.identify(obj); } }); }; LocalState.prototype.addExportedVariables = function (document, variables, context) { if (variables === void 0) { variables = {}; } if (context === void 0) { context = {}; } return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_a) { if (document) { return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return ((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, variables), data.exportedVariables)); })]; } return [2, (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, variables)]; }); }); }; LocalState.prototype.shouldForceResolvers = function (document) { var forceResolvers = false; (0,graphql__WEBPACK_IMPORTED_MODULE_4__.visit)(document, { Directive: { enter: function (node) { if (node.name.value === 'client' && node.arguments) { forceResolvers = node.arguments.some(function (arg) { return arg.name.value === 'always' && arg.value.kind === 'BooleanValue' && arg.value.value === true; }); if (forceResolvers) { return graphql__WEBPACK_IMPORTED_MODULE_4__.BREAK; } } }, }, }); return forceResolvers; }; LocalState.prototype.buildRootValueFromCache = function (document, variables) { return this.cache.diff({ query: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.buildQueryFromSelectionSet)(document), variables: variables, returnPartialData: true, optimistic: false, }).result; }; LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { if (context === void 0) { context = {}; } if (variables === void 0) { variables = {}; } if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; } if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; } return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () { var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_b) { mainDefinition = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.getMainDefinition)(document); fragments = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.getFragmentDefinitions)(document); fragmentMap = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.createFragmentMap)(fragments); definitionOperation = mainDefinition .operation; defaultOperationType = definitionOperation ? definitionOperation.charAt(0).toUpperCase() + definitionOperation.slice(1) : 'Query'; _a = this, cache = _a.cache, client = _a.client; execContext = { fragmentMap: fragmentMap, context: (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, context), { cache: cache, client: client }), variables: variables, fragmentMatcher: fragmentMatcher, defaultOperationType: defaultOperationType, exportedVariables: {}, onlyRunForcedResolvers: onlyRunForcedResolvers, }; return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { return ({ result: result, exportedVariables: execContext.exportedVariables, }); })]; }); }); }; LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () { var fragmentMap, context, variables, resultsToMerge, execute; var _this = this; return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_a) { fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; resultsToMerge = [rootValue]; execute = function (selection) { return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(_this, void 0, void 0, function () { var fragment, typeCondition; return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_a) { if (!(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.shouldInclude)(selection, variables)) { return [2]; } if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.isField)(selection)) { return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { var _a; if (typeof fieldResult !== 'undefined') { resultsToMerge.push((_a = {}, _a[(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.resultKeyNameFromField)(selection)] = fieldResult, _a)); } })]; } if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.isInlineFragment)(selection)) { fragment = selection; } else { fragment = fragmentMap[selection.name.value]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(fragment, "No fragment named " + selection.name.value); } if (fragment && fragment.typeCondition) { typeCondition = fragment.typeCondition.name.value; if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { resultsToMerge.push(fragmentResult); })]; } } return [2]; }); }); }; return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.mergeDeepArray)(resultsToMerge); })]; }); }); }; LocalState.prototype.resolveField = function (field, rootValue, execContext) { return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () { var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; var _this = this; return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_a) { variables = execContext.variables; fieldName = field.name.value; aliasedFieldName = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.resultKeyNameFromField)(field); aliasUsed = fieldName !== aliasedFieldName; defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; resultPromise = Promise.resolve(defaultResult); if (!execContext.onlyRunForcedResolvers || this.shouldForceResolvers(field)) { resolverType = rootValue.__typename || execContext.defaultOperationType; resolverMap = this.resolvers && this.resolvers[resolverType]; if (resolverMap) { resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; if (resolve) { resultPromise = Promise.resolve(_cache_index_js__WEBPACK_IMPORTED_MODULE_2__.cacheSlot.withValue(this.cache, resolve, [ rootValue, (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.argumentsObjectFromField)(field, variables), execContext.context, { field: field, fragmentMap: execContext.fragmentMap }, ])); } } } return [2, resultPromise.then(function (result) { if (result === void 0) { result = defaultResult; } if (field.directives) { field.directives.forEach(function (directive) { if (directive.name.value === 'export' && directive.arguments) { directive.arguments.forEach(function (arg) { if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { execContext.exportedVariables[arg.value.value] = result; } }); } }); } if (!field.selectionSet) { return result; } if (result == null) { return result; } if (Array.isArray(result)) { return _this.resolveSubSelectedArray(field, result, execContext); } if (field.selectionSet) { return _this.resolveSelectionSet(field.selectionSet, result, execContext); } })]; }); }); }; LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { var _this = this; return Promise.all(result.map(function (item) { if (item === null) { return null; } if (Array.isArray(item)) { return _this.resolveSubSelectedArray(field, item, execContext); } if (field.selectionSet) { return _this.resolveSelectionSet(field.selectionSet, item, execContext); } })); }; return LocalState; }()); //# sourceMappingURL=LocalState.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/MutationStore.js": /*!***********************************************************!*\ !*** ./node_modules/@apollo/client/core/MutationStore.js ***! \***********************************************************/ /*! namespace exports */ /*! export MutationStore [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "MutationStore": () => /* binding */ MutationStore /* harmony export */ }); var MutationStore = (function () { function MutationStore() { this.store = {}; } MutationStore.prototype.getStore = function () { return this.store; }; MutationStore.prototype.get = function (mutationId) { return this.store[mutationId]; }; MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { this.store[mutationId] = { mutation: mutation, variables: variables || {}, loading: true, error: null, }; }; MutationStore.prototype.markMutationError = function (mutationId, error) { var mutation = this.store[mutationId]; if (mutation) { mutation.loading = false; mutation.error = error; } }; MutationStore.prototype.markMutationResult = function (mutationId) { var mutation = this.store[mutationId]; if (mutation) { mutation.loading = false; mutation.error = null; } }; MutationStore.prototype.reset = function () { this.store = {}; }; return MutationStore; }()); //# sourceMappingURL=MutationStore.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/ObservableQuery.js": /*!*************************************************************!*\ !*** ./node_modules/@apollo/client/core/ObservableQuery.js ***! \*************************************************************/ /*! namespace exports */ /*! export ObservableQuery [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ObservableQuery": () => /* binding */ ObservableQuery /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _wry_equality__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wry/equality */ "./node_modules/@wry/equality/lib/equality.esm.js"); /* harmony import */ var _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./networkStatus.js */ "./node_modules/@apollo/client/core/networkStatus.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _Reobserver_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Reobserver.js */ "./node_modules/@apollo/client/core/Reobserver.js"); ; var warnedAboutUpdateQuery = false; var ObservableQuery = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__extends)(ObservableQuery, _super); function ObservableQuery(_a) { var queryManager = _a.queryManager, queryInfo = _a.queryInfo, options = _a.options; var _this = _super.call(this, function (observer) { return _this.onSubscribe(observer); }) || this; _this.observers = new Set(); _this.subscriptions = new Set(); _this.observer = { next: function (result) { if (_this.lastError || _this.isDifferentFromLastResult(result)) { _this.updateLastResult(result); (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.iterateObserversSafely)(_this.observers, 'next', result); } }, error: function (error) { _this.updateLastResult((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, _this.lastResult), { error: error, errors: error.graphQLErrors, networkStatus: _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.error, loading: false })); (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.iterateObserversSafely)(_this.observers, 'error', _this.lastError = error); }, }; _this.isTornDown = false; _this.options = options; _this.queryId = queryManager.generateQueryId(); var opDef = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.getOperationDefinition)(options.query); _this.queryName = opDef && opDef.name && opDef.name.value; _this.queryManager = queryManager; _this.queryInfo = queryInfo; return _this; } Object.defineProperty(ObservableQuery.prototype, "variables", { get: function () { return this.options.variables; }, enumerable: false, configurable: true }); ObservableQuery.prototype.result = function () { var _this = this; return new Promise(function (resolve, reject) { var observer = { next: function (result) { resolve(result); _this.observers.delete(observer); if (!_this.observers.size) { _this.queryManager.removeQuery(_this.queryId); } setTimeout(function () { subscription.unsubscribe(); }, 0); }, error: reject, }; var subscription = _this.subscribe(observer); }); }; ObservableQuery.prototype.getCurrentResult = function (saveAsLastResult) { if (saveAsLastResult === void 0) { saveAsLastResult = true; } var lastResult = this.lastResult; var networkStatus = this.queryInfo.networkStatus || (lastResult && lastResult.networkStatus) || _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.ready; var result = (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, lastResult), { loading: (0,_networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.isNetworkRequestInFlight)(networkStatus), networkStatus: networkStatus }); if (this.isTornDown) { return result; } var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? 'cache-first' : _a; if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { delete result.partial; } else if (!result.data || !this.queryManager.transform(this.options.query).hasForcedResolvers) { var diff = this.queryInfo.getDiff(); result.data = (diff.complete || this.options.returnPartialData) ? diff.result : void 0; if (diff.complete) { if (result.networkStatus === _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.loading && (fetchPolicy === 'cache-first' || fetchPolicy === 'cache-only')) { result.networkStatus = _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.ready; result.loading = false; } delete result.partial; } else { result.partial = true; } } if (saveAsLastResult) { this.updateLastResult(result); } return result; }; ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { return !(0,_wry_equality__WEBPACK_IMPORTED_MODULE_1__.equal)(this.lastResultSnapshot, newResult); }; ObservableQuery.prototype.getLastResult = function () { return this.lastResult; }; ObservableQuery.prototype.getLastError = function () { return this.lastError; }; ObservableQuery.prototype.resetLastResults = function () { delete this.lastResult; delete this.lastResultSnapshot; delete this.lastError; this.isTornDown = false; }; ObservableQuery.prototype.resetQueryStoreErrors = function () { this.queryManager.resetErrors(this.queryId); }; ObservableQuery.prototype.refetch = function (variables) { var reobserveOptions = { pollInterval: 0, }; var fetchPolicy = this.options.fetchPolicy; if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'cache-and-network') { reobserveOptions.fetchPolicy = 'network-only'; reobserveOptions.nextFetchPolicy = fetchPolicy || "cache-first"; } if (variables && !(0,_wry_equality__WEBPACK_IMPORTED_MODULE_1__.equal)(this.options.variables, variables)) { reobserveOptions.variables = this.options.variables = (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, this.options.variables), variables); } return this.newReobserver(false).reobserve(reobserveOptions, _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.refetch); }; ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { var _this = this; var combinedOptions = (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, (fetchMoreOptions.query ? fetchMoreOptions : (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, this.options), fetchMoreOptions), { variables: (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: "no-cache" }); var qid = this.queryManager.generateQueryId(); if (combinedOptions.notifyOnNetworkStatusChange) { this.queryInfo.networkStatus = _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.fetchMore; this.observe(); } return this.queryManager.fetchQuery(qid, combinedOptions, _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.fetchMore).then(function (fetchMoreResult) { var data = fetchMoreResult.data; var updateQuery = fetchMoreOptions.updateQuery; if (updateQuery) { if ( true && !warnedAboutUpdateQuery) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.warn("The updateQuery callback for fetchMore is deprecated, and will be removed\nin the next major version of Apollo Client.\n\nPlease convert updateQuery functions to field policies with appropriate\nread and merge functions, or use/adapt a helper function (such as\nconcatPagination, offsetLimitPagination, or relayStylePagination) from\n@apollo/client/utilities.\n\nThe field policy system handles pagination more effectively than a\nhand-written updateQuery function, and you only need to define the policy\nonce, rather than every time you call fetchMore."); warnedAboutUpdateQuery = true; } _this.updateQuery(function (previous) { return updateQuery(previous, { fetchMoreResult: data, variables: combinedOptions.variables, }); }); } else { _this.queryManager.cache.writeQuery({ query: combinedOptions.query, variables: combinedOptions.variables, data: data, }); } return fetchMoreResult; }).finally(function () { _this.queryManager.stopQuery(qid); _this.reobserve(); }); }; ObservableQuery.prototype.subscribeToMore = function (options) { var _this = this; var subscription = this.queryManager .startGraphQLSubscription({ query: options.document, variables: options.variables, context: options.context, }) .subscribe({ next: function (subscriptionData) { var updateQuery = options.updateQuery; if (updateQuery) { _this.updateQuery(function (previous, _a) { var variables = _a.variables; return updateQuery(previous, { subscriptionData: subscriptionData, variables: variables, }); }); } }, error: function (err) { if (options.onError) { options.onError(err); return; } false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.error('Unhandled GraphQL subscription error', err); }, }); this.subscriptions.add(subscription); return function () { if (_this.subscriptions.delete(subscription)) { subscription.unsubscribe(); } }; }; ObservableQuery.prototype.setOptions = function (newOptions) { return this.reobserve(newOptions); }; ObservableQuery.prototype.setVariables = function (variables) { if ((0,_wry_equality__WEBPACK_IMPORTED_MODULE_1__.equal)(this.variables, variables)) { return this.observers.size ? this.result() : Promise.resolve(); } this.options.variables = variables; if (!this.observers.size) { return Promise.resolve(); } var _a = this.options.fetchPolicy, fetchPolicy = _a === void 0 ? 'cache-first' : _a; var reobserveOptions = { fetchPolicy: fetchPolicy, variables: variables, }; if (fetchPolicy !== 'cache-first' && fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { reobserveOptions.fetchPolicy = 'cache-and-network'; reobserveOptions.nextFetchPolicy = fetchPolicy; } return this.reobserve(reobserveOptions, _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.setVariables); }; ObservableQuery.prototype.updateQuery = function (mapFn) { var _a; var queryManager = this.queryManager; var result = queryManager.cache.diff({ query: this.options.query, variables: this.variables, previousResult: (_a = this.lastResult) === null || _a === void 0 ? void 0 : _a.data, returnPartialData: true, optimistic: false, }).result; var newResult = mapFn(result, { variables: this.variables, }); if (newResult) { queryManager.cache.writeQuery({ query: this.options.query, data: newResult, variables: this.variables, }); queryManager.broadcastQueries(); } }; ObservableQuery.prototype.startPolling = function (pollInterval) { this.getReobserver().updateOptions({ pollInterval: pollInterval }); }; ObservableQuery.prototype.stopPolling = function () { if (this.reobserver) { this.reobserver.updateOptions({ pollInterval: 0 }); } }; ObservableQuery.prototype.updateLastResult = function (newResult) { var previousResult = this.lastResult; this.lastResult = newResult; this.lastResultSnapshot = this.queryManager.assumeImmutableResults ? newResult : (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(newResult); if (!(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.isNonEmptyArray)(newResult.errors)) { delete this.lastError; } return previousResult; }; ObservableQuery.prototype.onSubscribe = function (observer) { var _this = this; if (observer === this.observer) { return function () { }; } try { var subObserver = observer._subscription._observer; if (subObserver && !subObserver.error) { subObserver.error = defaultSubscriptionObserverErrorCallback; } } catch (_a) { } var first = !this.observers.size; this.observers.add(observer); if (this.lastError) { observer.error && observer.error(this.lastError); } else if (this.lastResult) { observer.next && observer.next(this.lastResult); } if (first) { this.reobserve().catch(function (_) { }); } return function () { if (_this.observers.delete(observer) && !_this.observers.size) { _this.tearDownQuery(); } }; }; ObservableQuery.prototype.getReobserver = function () { return this.reobserver || (this.reobserver = this.newReobserver(true)); }; ObservableQuery.prototype.newReobserver = function (shareOptions) { var _this = this; var _a = this, queryManager = _a.queryManager, queryId = _a.queryId; queryManager.setObservableQuery(this); return new _Reobserver_js__WEBPACK_IMPORTED_MODULE_4__.Reobserver(this.observer, shareOptions ? this.options : (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__assign)({}, this.options), function (currentOptions, newNetworkStatus) { queryManager.setObservableQuery(_this); return queryManager.fetchQueryObservable(queryId, currentOptions, newNetworkStatus); }, !queryManager.ssrMode && (function () { return !(0,_networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.isNetworkRequestInFlight)(_this.queryInfo.networkStatus); })); }; ObservableQuery.prototype.reobserve = function (newOptions, newNetworkStatus) { this.isTornDown = false; return this.getReobserver().reobserve(newOptions, newNetworkStatus); }; ObservableQuery.prototype.observe = function () { this.observer.next(this.getCurrentResult(false)); }; ObservableQuery.prototype.hasObservers = function () { return this.observers.size > 0; }; ObservableQuery.prototype.tearDownQuery = function () { var queryManager = this.queryManager; if (this.reobserver) { this.reobserver.stop(); delete this.reobserver; } this.isTornDown = true; this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); }); this.subscriptions.clear(); queryManager.stopQuery(this.queryId); this.observers.clear(); }; return ObservableQuery; }(_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Observable)); function defaultSubscriptionObserverErrorCallback(error) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.error('Unhandled error', error.message, error.stack); } //# sourceMappingURL=ObservableQuery.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/QueryInfo.js": /*!*******************************************************!*\ !*** ./node_modules/@apollo/client/core/QueryInfo.js ***! \*******************************************************/ /*! namespace exports */ /*! export QueryInfo [provided] [no usage info] [missing usage info prevents renaming] */ /*! export shouldWriteResult [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "QueryInfo": () => /* binding */ QueryInfo, /* harmony export */ "shouldWriteResult": () => /* binding */ shouldWriteResult /* harmony export */ }); /* harmony import */ var _wry_equality__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wry/equality */ "./node_modules/@wry/equality/lib/equality.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./networkStatus.js */ "./node_modules/@apollo/client/core/networkStatus.js"); ; var destructiveMethodCounts = new (_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.canUseWeakMap ? WeakMap : Map)(); function wrapDestructiveCacheMethod(cache, methodName) { var original = cache[methodName]; if (typeof original === "function") { cache[methodName] = function () { destructiveMethodCounts.set(cache, (destructiveMethodCounts.get(cache) + 1) % 1e15); return original.apply(this, arguments); }; } } var QueryInfo = (function () { function QueryInfo(cache) { this.cache = cache; this.listeners = new Set(); this.document = null; this.lastRequestId = 1; this.subscriptions = new Set(); this.dirty = false; this.diff = null; this.observableQuery = null; if (!destructiveMethodCounts.has(cache)) { destructiveMethodCounts.set(cache, 0); wrapDestructiveCacheMethod(cache, "evict"); wrapDestructiveCacheMethod(cache, "modify"); wrapDestructiveCacheMethod(cache, "reset"); } } QueryInfo.prototype.init = function (query) { var networkStatus = query.networkStatus || _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.loading; if (this.variables && this.networkStatus !== _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.loading && !(0,_wry_equality__WEBPACK_IMPORTED_MODULE_0__.equal)(this.variables, query.variables)) { networkStatus = _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.setVariables; } if (!(0,_wry_equality__WEBPACK_IMPORTED_MODULE_0__.equal)(query.variables, this.variables)) { this.diff = null; } Object.assign(this, { document: query.document, variables: query.variables, networkError: null, graphQLErrors: this.graphQLErrors || [], networkStatus: networkStatus, }); if (query.observableQuery) { this.setObservableQuery(query.observableQuery); } if (query.lastRequestId) { this.lastRequestId = query.lastRequestId; } return this; }; QueryInfo.prototype.getDiff = function (variables) { if (variables === void 0) { variables = this.variables; } if (this.diff && (0,_wry_equality__WEBPACK_IMPORTED_MODULE_0__.equal)(variables, this.variables)) { return this.diff; } this.updateWatch(this.variables = variables); return this.diff = this.cache.diff({ query: this.document, variables: variables, returnPartialData: true, optimistic: true, }); }; QueryInfo.prototype.setDiff = function (diff) { var _this = this; var oldDiff = this.diff; this.diff = diff; if (!this.dirty && (diff && diff.result) !== (oldDiff && oldDiff.result)) { this.dirty = true; if (!this.notifyTimeout) { this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0); } } }; QueryInfo.prototype.setObservableQuery = function (oq) { var _this = this; if (oq === this.observableQuery) return; if (this.oqListener) { this.listeners.delete(this.oqListener); } this.observableQuery = oq; if (oq) { oq["queryInfo"] = this; this.listeners.add(this.oqListener = function () { if (_this.getDiff().fromOptimisticTransaction) { oq["observe"](); } else { oq.reobserve(); } }); } else { delete this.oqListener; } }; QueryInfo.prototype.notify = function () { var _this = this; if (this.notifyTimeout) { clearTimeout(this.notifyTimeout); this.notifyTimeout = void 0; } if (this.shouldNotify()) { this.listeners.forEach(function (listener) { return listener(_this); }); } this.dirty = false; }; QueryInfo.prototype.shouldNotify = function () { if (!this.dirty || !this.listeners.size) { return false; } if ((0,_networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.isNetworkRequestInFlight)(this.networkStatus) && this.observableQuery) { var fetchPolicy = this.observableQuery.options.fetchPolicy; if (fetchPolicy !== "cache-only" && fetchPolicy !== "cache-and-network") { return false; } } return true; }; QueryInfo.prototype.stop = function () { this.cancel(); delete this.cancel; var oq = this.observableQuery; if (oq) oq.stopPolling(); }; QueryInfo.prototype.cancel = function () { }; QueryInfo.prototype.updateWatch = function (variables) { var _this = this; if (variables === void 0) { variables = this.variables; } var oq = this.observableQuery; if (oq && oq.options.fetchPolicy === "no-cache") { return; } if (!this.lastWatch || this.lastWatch.query !== this.document || !(0,_wry_equality__WEBPACK_IMPORTED_MODULE_0__.equal)(variables, this.lastWatch.variables)) { this.cancel(); this.cancel = this.cache.watch(this.lastWatch = { query: this.document, variables: variables, optimistic: true, callback: function (diff) { return _this.setDiff(diff); }, }); } }; QueryInfo.prototype.shouldWrite = function (result, variables) { var lastWrite = this.lastWrite; return !(lastWrite && lastWrite.dmCount === destructiveMethodCounts.get(this.cache) && (0,_wry_equality__WEBPACK_IMPORTED_MODULE_0__.equal)(variables, lastWrite.variables) && (0,_wry_equality__WEBPACK_IMPORTED_MODULE_0__.equal)(result.data, lastWrite.result.data)); }; QueryInfo.prototype.markResult = function (result, options, allowCacheWrite) { var _this = this; this.graphQLErrors = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.isNonEmptyArray)(result.errors) ? result.errors : []; if (options.fetchPolicy === 'no-cache') { this.diff = { result: result.data, complete: true }; } else if (allowCacheWrite) { if (shouldWriteResult(result, options.errorPolicy)) { this.cache.performTransaction(function (cache) { if (_this.shouldWrite(result, options.variables)) { cache.writeQuery({ query: _this.document, data: result.data, variables: options.variables, }); _this.lastWrite = { result: result, variables: options.variables, dmCount: destructiveMethodCounts.get(_this.cache), }; } else { if (_this.diff && _this.diff.complete) { result.data = _this.diff.result; return; } } var diff = cache.diff({ query: _this.document, variables: options.variables, returnPartialData: true, optimistic: true, }); _this.updateWatch(options.variables); _this.diff = diff; if (diff.complete) { result.data = diff.result; } }); } else { this.lastWrite = void 0; } } }; QueryInfo.prototype.markReady = function () { this.networkError = null; return this.networkStatus = _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.ready; }; QueryInfo.prototype.markError = function (error) { this.networkStatus = _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus.error; this.lastWrite = void 0; if (error.graphQLErrors) { this.graphQLErrors = error.graphQLErrors; } if (error.networkError) { this.networkError = error.networkError; } return error; }; return QueryInfo; }()); function shouldWriteResult(result, errorPolicy) { if (errorPolicy === void 0) { errorPolicy = "none"; } var ignoreErrors = errorPolicy === "ignore" || errorPolicy === "all"; var writeWithErrors = !(0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.graphQLResultHasError)(result); if (!writeWithErrors && ignoreErrors && result.data) { writeWithErrors = true; } return writeWithErrors; } //# sourceMappingURL=QueryInfo.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/QueryManager.js": /*!**********************************************************!*\ !*** ./node_modules/@apollo/client/core/QueryManager.js ***! \**********************************************************/ /*! namespace exports */ /*! export QueryManager [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "QueryManager": () => /* binding */ QueryManager /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _wry_equality__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wry/equality */ "./node_modules/@wry/equality/lib/equality.esm.js"); /* harmony import */ var _link_core_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../link/core/index.js */ "./node_modules/@apollo/client/link/core/index.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _errors_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../errors/index.js */ "./node_modules/@apollo/client/errors/index.js"); /* harmony import */ var _MutationStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MutationStore.js */ "./node_modules/@apollo/client/core/MutationStore.js"); /* harmony import */ var _ObservableQuery_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ObservableQuery.js */ "./node_modules/@apollo/client/core/ObservableQuery.js"); /* harmony import */ var _networkStatus_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./networkStatus.js */ "./node_modules/@apollo/client/core/networkStatus.js"); /* harmony import */ var _LocalState_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./LocalState.js */ "./node_modules/@apollo/client/core/LocalState.js"); /* harmony import */ var _QueryInfo_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./QueryInfo.js */ "./node_modules/@apollo/client/core/QueryInfo.js"); ; var hasOwnProperty = Object.prototype.hasOwnProperty; var QueryManager = (function () { function QueryManager(_a) { var cache = _a.cache, link = _a.link, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, _c = _a.onBroadcast, onBroadcast = _c === void 0 ? function () { return undefined; } : _c, _d = _a.ssrMode, ssrMode = _d === void 0 ? false : _d, _e = _a.clientAwareness, clientAwareness = _e === void 0 ? {} : _e, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults; this.mutationStore = new _MutationStore_js__WEBPACK_IMPORTED_MODULE_5__.MutationStore(); this.clientAwareness = {}; this.queries = new Map(); this.fetchCancelFns = new Map(); this.transformCache = new (_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.canUseWeakMap ? WeakMap : Map)(); this.queryIdCounter = 1; this.requestIdCounter = 1; this.mutationIdCounter = 1; this.inFlightLinkObservables = new Map(); this.cache = cache; this.link = link; this.queryDeduplication = queryDeduplication; this.onBroadcast = onBroadcast; this.clientAwareness = clientAwareness; this.localState = localState || new _LocalState_js__WEBPACK_IMPORTED_MODULE_8__.LocalState({ cache: cache }); this.ssrMode = ssrMode; this.assumeImmutableResults = !!assumeImmutableResults; } QueryManager.prototype.stop = function () { var _this = this; this.queries.forEach(function (_info, queryId) { _this.stopQueryNoBroadcast(queryId); }); this.cancelPendingFetches( false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError('QueryManager stopped while query was in flight')); }; QueryManager.prototype.cancelPendingFetches = function (error) { this.fetchCancelFns.forEach(function (cancel) { return cancel(error); }); this.fetchCancelFns.clear(); }; QueryManager.prototype.mutate = function (_a) { var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueriesByName = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e; return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () { var mutationId, generateUpdateQueriesInfo, optimistic_1, self; var _this = this; return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_f) { switch (_f.label) { case 0: false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); mutationId = this.generateMutationId(); mutation = this.transform(mutation).document; variables = this.getVariables(mutation, variables); if (!this.transform(mutation).hasClientExports) return [3, 2]; return [4, this.localState.addExportedVariables(mutation, variables, context)]; case 1: variables = _f.sent(); _f.label = 2; case 2: generateUpdateQueriesInfo = function () { var ret = {}; if (updateQueriesByName) { _this.queries.forEach(function (_a, queryId) { var observableQuery = _a.observableQuery; if (observableQuery) { var queryName = observableQuery.queryName; if (queryName && hasOwnProperty.call(updateQueriesByName, queryName)) { ret[queryId] = { updater: updateQueriesByName[queryName], queryInfo: _this.queries.get(queryId), }; } } }); } return ret; }; this.mutationStore.initMutation(mutationId, mutation, variables); if (optimisticResponse) { optimistic_1 = typeof optimisticResponse === 'function' ? optimisticResponse(variables) : optimisticResponse; this.cache.recordOptimisticTransaction(function (cache) { try { markMutationResult({ mutationId: mutationId, result: { data: optimistic_1 }, document: mutation, variables: variables, errorPolicy: errorPolicy, queryUpdatersById: generateUpdateQueriesInfo(), update: updateWithProxyFn, }, cache); } catch (error) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.error(error); } }, mutationId); } this.broadcastQueries(); self = this; return [2, new Promise(function (resolve, reject) { var storeResult; var error; self.getObservableFromLink(mutation, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, context), { optimisticResponse: optimisticResponse }), variables, false).subscribe({ next: function (result) { if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.graphQLResultHasError)(result) && errorPolicy === 'none') { error = new _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.ApolloError({ graphQLErrors: result.errors, }); return; } self.mutationStore.markMutationResult(mutationId); if (fetchPolicy !== 'no-cache') { try { markMutationResult({ mutationId: mutationId, result: result, document: mutation, variables: variables, errorPolicy: errorPolicy, queryUpdatersById: generateUpdateQueriesInfo(), update: updateWithProxyFn, }, self.cache); } catch (e) { error = new _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.ApolloError({ networkError: e, }); return; } } storeResult = result; }, error: function (err) { self.mutationStore.markMutationError(mutationId, err); if (optimisticResponse) { self.cache.removeOptimistic(mutationId); } self.broadcastQueries(); reject(new _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.ApolloError({ networkError: err, })); }, complete: function () { if (error) { self.mutationStore.markMutationError(mutationId, error); } if (optimisticResponse) { self.cache.removeOptimistic(mutationId); } self.broadcastQueries(); if (error) { reject(error); return; } if (typeof refetchQueries === 'function') { refetchQueries = refetchQueries(storeResult); } var refetchQueryPromises = []; if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.isNonEmptyArray)(refetchQueries)) { refetchQueries.forEach(function (refetchQuery) { if (typeof refetchQuery === 'string') { self.queries.forEach(function (_a) { var observableQuery = _a.observableQuery; if (observableQuery && observableQuery.queryName === refetchQuery) { refetchQueryPromises.push(observableQuery.refetch()); } }); } else { var queryOptions = { query: refetchQuery.query, variables: refetchQuery.variables, fetchPolicy: 'network-only', }; if (refetchQuery.context) { queryOptions.context = refetchQuery.context; } refetchQueryPromises.push(self.query(queryOptions)); } }); } Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { if (errorPolicy === 'ignore' && storeResult && (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.graphQLResultHasError)(storeResult)) { delete storeResult.errors; } resolve(storeResult); }, reject); }, }); })]; } }); }); }; QueryManager.prototype.fetchQuery = function (queryId, options, networkStatus) { return this.fetchQueryObservable(queryId, options, networkStatus).promise; }; QueryManager.prototype.getQueryStore = function () { var store = Object.create(null); this.queries.forEach(function (info, queryId) { store[queryId] = { variables: info.variables, networkStatus: info.networkStatus, networkError: info.networkError, graphQLErrors: info.graphQLErrors, }; }); return store; }; QueryManager.prototype.resetErrors = function (queryId) { var queryInfo = this.queries.get(queryId); if (queryInfo) { queryInfo.networkError = undefined; queryInfo.graphQLErrors = []; } }; QueryManager.prototype.transform = function (document) { var transformCache = this.transformCache; if (!transformCache.has(document)) { var transformed = this.cache.transformDocument(document); var forLink = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.removeConnectionDirectiveFromDocument)(this.cache.transformForLink(transformed)); var clientQuery = this.localState.clientQuery(transformed); var serverQuery = forLink && this.localState.serverQuery(forLink); var cacheEntry_1 = { document: transformed, hasClientExports: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.hasClientExports)(transformed), hasForcedResolvers: this.localState.shouldForceResolvers(transformed), clientQuery: clientQuery, serverQuery: serverQuery, defaultVars: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.getDefaultValues)((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.getOperationDefinition)(transformed)), }; var add = function (doc) { if (doc && !transformCache.has(doc)) { transformCache.set(doc, cacheEntry_1); } }; add(document); add(transformed); add(clientQuery); add(serverQuery); } return transformCache.get(document); }; QueryManager.prototype.getVariables = function (document, variables) { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, this.transform(document).defaultVars), variables); }; QueryManager.prototype.watchQuery = function (options) { options = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, options), { variables: this.getVariables(options.query, options.variables) }); if (typeof options.notifyOnNetworkStatusChange === 'undefined') { options.notifyOnNetworkStatusChange = false; } var queryInfo = new _QueryInfo_js__WEBPACK_IMPORTED_MODULE_9__.QueryInfo(this.cache); var observable = new _ObservableQuery_js__WEBPACK_IMPORTED_MODULE_6__.ObservableQuery({ queryManager: this, queryInfo: queryInfo, options: options, }); this.queries.set(observable.queryId, queryInfo); queryInfo.init({ document: options.query, observableQuery: observable, variables: options.variables, }); return observable; }; QueryManager.prototype.query = function (options) { var _this = this; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(options.query, 'query option is required. You must specify your GraphQL document ' + 'in the query option.'); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); var queryId = this.generateQueryId(); return this.fetchQuery(queryId, options).finally(function () { return _this.stopQuery(queryId); }); }; QueryManager.prototype.generateQueryId = function () { return String(this.queryIdCounter++); }; QueryManager.prototype.generateRequestId = function () { return this.requestIdCounter++; }; QueryManager.prototype.generateMutationId = function () { return String(this.mutationIdCounter++); }; QueryManager.prototype.stopQueryInStore = function (queryId) { this.stopQueryInStoreNoBroadcast(queryId); this.broadcastQueries(); }; QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { var queryInfo = this.queries.get(queryId); if (queryInfo) queryInfo.stop(); }; QueryManager.prototype.clearStore = function () { this.cancelPendingFetches( false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError('Store reset while query was in flight (not completed in link chain)')); this.queries.forEach(function (queryInfo) { if (queryInfo.observableQuery) { queryInfo.networkStatus = _networkStatus_js__WEBPACK_IMPORTED_MODULE_7__.NetworkStatus.loading; } else { queryInfo.stop(); } }); this.mutationStore.reset(); return this.cache.reset(); }; QueryManager.prototype.resetStore = function () { var _this = this; return this.clearStore().then(function () { return _this.reFetchObservableQueries(); }); }; QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { var _this = this; if (includeStandby === void 0) { includeStandby = false; } var observableQueryPromises = []; this.queries.forEach(function (_a, queryId) { var observableQuery = _a.observableQuery; if (observableQuery && observableQuery.hasObservers()) { var fetchPolicy = observableQuery.options.fetchPolicy; observableQuery.resetLastResults(); if (fetchPolicy !== 'cache-only' && (includeStandby || fetchPolicy !== 'standby')) { observableQueryPromises.push(observableQuery.refetch()); } _this.getQuery(queryId).setDiff(null); } }); this.broadcastQueries(); return Promise.all(observableQueryPromises); }; QueryManager.prototype.setObservableQuery = function (observableQuery) { this.getQuery(observableQuery.queryId).setObservableQuery(observableQuery); }; QueryManager.prototype.startGraphQLSubscription = function (_a) { var _this = this; var query = _a.query, fetchPolicy = _a.fetchPolicy, errorPolicy = _a.errorPolicy, variables = _a.variables, _b = _a.context, context = _b === void 0 ? {} : _b; query = this.transform(query).document; variables = this.getVariables(query, variables); var makeObservable = function (variables) { return _this.getObservableFromLink(query, context, variables, false).map(function (result) { if (fetchPolicy !== 'no-cache') { if ((0,_QueryInfo_js__WEBPACK_IMPORTED_MODULE_9__.shouldWriteResult)(result, errorPolicy)) { _this.cache.write({ query: query, result: result.data, dataId: 'ROOT_SUBSCRIPTION', variables: variables, }); } _this.broadcastQueries(); } if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.graphQLResultHasError)(result)) { throw new _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.ApolloError({ graphQLErrors: result.errors, }); } return result; }); }; if (this.transform(query).hasClientExports) { var observablePromise_1 = this.localState.addExportedVariables(query, variables, context).then(makeObservable); return new _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Observable(function (observer) { var sub = null; observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error); return function () { return sub && sub.unsubscribe(); }; }); } return makeObservable(variables); }; QueryManager.prototype.stopQuery = function (queryId) { this.stopQueryNoBroadcast(queryId); this.broadcastQueries(); }; QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { this.stopQueryInStoreNoBroadcast(queryId); this.removeQuery(queryId); }; QueryManager.prototype.removeQuery = function (queryId) { this.fetchCancelFns.delete(queryId); this.getQuery(queryId).subscriptions.forEach(function (x) { return x.unsubscribe(); }); this.queries.delete(queryId); }; QueryManager.prototype.broadcastQueries = function () { this.onBroadcast(); this.queries.forEach(function (info) { return info.notify(); }); }; QueryManager.prototype.getLocalState = function () { return this.localState; }; QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { var _this = this; var _a; if (deduplication === void 0) { deduplication = (_a = context === null || context === void 0 ? void 0 : context.queryDeduplication) !== null && _a !== void 0 ? _a : this.queryDeduplication; } var observable; var serverQuery = this.transform(query).serverQuery; if (serverQuery) { var _b = this, inFlightLinkObservables_1 = _b.inFlightLinkObservables, link = _b.link; var operation = { query: serverQuery, variables: variables, operationName: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.getOperationName)(serverQuery) || void 0, context: this.prepareContext((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, context), { forceFetch: !deduplication })), }; context = operation.context; if (deduplication) { var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); inFlightLinkObservables_1.set(serverQuery, byVariables_1); var varJson_1 = JSON.stringify(variables); observable = byVariables_1.get(varJson_1); if (!observable) { var concast = new _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Concast([ (0,_link_core_index_js__WEBPACK_IMPORTED_MODULE_2__.execute)(link, operation) ]); byVariables_1.set(varJson_1, observable = concast); concast.cleanup(function () { if (byVariables_1.delete(varJson_1) && byVariables_1.size < 1) { inFlightLinkObservables_1.delete(serverQuery); } }); } } else { observable = new _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Concast([ (0,_link_core_index_js__WEBPACK_IMPORTED_MODULE_2__.execute)(link, operation) ]); } } else { observable = new _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Concast([ _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Observable.of({ data: {} }) ]); context = this.prepareContext(context); } var clientQuery = this.transform(query).clientQuery; if (clientQuery) { observable = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.asyncMap)(observable, function (result) { return _this.localState.runResolvers({ document: clientQuery, remoteResult: result, context: context, variables: variables, }); }); } return observable; }; QueryManager.prototype.getResultsFromLink = function (queryInfo, allowCacheWrite, options) { var lastRequestId = queryInfo.lastRequestId; return (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.asyncMap)(this.getObservableFromLink(queryInfo.document, options.context, options.variables), function (result) { var hasErrors = (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.isNonEmptyArray)(result.errors); if (lastRequestId >= queryInfo.lastRequestId) { if (hasErrors && options.errorPolicy === "none") { throw queryInfo.markError(new _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.ApolloError({ graphQLErrors: result.errors, })); } queryInfo.markResult(result, options, allowCacheWrite); queryInfo.markReady(); } var aqr = { data: result.data, loading: false, networkStatus: queryInfo.networkStatus || _networkStatus_js__WEBPACK_IMPORTED_MODULE_7__.NetworkStatus.ready, }; if (hasErrors && options.errorPolicy !== "ignore") { aqr.errors = result.errors; } return aqr; }, function (networkError) { var error = (0,_errors_index_js__WEBPACK_IMPORTED_MODULE_4__.isApolloError)(networkError) ? networkError : new _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.ApolloError({ networkError: networkError }); if (lastRequestId >= queryInfo.lastRequestId) { queryInfo.markError(error); } throw error; }); }; QueryManager.prototype.fetchQueryObservable = function (queryId, options, networkStatus) { var _this = this; if (networkStatus === void 0) { networkStatus = _networkStatus_js__WEBPACK_IMPORTED_MODULE_7__.NetworkStatus.loading; } var query = this.transform(options.query).document; var variables = this.getVariables(query, options.variables); var queryInfo = this.getQuery(queryId); var oldNetworkStatus = queryInfo.networkStatus; var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? "cache-first" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? "none" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e; var mightUseNetwork = fetchPolicy === "cache-first" || fetchPolicy === "cache-and-network" || fetchPolicy === "network-only" || fetchPolicy === "no-cache"; if (mightUseNetwork && notifyOnNetworkStatusChange && typeof oldNetworkStatus === "number" && oldNetworkStatus !== networkStatus && (0,_networkStatus_js__WEBPACK_IMPORTED_MODULE_7__.isNetworkRequestInFlight)(networkStatus)) { if (fetchPolicy !== "cache-first") { fetchPolicy = "cache-and-network"; } returnPartialData = true; } var normalized = Object.assign({}, options, { query: query, variables: variables, fetchPolicy: fetchPolicy, errorPolicy: errorPolicy, returnPartialData: returnPartialData, notifyOnNetworkStatusChange: notifyOnNetworkStatusChange, context: context, }); var fromVariables = function (variables) { normalized.variables = variables; return _this.fetchQueryByPolicy(queryInfo, normalized, networkStatus); }; this.fetchCancelFns.set(queryId, function (reason) { Promise.resolve().then(function () { return concast.cancel(reason); }); }); var concast = new _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Concast(this.transform(normalized.query).hasClientExports ? this.localState.addExportedVariables(normalized.query, normalized.variables, normalized.context).then(fromVariables) : fromVariables(normalized.variables)); concast.cleanup(function () { _this.fetchCancelFns.delete(queryId); var nextFetchPolicy = options.nextFetchPolicy; if (nextFetchPolicy) { options.nextFetchPolicy = void 0; options.fetchPolicy = typeof nextFetchPolicy === "function" ? nextFetchPolicy.call(options, options.fetchPolicy || "cache-first") : nextFetchPolicy; } }); return concast; }; QueryManager.prototype.fetchQueryByPolicy = function (queryInfo, options, networkStatus) { var _this = this; var query = options.query, variables = options.variables, fetchPolicy = options.fetchPolicy, errorPolicy = options.errorPolicy, returnPartialData = options.returnPartialData, context = options.context; queryInfo.init({ document: query, variables: variables, lastRequestId: this.generateRequestId(), networkStatus: networkStatus, }); var readCache = function () { return queryInfo.getDiff(variables); }; var resultsFromCache = function (diff, networkStatus) { if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || _networkStatus_js__WEBPACK_IMPORTED_MODULE_7__.NetworkStatus.loading; } var data = diff.result; if ( true && (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.isNonEmptyArray)(diff.missing) && !(0,_wry_equality__WEBPACK_IMPORTED_MODULE_1__.equal)(data, {}) && !returnPartialData) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.warn("Missing cache result fields: " + diff.missing.map(function (m) { return m.path.join('.'); }).join(', '), diff.missing); } var fromData = function (data) { return _utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.Observable.of((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({ data: data, loading: (0,_networkStatus_js__WEBPACK_IMPORTED_MODULE_7__.isNetworkRequestInFlight)(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); }; if (_this.transform(query).hasForcedResolvers) { return _this.localState.runResolvers({ document: query, remoteResult: { data: data }, context: context, variables: variables, onlyRunForcedResolvers: true, }).then(function (resolved) { return fromData(resolved.data); }); } return fromData(data); }; var resultsFromLink = function (allowCacheWrite) { return _this.getResultsFromLink(queryInfo, allowCacheWrite, { variables: variables, context: context, fetchPolicy: fetchPolicy, errorPolicy: errorPolicy, }); }; switch (fetchPolicy) { default: case "cache-first": { var diff = readCache(); if (diff.complete) { return [ resultsFromCache(diff, queryInfo.markReady()), ]; } if (returnPartialData) { return [ resultsFromCache(diff), resultsFromLink(true), ]; } return [ resultsFromLink(true), ]; } case "cache-and-network": { var diff = readCache(); if (diff.complete || returnPartialData) { return [ resultsFromCache(diff), resultsFromLink(true), ]; } return [ resultsFromLink(true), ]; } case "cache-only": return [ resultsFromCache(readCache(), queryInfo.markReady()), ]; case "network-only": return [resultsFromLink(true)]; case "no-cache": return [resultsFromLink(false)]; case "standby": return []; } }; QueryManager.prototype.getQuery = function (queryId) { if (queryId && !this.queries.has(queryId)) { this.queries.set(queryId, new _QueryInfo_js__WEBPACK_IMPORTED_MODULE_9__.QueryInfo(this.cache)); } return this.queries.get(queryId); }; QueryManager.prototype.prepareContext = function (context) { if (context === void 0) { context = {}; } var newContext = this.localState.prepareContext(context); return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, newContext), { clientAwareness: this.clientAwareness }); }; return QueryManager; }()); function markMutationResult(mutation, cache) { if ((0,_QueryInfo_js__WEBPACK_IMPORTED_MODULE_9__.shouldWriteResult)(mutation.result, mutation.errorPolicy)) { var cacheWrites_1 = [{ result: mutation.result.data, dataId: 'ROOT_MUTATION', query: mutation.document, variables: mutation.variables, }]; var queryUpdatersById_1 = mutation.queryUpdatersById; if (queryUpdatersById_1) { Object.keys(queryUpdatersById_1).forEach(function (id) { var _a = queryUpdatersById_1[id], updater = _a.updater, _b = _a.queryInfo, document = _b.document, variables = _b.variables; var _c = cache.diff({ query: document, variables: variables, returnPartialData: true, optimistic: false, }), currentQueryResult = _c.result, complete = _c.complete; if (complete && currentQueryResult) { var nextQueryResult = updater(currentQueryResult, { mutationResult: mutation.result, queryName: (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_3__.getOperationName)(document) || undefined, queryVariables: variables, }); if (nextQueryResult) { cacheWrites_1.push({ result: nextQueryResult, dataId: 'ROOT_QUERY', query: document, variables: variables, }); } } }); } cache.performTransaction(function (c) { cacheWrites_1.forEach(function (write) { return c.write(write); }); var update = mutation.update; if (update) { update(c, mutation.result); } }, null); } } //# sourceMappingURL=QueryManager.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/Reobserver.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/core/Reobserver.js ***! \********************************************************/ /*! namespace exports */ /*! export Reobserver [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Reobserver": () => /* binding */ Reobserver /* harmony export */ }); /* harmony import */ var _networkStatus_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./networkStatus.js */ "./node_modules/@apollo/client/core/networkStatus.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); ; var Reobserver = (function () { function Reobserver(observer, options, fetch, shouldFetch) { this.observer = observer; this.options = options; this.fetch = fetch; this.shouldFetch = shouldFetch; } Reobserver.prototype.reobserve = function (newOptions, newNetworkStatus) { if (newOptions) { this.updateOptions(newOptions); } else { this.updatePolling(); } var concast = this.fetch(this.options, newNetworkStatus); if (this.concast) { this.concast.removeObserver(this.observer, true); } concast.addObserver(this.observer); return (this.concast = concast).promise; }; Reobserver.prototype.updateOptions = function (newOptions) { Object.assign(this.options, (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.compact)(newOptions)); this.updatePolling(); return this; }; Reobserver.prototype.stop = function () { if (this.concast) { this.concast.removeObserver(this.observer); delete this.concast; } if (this.pollingInfo) { clearTimeout(this.pollingInfo.timeout); this.options.pollInterval = 0; this.updatePolling(); } }; Reobserver.prototype.updatePolling = function () { var _this = this; var _a = this, pollingInfo = _a.pollingInfo, pollInterval = _a.options.pollInterval; if (!pollInterval) { if (pollingInfo) { clearTimeout(pollingInfo.timeout); delete this.pollingInfo; } return; } if (pollingInfo && pollingInfo.interval === pollInterval) { return; } false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_2__.invariant)(pollInterval, 'Attempted to start a polling query without a polling interval.'); if (this.shouldFetch === false) { return; } var info = pollingInfo || (this.pollingInfo = {}); info.interval = pollInterval; var maybeFetch = function () { if (_this.pollingInfo) { if (_this.shouldFetch && _this.shouldFetch()) { _this.reobserve({ fetchPolicy: "network-only", nextFetchPolicy: _this.options.fetchPolicy || "cache-first", }, _networkStatus_js__WEBPACK_IMPORTED_MODULE_0__.NetworkStatus.poll).then(poll, poll); } else { poll(); } } ; }; var poll = function () { var info = _this.pollingInfo; if (info) { clearTimeout(info.timeout); info.timeout = setTimeout(maybeFetch, info.interval); } }; poll(); }; return Reobserver; }()); //# sourceMappingURL=Reobserver.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/index.js": /*!***************************************************!*\ !*** ./node_modules/@apollo/client/core/index.js ***! \***************************************************/ /*! namespace exports */ /*! export ApolloCache [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/core/cache.js .ApolloCache */ /*! export ApolloClient [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/core/ApolloClient.js .ApolloClient */ /*! export ApolloError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/errors/index.js .ApolloError */ /*! export ApolloLink [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export Cache [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/core/types/Cache.js .Cache */ /*! export HttpLink [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export InMemoryCache [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/inmemory/inMemoryCache.js .InMemoryCache */ /*! export MissingFieldError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/core/types/common.js .MissingFieldError */ /*! export NetworkStatus [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/core/networkStatus.js .NetworkStatus */ /*! export Observable [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/zen-observable/index.js .default */ /*! export ObservableQuery [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/core/ObservableQuery.js .ObservableQuery */ /*! export checkFetcher [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export concat [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export createHttpLink [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export createSignalIfSupported [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export default [not provided] [no usage info] [missing usage info prevents renaming] */ /*! export defaultDataIdFromObject [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/inmemory/policies.js .defaultDataIdFromObject */ /*! export disableExperimentalFragmentVariables [provided] [no usage info] [missing usage info prevents renaming] */ /*! export disableFragmentWarnings [provided] [no usage info] [missing usage info prevents renaming] */ /*! export empty [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export enableExperimentalFragmentVariables [provided] [no usage info] [missing usage info prevents renaming] */ /*! export execute [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export fallbackHttpConfig [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export from [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export fromError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/fromError.js .fromError */ /*! export fromPromise [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/fromPromise.js .fromPromise */ /*! export gql [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-tag/src/index.js .default */ /*! export isApolloError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/errors/index.js .isApolloError */ /*! export isReference [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .isReference */ /*! export makeReference [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .makeReference */ /*! export makeVar [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/cache/inmemory/reactiveVars.js .makeVar */ /*! export parseAndCheckHttpResponse [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export resetCaches [provided] [no usage info] [missing usage info prevents renaming] */ /*! export rewriteURIForGET [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export selectHttpOptionsAndBody [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export selectURI [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export serializeFetchParameter [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export split [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export throwServerError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/throwServerError.js .throwServerError */ /*! export toPromise [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/toPromise.js .toPromise */ /*! other exports [maybe provided (runtime-defined)] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.n, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ApolloClient": () => /* reexport safe */ _ApolloClient_js__WEBPACK_IMPORTED_MODULE_0__.ApolloClient, /* harmony export */ "ObservableQuery": () => /* reexport safe */ _ObservableQuery_js__WEBPACK_IMPORTED_MODULE_1__.ObservableQuery, /* harmony export */ "NetworkStatus": () => /* reexport safe */ _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__.NetworkStatus, /* harmony export */ "isApolloError": () => /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.isApolloError, /* harmony export */ "ApolloError": () => /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_4__.ApolloError, /* harmony export */ "Cache": () => /* reexport safe */ _cache_index_js__WEBPACK_IMPORTED_MODULE_5__.Cache, /* harmony export */ "ApolloCache": () => /* reexport safe */ _cache_index_js__WEBPACK_IMPORTED_MODULE_5__.ApolloCache, /* harmony export */ "InMemoryCache": () => /* reexport safe */ _cache_index_js__WEBPACK_IMPORTED_MODULE_5__.InMemoryCache, /* harmony export */ "MissingFieldError": () => /* reexport safe */ _cache_index_js__WEBPACK_IMPORTED_MODULE_5__.MissingFieldError, /* harmony export */ "defaultDataIdFromObject": () => /* reexport safe */ _cache_index_js__WEBPACK_IMPORTED_MODULE_5__.defaultDataIdFromObject, /* harmony export */ "makeVar": () => /* reexport safe */ _cache_index_js__WEBPACK_IMPORTED_MODULE_5__.makeVar, /* harmony export */ "HttpLink": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.HttpLink, /* harmony export */ "checkFetcher": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.checkFetcher, /* harmony export */ "createHttpLink": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.createHttpLink, /* harmony export */ "createSignalIfSupported": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.createSignalIfSupported, /* harmony export */ "fallbackHttpConfig": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.fallbackHttpConfig, /* harmony export */ "parseAndCheckHttpResponse": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.parseAndCheckHttpResponse, /* harmony export */ "rewriteURIForGET": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.rewriteURIForGET, /* harmony export */ "selectHttpOptionsAndBody": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.selectHttpOptionsAndBody, /* harmony export */ "selectURI": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.selectURI, /* harmony export */ "serializeFetchParameter": () => /* reexport safe */ _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__.serializeFetchParameter, /* harmony export */ "fromError": () => /* reexport safe */ _link_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.fromError, /* harmony export */ "toPromise": () => /* reexport safe */ _link_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.toPromise, /* harmony export */ "fromPromise": () => /* reexport safe */ _link_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.fromPromise, /* harmony export */ "throwServerError": () => /* reexport safe */ _link_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.throwServerError, /* harmony export */ "Observable": () => /* reexport safe */ _utilities_index_js__WEBPACK_IMPORTED_MODULE_10__.Observable, /* harmony export */ "isReference": () => /* reexport safe */ _utilities_index_js__WEBPACK_IMPORTED_MODULE_10__.isReference, /* harmony export */ "makeReference": () => /* reexport safe */ _utilities_index_js__WEBPACK_IMPORTED_MODULE_10__.makeReference, /* harmony export */ "resetCaches": () => /* binding */ resetCaches, /* harmony export */ "disableFragmentWarnings": () => /* binding */ disableFragmentWarnings, /* harmony export */ "enableExperimentalFragmentVariables": () => /* binding */ enableExperimentalFragmentVariables, /* harmony export */ "disableExperimentalFragmentVariables": () => /* binding */ disableExperimentalFragmentVariables, /* harmony export */ "gql": () => /* reexport default from dynamic */ graphql_tag__WEBPACK_IMPORTED_MODULE_11___default.a /* harmony export */ }); /* harmony import */ var _ApolloClient_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ApolloClient.js */ "./node_modules/@apollo/client/core/ApolloClient.js"); /* harmony import */ var _ObservableQuery_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ObservableQuery.js */ "./node_modules/@apollo/client/core/ObservableQuery.js"); /* harmony import */ var _networkStatus_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./networkStatus.js */ "./node_modules/@apollo/client/core/networkStatus.js"); /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./types.js */ "./node_modules/@apollo/client/core/types.js"); /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_types_js__WEBPACK_IMPORTED_MODULE_3__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types_js__WEBPACK_IMPORTED_MODULE_3__) if(["default","ApolloClient","ObservableQuery","NetworkStatus","isApolloError","ApolloError","Cache","ApolloCache","InMemoryCache","MissingFieldError","defaultDataIdFromObject","makeVar","fromError","toPromise","fromPromise","throwServerError","Observable","isReference","makeReference","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","gql"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types_js__WEBPACK_IMPORTED_MODULE_3__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); /* harmony import */ var _errors_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../errors/index.js */ "./node_modules/@apollo/client/errors/index.js"); /* harmony import */ var _cache_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cache/index.js */ "./node_modules/@apollo/client/cache/index.js"); /* harmony import */ var _cache_inmemory_types_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../cache/inmemory/types.js */ "./node_modules/@apollo/client/cache/inmemory/types.js"); /* harmony import */ var _cache_inmemory_types_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_cache_inmemory_types_js__WEBPACK_IMPORTED_MODULE_6__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _cache_inmemory_types_js__WEBPACK_IMPORTED_MODULE_6__) if(["default","ApolloClient","ObservableQuery","NetworkStatus","isApolloError","ApolloError","Cache","ApolloCache","InMemoryCache","MissingFieldError","defaultDataIdFromObject","makeVar","fromError","toPromise","fromPromise","throwServerError","Observable","isReference","makeReference","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","gql"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _cache_inmemory_types_js__WEBPACK_IMPORTED_MODULE_6__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); /* harmony import */ var _link_core_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../link/core/index.js */ "./node_modules/@apollo/client/link/core/index.js"); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _link_core_index_js__WEBPACK_IMPORTED_MODULE_7__) if(["default","ApolloClient","ObservableQuery","NetworkStatus","isApolloError","ApolloError","Cache","ApolloCache","InMemoryCache","MissingFieldError","defaultDataIdFromObject","makeVar","fromError","toPromise","fromPromise","throwServerError","Observable","isReference","makeReference","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","gql"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _link_core_index_js__WEBPACK_IMPORTED_MODULE_7__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); /* harmony import */ var _link_http_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../link/http/index.js */ "./node_modules/@apollo/client/link/http/index.js"); /* harmony import */ var _link_utils_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../link/utils/index.js */ "./node_modules/@apollo/client/link/utils/index.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! graphql-tag */ "./node_modules/graphql-tag/src/index.js"); /* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(graphql_tag__WEBPACK_IMPORTED_MODULE_11__); var resetCaches = (graphql_tag__WEBPACK_IMPORTED_MODULE_11___default().resetCaches), disableFragmentWarnings = (graphql_tag__WEBPACK_IMPORTED_MODULE_11___default().disableFragmentWarnings), enableExperimentalFragmentVariables = (graphql_tag__WEBPACK_IMPORTED_MODULE_11___default().enableExperimentalFragmentVariables), disableExperimentalFragmentVariables = (graphql_tag__WEBPACK_IMPORTED_MODULE_11___default().disableExperimentalFragmentVariables); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/networkStatus.js": /*!***********************************************************!*\ !*** ./node_modules/@apollo/client/core/networkStatus.js ***! \***********************************************************/ /*! namespace exports */ /*! export NetworkStatus [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNetworkRequestInFlight [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "NetworkStatus": () => /* binding */ NetworkStatus, /* harmony export */ "isNetworkRequestInFlight": () => /* binding */ isNetworkRequestInFlight /* harmony export */ }); var NetworkStatus; (function (NetworkStatus) { NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; NetworkStatus[NetworkStatus["error"] = 8] = "error"; })(NetworkStatus || (NetworkStatus = {})); function isNetworkRequestInFlight(networkStatus) { return networkStatus ? networkStatus < 7 : false; } //# sourceMappingURL=networkStatus.js.map /***/ }), /***/ "./node_modules/@apollo/client/core/types.js": /*!***************************************************!*\ !*** ./node_modules/@apollo/client/core/types.js ***! \***************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: */ /***/ (() => { //# sourceMappingURL=types.js.map /***/ }), /***/ "./node_modules/@apollo/client/errors/index.js": /*!*****************************************************!*\ !*** ./node_modules/@apollo/client/errors/index.js ***! \*****************************************************/ /*! namespace exports */ /*! export ApolloError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isApolloError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isApolloError": () => /* binding */ isApolloError, /* harmony export */ "ApolloError": () => /* binding */ ApolloError /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); ; function isApolloError(err) { return err.hasOwnProperty('graphQLErrors'); } var generateErrorMessage = function (err) { var message = ''; if ((0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.isNonEmptyArray)(err.graphQLErrors)) { err.graphQLErrors.forEach(function (graphQLError) { var errorMessage = graphQLError ? graphQLError.message : 'Error message not found.'; message += errorMessage + "\n"; }); } if (err.networkError) { message += err.networkError.message + "\n"; } message = message.replace(/\n$/, ''); return message; }; var ApolloError = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(ApolloError, _super); function ApolloError(_a) { var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo; var _this = _super.call(this, errorMessage) || this; _this.graphQLErrors = graphQLErrors || []; _this.networkError = networkError || null; _this.message = errorMessage || generateErrorMessage(_this); _this.extraInfo = extraInfo; _this.__proto__ = ApolloError.prototype; return _this; } return ApolloError; }(Error)); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/ApolloLink.js": /*!*************************************************************!*\ !*** ./node_modules/@apollo/client/link/core/ApolloLink.js ***! \*************************************************************/ /*! namespace exports */ /*! export ApolloLink [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ApolloLink": () => /* binding */ ApolloLink /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/@apollo/client/link/utils/index.js"); ; function passthrough(op, forward) { return (forward ? forward(op) : _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of()); } function toLink(handler) { return typeof handler === 'function' ? new ApolloLink(handler) : handler; } function isTerminating(link) { return link.request.length <= 1; } var LinkError = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(LinkError, _super); function LinkError(message, link) { var _this = _super.call(this, message) || this; _this.link = link; return _this; } return LinkError; }(Error)); var ApolloLink = (function () { function ApolloLink(request) { if (request) this.request = request; } ApolloLink.empty = function () { return new ApolloLink(function () { return _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of(); }); }; ApolloLink.from = function (links) { if (links.length === 0) return ApolloLink.empty(); return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); }; ApolloLink.split = function (test, left, right) { var leftLink = toLink(left); var rightLink = toLink(right || new ApolloLink(passthrough)); if (isTerminating(leftLink) && isTerminating(rightLink)) { return new ApolloLink(function (operation) { return test(operation) ? leftLink.request(operation) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of() : rightLink.request(operation) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of(); }); } else { return new ApolloLink(function (operation, forward) { return test(operation) ? leftLink.request(operation, forward) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of() : rightLink.request(operation, forward) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of(); }); } }; ApolloLink.execute = function (link, operation) { return (link.request((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.createOperation)(operation.context, (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.transformOperation)((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_2__.validateOperation)(operation)))) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of()); }; ApolloLink.concat = function (first, second) { var firstLink = toLink(first); if (isTerminating(firstLink)) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); return firstLink; } var nextLink = toLink(second); if (isTerminating(nextLink)) { return new ApolloLink(function (operation) { return firstLink.request(operation, function (op) { return nextLink.request(op) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of(); }) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of(); }); } else { return new ApolloLink(function (operation, forward) { return (firstLink.request(operation, function (op) { return nextLink.request(op, forward) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of(); }) || _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable.of()); }); } }; ApolloLink.prototype.split = function (test, left, right) { return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough))); }; ApolloLink.prototype.concat = function (next) { return ApolloLink.concat(this, next); }; ApolloLink.prototype.request = function (operation, forward) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError('request is not implemented'); }; ApolloLink.prototype.onError = function (reason) { throw reason; }; ApolloLink.prototype.setOnError = function (fn) { this.onError = fn; return this; }; return ApolloLink; }()); //# sourceMappingURL=ApolloLink.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/concat.js": /*!*********************************************************!*\ !*** ./node_modules/@apollo/client/link/core/concat.js ***! \*********************************************************/ /*! namespace exports */ /*! export concat [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "concat": () => /* binding */ concat /* harmony export */ }); /* harmony import */ var _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ApolloLink.js */ "./node_modules/@apollo/client/link/core/ApolloLink.js"); ; var concat = _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__.ApolloLink.concat; //# sourceMappingURL=concat.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/empty.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/link/core/empty.js ***! \********************************************************/ /*! namespace exports */ /*! export empty [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "empty": () => /* binding */ empty /* harmony export */ }); /* harmony import */ var _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ApolloLink.js */ "./node_modules/@apollo/client/link/core/ApolloLink.js"); ; var empty = _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__.ApolloLink.empty; //# sourceMappingURL=empty.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/execute.js": /*!**********************************************************!*\ !*** ./node_modules/@apollo/client/link/core/execute.js ***! \**********************************************************/ /*! namespace exports */ /*! export execute [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "execute": () => /* binding */ execute /* harmony export */ }); /* harmony import */ var _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ApolloLink.js */ "./node_modules/@apollo/client/link/core/ApolloLink.js"); ; var execute = _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__.ApolloLink.execute; //# sourceMappingURL=execute.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/from.js": /*!*******************************************************!*\ !*** ./node_modules/@apollo/client/link/core/from.js ***! \*******************************************************/ /*! namespace exports */ /*! export from [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "from": () => /* binding */ from /* harmony export */ }); /* harmony import */ var _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ApolloLink.js */ "./node_modules/@apollo/client/link/core/ApolloLink.js"); ; var from = _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__.ApolloLink.from; //# sourceMappingURL=from.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/index.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/link/core/index.js ***! \********************************************************/ /*! namespace exports */ /*! export ApolloLink [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/core/ApolloLink.js .ApolloLink */ /*! export concat [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/core/concat.js .concat */ /*! export default [not provided] [no usage info] [missing usage info prevents renaming] */ /*! export empty [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/core/empty.js .empty */ /*! export execute [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/core/execute.js .execute */ /*! export from [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/core/from.js .from */ /*! export split [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/core/split.js .split */ /*! other exports [maybe provided (runtime-defined)] [no usage info] -> ./node_modules/@apollo/client/link/core/types.js */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.n, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "empty": () => /* reexport safe */ _empty_js__WEBPACK_IMPORTED_MODULE_0__.empty, /* harmony export */ "from": () => /* reexport safe */ _from_js__WEBPACK_IMPORTED_MODULE_1__.from, /* harmony export */ "split": () => /* reexport safe */ _split_js__WEBPACK_IMPORTED_MODULE_2__.split, /* harmony export */ "concat": () => /* reexport safe */ _concat_js__WEBPACK_IMPORTED_MODULE_3__.concat, /* harmony export */ "execute": () => /* reexport safe */ _execute_js__WEBPACK_IMPORTED_MODULE_4__.execute, /* harmony export */ "ApolloLink": () => /* reexport safe */ _ApolloLink_js__WEBPACK_IMPORTED_MODULE_5__.ApolloLink /* harmony export */ }); /* harmony import */ var _empty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./empty.js */ "./node_modules/@apollo/client/link/core/empty.js"); /* harmony import */ var _from_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from.js */ "./node_modules/@apollo/client/link/core/from.js"); /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./split.js */ "./node_modules/@apollo/client/link/core/split.js"); /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./concat.js */ "./node_modules/@apollo/client/link/core/concat.js"); /* harmony import */ var _execute_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./execute.js */ "./node_modules/@apollo/client/link/core/execute.js"); /* harmony import */ var _ApolloLink_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ApolloLink.js */ "./node_modules/@apollo/client/link/core/ApolloLink.js"); /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./types.js */ "./node_modules/@apollo/client/link/core/types.js"); /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_types_js__WEBPACK_IMPORTED_MODULE_6__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _types_js__WEBPACK_IMPORTED_MODULE_6__) if(["default","empty","from","split","concat","execute","ApolloLink"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _types_js__WEBPACK_IMPORTED_MODULE_6__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/split.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/link/core/split.js ***! \********************************************************/ /*! namespace exports */ /*! export split [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "split": () => /* binding */ split /* harmony export */ }); /* harmony import */ var _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ApolloLink.js */ "./node_modules/@apollo/client/link/core/ApolloLink.js"); ; var split = _ApolloLink_js__WEBPACK_IMPORTED_MODULE_0__.ApolloLink.split; //# sourceMappingURL=split.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/core/types.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/link/core/types.js ***! \********************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: */ /***/ (() => { ; //# sourceMappingURL=types.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/HttpLink.js": /*!***********************************************************!*\ !*** ./node_modules/@apollo/client/link/http/HttpLink.js ***! \***********************************************************/ /*! namespace exports */ /*! export HttpLink [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "HttpLink": () => /* binding */ HttpLink /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/@apollo/client/link/core/index.js"); /* harmony import */ var _createHttpLink_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createHttpLink.js */ "./node_modules/@apollo/client/link/http/createHttpLink.js"); ; var HttpLink = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(HttpLink, _super); function HttpLink(options) { if (options === void 0) { options = {}; } var _this = _super.call(this, (0,_createHttpLink_js__WEBPACK_IMPORTED_MODULE_1__.createHttpLink)(options).request) || this; _this.options = options; return _this; } return HttpLink; }(_core_index_js__WEBPACK_IMPORTED_MODULE_0__.ApolloLink)); //# sourceMappingURL=HttpLink.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/checkFetcher.js": /*!***************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/checkFetcher.js ***! \***************************************************************/ /*! namespace exports */ /*! export checkFetcher [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "checkFetcher": () => /* binding */ checkFetcher /* harmony export */ }); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); ; var checkFetcher = function (fetcher) { if (!fetcher && typeof fetch === 'undefined') { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "); } }; //# sourceMappingURL=checkFetcher.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/createHttpLink.js": /*!*****************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/createHttpLink.js ***! \*****************************************************************/ /*! namespace exports */ /*! export createHttpLink [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "createHttpLink": () => /* binding */ createHttpLink /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/@apollo/client/link/core/index.js"); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var _serializeFetchParameter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./serializeFetchParameter.js */ "./node_modules/@apollo/client/link/http/serializeFetchParameter.js"); /* harmony import */ var _selectURI_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectURI.js */ "./node_modules/@apollo/client/link/http/selectURI.js"); /* harmony import */ var _parseAndCheckHttpResponse_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parseAndCheckHttpResponse.js */ "./node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js"); /* harmony import */ var _checkFetcher_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkFetcher.js */ "./node_modules/@apollo/client/link/http/checkFetcher.js"); /* harmony import */ var _selectHttpOptionsAndBody_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selectHttpOptionsAndBody.js */ "./node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js"); /* harmony import */ var _createSignalIfSupported_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./createSignalIfSupported.js */ "./node_modules/@apollo/client/link/http/createSignalIfSupported.js"); /* harmony import */ var _rewriteURIForGET_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rewriteURIForGET.js */ "./node_modules/@apollo/client/link/http/rewriteURIForGET.js"); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/@apollo/client/link/utils/index.js"); ; var createHttpLink = function (linkOptions) { if (linkOptions === void 0) { linkOptions = {}; } var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__rest)(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); (0,_checkFetcher_js__WEBPACK_IMPORTED_MODULE_5__.checkFetcher)(fetcher); if (!fetcher) { fetcher = fetch; } var linkConfig = { http: { includeExtensions: includeExtensions }, options: requestOptions.fetchOptions, credentials: requestOptions.credentials, headers: requestOptions.headers, }; return new _core_index_js__WEBPACK_IMPORTED_MODULE_0__.ApolloLink(function (operation) { var chosenURI = (0,_selectURI_js__WEBPACK_IMPORTED_MODULE_3__.selectURI)(operation, uri); var context = operation.getContext(); var clientAwarenessHeaders = {}; if (context.clientAwareness) { var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; if (name_1) { clientAwarenessHeaders['apollographql-client-name'] = name_1; } if (version) { clientAwarenessHeaders['apollographql-client-version'] = version; } } var contextHeaders = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_10__.__assign)({}, clientAwarenessHeaders), context.headers); var contextConfig = { http: context.http, options: context.fetchOptions, credentials: context.credentials, headers: contextHeaders, }; var _b = (0,_selectHttpOptionsAndBody_js__WEBPACK_IMPORTED_MODULE_6__.selectHttpOptionsAndBody)(operation, _selectHttpOptionsAndBody_js__WEBPACK_IMPORTED_MODULE_6__.fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; var controller; if (!options.signal) { var _c = (0,_createSignalIfSupported_js__WEBPACK_IMPORTED_MODULE_7__.createSignalIfSupported)(), _controller = _c.controller, signal = _c.signal; controller = _controller; if (controller) options.signal = signal; } var definitionIsMutation = function (d) { return d.kind === 'OperationDefinition' && d.operation === 'mutation'; }; if (useGETForQueries && !operation.query.definitions.some(definitionIsMutation)) { options.method = 'GET'; } if (options.method === 'GET') { var _d = (0,_rewriteURIForGET_js__WEBPACK_IMPORTED_MODULE_8__.rewriteURIForGET)(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; if (parseError) { return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.fromError)(parseError); } chosenURI = newURI; } else { try { options.body = (0,_serializeFetchParameter_js__WEBPACK_IMPORTED_MODULE_2__.serializeFetchParameter)(body, 'Payload'); } catch (parseError) { return (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.fromError)(parseError); } } return new _utilities_index_js__WEBPACK_IMPORTED_MODULE_1__.Observable(function (observer) { fetcher(chosenURI, options) .then(function (response) { operation.setContext({ response: response }); return response; }) .then((0,_parseAndCheckHttpResponse_js__WEBPACK_IMPORTED_MODULE_4__.parseAndCheckHttpResponse)(operation)) .then(function (result) { observer.next(result); observer.complete(); return result; }) .catch(function (err) { if (err.name === 'AbortError') return; if (err.result && err.result.errors && err.result.data) { observer.next(err.result); } observer.error(err); }); return function () { if (controller) controller.abort(); }; }); }); }; //# sourceMappingURL=createHttpLink.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/createSignalIfSupported.js": /*!**************************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/createSignalIfSupported.js ***! \**************************************************************************/ /*! namespace exports */ /*! export createSignalIfSupported [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "createSignalIfSupported": () => /* binding */ createSignalIfSupported /* harmony export */ }); var createSignalIfSupported = function () { if (typeof AbortController === 'undefined') return { controller: false, signal: false }; var controller = new AbortController(); var signal = controller.signal; return { controller: controller, signal: signal }; }; //# sourceMappingURL=createSignalIfSupported.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/index.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/link/http/index.js ***! \********************************************************/ /*! namespace exports */ /*! export HttpLink [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/HttpLink.js .HttpLink */ /*! export checkFetcher [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/checkFetcher.js .checkFetcher */ /*! export createHttpLink [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/createHttpLink.js .createHttpLink */ /*! export createSignalIfSupported [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/createSignalIfSupported.js .createSignalIfSupported */ /*! export fallbackHttpConfig [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js .fallbackHttpConfig */ /*! export parseAndCheckHttpResponse [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js .parseAndCheckHttpResponse */ /*! export rewriteURIForGET [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/rewriteURIForGET.js .rewriteURIForGET */ /*! export selectHttpOptionsAndBody [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js .selectHttpOptionsAndBody */ /*! export selectURI [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/selectURI.js .selectURI */ /*! export serializeFetchParameter [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/http/serializeFetchParameter.js .serializeFetchParameter */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "parseAndCheckHttpResponse": () => /* reexport safe */ _parseAndCheckHttpResponse_js__WEBPACK_IMPORTED_MODULE_0__.parseAndCheckHttpResponse, /* harmony export */ "serializeFetchParameter": () => /* reexport safe */ _serializeFetchParameter_js__WEBPACK_IMPORTED_MODULE_1__.serializeFetchParameter, /* harmony export */ "fallbackHttpConfig": () => /* reexport safe */ _selectHttpOptionsAndBody_js__WEBPACK_IMPORTED_MODULE_2__.fallbackHttpConfig, /* harmony export */ "selectHttpOptionsAndBody": () => /* reexport safe */ _selectHttpOptionsAndBody_js__WEBPACK_IMPORTED_MODULE_2__.selectHttpOptionsAndBody, /* harmony export */ "checkFetcher": () => /* reexport safe */ _checkFetcher_js__WEBPACK_IMPORTED_MODULE_3__.checkFetcher, /* harmony export */ "createSignalIfSupported": () => /* reexport safe */ _createSignalIfSupported_js__WEBPACK_IMPORTED_MODULE_4__.createSignalIfSupported, /* harmony export */ "selectURI": () => /* reexport safe */ _selectURI_js__WEBPACK_IMPORTED_MODULE_5__.selectURI, /* harmony export */ "createHttpLink": () => /* reexport safe */ _createHttpLink_js__WEBPACK_IMPORTED_MODULE_6__.createHttpLink, /* harmony export */ "HttpLink": () => /* reexport safe */ _HttpLink_js__WEBPACK_IMPORTED_MODULE_7__.HttpLink, /* harmony export */ "rewriteURIForGET": () => /* reexport safe */ _rewriteURIForGET_js__WEBPACK_IMPORTED_MODULE_8__.rewriteURIForGET /* harmony export */ }); /* harmony import */ var _parseAndCheckHttpResponse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parseAndCheckHttpResponse.js */ "./node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js"); /* harmony import */ var _serializeFetchParameter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./serializeFetchParameter.js */ "./node_modules/@apollo/client/link/http/serializeFetchParameter.js"); /* harmony import */ var _selectHttpOptionsAndBody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectHttpOptionsAndBody.js */ "./node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js"); /* harmony import */ var _checkFetcher_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./checkFetcher.js */ "./node_modules/@apollo/client/link/http/checkFetcher.js"); /* harmony import */ var _createSignalIfSupported_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createSignalIfSupported.js */ "./node_modules/@apollo/client/link/http/createSignalIfSupported.js"); /* harmony import */ var _selectURI_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./selectURI.js */ "./node_modules/@apollo/client/link/http/selectURI.js"); /* harmony import */ var _createHttpLink_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./createHttpLink.js */ "./node_modules/@apollo/client/link/http/createHttpLink.js"); /* harmony import */ var _HttpLink_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./HttpLink.js */ "./node_modules/@apollo/client/link/http/HttpLink.js"); /* harmony import */ var _rewriteURIForGET_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rewriteURIForGET.js */ "./node_modules/@apollo/client/link/http/rewriteURIForGET.js"); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js": /*!****************************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js ***! \****************************************************************************/ /*! namespace exports */ /*! export parseAndCheckHttpResponse [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "parseAndCheckHttpResponse": () => /* binding */ parseAndCheckHttpResponse /* harmony export */ }); /* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/index.js */ "./node_modules/@apollo/client/link/utils/index.js"); ; var hasOwnProperty = Object.prototype.hasOwnProperty; function parseAndCheckHttpResponse(operations) { return function (response) { return response .text() .then(function (bodyText) { try { return JSON.parse(bodyText); } catch (err) { var parseError = err; parseError.name = 'ServerParseError'; parseError.response = response; parseError.statusCode = response.status; parseError.bodyText = bodyText; throw parseError; } }) .then(function (result) { if (response.status >= 300) { (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.throwServerError)(response, result, "Response not successful: Received status code " + response.status); } if (!Array.isArray(result) && !hasOwnProperty.call(result, 'data') && !hasOwnProperty.call(result, 'errors')) { (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_0__.throwServerError)(response, result, "Server response was missing for query '" + (Array.isArray(operations) ? operations.map(function (op) { return op.operationName; }) : operations.operationName) + "'."); } return result; }); }; } //# sourceMappingURL=parseAndCheckHttpResponse.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/rewriteURIForGET.js": /*!*******************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/rewriteURIForGET.js ***! \*******************************************************************/ /*! namespace exports */ /*! export rewriteURIForGET [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "rewriteURIForGET": () => /* binding */ rewriteURIForGET /* harmony export */ }); /* harmony import */ var _serializeFetchParameter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./serializeFetchParameter.js */ "./node_modules/@apollo/client/link/http/serializeFetchParameter.js"); ; function rewriteURIForGET(chosenURI, body) { var queryParams = []; var addQueryParam = function (key, value) { queryParams.push(key + "=" + encodeURIComponent(value)); }; if ('query' in body) { addQueryParam('query', body.query); } if (body.operationName) { addQueryParam('operationName', body.operationName); } if (body.variables) { var serializedVariables = void 0; try { serializedVariables = (0,_serializeFetchParameter_js__WEBPACK_IMPORTED_MODULE_0__.serializeFetchParameter)(body.variables, 'Variables map'); } catch (parseError) { return { parseError: parseError }; } addQueryParam('variables', serializedVariables); } if (body.extensions) { var serializedExtensions = void 0; try { serializedExtensions = (0,_serializeFetchParameter_js__WEBPACK_IMPORTED_MODULE_0__.serializeFetchParameter)(body.extensions, 'Extensions map'); } catch (parseError) { return { parseError: parseError }; } addQueryParam('extensions', serializedExtensions); } var fragment = '', preFragment = chosenURI; var fragmentStart = chosenURI.indexOf('#'); if (fragmentStart !== -1) { fragment = chosenURI.substr(fragmentStart); preFragment = chosenURI.substr(0, fragmentStart); } var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; return { newURI: newURI }; } //# sourceMappingURL=rewriteURIForGET.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js": /*!***************************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js ***! \***************************************************************************/ /*! namespace exports */ /*! export fallbackHttpConfig [provided] [no usage info] [missing usage info prevents renaming] */ /*! export selectHttpOptionsAndBody [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "fallbackHttpConfig": () => /* binding */ fallbackHttpConfig, /* harmony export */ "selectHttpOptionsAndBody": () => /* binding */ selectHttpOptionsAndBody /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! graphql */ "./node_modules/graphql/language/printer.mjs"); ; var defaultHttpOptions = { includeQuery: true, includeExtensions: false, }; var defaultHeaders = { accept: '*/*', 'content-type': 'application/json', }; var defaultOptions = { method: 'POST', }; var fallbackHttpConfig = { http: defaultHttpOptions, headers: defaultHeaders, options: defaultOptions, }; var selectHttpOptionsAndBody = function (operation, fallbackConfig) { var configs = []; for (var _i = 2; _i < arguments.length; _i++) { configs[_i - 2] = arguments[_i]; } var options = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, fallbackConfig.options), { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); var http = fallbackConfig.http || {}; configs.forEach(function (config) { options = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, options), config.options), { headers: (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, options.headers), config.headers) }); if (config.credentials) options.credentials = config.credentials; http = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, http), config.http); }); var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; var body = { operationName: operationName, variables: variables }; if (http.includeExtensions) body.extensions = extensions; if (http.includeQuery) body.query = (0,graphql__WEBPACK_IMPORTED_MODULE_1__.print)(query); return { options: options, body: body, }; }; //# sourceMappingURL=selectHttpOptionsAndBody.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/selectURI.js": /*!************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/selectURI.js ***! \************************************************************/ /*! namespace exports */ /*! export selectURI [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "selectURI": () => /* binding */ selectURI /* harmony export */ }); var selectURI = function (operation, fallbackURI) { var context = operation.getContext(); var contextURI = context.uri; if (contextURI) { return contextURI; } else if (typeof fallbackURI === 'function') { return fallbackURI(operation); } else { return fallbackURI || '/graphql'; } }; //# sourceMappingURL=selectURI.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/http/serializeFetchParameter.js": /*!**************************************************************************!*\ !*** ./node_modules/@apollo/client/link/http/serializeFetchParameter.js ***! \**************************************************************************/ /*! namespace exports */ /*! export serializeFetchParameter [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "serializeFetchParameter": () => /* binding */ serializeFetchParameter /* harmony export */ }); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); ; var serializeFetchParameter = function (p, label) { var serialized; try { serialized = JSON.stringify(p); } catch (e) { var parseError = false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Network request failed. " + label + " is not serializable: " + e.message); parseError.parseError = e; throw parseError; } return serialized; }; //# sourceMappingURL=serializeFetchParameter.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/createOperation.js": /*!*******************************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/createOperation.js ***! \*******************************************************************/ /*! namespace exports */ /*! export createOperation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "createOperation": () => /* binding */ createOperation /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); ; function createOperation(starting, operation) { var context = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, starting); var setContext = function (next) { if (typeof next === 'function') { context = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, context), next(context)); } else { context = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, context), next); } }; var getContext = function () { return ((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, context)); }; Object.defineProperty(operation, 'setContext', { enumerable: false, value: setContext, }); Object.defineProperty(operation, 'getContext', { enumerable: false, value: getContext, }); return operation; } //# sourceMappingURL=createOperation.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/fromError.js": /*!*************************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/fromError.js ***! \*************************************************************/ /*! namespace exports */ /*! export fromError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "fromError": () => /* binding */ fromError /* harmony export */ }); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); ; function fromError(errorValue) { return new _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.Observable(function (observer) { observer.error(errorValue); }); } //# sourceMappingURL=fromError.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/fromPromise.js": /*!***************************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/fromPromise.js ***! \***************************************************************/ /*! namespace exports */ /*! export fromPromise [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "fromPromise": () => /* binding */ fromPromise /* harmony export */ }); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); ; function fromPromise(promise) { return new _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.Observable(function (observer) { promise .then(function (value) { observer.next(value); observer.complete(); }) .catch(observer.error.bind(observer)); }); } //# sourceMappingURL=fromPromise.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/index.js": /*!*********************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/index.js ***! \*********************************************************/ /*! namespace exports */ /*! export createOperation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/createOperation.js .createOperation */ /*! export fromError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/fromError.js .fromError */ /*! export fromPromise [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/fromPromise.js .fromPromise */ /*! export throwServerError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/throwServerError.js .throwServerError */ /*! export toPromise [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/toPromise.js .toPromise */ /*! export transformOperation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/transformOperation.js .transformOperation */ /*! export validateOperation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/link/utils/validateOperation.js .validateOperation */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "fromError": () => /* reexport safe */ _fromError_js__WEBPACK_IMPORTED_MODULE_0__.fromError, /* harmony export */ "toPromise": () => /* reexport safe */ _toPromise_js__WEBPACK_IMPORTED_MODULE_1__.toPromise, /* harmony export */ "fromPromise": () => /* reexport safe */ _fromPromise_js__WEBPACK_IMPORTED_MODULE_2__.fromPromise, /* harmony export */ "throwServerError": () => /* reexport safe */ _throwServerError_js__WEBPACK_IMPORTED_MODULE_3__.throwServerError, /* harmony export */ "validateOperation": () => /* reexport safe */ _validateOperation_js__WEBPACK_IMPORTED_MODULE_4__.validateOperation, /* harmony export */ "createOperation": () => /* reexport safe */ _createOperation_js__WEBPACK_IMPORTED_MODULE_5__.createOperation, /* harmony export */ "transformOperation": () => /* reexport safe */ _transformOperation_js__WEBPACK_IMPORTED_MODULE_6__.transformOperation /* harmony export */ }); /* harmony import */ var _fromError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fromError.js */ "./node_modules/@apollo/client/link/utils/fromError.js"); /* harmony import */ var _toPromise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPromise.js */ "./node_modules/@apollo/client/link/utils/toPromise.js"); /* harmony import */ var _fromPromise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fromPromise.js */ "./node_modules/@apollo/client/link/utils/fromPromise.js"); /* harmony import */ var _throwServerError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./throwServerError.js */ "./node_modules/@apollo/client/link/utils/throwServerError.js"); /* harmony import */ var _validateOperation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./validateOperation.js */ "./node_modules/@apollo/client/link/utils/validateOperation.js"); /* harmony import */ var _createOperation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createOperation.js */ "./node_modules/@apollo/client/link/utils/createOperation.js"); /* harmony import */ var _transformOperation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transformOperation.js */ "./node_modules/@apollo/client/link/utils/transformOperation.js"); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/throwServerError.js": /*!********************************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/throwServerError.js ***! \********************************************************************/ /*! namespace exports */ /*! export throwServerError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "throwServerError": () => /* binding */ throwServerError /* harmony export */ }); var throwServerError = function (response, result, message) { var error = new Error(message); error.name = 'ServerError'; error.response = response; error.statusCode = response.status; error.result = result; throw error; }; //# sourceMappingURL=throwServerError.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/toPromise.js": /*!*************************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/toPromise.js ***! \*************************************************************/ /*! namespace exports */ /*! export toPromise [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "toPromise": () => /* binding */ toPromise /* harmony export */ }); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); ; function toPromise(observable) { var completed = false; return new Promise(function (resolve, reject) { observable.subscribe({ next: function (data) { if (completed) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.warn("Promise Wrapper does not support multiple results from Observable"); } else { completed = true; resolve(data); } }, error: reject, }); }); } //# sourceMappingURL=toPromise.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/transformOperation.js": /*!**********************************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/transformOperation.js ***! \**********************************************************************/ /*! namespace exports */ /*! export transformOperation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "transformOperation": () => /* binding */ transformOperation /* harmony export */ }); /* harmony import */ var _utilities_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/index.js */ "./node_modules/@apollo/client/utilities/index.js"); ; function transformOperation(operation) { var transformedOperation = { variables: operation.variables || {}, extensions: operation.extensions || {}, operationName: operation.operationName, query: operation.query, }; if (!transformedOperation.operationName) { transformedOperation.operationName = typeof transformedOperation.query !== 'string' ? (0,_utilities_index_js__WEBPACK_IMPORTED_MODULE_0__.getOperationName)(transformedOperation.query) || undefined : ''; } return transformedOperation; } //# sourceMappingURL=transformOperation.js.map /***/ }), /***/ "./node_modules/@apollo/client/link/utils/validateOperation.js": /*!*********************************************************************!*\ !*** ./node_modules/@apollo/client/link/utils/validateOperation.js ***! \*********************************************************************/ /*! namespace exports */ /*! export validateOperation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "validateOperation": () => /* binding */ validateOperation /* harmony export */ }); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); ; function validateOperation(operation) { var OPERATION_FIELDS = [ 'query', 'operationName', 'variables', 'extensions', 'context', ]; for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { var key = _a[_i]; if (OPERATION_FIELDS.indexOf(key) < 0) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("illegal argument: " + key); } } return operation; } //# sourceMappingURL=validateOperation.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/arrays.js": /*!****************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/arrays.js ***! \****************************************************************/ /*! namespace exports */ /*! export isNonEmptyArray [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isNonEmptyArray": () => /* binding */ isNonEmptyArray /* harmony export */ }); function isNonEmptyArray(value) { return Array.isArray(value) && value.length > 0; } //# sourceMappingURL=arrays.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/canUse.js": /*!****************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/canUse.js ***! \****************************************************************/ /*! namespace exports */ /*! export canUseWeakMap [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "canUseWeakMap": () => /* binding */ canUseWeakMap /* harmony export */ }); var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && navigator.product === 'ReactNative'); //# sourceMappingURL=canUse.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/cloneDeep.js": /*!*******************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/cloneDeep.js ***! \*******************************************************************/ /*! namespace exports */ /*! export cloneDeep [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "cloneDeep": () => /* binding */ cloneDeep /* harmony export */ }); var toString = Object.prototype.toString; function cloneDeep(value) { return cloneDeepHelper(value); } function cloneDeepHelper(val, seen) { switch (toString.call(val)) { case "[object Array]": { seen = seen || new Map; if (seen.has(val)) return seen.get(val); var copy_1 = val.slice(0); seen.set(val, copy_1); copy_1.forEach(function (child, i) { copy_1[i] = cloneDeepHelper(child, seen); }); return copy_1; } case "[object Object]": { seen = seen || new Map; if (seen.has(val)) return seen.get(val); var copy_2 = Object.create(Object.getPrototypeOf(val)); seen.set(val, copy_2); Object.keys(val).forEach(function (key) { copy_2[key] = cloneDeepHelper(val[key], seen); }); return copy_2; } default: return val; } } //# sourceMappingURL=cloneDeep.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/compact.js": /*!*****************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/compact.js ***! \*****************************************************************/ /*! namespace exports */ /*! export compact [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "compact": () => /* binding */ compact /* harmony export */ }); function compact() { var objects = []; for (var _i = 0; _i < arguments.length; _i++) { objects[_i] = arguments[_i]; } var result = Object.create(null); objects.forEach(function (obj) { if (!obj) return; Object.keys(obj).forEach(function (key) { var value = obj[key]; if (value !== void 0) { result[key] = value; } }); }); return result; } //# sourceMappingURL=compact.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/environment.js": /*!*********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/environment.js ***! \*********************************************************************/ /*! namespace exports */ /*! export getEnv [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isDevelopment [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isEnv [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTest [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getEnv": () => /* binding */ getEnv, /* harmony export */ "isEnv": () => /* binding */ isEnv, /* harmony export */ "isDevelopment": () => /* binding */ isDevelopment, /* harmony export */ "isTest": () => /* binding */ isTest /* harmony export */ }); function getEnv() { if (typeof process !== 'undefined' && "development") { return "development"; } return 'development'; } function isEnv(env) { return getEnv() === env; } function isDevelopment() { return isEnv('development') === true; } function isTest() { return isEnv('test') === true; } //# sourceMappingURL=environment.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/errorHandling.js": /*!***********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/errorHandling.js ***! \***********************************************************************/ /*! namespace exports */ /*! export graphQLResultHasError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "graphQLResultHasError": () => /* binding */ graphQLResultHasError /* harmony export */ }); function graphQLResultHasError(result) { return (result.errors && result.errors.length > 0) || false; } //# sourceMappingURL=errorHandling.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/filterInPlace.js": /*!***********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/filterInPlace.js ***! \***********************************************************************/ /*! namespace exports */ /*! export filterInPlace [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "filterInPlace": () => /* binding */ filterInPlace /* harmony export */ }); function filterInPlace(array, test, context) { var target = 0; array.forEach(function (elem, i) { if (test.call(this, elem, i, array)) { array[target++] = elem; } }, context); array.length = target; return array; } //# sourceMappingURL=filterInPlace.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js": /*!*************************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js ***! \*************************************************************************/ /*! namespace exports */ /*! export maybeDeepFreeze [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "maybeDeepFreeze": () => /* binding */ maybeDeepFreeze /* harmony export */ }); /* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./environment.js */ "./node_modules/@apollo/client/utilities/common/environment.js"); ; function isObject(value) { return value !== null && typeof value === "object"; } function deepFreeze(value) { var workSet = new Set([value]); workSet.forEach(function (obj) { if (isObject(obj)) { if (!Object.isFrozen(obj)) Object.freeze(obj); Object.getOwnPropertyNames(obj).forEach(function (name) { if (isObject(obj[name])) workSet.add(obj[name]); }); } }); return value; } function maybeDeepFreeze(obj) { if ( true && ((0,_environment_js__WEBPACK_IMPORTED_MODULE_0__.isDevelopment)() || (0,_environment_js__WEBPACK_IMPORTED_MODULE_0__.isTest)())) { deepFreeze(obj); } return obj; } //# sourceMappingURL=maybeDeepFreeze.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/common/mergeDeep.js": /*!*******************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/common/mergeDeep.js ***! \*******************************************************************/ /*! namespace exports */ /*! export DeepMerger [provided] [no usage info] [missing usage info prevents renaming] */ /*! export mergeDeep [provided] [no usage info] [missing usage info prevents renaming] */ /*! export mergeDeepArray [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "mergeDeep": () => /* binding */ mergeDeep, /* harmony export */ "mergeDeepArray": () => /* binding */ mergeDeepArray, /* harmony export */ "DeepMerger": () => /* binding */ DeepMerger /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); ; var hasOwnProperty = Object.prototype.hasOwnProperty; function mergeDeep() { var sources = []; for (var _i = 0; _i < arguments.length; _i++) { sources[_i] = arguments[_i]; } return mergeDeepArray(sources); } function mergeDeepArray(sources) { var target = sources[0] || {}; var count = sources.length; if (count > 1) { var merger = new DeepMerger(); for (var i = 1; i < count; ++i) { target = merger.merge(target, sources[i]); } } return target; } function isObject(obj) { return obj !== null && typeof obj === 'object'; } var defaultReconciler = function (target, source, property) { return this.merge(target[property], source[property]); }; var DeepMerger = (function () { function DeepMerger(reconciler) { if (reconciler === void 0) { reconciler = defaultReconciler; } this.reconciler = reconciler; this.isObject = isObject; this.pastCopies = new Set(); } DeepMerger.prototype.merge = function (target, source) { var _this = this; var context = []; for (var _i = 2; _i < arguments.length; _i++) { context[_i - 2] = arguments[_i]; } if (isObject(source) && isObject(target)) { Object.keys(source).forEach(function (sourceKey) { if (hasOwnProperty.call(target, sourceKey)) { var targetValue = target[sourceKey]; if (source[sourceKey] !== targetValue) { var result = _this.reconciler.apply(_this, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArrays)([target, source, sourceKey], context)); if (result !== targetValue) { target = _this.shallowCopyForMerge(target); target[sourceKey] = result; } } } else { target = _this.shallowCopyForMerge(target); target[sourceKey] = source[sourceKey]; } }); return target; } return source; }; DeepMerger.prototype.shallowCopyForMerge = function (value) { if (isObject(value) && !this.pastCopies.has(value)) { if (Array.isArray(value)) { value = value.slice(0); } else { value = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({ __proto__: Object.getPrototypeOf(value) }, value); } this.pastCopies.add(value); } return value; }; return DeepMerger; }()); //# sourceMappingURL=mergeDeep.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/graphql/directives.js": /*!*********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/graphql/directives.js ***! \*********************************************************************/ /*! namespace exports */ /*! export getDirectiveNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getInclusionDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export hasClientExports [provided] [no usage info] [missing usage info prevents renaming] */ /*! export hasDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export shouldInclude [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "shouldInclude": () => /* binding */ shouldInclude, /* harmony export */ "getDirectiveNames": () => /* binding */ getDirectiveNames, /* harmony export */ "hasDirectives": () => /* binding */ hasDirectives, /* harmony export */ "hasClientExports": () => /* binding */ hasClientExports, /* harmony export */ "getInclusionDirectives": () => /* binding */ getInclusionDirectives /* harmony export */ }); /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! graphql */ "./node_modules/graphql/language/visitor.mjs"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); ; function shouldInclude(_a, variables) { var directives = _a.directives; if (!directives || !directives.length) { return true; } return getInclusionDirectives(directives).every(function (_a) { var directive = _a.directive, ifArgument = _a.ifArgument; var evaledValue = false; if (ifArgument.value.kind === 'Variable') { evaledValue = variables && variables[ifArgument.value.name.value]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); } else { evaledValue = ifArgument.value.value; } return directive.name.value === 'skip' ? !evaledValue : evaledValue; }); } function getDirectiveNames(root) { var names = []; (0,graphql__WEBPACK_IMPORTED_MODULE_1__.visit)(root, { Directive: function (node) { names.push(node.name.value); }, }); return names; } function hasDirectives(names, root) { return getDirectiveNames(root).some(function (name) { return names.indexOf(name) > -1; }); } function hasClientExports(document) { return (document && hasDirectives(['client'], document) && hasDirectives(['export'], document)); } function isInclusionDirective(_a) { var value = _a.name.value; return value === 'skip' || value === 'include'; } function getInclusionDirectives(directives) { var result = []; if (directives && directives.length) { directives.forEach(function (directive) { if (!isInclusionDirective(directive)) return; var directiveArguments = directive.arguments; var directiveName = directive.name.value; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); var ifArgument = directiveArguments[0]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); var ifValue = ifArgument.value; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); result.push({ directive: directive, ifArgument: ifArgument }); }); } return result; } //# sourceMappingURL=directives.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/graphql/fragments.js": /*!********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/graphql/fragments.js ***! \********************************************************************/ /*! namespace exports */ /*! export createFragmentMap [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFragmentFromSelection [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFragmentQueryDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "getFragmentQueryDocument": () => /* binding */ getFragmentQueryDocument, /* harmony export */ "createFragmentMap": () => /* binding */ createFragmentMap, /* harmony export */ "getFragmentFromSelection": () => /* binding */ getFragmentFromSelection /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); ; function getFragmentQueryDocument(document, fragmentName) { var actualFragmentName = fragmentName; var fragments = []; document.definitions.forEach(function (definition) { if (definition.kind === 'OperationDefinition') { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); } if (definition.kind === 'FragmentDefinition') { fragments.push(definition); } }); if (typeof actualFragmentName === 'undefined') { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); actualFragmentName = fragments[0].name.value; } var query = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, document), { definitions: (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__spreadArrays)([ { kind: 'OperationDefinition', operation: 'query', selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'FragmentSpread', name: { kind: 'Name', value: actualFragmentName, }, }, ], }, } ], document.definitions) }); return query; } function createFragmentMap(fragments) { if (fragments === void 0) { fragments = []; } var symTable = {}; fragments.forEach(function (fragment) { symTable[fragment.name.value] = fragment; }); return symTable; } function getFragmentFromSelection(selection, fragmentMap) { switch (selection.kind) { case 'InlineFragment': return selection; case 'FragmentSpread': { var fragment = fragmentMap && fragmentMap[selection.name.value]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(fragment, "No fragment named " + selection.name.value + "."); return fragment; } default: return null; } } //# sourceMappingURL=fragments.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/graphql/getFromAST.js": /*!*********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/graphql/getFromAST.js ***! \*********************************************************************/ /*! namespace exports */ /*! export checkDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDefaultValues [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFragmentDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFragmentDefinitions [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getMainDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationName [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getQueryDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "checkDocument": () => /* binding */ checkDocument, /* harmony export */ "getOperationDefinition": () => /* binding */ getOperationDefinition, /* harmony export */ "getOperationName": () => /* binding */ getOperationName, /* harmony export */ "getFragmentDefinitions": () => /* binding */ getFragmentDefinitions, /* harmony export */ "getQueryDefinition": () => /* binding */ getQueryDefinition, /* harmony export */ "getFragmentDefinition": () => /* binding */ getFragmentDefinition, /* harmony export */ "getMainDefinition": () => /* binding */ getMainDefinition, /* harmony export */ "getDefaultValues": () => /* binding */ getDefaultValues /* harmony export */ }); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _storeUtils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./storeUtils.js */ "./node_modules/@apollo/client/utilities/graphql/storeUtils.js"); ; function checkDocument(doc) { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); var operations = doc.definitions .filter(function (d) { return d.kind !== 'FragmentDefinition'; }) .map(function (definition) { if (definition.kind !== 'OperationDefinition') { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); } return definition; }); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); return doc; } function getOperationDefinition(doc) { checkDocument(doc); return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0]; } function getOperationName(doc) { return (doc.definitions .filter(function (definition) { return definition.kind === 'OperationDefinition' && definition.name; }) .map(function (x) { return x.name.value; })[0] || null); } function getFragmentDefinitions(doc) { return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; }); } function getQueryDefinition(doc) { var queryDef = getOperationDefinition(doc); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); return queryDef; } function getFragmentDefinition(doc) { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); var fragmentDef = doc.definitions[0]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); return fragmentDef; } function getMainDefinition(queryDoc) { checkDocument(queryDoc); var fragmentDefinition; for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { var definition = _a[_i]; if (definition.kind === 'OperationDefinition') { var operation = definition.operation; if (operation === 'query' || operation === 'mutation' || operation === 'subscription') { return definition; } } if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { fragmentDefinition = definition; } } if (fragmentDefinition) { return fragmentDefinition; } throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); } function getDefaultValues(definition) { var defaultValues = Object.create(null); var defs = definition && definition.variableDefinitions; if (defs && defs.length) { defs.forEach(function (def) { if (def.defaultValue) { (0,_storeUtils_js__WEBPACK_IMPORTED_MODULE_1__.valueToObjectRepresentation)(defaultValues, def.variable.name, def.defaultValue); } }); } return defaultValues; } //# sourceMappingURL=getFromAST.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/graphql/storeUtils.js": /*!*********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/graphql/storeUtils.js ***! \*********************************************************************/ /*! namespace exports */ /*! export argumentsObjectFromField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getStoreKeyName [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getTypenameFromResult [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInlineFragment [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isReference [provided] [no usage info] [missing usage info prevents renaming] */ /*! export makeReference [provided] [no usage info] [missing usage info prevents renaming] */ /*! export resultKeyNameFromField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export storeKeyNameFromField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export valueToObjectRepresentation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "makeReference": () => /* binding */ makeReference, /* harmony export */ "isReference": () => /* binding */ isReference, /* harmony export */ "valueToObjectRepresentation": () => /* binding */ valueToObjectRepresentation, /* harmony export */ "storeKeyNameFromField": () => /* binding */ storeKeyNameFromField, /* harmony export */ "getStoreKeyName": () => /* binding */ getStoreKeyName, /* harmony export */ "argumentsObjectFromField": () => /* binding */ argumentsObjectFromField, /* harmony export */ "resultKeyNameFromField": () => /* binding */ resultKeyNameFromField, /* harmony export */ "getTypenameFromResult": () => /* binding */ getTypenameFromResult, /* harmony export */ "isField": () => /* binding */ isField, /* harmony export */ "isInlineFragment": () => /* binding */ isInlineFragment /* harmony export */ }); /* harmony import */ var fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-json-stable-stringify */ "./node_modules/fast-json-stable-stringify/index.js"); /* harmony import */ var fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _fragments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fragments.js */ "./node_modules/@apollo/client/utilities/graphql/fragments.js"); ; function makeReference(id) { return { __ref: String(id) }; } function isReference(obj) { return Boolean(obj && typeof obj === 'object' && typeof obj.__ref === 'string'); } function isStringValue(value) { return value.kind === 'StringValue'; } function isBooleanValue(value) { return value.kind === 'BooleanValue'; } function isIntValue(value) { return value.kind === 'IntValue'; } function isFloatValue(value) { return value.kind === 'FloatValue'; } function isVariable(value) { return value.kind === 'Variable'; } function isObjectValue(value) { return value.kind === 'ObjectValue'; } function isListValue(value) { return value.kind === 'ListValue'; } function isEnumValue(value) { return value.kind === 'EnumValue'; } function isNullValue(value) { return value.kind === 'NullValue'; } function valueToObjectRepresentation(argObj, name, value, variables) { if (isIntValue(value) || isFloatValue(value)) { argObj[name.value] = Number(value.value); } else if (isBooleanValue(value) || isStringValue(value)) { argObj[name.value] = value.value; } else if (isObjectValue(value)) { var nestedArgObj_1 = {}; value.fields.map(function (obj) { return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); }); argObj[name.value] = nestedArgObj_1; } else if (isVariable(value)) { var variableValue = (variables || {})[value.name.value]; argObj[name.value] = variableValue; } else if (isListValue(value)) { argObj[name.value] = value.values.map(function (listValue) { var nestedArgArrayObj = {}; valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); return nestedArgArrayObj[name.value]; }); } else if (isEnumValue(value)) { argObj[name.value] = value.value; } else if (isNullValue(value)) { argObj[name.value] = null; } else { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_1__.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + 'is not supported. Use variables instead of inline arguments to ' + 'overcome this limitation.'); } } function storeKeyNameFromField(field, variables) { var directivesObj = null; if (field.directives) { directivesObj = {}; field.directives.forEach(function (directive) { directivesObj[directive.name.value] = {}; if (directive.arguments) { directive.arguments.forEach(function (_a) { var name = _a.name, value = _a.value; return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); }); } }); } var argObj = null; if (field.arguments && field.arguments.length) { argObj = {}; field.arguments.forEach(function (_a) { var name = _a.name, value = _a.value; return valueToObjectRepresentation(argObj, name, value, variables); }); } return getStoreKeyName(field.name.value, argObj, directivesObj); } var KNOWN_DIRECTIVES = [ 'connection', 'include', 'skip', 'client', 'rest', 'export', ]; function getStoreKeyName(fieldName, args, directives) { if (args && directives && directives['connection'] && directives['connection']['key']) { if (directives['connection']['filter'] && directives['connection']['filter'].length > 0) { var filterKeys = directives['connection']['filter'] ? directives['connection']['filter'] : []; filterKeys.sort(); var filteredArgs_1 = {}; filterKeys.forEach(function (key) { filteredArgs_1[key] = args[key]; }); return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; } else { return directives['connection']['key']; } } var completeFieldName = fieldName; if (args) { var stringifiedArgs = fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_0___default()(args); completeFieldName += "(" + stringifiedArgs + ")"; } if (directives) { Object.keys(directives).forEach(function (key) { if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; if (directives[key] && Object.keys(directives[key]).length) { completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; } else { completeFieldName += "@" + key; } }); } return completeFieldName; } function argumentsObjectFromField(field, variables) { if (field.arguments && field.arguments.length) { var argObj_1 = {}; field.arguments.forEach(function (_a) { var name = _a.name, value = _a.value; return valueToObjectRepresentation(argObj_1, name, value, variables); }); return argObj_1; } return null; } function resultKeyNameFromField(field) { return field.alias ? field.alias.value : field.name.value; } function getTypenameFromResult(result, selectionSet, fragmentMap) { if (typeof result.__typename === 'string') { return result.__typename; } for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) { var selection = _a[_i]; if (isField(selection)) { if (selection.name.value === '__typename') { return result[resultKeyNameFromField(selection)]; } } else { var typename = getTypenameFromResult(result, (0,_fragments_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentFromSelection)(selection, fragmentMap).selectionSet, fragmentMap); if (typeof typename === 'string') { return typename; } } } } function isField(selection) { return selection.kind === 'Field'; } function isInlineFragment(selection) { return selection.kind === 'InlineFragment'; } //# sourceMappingURL=storeUtils.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/graphql/transform.js": /*!********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/graphql/transform.js ***! \********************************************************************/ /*! namespace exports */ /*! export addTypenameToDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildQueryFromSelectionSet [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeArgumentsFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeClientSetsFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeConnectionDirectiveFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeDirectivesFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeFragmentSpreadFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "removeDirectivesFromDocument": () => /* binding */ removeDirectivesFromDocument, /* harmony export */ "addTypenameToDocument": () => /* binding */ addTypenameToDocument, /* harmony export */ "removeConnectionDirectiveFromDocument": () => /* binding */ removeConnectionDirectiveFromDocument, /* harmony export */ "removeArgumentsFromDocument": () => /* binding */ removeArgumentsFromDocument, /* harmony export */ "removeFragmentSpreadFromDocument": () => /* binding */ removeFragmentSpreadFromDocument, /* harmony export */ "buildQueryFromSelectionSet": () => /* binding */ buildQueryFromSelectionSet, /* harmony export */ "removeClientSetsFromDocument": () => /* binding */ removeClientSetsFromDocument /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! graphql */ "./node_modules/graphql/language/visitor.mjs"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var _getFromAST_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getFromAST.js */ "./node_modules/@apollo/client/utilities/graphql/getFromAST.js"); /* harmony import */ var _common_filterInPlace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/filterInPlace.js */ "./node_modules/@apollo/client/utilities/common/filterInPlace.js"); /* harmony import */ var _storeUtils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./storeUtils.js */ "./node_modules/@apollo/client/utilities/graphql/storeUtils.js"); /* harmony import */ var _fragments_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fragments.js */ "./node_modules/@apollo/client/utilities/graphql/fragments.js"); ; var TYPENAME_FIELD = { kind: 'Field', name: { kind: 'Name', value: '__typename', }, }; function isEmpty(op, fragments) { return op.selectionSet.selections.every(function (selection) { return selection.kind === 'FragmentSpread' && isEmpty(fragments[selection.name.value], fragments); }); } function nullIfDocIsEmpty(doc) { return isEmpty((0,_getFromAST_js__WEBPACK_IMPORTED_MODULE_1__.getOperationDefinition)(doc) || (0,_getFromAST_js__WEBPACK_IMPORTED_MODULE_1__.getFragmentDefinition)(doc), (0,_fragments_js__WEBPACK_IMPORTED_MODULE_4__.createFragmentMap)((0,_getFromAST_js__WEBPACK_IMPORTED_MODULE_1__.getFragmentDefinitions)(doc))) ? null : doc; } function getDirectiveMatcher(directives) { return function directiveMatcher(directive) { return directives.some(function (dir) { return (dir.name && dir.name === directive.name.value) || (dir.test && dir.test(directive)); }); }; } function removeDirectivesFromDocument(directives, doc) { var variablesInUse = Object.create(null); var variablesToRemove = []; var fragmentSpreadsInUse = Object.create(null); var fragmentSpreadsToRemove = []; var modifiedDoc = nullIfDocIsEmpty((0,graphql__WEBPACK_IMPORTED_MODULE_5__.visit)(doc, { Variable: { enter: function (node, _key, parent) { if (parent.kind !== 'VariableDefinition') { variablesInUse[node.name.value] = true; } }, }, Field: { enter: function (node) { if (directives && node.directives) { var shouldRemoveField = directives.some(function (directive) { return directive.remove; }); if (shouldRemoveField && node.directives && node.directives.some(getDirectiveMatcher(directives))) { if (node.arguments) { node.arguments.forEach(function (arg) { if (arg.value.kind === 'Variable') { variablesToRemove.push({ name: arg.value.name.value, }); } }); } if (node.selectionSet) { getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { fragmentSpreadsToRemove.push({ name: frag.name.value, }); }); } return null; } } }, }, FragmentSpread: { enter: function (node) { fragmentSpreadsInUse[node.name.value] = true; }, }, Directive: { enter: function (node) { if (getDirectiveMatcher(directives)(node)) { return null; } }, }, })); if (modifiedDoc && (0,_common_filterInPlace_js__WEBPACK_IMPORTED_MODULE_2__.filterInPlace)(variablesToRemove, function (v) { return !!v.name && !variablesInUse[v.name]; }).length) { modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); } if (modifiedDoc && (0,_common_filterInPlace_js__WEBPACK_IMPORTED_MODULE_2__.filterInPlace)(fragmentSpreadsToRemove, function (fs) { return !!fs.name && !fragmentSpreadsInUse[fs.name]; }) .length) { modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); } return modifiedDoc; } function addTypenameToDocument(doc) { return (0,graphql__WEBPACK_IMPORTED_MODULE_5__.visit)((0,_getFromAST_js__WEBPACK_IMPORTED_MODULE_1__.checkDocument)(doc), { SelectionSet: { enter: function (node, _key, parent) { if (parent && parent.kind === 'OperationDefinition') { return; } var selections = node.selections; if (!selections) { return; } var skip = selections.some(function (selection) { return ((0,_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isField)(selection) && (selection.name.value === '__typename' || selection.name.value.lastIndexOf('__', 0) === 0)); }); if (skip) { return; } var field = parent; if ((0,_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isField)(field) && field.directives && field.directives.some(function (d) { return d.name.value === 'export'; })) { return; } return (0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)({}, node), { selections: (0,tslib__WEBPACK_IMPORTED_MODULE_6__.__spreadArrays)(selections, [TYPENAME_FIELD]) }); }, }, }); } addTypenameToDocument.added = function (field) { return field === TYPENAME_FIELD; }; var connectionRemoveConfig = { test: function (directive) { var willRemove = directive.name.value === 'connection'; if (willRemove) { if (!directive.arguments || !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.warn('Removing an @connection directive even though it does not have a key. ' + 'You may want to use the key parameter to specify a store key.'); } } return willRemove; }, }; function removeConnectionDirectiveFromDocument(doc) { return removeDirectivesFromDocument([connectionRemoveConfig], (0,_getFromAST_js__WEBPACK_IMPORTED_MODULE_1__.checkDocument)(doc)); } function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { if (nestedCheck === void 0) { nestedCheck = true; } return (!!selectionSet && selectionSet.selections && selectionSet.selections.some(function (selection) { return hasDirectivesInSelection(directives, selection, nestedCheck); })); } function hasDirectivesInSelection(directives, selection, nestedCheck) { if (nestedCheck === void 0) { nestedCheck = true; } if (!(0,_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isField)(selection)) { return true; } if (!selection.directives) { return false; } return (selection.directives.some(getDirectiveMatcher(directives)) || (nestedCheck && hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck))); } function getArgumentMatcher(config) { return function argumentMatcher(argument) { return config.some(function (aConfig) { return argument.value && argument.value.kind === 'Variable' && argument.value.name && (aConfig.name === argument.value.name.value || (aConfig.test && aConfig.test(argument))); }); }; } function removeArgumentsFromDocument(config, doc) { var argMatcher = getArgumentMatcher(config); return nullIfDocIsEmpty((0,graphql__WEBPACK_IMPORTED_MODULE_5__.visit)(doc, { OperationDefinition: { enter: function (node) { return (0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)({}, node), { variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(function (varDef) { return !config.some(function (arg) { return arg.name === varDef.variable.name.value; }); }) : [] }); }, }, Field: { enter: function (node) { var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; }); if (shouldRemoveField) { var argMatchCount_1 = 0; if (node.arguments) { node.arguments.forEach(function (arg) { if (argMatcher(arg)) { argMatchCount_1 += 1; } }); } if (argMatchCount_1 === 1) { return null; } } }, }, Argument: { enter: function (node) { if (argMatcher(node)) { return null; } }, }, })); } function removeFragmentSpreadFromDocument(config, doc) { function enter(node) { if (config.some(function (def) { return def.name === node.name.value; })) { return null; } } return nullIfDocIsEmpty((0,graphql__WEBPACK_IMPORTED_MODULE_5__.visit)(doc, { FragmentSpread: { enter: enter }, FragmentDefinition: { enter: enter }, })); } function getAllFragmentSpreadsFromSelectionSet(selectionSet) { var allFragments = []; selectionSet.selections.forEach(function (selection) { if (((0,_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isField)(selection) || (0,_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isInlineFragment)(selection)) && selection.selectionSet) { getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); }); } else if (selection.kind === 'FragmentSpread') { allFragments.push(selection); } }); return allFragments; } function buildQueryFromSelectionSet(document) { var definition = (0,_getFromAST_js__WEBPACK_IMPORTED_MODULE_1__.getMainDefinition)(document); var definitionOperation = definition.operation; if (definitionOperation === 'query') { return document; } var modifiedDoc = (0,graphql__WEBPACK_IMPORTED_MODULE_5__.visit)(document, { OperationDefinition: { enter: function (node) { return (0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_6__.__assign)({}, node), { operation: 'query' }); }, }, }); return modifiedDoc; } function removeClientSetsFromDocument(document) { (0,_getFromAST_js__WEBPACK_IMPORTED_MODULE_1__.checkDocument)(document); var modifiedDoc = removeDirectivesFromDocument([ { test: function (directive) { return directive.name.value === 'client'; }, remove: true, }, ], document); if (modifiedDoc) { modifiedDoc = (0,graphql__WEBPACK_IMPORTED_MODULE_5__.visit)(modifiedDoc, { FragmentDefinition: { enter: function (node) { if (node.selectionSet) { var isTypenameOnly = node.selectionSet.selections.every(function (selection) { return (0,_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isField)(selection) && selection.name.value === '__typename'; }); if (isTypenameOnly) { return null; } } }, }, }); } return modifiedDoc; } //# sourceMappingURL=transform.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/index.js": /*!********************************************************!*\ !*** ./node_modules/@apollo/client/utilities/index.js ***! \********************************************************/ /*! namespace exports */ /*! export Concast [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/observables/Concast.js .Concast */ /*! export DeepMerger [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/mergeDeep.js .DeepMerger */ /*! export Observable [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/zen-observable/index.js .default */ /*! export addTypenameToDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/transform.js .addTypenameToDocument */ /*! export argumentsObjectFromField [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .argumentsObjectFromField */ /*! export asyncMap [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/observables/asyncMap.js .asyncMap */ /*! export buildQueryFromSelectionSet [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/transform.js .buildQueryFromSelectionSet */ /*! export canUseWeakMap [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/canUse.js .canUseWeakMap */ /*! export checkDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .checkDocument */ /*! export cloneDeep [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/cloneDeep.js .cloneDeep */ /*! export compact [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/compact.js .compact */ /*! export concatPagination [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/policies/pagination.js .concatPagination */ /*! export createFragmentMap [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/fragments.js .createFragmentMap */ /*! export getDefaultValues [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .getDefaultValues */ /*! export getDirectiveNames [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/directives.js .getDirectiveNames */ /*! export getFragmentDefinition [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .getFragmentDefinition */ /*! export getFragmentDefinitions [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .getFragmentDefinitions */ /*! export getFragmentFromSelection [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/fragments.js .getFragmentFromSelection */ /*! export getFragmentQueryDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/fragments.js .getFragmentQueryDocument */ /*! export getInclusionDirectives [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/directives.js .getInclusionDirectives */ /*! export getMainDefinition [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .getMainDefinition */ /*! export getOperationDefinition [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .getOperationDefinition */ /*! export getOperationName [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .getOperationName */ /*! export getQueryDefinition [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/getFromAST.js .getQueryDefinition */ /*! export getStoreKeyName [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .getStoreKeyName */ /*! export getTypenameFromResult [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .getTypenameFromResult */ /*! export graphQLResultHasError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/errorHandling.js .graphQLResultHasError */ /*! export hasClientExports [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/directives.js .hasClientExports */ /*! export hasDirectives [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/directives.js .hasDirectives */ /*! export isField [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .isField */ /*! export isInlineFragment [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .isInlineFragment */ /*! export isNonEmptyArray [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/arrays.js .isNonEmptyArray */ /*! export isReference [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .isReference */ /*! export iterateObserversSafely [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/observables/iteration.js .iterateObserversSafely */ /*! export makeReference [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .makeReference */ /*! export maybeDeepFreeze [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js .maybeDeepFreeze */ /*! export mergeDeep [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/mergeDeep.js .mergeDeep */ /*! export mergeDeepArray [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/common/mergeDeep.js .mergeDeepArray */ /*! export offsetLimitPagination [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/policies/pagination.js .offsetLimitPagination */ /*! export relayStylePagination [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/policies/pagination.js .relayStylePagination */ /*! export removeArgumentsFromDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/transform.js .removeArgumentsFromDocument */ /*! export removeClientSetsFromDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/transform.js .removeClientSetsFromDocument */ /*! export removeConnectionDirectiveFromDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/transform.js .removeConnectionDirectiveFromDocument */ /*! export removeDirectivesFromDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/transform.js .removeDirectivesFromDocument */ /*! export removeFragmentSpreadFromDocument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/transform.js .removeFragmentSpreadFromDocument */ /*! export resultKeyNameFromField [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .resultKeyNameFromField */ /*! export shouldInclude [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/directives.js .shouldInclude */ /*! export storeKeyNameFromField [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .storeKeyNameFromField */ /*! export valueToObjectRepresentation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@apollo/client/utilities/graphql/storeUtils.js .valueToObjectRepresentation */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "shouldInclude": () => /* reexport safe */ _graphql_directives_js__WEBPACK_IMPORTED_MODULE_0__.shouldInclude, /* harmony export */ "hasDirectives": () => /* reexport safe */ _graphql_directives_js__WEBPACK_IMPORTED_MODULE_0__.hasDirectives, /* harmony export */ "hasClientExports": () => /* reexport safe */ _graphql_directives_js__WEBPACK_IMPORTED_MODULE_0__.hasClientExports, /* harmony export */ "getDirectiveNames": () => /* reexport safe */ _graphql_directives_js__WEBPACK_IMPORTED_MODULE_0__.getDirectiveNames, /* harmony export */ "getInclusionDirectives": () => /* reexport safe */ _graphql_directives_js__WEBPACK_IMPORTED_MODULE_0__.getInclusionDirectives, /* harmony export */ "createFragmentMap": () => /* reexport safe */ _graphql_fragments_js__WEBPACK_IMPORTED_MODULE_1__.createFragmentMap, /* harmony export */ "getFragmentQueryDocument": () => /* reexport safe */ _graphql_fragments_js__WEBPACK_IMPORTED_MODULE_1__.getFragmentQueryDocument, /* harmony export */ "getFragmentFromSelection": () => /* reexport safe */ _graphql_fragments_js__WEBPACK_IMPORTED_MODULE_1__.getFragmentFromSelection, /* harmony export */ "checkDocument": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.checkDocument, /* harmony export */ "getOperationDefinition": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.getOperationDefinition, /* harmony export */ "getOperationName": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.getOperationName, /* harmony export */ "getFragmentDefinitions": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentDefinitions, /* harmony export */ "getQueryDefinition": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.getQueryDefinition, /* harmony export */ "getFragmentDefinition": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.getFragmentDefinition, /* harmony export */ "getMainDefinition": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.getMainDefinition, /* harmony export */ "getDefaultValues": () => /* reexport safe */ _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__.getDefaultValues, /* harmony export */ "makeReference": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.makeReference, /* harmony export */ "isReference": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isReference, /* harmony export */ "isField": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isField, /* harmony export */ "isInlineFragment": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.isInlineFragment, /* harmony export */ "valueToObjectRepresentation": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.valueToObjectRepresentation, /* harmony export */ "storeKeyNameFromField": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.storeKeyNameFromField, /* harmony export */ "argumentsObjectFromField": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.argumentsObjectFromField, /* harmony export */ "resultKeyNameFromField": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.resultKeyNameFromField, /* harmony export */ "getStoreKeyName": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.getStoreKeyName, /* harmony export */ "getTypenameFromResult": () => /* reexport safe */ _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__.getTypenameFromResult, /* harmony export */ "addTypenameToDocument": () => /* reexport safe */ _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__.addTypenameToDocument, /* harmony export */ "buildQueryFromSelectionSet": () => /* reexport safe */ _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__.buildQueryFromSelectionSet, /* harmony export */ "removeDirectivesFromDocument": () => /* reexport safe */ _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__.removeDirectivesFromDocument, /* harmony export */ "removeConnectionDirectiveFromDocument": () => /* reexport safe */ _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__.removeConnectionDirectiveFromDocument, /* harmony export */ "removeArgumentsFromDocument": () => /* reexport safe */ _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__.removeArgumentsFromDocument, /* harmony export */ "removeFragmentSpreadFromDocument": () => /* reexport safe */ _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__.removeFragmentSpreadFromDocument, /* harmony export */ "removeClientSetsFromDocument": () => /* reexport safe */ _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__.removeClientSetsFromDocument, /* harmony export */ "concatPagination": () => /* reexport safe */ _policies_pagination_js__WEBPACK_IMPORTED_MODULE_5__.concatPagination, /* harmony export */ "offsetLimitPagination": () => /* reexport safe */ _policies_pagination_js__WEBPACK_IMPORTED_MODULE_5__.offsetLimitPagination, /* harmony export */ "relayStylePagination": () => /* reexport safe */ _policies_pagination_js__WEBPACK_IMPORTED_MODULE_5__.relayStylePagination, /* harmony export */ "Observable": () => /* reexport safe */ _observables_Observable_js__WEBPACK_IMPORTED_MODULE_6__.Observable, /* harmony export */ "DeepMerger": () => /* reexport safe */ _common_mergeDeep_js__WEBPACK_IMPORTED_MODULE_7__.DeepMerger, /* harmony export */ "mergeDeep": () => /* reexport safe */ _common_mergeDeep_js__WEBPACK_IMPORTED_MODULE_7__.mergeDeep, /* harmony export */ "mergeDeepArray": () => /* reexport safe */ _common_mergeDeep_js__WEBPACK_IMPORTED_MODULE_7__.mergeDeepArray, /* harmony export */ "cloneDeep": () => /* reexport safe */ _common_cloneDeep_js__WEBPACK_IMPORTED_MODULE_8__.cloneDeep, /* harmony export */ "maybeDeepFreeze": () => /* reexport safe */ _common_maybeDeepFreeze_js__WEBPACK_IMPORTED_MODULE_9__.maybeDeepFreeze, /* harmony export */ "iterateObserversSafely": () => /* reexport safe */ _observables_iteration_js__WEBPACK_IMPORTED_MODULE_10__.iterateObserversSafely, /* harmony export */ "asyncMap": () => /* reexport safe */ _observables_asyncMap_js__WEBPACK_IMPORTED_MODULE_11__.asyncMap, /* harmony export */ "Concast": () => /* reexport safe */ _observables_Concast_js__WEBPACK_IMPORTED_MODULE_12__.Concast, /* harmony export */ "isNonEmptyArray": () => /* reexport safe */ _common_arrays_js__WEBPACK_IMPORTED_MODULE_13__.isNonEmptyArray, /* harmony export */ "graphQLResultHasError": () => /* reexport safe */ _common_errorHandling_js__WEBPACK_IMPORTED_MODULE_14__.graphQLResultHasError, /* harmony export */ "canUseWeakMap": () => /* reexport safe */ _common_canUse_js__WEBPACK_IMPORTED_MODULE_15__.canUseWeakMap, /* harmony export */ "compact": () => /* reexport safe */ _common_compact_js__WEBPACK_IMPORTED_MODULE_16__.compact /* harmony export */ }); /* harmony import */ var _graphql_directives_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graphql/directives.js */ "./node_modules/@apollo/client/utilities/graphql/directives.js"); /* harmony import */ var _graphql_fragments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./graphql/fragments.js */ "./node_modules/@apollo/client/utilities/graphql/fragments.js"); /* harmony import */ var _graphql_getFromAST_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./graphql/getFromAST.js */ "./node_modules/@apollo/client/utilities/graphql/getFromAST.js"); /* harmony import */ var _graphql_storeUtils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./graphql/storeUtils.js */ "./node_modules/@apollo/client/utilities/graphql/storeUtils.js"); /* harmony import */ var _graphql_transform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./graphql/transform.js */ "./node_modules/@apollo/client/utilities/graphql/transform.js"); /* harmony import */ var _policies_pagination_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./policies/pagination.js */ "./node_modules/@apollo/client/utilities/policies/pagination.js"); /* harmony import */ var _observables_Observable_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./observables/Observable.js */ "./node_modules/@apollo/client/utilities/observables/Observable.js"); /* harmony import */ var _common_mergeDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./common/mergeDeep.js */ "./node_modules/@apollo/client/utilities/common/mergeDeep.js"); /* harmony import */ var _common_cloneDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./common/cloneDeep.js */ "./node_modules/@apollo/client/utilities/common/cloneDeep.js"); /* harmony import */ var _common_maybeDeepFreeze_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./common/maybeDeepFreeze.js */ "./node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js"); /* harmony import */ var _observables_iteration_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./observables/iteration.js */ "./node_modules/@apollo/client/utilities/observables/iteration.js"); /* harmony import */ var _observables_asyncMap_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./observables/asyncMap.js */ "./node_modules/@apollo/client/utilities/observables/asyncMap.js"); /* harmony import */ var _observables_Concast_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./observables/Concast.js */ "./node_modules/@apollo/client/utilities/observables/Concast.js"); /* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./common/arrays.js */ "./node_modules/@apollo/client/utilities/common/arrays.js"); /* harmony import */ var _common_errorHandling_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./common/errorHandling.js */ "./node_modules/@apollo/client/utilities/common/errorHandling.js"); /* harmony import */ var _common_canUse_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./common/canUse.js */ "./node_modules/@apollo/client/utilities/common/canUse.js"); /* harmony import */ var _common_compact_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./common/compact.js */ "./node_modules/@apollo/client/utilities/common/compact.js"); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/observables/Concast.js": /*!**********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/observables/Concast.js ***! \**********************************************************************/ /*! namespace exports */ /*! export Concast [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Concast": () => /* binding */ Concast /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Observable.js */ "./node_modules/@apollo/client/utilities/observables/Observable.js"); /* harmony import */ var _iteration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iteration.js */ "./node_modules/@apollo/client/utilities/observables/iteration.js"); ; function isPromiseLike(value) { return value && typeof value.then === "function"; } var Concast = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Concast, _super); function Concast(sources) { var _this = _super.call(this, function (observer) { _this.addObserver(observer); return function () { return _this.removeObserver(observer); }; }) || this; _this.observers = new Set(); _this.promise = new Promise(function (resolve, reject) { _this.resolve = resolve; _this.reject = reject; }); _this.handlers = { next: function (result) { if (_this.sub !== null) { _this.latest = ["next", result]; (0,_iteration_js__WEBPACK_IMPORTED_MODULE_1__.iterateObserversSafely)(_this.observers, "next", result); } }, error: function (error) { if (_this.sub !== null) { if (_this.sub) _this.sub.unsubscribe(); _this.sub = null; _this.latest = ["error", error]; _this.reject(error); (0,_iteration_js__WEBPACK_IMPORTED_MODULE_1__.iterateObserversSafely)(_this.observers, "error", error); } }, complete: function () { if (_this.sub !== null) { var value = _this.sources.shift(); if (!value) { _this.sub = null; if (_this.latest && _this.latest[0] === "next") { _this.resolve(_this.latest[1]); } else { _this.resolve(); } (0,_iteration_js__WEBPACK_IMPORTED_MODULE_1__.iterateObserversSafely)(_this.observers, "complete"); } else if (isPromiseLike(value)) { value.then(function (obs) { return _this.sub = obs.subscribe(_this.handlers); }); } else { _this.sub = value.subscribe(_this.handlers); } } }, }; _this.cancel = function (reason) { _this.reject(reason); _this.sources = []; _this.handlers.complete(); }; _this.promise.catch(function (_) { }); if (isPromiseLike(sources)) { sources.then(function (iterable) { return _this.start(iterable); }, _this.handlers.error); } else { _this.start(sources); } return _this; } Concast.prototype.start = function (sources) { if (this.sub !== void 0) return; this.sources = Array.from(sources); this.handlers.complete(); }; Concast.prototype.addObserver = function (observer) { if (!this.observers.has(observer)) { if (this.latest) { var nextOrError = this.latest[0]; var method = observer[nextOrError]; if (method) { method.call(observer, this.latest[1]); } if (this.sub === null && nextOrError === "next" && observer.complete) { observer.complete(); } } this.observers.add(observer); } }; Concast.prototype.removeObserver = function (observer, quietly) { if (this.observers.delete(observer) && this.observers.size < 1) { if (quietly) return; if (this.sub) { this.sub.unsubscribe(); this.reject(new Error("Observable cancelled prematurely")); } this.sub = null; } }; Concast.prototype.cleanup = function (callback) { var _this = this; var called = false; var once = function () { if (!called) { called = true; _this.observers.delete(observer); callback(); } }; var observer = { next: once, error: once, complete: once, }; this.addObserver(observer); }; return Concast; }(_Observable_js__WEBPACK_IMPORTED_MODULE_0__.Observable)); if (typeof Symbol === "function" && Symbol.species) { Object.defineProperty(Concast, Symbol.species, { value: _Observable_js__WEBPACK_IMPORTED_MODULE_0__.Observable, }); } //# sourceMappingURL=Concast.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/observables/Observable.js": /*!*************************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/observables/Observable.js ***! \*************************************************************************/ /*! namespace exports */ /*! export Observable [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/zen-observable/index.js .default */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Observable": () => /* reexport default from dynamic */ zen_observable__WEBPACK_IMPORTED_MODULE_0___default.a /* harmony export */ }); /* harmony import */ var zen_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zen-observable */ "./node_modules/zen-observable/index.js"); /* harmony import */ var zen_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(zen_observable__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! symbol-observable */ "./node_modules/symbol-observable/es/index.js"); ; (zen_observable__WEBPACK_IMPORTED_MODULE_0___default().prototype["@@observable"]) = function () { return this; }; //# sourceMappingURL=Observable.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/observables/asyncMap.js": /*!***********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/observables/asyncMap.js ***! \***********************************************************************/ /*! namespace exports */ /*! export asyncMap [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "asyncMap": () => /* binding */ asyncMap /* harmony export */ }); /* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Observable.js */ "./node_modules/@apollo/client/utilities/observables/Observable.js"); ; function asyncMap(observable, mapFn, catchFn) { return new _Observable_js__WEBPACK_IMPORTED_MODULE_0__.Observable(function (observer) { var next = observer.next, error = observer.error, complete = observer.complete; var activeCallbackCount = 0; var completed = false; function makeCallback(examiner, delegate) { if (examiner) { return function (arg) { ++activeCallbackCount; new Promise(function (resolve) { return resolve(examiner(arg)); }).then(function (result) { --activeCallbackCount; next && next.call(observer, result); if (completed) { handler.complete(); } }, function (e) { --activeCallbackCount; error && error.call(observer, e); }); }; } else { return function (arg) { return delegate && delegate.call(observer, arg); }; } } var handler = { next: makeCallback(mapFn, next), error: makeCallback(catchFn, error), complete: function () { completed = true; if (!activeCallbackCount) { complete && complete.call(observer); } }, }; var sub = observable.subscribe(handler); return function () { return sub.unsubscribe(); }; }); } //# sourceMappingURL=asyncMap.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/observables/iteration.js": /*!************************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/observables/iteration.js ***! \************************************************************************/ /*! namespace exports */ /*! export iterateObserversSafely [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "iterateObserversSafely": () => /* binding */ iterateObserversSafely /* harmony export */ }); function iterateObserversSafely(observers, method, argument) { var observersWithMethod = []; observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); }); observersWithMethod.forEach(function (obs) { return obs[method](argument); }); } //# sourceMappingURL=iteration.js.map /***/ }), /***/ "./node_modules/@apollo/client/utilities/policies/pagination.js": /*!**********************************************************************!*\ !*** ./node_modules/@apollo/client/utilities/policies/pagination.js ***! \**********************************************************************/ /*! namespace exports */ /*! export concatPagination [provided] [no usage info] [missing usage info prevents renaming] */ /*! export offsetLimitPagination [provided] [no usage info] [missing usage info prevents renaming] */ /*! export relayStylePagination [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "concatPagination": () => /* binding */ concatPagination, /* harmony export */ "offsetLimitPagination": () => /* binding */ offsetLimitPagination, /* harmony export */ "relayStylePagination": () => /* binding */ relayStylePagination /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _common_mergeDeep_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/mergeDeep.js */ "./node_modules/@apollo/client/utilities/common/mergeDeep.js"); ; function concatPagination(keyArgs) { if (keyArgs === void 0) { keyArgs = false; } return { keyArgs: keyArgs, merge: function (existing, incoming) { return existing ? (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__spreadArrays)(existing, incoming) : incoming; }, }; } function offsetLimitPagination(keyArgs) { if (keyArgs === void 0) { keyArgs = false; } return { keyArgs: keyArgs, merge: function (existing, incoming, _a) { var args = _a.args; var merged = existing ? existing.slice(0) : []; if (args) { var _b = args.offset, offset = _b === void 0 ? 0 : _b; for (var i = 0; i < incoming.length; ++i) { merged[offset + i] = incoming[i]; } } else { merged.push.apply(merged, incoming); } return merged; }, }; } function relayStylePagination(keyArgs) { if (keyArgs === void 0) { keyArgs = false; } return { keyArgs: keyArgs, read: function (existing, _a) { var canRead = _a.canRead, readField = _a.readField; if (!existing) return; var edges = []; var startCursor = ""; var endCursor = ""; existing.edges.forEach(function (edge) { if (canRead(readField("node", edge))) { edges.push(edge); if (edge.cursor) { startCursor = startCursor || edge.cursor; endCursor = edge.cursor; } } }); return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, getExtras(existing)), { edges: edges, pageInfo: (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, existing.pageInfo), { startCursor: startCursor, endCursor: endCursor }) }); }, merge: function (existing, incoming, _a) { if (existing === void 0) { existing = makeEmptyData(); } var args = _a.args, isReference = _a.isReference, readField = _a.readField; var incomingEdges = incoming.edges ? incoming.edges.map(function (edge) { if (isReference(edge = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, edge))) { edge.cursor = readField("cursor", edge); } return edge; }) : []; if (incoming.pageInfo) { var pageInfo_1 = incoming.pageInfo; var startCursor = pageInfo_1.startCursor, endCursor = pageInfo_1.endCursor; var firstEdge = incomingEdges[0]; var lastEdge = incomingEdges[incomingEdges.length - 1]; if (firstEdge && startCursor) { firstEdge.cursor = startCursor; } if (lastEdge && endCursor) { lastEdge.cursor = endCursor; } var firstCursor = firstEdge && firstEdge.cursor; if (firstCursor && !startCursor) { incoming = (0,_common_mergeDeep_js__WEBPACK_IMPORTED_MODULE_0__.mergeDeep)(incoming, { pageInfo: { startCursor: firstCursor, }, }); } var lastCursor = lastEdge && lastEdge.cursor; if (lastCursor && !endCursor) { incoming = (0,_common_mergeDeep_js__WEBPACK_IMPORTED_MODULE_0__.mergeDeep)(incoming, { pageInfo: { endCursor: lastCursor, }, }); } } var prefix = existing.edges; var suffix = []; if (args && args.after) { var index = prefix.findIndex(function (edge) { return edge.cursor === args.after; }); if (index >= 0) { prefix = prefix.slice(0, index + 1); } } else if (args && args.before) { var index = prefix.findIndex(function (edge) { return edge.cursor === args.before; }); suffix = index < 0 ? prefix : prefix.slice(index); prefix = []; } else if (incoming.edges) { prefix = []; } var edges = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__spreadArrays)(prefix, incomingEdges, suffix); var pageInfo = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, incoming.pageInfo), existing.pageInfo); if (incoming.pageInfo) { var _b = incoming.pageInfo, hasPreviousPage = _b.hasPreviousPage, hasNextPage = _b.hasNextPage, startCursor = _b.startCursor, endCursor = _b.endCursor; if (!prefix.length) { if (void 0 !== hasPreviousPage) pageInfo.hasPreviousPage = hasPreviousPage; if (void 0 !== startCursor) pageInfo.startCursor = startCursor; } if (!suffix.length) { if (void 0 !== hasNextPage) pageInfo.hasNextPage = hasNextPage; if (void 0 !== endCursor) pageInfo.endCursor = endCursor; } } return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, getExtras(existing)), getExtras(incoming)), { edges: edges, pageInfo: pageInfo }); }, }; } var getExtras = function (obj) { return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__rest)(obj, notExtras); }; var notExtras = ["edges", "pageInfo"]; function makeEmptyData() { return { edges: [], pageInfo: { hasPreviousPage: false, hasNextPage: true, startCursor: "", endCursor: "", }, }; } //# sourceMappingURL=pagination.js.map /***/ }), /***/ "./node_modules/@apollo/client/version.js": /*!************************************************!*\ !*** ./node_modules/@apollo/client/version.js ***! \************************************************/ /*! namespace exports */ /*! export version [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "version": () => /* binding */ version /* harmony export */ }); var version = 'local'; //# sourceMappingURL=version.js.map /***/ }), /***/ "./node_modules/@wry/context/lib/context.esm.js": /*!******************************************************!*\ !*** ./node_modules/@wry/context/lib/context.esm.js ***! \******************************************************/ /*! namespace exports */ /*! export Slot [provided] [no usage info] [missing usage info prevents renaming] */ /*! export asyncFromGen [provided] [no usage info] [missing usage info prevents renaming] */ /*! export bind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export noContext [provided] [no usage info] [missing usage info prevents renaming] */ /*! export setTimeout [provided] [no usage info] [missing usage info prevents renaming] */ /*! export wrapYieldingFiberMethods [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Slot": () => /* binding */ Slot, /* harmony export */ "asyncFromGen": () => /* binding */ asyncFromGen, /* harmony export */ "bind": () => /* binding */ bind, /* harmony export */ "noContext": () => /* binding */ noContext, /* harmony export */ "setTimeout": () => /* binding */ setTimeoutWithContext, /* harmony export */ "wrapYieldingFiberMethods": () => /* binding */ wrapYieldingFiberMethods /* harmony export */ }); // This currentContext variable will only be used if the makeSlotClass // function is called, which happens only if this is the first copy of the // @wry/context package to be imported. var currentContext = null; // This unique internal object is used to denote the absence of a value // for a given Slot, and is never exposed to outside code. var MISSING_VALUE = {}; var idCounter = 1; // Although we can't do anything about the cost of duplicated code from // accidentally bundling multiple copies of the @wry/context package, we can // avoid creating the Slot class more than once using makeSlotClass. var makeSlotClass = function () { return /** @class */ (function () { function Slot() { // If you have a Slot object, you can find out its slot.id, but you cannot // guess the slot.id of a Slot you don't have access to, thanks to the // randomized suffix. this.id = [ "slot", idCounter++, Date.now(), Math.random().toString(36).slice(2), ].join(":"); } Slot.prototype.hasValue = function () { for (var context_1 = currentContext; context_1; context_1 = context_1.parent) { // We use the Slot object iself as a key to its value, which means the // value cannot be obtained without a reference to the Slot object. if (this.id in context_1.slots) { var value = context_1.slots[this.id]; if (value === MISSING_VALUE) break; if (context_1 !== currentContext) { // Cache the value in currentContext.slots so the next lookup will // be faster. This caching is safe because the tree of contexts and // the values of the slots are logically immutable. currentContext.slots[this.id] = value; } return true; } } if (currentContext) { // If a value was not found for this Slot, it's never going to be found // no matter how many times we look it up, so we might as well cache // the absence of the value, too. currentContext.slots[this.id] = MISSING_VALUE; } return false; }; Slot.prototype.getValue = function () { if (this.hasValue()) { return currentContext.slots[this.id]; } }; Slot.prototype.withValue = function (value, callback, // Given the prevalence of arrow functions, specifying arguments is likely // to be much more common than specifying `this`, hence this ordering: args, thisArg) { var _a; var slots = (_a = { __proto__: null }, _a[this.id] = value, _a); var parent = currentContext; currentContext = { parent: parent, slots: slots }; try { // Function.prototype.apply allows the arguments array argument to be // omitted or undefined, so args! is fine here. return callback.apply(thisArg, args); } finally { currentContext = parent; } }; // Capture the current context and wrap a callback function so that it // reestablishes the captured context when called. Slot.bind = function (callback) { var context = currentContext; return function () { var saved = currentContext; try { currentContext = context; return callback.apply(this, arguments); } finally { currentContext = saved; } }; }; // Immediately run a callback function without any captured context. Slot.noContext = function (callback, // Given the prevalence of arrow functions, specifying arguments is likely // to be much more common than specifying `this`, hence this ordering: args, thisArg) { if (currentContext) { var saved = currentContext; try { currentContext = null; // Function.prototype.apply allows the arguments array argument to be // omitted or undefined, so args! is fine here. return callback.apply(thisArg, args); } finally { currentContext = saved; } } else { return callback.apply(thisArg, args); } }; return Slot; }()); }; // We store a single global implementation of the Slot class as a permanent // non-enumerable symbol property of the Array constructor. This obfuscation // does nothing to prevent access to the Slot class, but at least it ensures // the implementation (i.e. currentContext) cannot be tampered with, and all // copies of the @wry/context package (hopefully just one) will share the // same Slot implementation. Since the first copy of the @wry/context package // to be imported wins, this technique imposes a very high cost for any // future breaking changes to the Slot class. var globalKey = "@wry/context:Slot"; var host = Array; var Slot = host[globalKey] || function () { var Slot = makeSlotClass(); try { Object.defineProperty(host, globalKey, { value: host[globalKey] = Slot, enumerable: false, writable: false, configurable: false, }); } finally { return Slot; } }(); var bind = Slot.bind, noContext = Slot.noContext; function setTimeoutWithContext(callback, delay) { return setTimeout(bind(callback), delay); } // Turn any generator function into an async function (using yield instead // of await), with context automatically preserved across yields. function asyncFromGen(genFn) { return function () { var gen = genFn.apply(this, arguments); var boundNext = bind(gen.next); var boundThrow = bind(gen.throw); return new Promise(function (resolve, reject) { function invoke(method, argument) { try { var result = method.call(gen, argument); } catch (error) { return reject(error); } var next = result.done ? resolve : invokeNext; if (isPromiseLike(result.value)) { result.value.then(next, result.done ? reject : invokeThrow); } else { next(result.value); } } var invokeNext = function (value) { return invoke(boundNext, value); }; var invokeThrow = function (error) { return invoke(boundThrow, error); }; invokeNext(); }); }; } function isPromiseLike(value) { return value && typeof value.then === "function"; } // If you use the fibers npm package to implement coroutines in Node.js, // you should call this function at least once to ensure context management // remains coherent across any yields. var wrappedFibers = []; function wrapYieldingFiberMethods(Fiber) { // There can be only one implementation of Fiber per process, so this array // should never grow longer than one element. if (wrappedFibers.indexOf(Fiber) < 0) { var wrap = function (obj, method) { var fn = obj[method]; obj[method] = function () { return noContext(fn, arguments, this); }; }; // These methods can yield, according to // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100 wrap(Fiber, "yield"); wrap(Fiber.prototype, "run"); wrap(Fiber.prototype, "throwInto"); wrappedFibers.push(Fiber); } return Fiber; } //# sourceMappingURL=context.esm.js.map /***/ }), /***/ "./node_modules/@wry/equality/lib/equality.esm.js": /*!********************************************************!*\ !*** ./node_modules/@wry/equality/lib/equality.esm.js ***! \********************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! export equal [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ /***/ ((__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 */ "equal": () => /* binding */ equal /* harmony export */ }); var _a = Object.prototype, toString = _a.toString, hasOwnProperty = _a.hasOwnProperty; var fnToStr = Function.prototype.toString; var previousComparisons = new Map(); /** * Performs a deep equality check on two JavaScript values, tolerating cycles. */ function equal(a, b) { try { return check(a, b); } finally { previousComparisons.clear(); } } function check(a, b) { // If the two values are strictly equal, our job is easy. if (a === b) { return true; } // Object.prototype.toString returns a representation of the runtime type of // the given value that is considerably more precise than typeof. var aTag = toString.call(a); var bTag = toString.call(b); // If the runtime types of a and b are different, they could maybe be equal // under some interpretation of equality, but for simplicity and performance // we just return false instead. if (aTag !== bTag) { return false; } switch (aTag) { case '[object Array]': // Arrays are a lot like other objects, but we can cheaply compare their // lengths as a short-cut before comparing their elements. if (a.length !== b.length) return false; // Fall through to object case... case '[object Object]': { if (previouslyCompared(a, b)) return true; var aKeys = Object.keys(a); var bKeys = Object.keys(b); // If `a` and `b` have a different number of enumerable keys, they // must be different. var keyCount = aKeys.length; if (keyCount !== bKeys.length) return false; // Now make sure they have the same keys. for (var k = 0; k < keyCount; ++k) { if (!hasOwnProperty.call(b, aKeys[k])) { return false; } } // Finally, check deep equality of all child properties. for (var k = 0; k < keyCount; ++k) { var key = aKeys[k]; if (!check(a[key], b[key])) { return false; } } return true; } case '[object Error]': return a.name === b.name && a.message === b.message; case '[object Number]': // Handle NaN, which is !== itself. if (a !== a) return b !== b; // Fall through to shared +a === +b case... case '[object Boolean]': case '[object Date]': return +a === +b; case '[object RegExp]': case '[object String]': return a == "" + b; case '[object Map]': case '[object Set]': { if (a.size !== b.size) return false; if (previouslyCompared(a, b)) return true; var aIterator = a.entries(); var isMap = aTag === '[object Map]'; while (true) { var info = aIterator.next(); if (info.done) break; // If a instanceof Set, aValue === aKey. var _a = info.value, aKey = _a[0], aValue = _a[1]; // So this works the same way for both Set and Map. if (!b.has(aKey)) { return false; } // However, we care about deep equality of values only when dealing // with Map structures. if (isMap && !check(aValue, b.get(aKey))) { return false; } } return true; } case '[object Function]': { var aCode = fnToStr.call(a); if (aCode !== fnToStr.call(b)) { return false; } // We consider non-native functions equal if they have the same code // (native functions require === because their code is censored). // Note that this behavior is not entirely sound, since !== function // objects with the same code can behave differently depending on // their closure scope. However, any function can behave differently // depending on the values of its input arguments (including this) // and its calling context (including its closure scope), even // though the function object is === to itself; and it is entirely // possible for functions that are not === to behave exactly the // same under all conceivable circumstances. Because none of these // factors are statically decidable in JavaScript, JS function // equality is not well-defined. This ambiguity allows us to // consider the best possible heuristic among various imperfect // options, and equating non-native functions that have the same // code has enormous practical benefits, such as when comparing // functions that are repeatedly passed as fresh function // expressions within objects that are otherwise deeply equal. Since // any function created from the same syntactic expression (in the // same code location) will always stringify to the same code // according to fnToStr.call, we can reasonably expect these // repeatedly passed function expressions to have the same code, and // thus behave "the same" (with all the caveats mentioned above), // even though the runtime function objects are !== to one another. return !endsWith(aCode, nativeCodeSuffix); } } // Otherwise the values are not equal. return false; } var nativeCodeSuffix = "{ [native code] }"; function endsWith(full, suffix) { var fromIndex = full.length - suffix.length; return fromIndex >= 0 && full.indexOf(suffix, fromIndex) === fromIndex; } function previouslyCompared(a, b) { // Though cyclic references can make an object graph appear infinite from the // perspective of a depth-first traversal, the graph still contains a finite // number of distinct object references. We use the previousComparisons cache // to avoid comparing the same pair of object references more than once, which // guarantees termination (even if we end up comparing every object in one // graph to every object in the other graph, which is extremely unlikely), // while still allowing weird isomorphic structures (like rings with different // lengths) a chance to pass the equality test. var bSet = previousComparisons.get(a); if (bSet) { // Return true here because we can be sure false will be returned somewhere // else if the objects are not equivalent. if (bSet.has(b)) return true; } else { previousComparisons.set(a, bSet = new Set); } bSet.add(b); return false; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (equal); //# sourceMappingURL=equality.esm.js.map /***/ }), /***/ "./node_modules/actioncable/lib/assets/compiled/action_cable.js": /*!**********************************************************************!*\ !*** ./node_modules/actioncable/lib/assets/compiled/action_cable.js ***! \**********************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module, top-level-this-exports, __webpack_require__, __webpack_exports__ */ /*! CommonJS bailout: this is used directly at 601:8-12 */ /*! CommonJS bailout: module.exports is used directly at 596:36-50 */ /*! CommonJS bailout: module.exports is used directly at 597:4-18 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function() { var context = this; (function() { (function() { var slice = [].slice; this.ActionCable = { INTERNAL: { "message_types": { "welcome": "welcome", "ping": "ping", "confirmation": "confirm_subscription", "rejection": "reject_subscription" }, "default_mount_path": "/cable", "protocols": ["actioncable-v1-json", "actioncable-unsupported"] }, WebSocket: window.WebSocket, logger: window.console, createConsumer: function(url) { var ref; if (url == null) { url = (ref = this.getConfig("url")) != null ? ref : this.INTERNAL.default_mount_path; } return new ActionCable.Consumer(this.createWebSocketURL(url)); }, getConfig: function(name) { var element; element = document.head.querySelector("meta[name='action-cable-" + name + "']"); return element != null ? element.getAttribute("content") : void 0; }, createWebSocketURL: function(url) { var a; if (url && !/^wss?:/i.test(url)) { a = document.createElement("a"); a.href = url; a.href = a.href; a.protocol = a.protocol.replace("http", "ws"); return a.href; } else { return url; } }, startDebugging: function() { return this.debugging = true; }, stopDebugging: function() { return this.debugging = null; }, log: function() { var messages, ref; messages = 1 <= arguments.length ? slice.call(arguments, 0) : []; if (this.debugging) { messages.push(Date.now()); return (ref = this.logger).log.apply(ref, ["[ActionCable]"].concat(slice.call(messages))); } } }; }).call(this); }).call(context); var ActionCable = context.ActionCable; (function() { (function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; ActionCable.ConnectionMonitor = (function() { var clamp, now, secondsSince; ConnectionMonitor.pollInterval = { min: 3, max: 30 }; ConnectionMonitor.staleThreshold = 6; function ConnectionMonitor(connection) { this.connection = connection; this.visibilityDidChange = bind(this.visibilityDidChange, this); this.reconnectAttempts = 0; } ConnectionMonitor.prototype.start = function() { if (!this.isRunning()) { this.startedAt = now(); delete this.stoppedAt; this.startPolling(); document.addEventListener("visibilitychange", this.visibilityDidChange); return ActionCable.log("ConnectionMonitor started. pollInterval = " + (this.getPollInterval()) + " ms"); } }; ConnectionMonitor.prototype.stop = function() { if (this.isRunning()) { this.stoppedAt = now(); this.stopPolling(); document.removeEventListener("visibilitychange", this.visibilityDidChange); return ActionCable.log("ConnectionMonitor stopped"); } }; ConnectionMonitor.prototype.isRunning = function() { return (this.startedAt != null) && (this.stoppedAt == null); }; ConnectionMonitor.prototype.recordPing = function() { return this.pingedAt = now(); }; ConnectionMonitor.prototype.recordConnect = function() { this.reconnectAttempts = 0; this.recordPing(); delete this.disconnectedAt; return ActionCable.log("ConnectionMonitor recorded connect"); }; ConnectionMonitor.prototype.recordDisconnect = function() { this.disconnectedAt = now(); return ActionCable.log("ConnectionMonitor recorded disconnect"); }; ConnectionMonitor.prototype.startPolling = function() { this.stopPolling(); return this.poll(); }; ConnectionMonitor.prototype.stopPolling = function() { return clearTimeout(this.pollTimeout); }; ConnectionMonitor.prototype.poll = function() { return this.pollTimeout = setTimeout((function(_this) { return function() { _this.reconnectIfStale(); return _this.poll(); }; })(this), this.getPollInterval()); }; ConnectionMonitor.prototype.getPollInterval = function() { var interval, max, min, ref; ref = this.constructor.pollInterval, min = ref.min, max = ref.max; interval = 5 * Math.log(this.reconnectAttempts + 1); return Math.round(clamp(interval, min, max) * 1000); }; ConnectionMonitor.prototype.reconnectIfStale = function() { if (this.connectionIsStale()) { ActionCable.log("ConnectionMonitor detected stale connection. reconnectAttempts = " + this.reconnectAttempts + ", pollInterval = " + (this.getPollInterval()) + " ms, time disconnected = " + (secondsSince(this.disconnectedAt)) + " s, stale threshold = " + this.constructor.staleThreshold + " s"); this.reconnectAttempts++; if (this.disconnectedRecently()) { return ActionCable.log("ConnectionMonitor skipping reopening recent disconnect"); } else { ActionCable.log("ConnectionMonitor reopening"); return this.connection.reopen(); } } }; ConnectionMonitor.prototype.connectionIsStale = function() { var ref; return secondsSince((ref = this.pingedAt) != null ? ref : this.startedAt) > this.constructor.staleThreshold; }; ConnectionMonitor.prototype.disconnectedRecently = function() { return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold; }; ConnectionMonitor.prototype.visibilityDidChange = function() { if (document.visibilityState === "visible") { return setTimeout((function(_this) { return function() { if (_this.connectionIsStale() || !_this.connection.isOpen()) { ActionCable.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = " + document.visibilityState); return _this.connection.reopen(); } }; })(this), 200); } }; now = function() { return new Date().getTime(); }; secondsSince = function(time) { return (now() - time) / 1000; }; clamp = function(number, min, max) { return Math.max(min, Math.min(max, number)); }; return ConnectionMonitor; })(); }).call(this); (function() { var i, message_types, protocols, ref, supportedProtocols, unsupportedProtocol, slice = [].slice, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; ref = ActionCable.INTERNAL, message_types = ref.message_types, protocols = ref.protocols; supportedProtocols = 2 <= protocols.length ? slice.call(protocols, 0, i = protocols.length - 1) : (i = 0, []), unsupportedProtocol = protocols[i++]; ActionCable.Connection = (function() { Connection.reopenDelay = 500; function Connection(consumer) { this.consumer = consumer; this.open = bind(this.open, this); this.subscriptions = this.consumer.subscriptions; this.monitor = new ActionCable.ConnectionMonitor(this); this.disconnected = true; } Connection.prototype.send = function(data) { if (this.isOpen()) { this.webSocket.send(JSON.stringify(data)); return true; } else { return false; } }; Connection.prototype.open = function() { if (this.isActive()) { ActionCable.log("Attempted to open WebSocket, but existing socket is " + (this.getState())); return false; } else { ActionCable.log("Opening WebSocket, current state is " + (this.getState()) + ", subprotocols: " + protocols); if (this.webSocket != null) { this.uninstallEventHandlers(); } this.webSocket = new ActionCable.WebSocket(this.consumer.url, protocols); this.installEventHandlers(); this.monitor.start(); return true; } }; Connection.prototype.close = function(arg) { var allowReconnect, ref1; allowReconnect = (arg != null ? arg : { allowReconnect: true }).allowReconnect; if (!allowReconnect) { this.monitor.stop(); } if (this.isActive()) { return (ref1 = this.webSocket) != null ? ref1.close() : void 0; } }; Connection.prototype.reopen = function() { var error; ActionCable.log("Reopening WebSocket, current state is " + (this.getState())); if (this.isActive()) { try { return this.close(); } catch (error1) { error = error1; return ActionCable.log("Failed to reopen WebSocket", error); } finally { ActionCable.log("Reopening WebSocket in " + this.constructor.reopenDelay + "ms"); setTimeout(this.open, this.constructor.reopenDelay); } } else { return this.open(); } }; Connection.prototype.getProtocol = function() { var ref1; return (ref1 = this.webSocket) != null ? ref1.protocol : void 0; }; Connection.prototype.isOpen = function() { return this.isState("open"); }; Connection.prototype.isActive = function() { return this.isState("open", "connecting"); }; Connection.prototype.isProtocolSupported = function() { var ref1; return ref1 = this.getProtocol(), indexOf.call(supportedProtocols, ref1) >= 0; }; Connection.prototype.isState = function() { var ref1, states; states = 1 <= arguments.length ? slice.call(arguments, 0) : []; return ref1 = this.getState(), indexOf.call(states, ref1) >= 0; }; Connection.prototype.getState = function() { var ref1, state, value; for (state in WebSocket) { value = WebSocket[state]; if (value === ((ref1 = this.webSocket) != null ? ref1.readyState : void 0)) { return state.toLowerCase(); } } return null; }; Connection.prototype.installEventHandlers = function() { var eventName, handler; for (eventName in this.events) { handler = this.events[eventName].bind(this); this.webSocket["on" + eventName] = handler; } }; Connection.prototype.uninstallEventHandlers = function() { var eventName; for (eventName in this.events) { this.webSocket["on" + eventName] = function() {}; } }; Connection.prototype.events = { message: function(event) { var identifier, message, ref1, type; if (!this.isProtocolSupported()) { return; } ref1 = JSON.parse(event.data), identifier = ref1.identifier, message = ref1.message, type = ref1.type; switch (type) { case message_types.welcome: this.monitor.recordConnect(); return this.subscriptions.reload(); case message_types.ping: return this.monitor.recordPing(); case message_types.confirmation: return this.subscriptions.notify(identifier, "connected"); case message_types.rejection: return this.subscriptions.reject(identifier); default: return this.subscriptions.notify(identifier, "received", message); } }, open: function() { ActionCable.log("WebSocket onopen event, using '" + (this.getProtocol()) + "' subprotocol"); this.disconnected = false; if (!this.isProtocolSupported()) { ActionCable.log("Protocol is unsupported. Stopping monitor and disconnecting."); return this.close({ allowReconnect: false }); } }, close: function(event) { ActionCable.log("WebSocket onclose event"); if (this.disconnected) { return; } this.disconnected = true; this.monitor.recordDisconnect(); return this.subscriptions.notifyAll("disconnected", { willAttemptReconnect: this.monitor.isRunning() }); }, error: function() { return ActionCable.log("WebSocket onerror event"); } }; return Connection; })(); }).call(this); (function() { var slice = [].slice; ActionCable.Subscriptions = (function() { function Subscriptions(consumer) { this.consumer = consumer; this.subscriptions = []; } Subscriptions.prototype.create = function(channelName, mixin) { var channel, params, subscription; channel = channelName; params = typeof channel === "object" ? channel : { channel: channel }; subscription = new ActionCable.Subscription(this.consumer, params, mixin); return this.add(subscription); }; Subscriptions.prototype.add = function(subscription) { this.subscriptions.push(subscription); this.consumer.ensureActiveConnection(); this.notify(subscription, "initialized"); this.sendCommand(subscription, "subscribe"); return subscription; }; Subscriptions.prototype.remove = function(subscription) { this.forget(subscription); if (!this.findAll(subscription.identifier).length) { this.sendCommand(subscription, "unsubscribe"); } return subscription; }; Subscriptions.prototype.reject = function(identifier) { var i, len, ref, results, subscription; ref = this.findAll(identifier); results = []; for (i = 0, len = ref.length; i < len; i++) { subscription = ref[i]; this.forget(subscription); this.notify(subscription, "rejected"); results.push(subscription); } return results; }; Subscriptions.prototype.forget = function(subscription) { var s; this.subscriptions = (function() { var i, len, ref, results; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { s = ref[i]; if (s !== subscription) { results.push(s); } } return results; }).call(this); return subscription; }; Subscriptions.prototype.findAll = function(identifier) { var i, len, ref, results, s; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { s = ref[i]; if (s.identifier === identifier) { results.push(s); } } return results; }; Subscriptions.prototype.reload = function() { var i, len, ref, results, subscription; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { subscription = ref[i]; results.push(this.sendCommand(subscription, "subscribe")); } return results; }; Subscriptions.prototype.notifyAll = function() { var args, callbackName, i, len, ref, results, subscription; callbackName = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; ref = this.subscriptions; results = []; for (i = 0, len = ref.length; i < len; i++) { subscription = ref[i]; results.push(this.notify.apply(this, [subscription, callbackName].concat(slice.call(args)))); } return results; }; Subscriptions.prototype.notify = function() { var args, callbackName, i, len, results, subscription, subscriptions; subscription = arguments[0], callbackName = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; if (typeof subscription === "string") { subscriptions = this.findAll(subscription); } else { subscriptions = [subscription]; } results = []; for (i = 0, len = subscriptions.length; i < len; i++) { subscription = subscriptions[i]; results.push(typeof subscription[callbackName] === "function" ? subscription[callbackName].apply(subscription, args) : void 0); } return results; }; Subscriptions.prototype.sendCommand = function(subscription, command) { var identifier; identifier = subscription.identifier; return this.consumer.send({ command: command, identifier: identifier }); }; return Subscriptions; })(); }).call(this); (function() { ActionCable.Subscription = (function() { var extend; function Subscription(consumer, params, mixin) { this.consumer = consumer; if (params == null) { params = {}; } this.identifier = JSON.stringify(params); extend(this, mixin); } Subscription.prototype.perform = function(action, data) { if (data == null) { data = {}; } data.action = action; return this.send(data); }; Subscription.prototype.send = function(data) { return this.consumer.send({ command: "message", identifier: this.identifier, data: JSON.stringify(data) }); }; Subscription.prototype.unsubscribe = function() { return this.consumer.subscriptions.remove(this); }; extend = function(object, properties) { var key, value; if (properties != null) { for (key in properties) { value = properties[key]; object[key] = value; } } return object; }; return Subscription; })(); }).call(this); (function() { ActionCable.Consumer = (function() { function Consumer(url) { this.url = url; this.subscriptions = new ActionCable.Subscriptions(this); this.connection = new ActionCable.Connection(this); } Consumer.prototype.send = function(data) { return this.connection.send(data); }; Consumer.prototype.connect = function() { return this.connection.open(); }; Consumer.prototype.disconnect = function() { return this.connection.close({ allowReconnect: false }); }; Consumer.prototype.ensureActiveConnection = function() { if (!this.connection.isActive()) { return this.connection.open(); } }; return Consumer; })(); }).call(this); }).call(this); if ( true && module.exports) { module.exports = ActionCable; } else if (true) { !(__WEBPACK_AMD_DEFINE_FACTORY__ = (ActionCable), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } }).call(this); /***/ }), /***/ "./node_modules/apollo-link/lib/bundle.esm.js": /*!****************************************************!*\ !*** ./node_modules/apollo-link/lib/bundle.esm.js ***! \****************************************************/ /*! namespace exports */ /*! export ApolloLink [provided] [no usage info] [missing usage info prevents renaming] */ /*! export Observable [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/zen-observable-ts/lib/bundle.esm.js .default */ /*! export concat [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createOperation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export empty [provided] [no usage info] [missing usage info prevents renaming] */ /*! export execute [provided] [no usage info] [missing usage info prevents renaming] */ /*! export from [provided] [no usage info] [missing usage info prevents renaming] */ /*! export fromError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export fromPromise [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationName [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/apollo-utilities/lib/bundle.esm.js .getOperationName */ /*! export makePromise [provided] [no usage info] [missing usage info prevents renaming] */ /*! export split [provided] [no usage info] [missing usage info prevents renaming] */ /*! export toPromise [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Observable": () => /* reexport safe */ zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default, /* harmony export */ "getOperationName": () => /* reexport safe */ apollo_utilities__WEBPACK_IMPORTED_MODULE_2__.getOperationName, /* harmony export */ "ApolloLink": () => /* binding */ ApolloLink, /* harmony export */ "concat": () => /* binding */ concat, /* harmony export */ "createOperation": () => /* binding */ createOperation, /* harmony export */ "empty": () => /* binding */ empty, /* harmony export */ "execute": () => /* binding */ execute, /* harmony export */ "from": () => /* binding */ from, /* harmony export */ "fromError": () => /* binding */ fromError, /* harmony export */ "fromPromise": () => /* binding */ fromPromise, /* harmony export */ "makePromise": () => /* binding */ makePromise, /* harmony export */ "split": () => /* binding */ split, /* harmony export */ "toPromise": () => /* binding */ toPromise /* harmony export */ }); /* harmony import */ var zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zen-observable-ts */ "./node_modules/zen-observable-ts/lib/bundle.esm.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ts-invariant */ "./node_modules/apollo-link/node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var apollo_utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! apollo-utilities */ "./node_modules/apollo-utilities/lib/bundle.esm.js"); ; function validateOperation(operation) { var OPERATION_FIELDS = [ 'query', 'operationName', 'variables', 'extensions', 'context', ]; for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { var key = _a[_i]; if (OPERATION_FIELDS.indexOf(key) < 0) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_1__.InvariantError("illegal argument: " + key); } } return operation; } var LinkError = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(LinkError, _super); function LinkError(message, link) { var _this = _super.call(this, message) || this; _this.link = link; return _this; } return LinkError; }(Error)); function isTerminating(link) { return link.request.length <= 1; } function toPromise(observable) { var completed = false; return new Promise(function (resolve, reject) { observable.subscribe({ next: function (data) { if (completed) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant.warn("Promise Wrapper does not support multiple results from Observable"); } else { completed = true; resolve(data); } }, error: reject, }); }); } var makePromise = toPromise; function fromPromise(promise) { return new zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default(function (observer) { promise .then(function (value) { observer.next(value); observer.complete(); }) .catch(observer.error.bind(observer)); }); } function fromError(errorValue) { return new zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default(function (observer) { observer.error(errorValue); }); } function transformOperation(operation) { var transformedOperation = { variables: operation.variables || {}, extensions: operation.extensions || {}, operationName: operation.operationName, query: operation.query, }; if (!transformedOperation.operationName) { transformedOperation.operationName = typeof transformedOperation.query !== 'string' ? (0,apollo_utilities__WEBPACK_IMPORTED_MODULE_2__.getOperationName)(transformedOperation.query) : ''; } return transformedOperation; } function createOperation(starting, operation) { var context = (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, starting); var setContext = function (next) { if (typeof next === 'function') { context = (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, context, next(context)); } else { context = (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, context, next); } }; var getContext = function () { return ((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, context)); }; Object.defineProperty(operation, 'setContext', { enumerable: false, value: setContext, }); Object.defineProperty(operation, 'getContext', { enumerable: false, value: getContext, }); Object.defineProperty(operation, 'toKey', { enumerable: false, value: function () { return getKey(operation); }, }); return operation; } function getKey(operation) { var query = operation.query, variables = operation.variables, operationName = operation.operationName; return JSON.stringify([operationName, query, variables]); } function passthrough(op, forward) { return forward ? forward(op) : zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of(); } function toLink(handler) { return typeof handler === 'function' ? new ApolloLink(handler) : handler; } function empty() { return new ApolloLink(function () { return zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of(); }); } function from(links) { if (links.length === 0) return empty(); return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); } function split(test, left, right) { var leftLink = toLink(left); var rightLink = toLink(right || new ApolloLink(passthrough)); if (isTerminating(leftLink) && isTerminating(rightLink)) { return new ApolloLink(function (operation) { return test(operation) ? leftLink.request(operation) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of() : rightLink.request(operation) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of(); }); } else { return new ApolloLink(function (operation, forward) { return test(operation) ? leftLink.request(operation, forward) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of() : rightLink.request(operation, forward) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of(); }); } } var concat = function (first, second) { var firstLink = toLink(first); if (isTerminating(firstLink)) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_1__.invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); return firstLink; } var nextLink = toLink(second); if (isTerminating(nextLink)) { return new ApolloLink(function (operation) { return firstLink.request(operation, function (op) { return nextLink.request(op) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of(); }) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of(); }); } else { return new ApolloLink(function (operation, forward) { return (firstLink.request(operation, function (op) { return nextLink.request(op, forward) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of(); }) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of()); }); } }; var ApolloLink = (function () { function ApolloLink(request) { if (request) this.request = request; } ApolloLink.prototype.split = function (test, left, right) { return this.concat(split(test, left, right || new ApolloLink(passthrough))); }; ApolloLink.prototype.concat = function (next) { return concat(this, next); }; ApolloLink.prototype.request = function (operation, forward) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_1__.InvariantError('request is not implemented'); }; ApolloLink.empty = empty; ApolloLink.from = from; ApolloLink.split = split; ApolloLink.execute = execute; return ApolloLink; }()); function execute(link, operation) { return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || zen_observable_ts__WEBPACK_IMPORTED_MODULE_0__.default.of()); } //# sourceMappingURL=bundle.esm.js.map /***/ }), /***/ "./node_modules/apollo-link/node_modules/ts-invariant/lib/invariant.esm.js": /*!*********************************************************************************!*\ !*** ./node_modules/apollo-link/node_modules/ts-invariant/lib/invariant.esm.js ***! \*********************************************************************************/ /*! namespace exports */ /*! export InvariantError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! export invariant [provided] [no usage info] [missing usage info prevents renaming] */ /*! export process [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ /***/ ((__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 */ "InvariantError": () => /* binding */ InvariantError, /* harmony export */ "invariant": () => /* binding */ invariant, /* harmony export */ "process": () => /* binding */ processStub /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); ; var genericMessage = "Invariant Violation"; var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { obj.__proto__ = proto; return obj; } : _a; var InvariantError = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(InvariantError, _super); function InvariantError(message) { if (message === void 0) { message = genericMessage; } var _this = _super.call(this, typeof message === "number" ? genericMessage + ": " + message + " (see https://github.com/apollographql/invariant-packages)" : message) || this; _this.framesToPop = 1; _this.name = genericMessage; setPrototypeOf(_this, InvariantError.prototype); return _this; } return InvariantError; }(Error)); function invariant(condition, message) { if (!condition) { throw new InvariantError(message); } } function wrapConsoleMethod(method) { return function () { return console[method].apply(console, arguments); }; } (function (invariant) { invariant.warn = wrapConsoleMethod("warn"); invariant.error = wrapConsoleMethod("error"); })(invariant || (invariant = {})); // Code that uses ts-invariant with rollup-plugin-invariant may want to // import this process stub to avoid errors evaluating process.env.NODE_ENV. // However, because most ESM-to-CJS compilers will rewrite the process import // as tsInvariant.process, which prevents proper replacement by minifiers, we // also attempt to define the stub globally when it is not already defined. var processStub = { env: {} }; if (typeof process === "object") { processStub = process; } else try { // Using Function to evaluate this assignment in global scope also escapes // the strict mode of the current module, thereby allowing the assignment. // Inspired by https://github.com/facebook/regenerator/pull/369. Function("stub", "process = stub")(processStub); } catch (atLeastWeTried) { // The assignment can fail if a Content Security Policy heavy-handedly // forbids Function usage. In those environments, developers should take // extra care to replace process.env.NODE_ENV in their production builds, // or define an appropriate global.process polyfill. } var invariant$1 = invariant; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (invariant$1); //# sourceMappingURL=invariant.esm.js.map /***/ }), /***/ "./node_modules/apollo-utilities/lib/bundle.esm.js": /*!*********************************************************!*\ !*** ./node_modules/apollo-utilities/lib/bundle.esm.js ***! \*********************************************************/ /*! namespace exports */ /*! export addTypenameToDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export argumentsObjectFromField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assign [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildQueryFromSelectionSet [provided] [no usage info] [missing usage info prevents renaming] */ /*! export canUseWeakMap [provided] [no usage info] [missing usage info prevents renaming] */ /*! export checkDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export cloneDeep [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createFragmentMap [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDefaultValues [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDirectiveInfoFromField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDirectiveNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDirectivesFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getEnv [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFragmentDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFragmentDefinitions [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFragmentQueryDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getInclusionDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getMainDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getMutationDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationDefinitionOrDie [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationName [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getQueryDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getStoreKeyName [provided] [no usage info] [missing usage info prevents renaming] */ /*! export graphQLResultHasError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export hasClientExports [provided] [no usage info] [missing usage info prevents renaming] */ /*! export hasDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isDevelopment [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isEnv [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isEqual [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/apollo-utilities/node_modules/@wry/equality/lib/equality.esm.js .equal */ /*! export isField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isIdValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInlineFragment [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isJsonValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNumberValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isProduction [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isScalarValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTest [provided] [no usage info] [missing usage info prevents renaming] */ /*! export maybeDeepFreeze [provided] [no usage info] [missing usage info prevents renaming] */ /*! export mergeDeep [provided] [no usage info] [missing usage info prevents renaming] */ /*! export mergeDeepArray [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeArgumentsFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeClientSetsFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeConnectionDirectiveFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeDirectivesFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export removeFragmentSpreadFromDocument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export resultKeyNameFromField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export shouldInclude [provided] [no usage info] [missing usage info prevents renaming] */ /*! export storeKeyNameFromField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export stripSymbols [provided] [no usage info] [missing usage info prevents renaming] */ /*! export toIdValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export tryFunctionOrLogError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export valueFromNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export valueToObjectRepresentation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export variablesInOperation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export warnOnceInDevelopment [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isEqual": () => /* reexport safe */ _wry_equality__WEBPACK_IMPORTED_MODULE_2__.equal, /* harmony export */ "addTypenameToDocument": () => /* binding */ addTypenameToDocument, /* harmony export */ "argumentsObjectFromField": () => /* binding */ argumentsObjectFromField, /* harmony export */ "assign": () => /* binding */ assign, /* harmony export */ "buildQueryFromSelectionSet": () => /* binding */ buildQueryFromSelectionSet, /* harmony export */ "canUseWeakMap": () => /* binding */ canUseWeakMap, /* harmony export */ "checkDocument": () => /* binding */ checkDocument, /* harmony export */ "cloneDeep": () => /* binding */ cloneDeep, /* harmony export */ "createFragmentMap": () => /* binding */ createFragmentMap, /* harmony export */ "getDefaultValues": () => /* binding */ getDefaultValues, /* harmony export */ "getDirectiveInfoFromField": () => /* binding */ getDirectiveInfoFromField, /* harmony export */ "getDirectiveNames": () => /* binding */ getDirectiveNames, /* harmony export */ "getDirectivesFromDocument": () => /* binding */ getDirectivesFromDocument, /* harmony export */ "getEnv": () => /* binding */ getEnv, /* harmony export */ "getFragmentDefinition": () => /* binding */ getFragmentDefinition, /* harmony export */ "getFragmentDefinitions": () => /* binding */ getFragmentDefinitions, /* harmony export */ "getFragmentQueryDocument": () => /* binding */ getFragmentQueryDocument, /* harmony export */ "getInclusionDirectives": () => /* binding */ getInclusionDirectives, /* harmony export */ "getMainDefinition": () => /* binding */ getMainDefinition, /* harmony export */ "getMutationDefinition": () => /* binding */ getMutationDefinition, /* harmony export */ "getOperationDefinition": () => /* binding */ getOperationDefinition, /* harmony export */ "getOperationDefinitionOrDie": () => /* binding */ getOperationDefinitionOrDie, /* harmony export */ "getOperationName": () => /* binding */ getOperationName, /* harmony export */ "getQueryDefinition": () => /* binding */ getQueryDefinition, /* harmony export */ "getStoreKeyName": () => /* binding */ getStoreKeyName, /* harmony export */ "graphQLResultHasError": () => /* binding */ graphQLResultHasError, /* harmony export */ "hasClientExports": () => /* binding */ hasClientExports, /* harmony export */ "hasDirectives": () => /* binding */ hasDirectives, /* harmony export */ "isDevelopment": () => /* binding */ isDevelopment, /* harmony export */ "isEnv": () => /* binding */ isEnv, /* harmony export */ "isField": () => /* binding */ isField, /* harmony export */ "isIdValue": () => /* binding */ isIdValue, /* harmony export */ "isInlineFragment": () => /* binding */ isInlineFragment, /* harmony export */ "isJsonValue": () => /* binding */ isJsonValue, /* harmony export */ "isNumberValue": () => /* binding */ isNumberValue, /* harmony export */ "isProduction": () => /* binding */ isProduction, /* harmony export */ "isScalarValue": () => /* binding */ isScalarValue, /* harmony export */ "isTest": () => /* binding */ isTest, /* harmony export */ "maybeDeepFreeze": () => /* binding */ maybeDeepFreeze, /* harmony export */ "mergeDeep": () => /* binding */ mergeDeep, /* harmony export */ "mergeDeepArray": () => /* binding */ mergeDeepArray, /* harmony export */ "removeArgumentsFromDocument": () => /* binding */ removeArgumentsFromDocument, /* harmony export */ "removeClientSetsFromDocument": () => /* binding */ removeClientSetsFromDocument, /* harmony export */ "removeConnectionDirectiveFromDocument": () => /* binding */ removeConnectionDirectiveFromDocument, /* harmony export */ "removeDirectivesFromDocument": () => /* binding */ removeDirectivesFromDocument, /* harmony export */ "removeFragmentSpreadFromDocument": () => /* binding */ removeFragmentSpreadFromDocument, /* harmony export */ "resultKeyNameFromField": () => /* binding */ resultKeyNameFromField, /* harmony export */ "shouldInclude": () => /* binding */ shouldInclude, /* harmony export */ "storeKeyNameFromField": () => /* binding */ storeKeyNameFromField, /* harmony export */ "stripSymbols": () => /* binding */ stripSymbols, /* harmony export */ "toIdValue": () => /* binding */ toIdValue, /* harmony export */ "tryFunctionOrLogError": () => /* binding */ tryFunctionOrLogError, /* harmony export */ "valueFromNode": () => /* binding */ valueFromNode, /* harmony export */ "valueToObjectRepresentation": () => /* binding */ valueToObjectRepresentation, /* harmony export */ "variablesInOperation": () => /* binding */ variablesInOperation, /* harmony export */ "warnOnceInDevelopment": () => /* binding */ warnOnceInDevelopment /* harmony export */ }); /* harmony import */ var graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! graphql/language/visitor */ "./node_modules/graphql/language/visitor.js"); /* harmony import */ var ts_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ts-invariant */ "./node_modules/apollo-utilities/node_modules/ts-invariant/lib/invariant.esm.js"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-json-stable-stringify */ "./node_modules/fast-json-stable-stringify/index.js"); /* harmony import */ var fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _wry_equality__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wry/equality */ "./node_modules/apollo-utilities/node_modules/@wry/equality/lib/equality.esm.js"); ; function isScalarValue(value) { return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; } function isNumberValue(value) { return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; } function isStringValue(value) { return value.kind === 'StringValue'; } function isBooleanValue(value) { return value.kind === 'BooleanValue'; } function isIntValue(value) { return value.kind === 'IntValue'; } function isFloatValue(value) { return value.kind === 'FloatValue'; } function isVariable(value) { return value.kind === 'Variable'; } function isObjectValue(value) { return value.kind === 'ObjectValue'; } function isListValue(value) { return value.kind === 'ListValue'; } function isEnumValue(value) { return value.kind === 'EnumValue'; } function isNullValue(value) { return value.kind === 'NullValue'; } function valueToObjectRepresentation(argObj, name, value, variables) { if (isIntValue(value) || isFloatValue(value)) { argObj[name.value] = Number(value.value); } else if (isBooleanValue(value) || isStringValue(value)) { argObj[name.value] = value.value; } else if (isObjectValue(value)) { var nestedArgObj_1 = {}; value.fields.map(function (obj) { return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); }); argObj[name.value] = nestedArgObj_1; } else if (isVariable(value)) { var variableValue = (variables || {})[value.name.value]; argObj[name.value] = variableValue; } else if (isListValue(value)) { argObj[name.value] = value.values.map(function (listValue) { var nestedArgArrayObj = {}; valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); return nestedArgArrayObj[name.value]; }); } else if (isEnumValue(value)) { argObj[name.value] = value.value; } else if (isNullValue(value)) { argObj[name.value] = null; } else { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + 'is not supported. Use variables instead of inline arguments to ' + 'overcome this limitation.'); } } function storeKeyNameFromField(field, variables) { var directivesObj = null; if (field.directives) { directivesObj = {}; field.directives.forEach(function (directive) { directivesObj[directive.name.value] = {}; if (directive.arguments) { directive.arguments.forEach(function (_a) { var name = _a.name, value = _a.value; return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); }); } }); } var argObj = null; if (field.arguments && field.arguments.length) { argObj = {}; field.arguments.forEach(function (_a) { var name = _a.name, value = _a.value; return valueToObjectRepresentation(argObj, name, value, variables); }); } return getStoreKeyName(field.name.value, argObj, directivesObj); } var KNOWN_DIRECTIVES = [ 'connection', 'include', 'skip', 'client', 'rest', 'export', ]; function getStoreKeyName(fieldName, args, directives) { if (directives && directives['connection'] && directives['connection']['key']) { if (directives['connection']['filter'] && directives['connection']['filter'].length > 0) { var filterKeys = directives['connection']['filter'] ? directives['connection']['filter'] : []; filterKeys.sort(); var queryArgs_1 = args; var filteredArgs_1 = {}; filterKeys.forEach(function (key) { filteredArgs_1[key] = queryArgs_1[key]; }); return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; } else { return directives['connection']['key']; } } var completeFieldName = fieldName; if (args) { var stringifiedArgs = fast_json_stable_stringify__WEBPACK_IMPORTED_MODULE_1___default()(args); completeFieldName += "(" + stringifiedArgs + ")"; } if (directives) { Object.keys(directives).forEach(function (key) { if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; if (directives[key] && Object.keys(directives[key]).length) { completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; } else { completeFieldName += "@" + key; } }); } return completeFieldName; } function argumentsObjectFromField(field, variables) { if (field.arguments && field.arguments.length) { var argObj_1 = {}; field.arguments.forEach(function (_a) { var name = _a.name, value = _a.value; return valueToObjectRepresentation(argObj_1, name, value, variables); }); return argObj_1; } return null; } function resultKeyNameFromField(field) { return field.alias ? field.alias.value : field.name.value; } function isField(selection) { return selection.kind === 'Field'; } function isInlineFragment(selection) { return selection.kind === 'InlineFragment'; } function isIdValue(idObject) { return idObject && idObject.type === 'id' && typeof idObject.generated === 'boolean'; } function toIdValue(idConfig, generated) { if (generated === void 0) { generated = false; } return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({ type: 'id', generated: generated }, (typeof idConfig === 'string' ? { id: idConfig, typename: undefined } : idConfig)); } function isJsonValue(jsonObject) { return (jsonObject != null && typeof jsonObject === 'object' && jsonObject.type === 'json'); } function defaultValueFromVariable(node) { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Variable nodes are not supported by valueFromNode"); } function valueFromNode(node, onVariable) { if (onVariable === void 0) { onVariable = defaultValueFromVariable; } switch (node.kind) { case 'Variable': return onVariable(node); case 'NullValue': return null; case 'IntValue': return parseInt(node.value, 10); case 'FloatValue': return parseFloat(node.value); case 'ListValue': return node.values.map(function (v) { return valueFromNode(v, onVariable); }); case 'ObjectValue': { var value = {}; for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { var field = _a[_i]; value[field.name.value] = valueFromNode(field.value, onVariable); } return value; } default: return node.value; } } function getDirectiveInfoFromField(field, variables) { if (field.directives && field.directives.length) { var directiveObj_1 = {}; field.directives.forEach(function (directive) { directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables); }); return directiveObj_1; } return null; } function shouldInclude(selection, variables) { if (variables === void 0) { variables = {}; } return getInclusionDirectives(selection.directives).every(function (_a) { var directive = _a.directive, ifArgument = _a.ifArgument; var evaledValue = false; if (ifArgument.value.kind === 'Variable') { evaledValue = variables[ifArgument.value.name.value]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); } else { evaledValue = ifArgument.value.value; } return directive.name.value === 'skip' ? !evaledValue : evaledValue; }); } function getDirectiveNames(doc) { var names = []; (0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(doc, { Directive: function (node) { names.push(node.name.value); }, }); return names; } function hasDirectives(names, doc) { return getDirectiveNames(doc).some(function (name) { return names.indexOf(name) > -1; }); } function hasClientExports(document) { return (document && hasDirectives(['client'], document) && hasDirectives(['export'], document)); } function isInclusionDirective(_a) { var value = _a.name.value; return value === 'skip' || value === 'include'; } function getInclusionDirectives(directives) { return directives ? directives.filter(isInclusionDirective).map(function (directive) { var directiveArguments = directive.arguments; var directiveName = directive.name.value; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); var ifArgument = directiveArguments[0]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); var ifValue = ifArgument.value; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); return { directive: directive, ifArgument: ifArgument }; }) : []; } function getFragmentQueryDocument(document, fragmentName) { var actualFragmentName = fragmentName; var fragments = []; document.definitions.forEach(function (definition) { if (definition.kind === 'OperationDefinition') { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); } if (definition.kind === 'FragmentDefinition') { fragments.push(definition); } }); if (typeof actualFragmentName === 'undefined') { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); actualFragmentName = fragments[0].name.value; } var query = (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, document), { definitions: (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__spreadArrays)([ { kind: 'OperationDefinition', operation: 'query', selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'FragmentSpread', name: { kind: 'Name', value: actualFragmentName, }, }, ], }, } ], document.definitions) }); return query; } function assign(target) { var sources = []; for (var _i = 1; _i < arguments.length; _i++) { sources[_i - 1] = arguments[_i]; } sources.forEach(function (source) { if (typeof source === 'undefined' || source === null) { return; } Object.keys(source).forEach(function (key) { target[key] = source[key]; }); }); return target; } function getMutationDefinition(doc) { checkDocument(doc); var mutationDef = doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition' && definition.operation === 'mutation'; })[0]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(mutationDef, 'Must contain a mutation definition.'); return mutationDef; } function checkDocument(doc) { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); var operations = doc.definitions .filter(function (d) { return d.kind !== 'FragmentDefinition'; }) .map(function (definition) { if (definition.kind !== 'OperationDefinition') { throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); } return definition; }); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); return doc; } function getOperationDefinition(doc) { checkDocument(doc); return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0]; } function getOperationDefinitionOrDie(document) { var def = getOperationDefinition(document); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(def, "GraphQL document is missing an operation"); return def; } function getOperationName(doc) { return (doc.definitions .filter(function (definition) { return definition.kind === 'OperationDefinition' && definition.name; }) .map(function (x) { return x.name.value; })[0] || null); } function getFragmentDefinitions(doc) { return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; }); } function getQueryDefinition(doc) { var queryDef = getOperationDefinition(doc); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); return queryDef; } function getFragmentDefinition(doc) { false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); var fragmentDef = doc.definitions[0]; false ? 0 : (0,ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant)(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); return fragmentDef; } function getMainDefinition(queryDoc) { checkDocument(queryDoc); var fragmentDefinition; for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { var definition = _a[_i]; if (definition.kind === 'OperationDefinition') { var operation = definition.operation; if (operation === 'query' || operation === 'mutation' || operation === 'subscription') { return definition; } } if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { fragmentDefinition = definition; } } if (fragmentDefinition) { return fragmentDefinition; } throw false ? 0 : new ts_invariant__WEBPACK_IMPORTED_MODULE_0__.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); } function createFragmentMap(fragments) { if (fragments === void 0) { fragments = []; } var symTable = {}; fragments.forEach(function (fragment) { symTable[fragment.name.value] = fragment; }); return symTable; } function getDefaultValues(definition) { if (definition && definition.variableDefinitions && definition.variableDefinitions.length) { var defaultValues = definition.variableDefinitions .filter(function (_a) { var defaultValue = _a.defaultValue; return defaultValue; }) .map(function (_a) { var variable = _a.variable, defaultValue = _a.defaultValue; var defaultValueObj = {}; valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); return defaultValueObj; }); return assign.apply(void 0, (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__spreadArrays)([{}], defaultValues)); } return {}; } function variablesInOperation(operation) { var names = new Set(); if (operation.variableDefinitions) { for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { var definition = _a[_i]; names.add(definition.variable.name.value); } } return names; } function filterInPlace(array, test, context) { var target = 0; array.forEach(function (elem, i) { if (test.call(this, elem, i, array)) { array[target++] = elem; } }, context); array.length = target; return array; } var TYPENAME_FIELD = { kind: 'Field', name: { kind: 'Name', value: '__typename', }, }; function isEmpty(op, fragments) { return op.selectionSet.selections.every(function (selection) { return selection.kind === 'FragmentSpread' && isEmpty(fragments[selection.name.value], fragments); }); } function nullIfDocIsEmpty(doc) { return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc))) ? null : doc; } function getDirectiveMatcher(directives) { return function directiveMatcher(directive) { return directives.some(function (dir) { return (dir.name && dir.name === directive.name.value) || (dir.test && dir.test(directive)); }); }; } function removeDirectivesFromDocument(directives, doc) { var variablesInUse = Object.create(null); var variablesToRemove = []; var fragmentSpreadsInUse = Object.create(null); var fragmentSpreadsToRemove = []; var modifiedDoc = nullIfDocIsEmpty((0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(doc, { Variable: { enter: function (node, _key, parent) { if (parent.kind !== 'VariableDefinition') { variablesInUse[node.name.value] = true; } }, }, Field: { enter: function (node) { if (directives && node.directives) { var shouldRemoveField = directives.some(function (directive) { return directive.remove; }); if (shouldRemoveField && node.directives && node.directives.some(getDirectiveMatcher(directives))) { if (node.arguments) { node.arguments.forEach(function (arg) { if (arg.value.kind === 'Variable') { variablesToRemove.push({ name: arg.value.name.value, }); } }); } if (node.selectionSet) { getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { fragmentSpreadsToRemove.push({ name: frag.name.value, }); }); } return null; } } }, }, FragmentSpread: { enter: function (node) { fragmentSpreadsInUse[node.name.value] = true; }, }, Directive: { enter: function (node) { if (getDirectiveMatcher(directives)(node)) { return null; } }, }, })); if (modifiedDoc && filterInPlace(variablesToRemove, function (v) { return !variablesInUse[v.name]; }).length) { modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); } if (modifiedDoc && filterInPlace(fragmentSpreadsToRemove, function (fs) { return !fragmentSpreadsInUse[fs.name]; }) .length) { modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); } return modifiedDoc; } function addTypenameToDocument(doc) { return (0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(checkDocument(doc), { SelectionSet: { enter: function (node, _key, parent) { if (parent && parent.kind === 'OperationDefinition') { return; } var selections = node.selections; if (!selections) { return; } var skip = selections.some(function (selection) { return (isField(selection) && (selection.name.value === '__typename' || selection.name.value.lastIndexOf('__', 0) === 0)); }); if (skip) { return; } var field = parent; if (isField(field) && field.directives && field.directives.some(function (d) { return d.name.value === 'export'; })) { return; } return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, node), { selections: (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__spreadArrays)(selections, [TYPENAME_FIELD]) }); }, }, }); } var connectionRemoveConfig = { test: function (directive) { var willRemove = directive.name.value === 'connection'; if (willRemove) { if (!directive.arguments || !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) { false || ts_invariant__WEBPACK_IMPORTED_MODULE_0__.invariant.warn('Removing an @connection directive even though it does not have a key. ' + 'You may want to use the key parameter to specify a store key.'); } } return willRemove; }, }; function removeConnectionDirectiveFromDocument(doc) { return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc)); } function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { if (nestedCheck === void 0) { nestedCheck = true; } return (selectionSet && selectionSet.selections && selectionSet.selections.some(function (selection) { return hasDirectivesInSelection(directives, selection, nestedCheck); })); } function hasDirectivesInSelection(directives, selection, nestedCheck) { if (nestedCheck === void 0) { nestedCheck = true; } if (!isField(selection)) { return true; } if (!selection.directives) { return false; } return (selection.directives.some(getDirectiveMatcher(directives)) || (nestedCheck && hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck))); } function getDirectivesFromDocument(directives, doc) { checkDocument(doc); var parentPath; return nullIfDocIsEmpty((0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(doc, { SelectionSet: { enter: function (node, _key, _parent, path) { var currentPath = path.join('-'); if (!parentPath || currentPath === parentPath || !currentPath.startsWith(parentPath)) { if (node.selections) { var selectionsWithDirectives = node.selections.filter(function (selection) { return hasDirectivesInSelection(directives, selection); }); if (hasDirectivesInSelectionSet(directives, node, false)) { parentPath = currentPath; } return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, node), { selections: selectionsWithDirectives }); } else { return null; } } }, }, })); } function getArgumentMatcher(config) { return function argumentMatcher(argument) { return config.some(function (aConfig) { return argument.value && argument.value.kind === 'Variable' && argument.value.name && (aConfig.name === argument.value.name.value || (aConfig.test && aConfig.test(argument))); }); }; } function removeArgumentsFromDocument(config, doc) { var argMatcher = getArgumentMatcher(config); return nullIfDocIsEmpty((0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(doc, { OperationDefinition: { enter: function (node) { return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) { return !config.some(function (arg) { return arg.name === varDef.variable.name.value; }); }) }); }, }, Field: { enter: function (node) { var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; }); if (shouldRemoveField) { var argMatchCount_1 = 0; node.arguments.forEach(function (arg) { if (argMatcher(arg)) { argMatchCount_1 += 1; } }); if (argMatchCount_1 === 1) { return null; } } }, }, Argument: { enter: function (node) { if (argMatcher(node)) { return null; } }, }, })); } function removeFragmentSpreadFromDocument(config, doc) { function enter(node) { if (config.some(function (def) { return def.name === node.name.value; })) { return null; } } return nullIfDocIsEmpty((0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(doc, { FragmentSpread: { enter: enter }, FragmentDefinition: { enter: enter }, })); } function getAllFragmentSpreadsFromSelectionSet(selectionSet) { var allFragments = []; selectionSet.selections.forEach(function (selection) { if ((isField(selection) || isInlineFragment(selection)) && selection.selectionSet) { getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); }); } else if (selection.kind === 'FragmentSpread') { allFragments.push(selection); } }); return allFragments; } function buildQueryFromSelectionSet(document) { var definition = getMainDefinition(document); var definitionOperation = definition.operation; if (definitionOperation === 'query') { return document; } var modifiedDoc = (0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(document, { OperationDefinition: { enter: function (node) { return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, node), { operation: 'query' }); }, }, }); return modifiedDoc; } function removeClientSetsFromDocument(document) { checkDocument(document); var modifiedDoc = removeDirectivesFromDocument([ { test: function (directive) { return directive.name.value === 'client'; }, remove: true, }, ], document); if (modifiedDoc) { modifiedDoc = (0,graphql_language_visitor__WEBPACK_IMPORTED_MODULE_4__.visit)(modifiedDoc, { FragmentDefinition: { enter: function (node) { if (node.selectionSet) { var isTypenameOnly = node.selectionSet.selections.every(function (selection) { return isField(selection) && selection.name.value === '__typename'; }); if (isTypenameOnly) { return null; } } }, }, }); } return modifiedDoc; } var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && navigator.product === 'ReactNative'); var toString = Object.prototype.toString; function cloneDeep(value) { return cloneDeepHelper(value, new Map()); } function cloneDeepHelper(val, seen) { switch (toString.call(val)) { case "[object Array]": { if (seen.has(val)) return seen.get(val); var copy_1 = val.slice(0); seen.set(val, copy_1); copy_1.forEach(function (child, i) { copy_1[i] = cloneDeepHelper(child, seen); }); return copy_1; } case "[object Object]": { if (seen.has(val)) return seen.get(val); var copy_2 = Object.create(Object.getPrototypeOf(val)); seen.set(val, copy_2); Object.keys(val).forEach(function (key) { copy_2[key] = cloneDeepHelper(val[key], seen); }); return copy_2; } default: return val; } } function getEnv() { if (typeof process !== 'undefined' && "development") { return "development"; } return 'development'; } function isEnv(env) { return getEnv() === env; } function isProduction() { return isEnv('production') === true; } function isDevelopment() { return isEnv('development') === true; } function isTest() { return isEnv('test') === true; } function tryFunctionOrLogError(f) { try { return f(); } catch (e) { if (console.error) { console.error(e); } } } function graphQLResultHasError(result) { return result.errors && result.errors.length; } function deepFreeze(o) { Object.freeze(o); Object.getOwnPropertyNames(o).forEach(function (prop) { if (o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop])) { deepFreeze(o[prop]); } }); return o; } function maybeDeepFreeze(obj) { if (isDevelopment() || isTest()) { var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; if (!symbolIsPolyfilled) { return deepFreeze(obj); } } return obj; } var hasOwnProperty = Object.prototype.hasOwnProperty; function mergeDeep() { var sources = []; for (var _i = 0; _i < arguments.length; _i++) { sources[_i] = arguments[_i]; } return mergeDeepArray(sources); } function mergeDeepArray(sources) { var target = sources[0] || {}; var count = sources.length; if (count > 1) { var pastCopies = []; target = shallowCopyForMerge(target, pastCopies); for (var i = 1; i < count; ++i) { target = mergeHelper(target, sources[i], pastCopies); } } return target; } function isObject(obj) { return obj !== null && typeof obj === 'object'; } function mergeHelper(target, source, pastCopies) { if (isObject(source) && isObject(target)) { if (Object.isExtensible && !Object.isExtensible(target)) { target = shallowCopyForMerge(target, pastCopies); } Object.keys(source).forEach(function (sourceKey) { var sourceValue = source[sourceKey]; if (hasOwnProperty.call(target, sourceKey)) { var targetValue = target[sourceKey]; if (sourceValue !== targetValue) { target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); } } else { target[sourceKey] = sourceValue; } }); return target; } return source; } function shallowCopyForMerge(value, pastCopies) { if (value !== null && typeof value === 'object' && pastCopies.indexOf(value) < 0) { if (Array.isArray(value)) { value = value.slice(0); } else { value = (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({ __proto__: Object.getPrototypeOf(value) }, value); } pastCopies.push(value); } return value; } var haveWarned = Object.create({}); function warnOnceInDevelopment(msg, type) { if (type === void 0) { type = 'warn'; } if (!isProduction() && !haveWarned[msg]) { if (!isTest()) { haveWarned[msg] = true; } if (type === 'error') { console.error(msg); } else { console.warn(msg); } } } function stripSymbols(data) { return JSON.parse(JSON.stringify(data)); } //# sourceMappingURL=bundle.esm.js.map /***/ }), /***/ "./node_modules/apollo-utilities/node_modules/@wry/equality/lib/equality.esm.js": /*!**************************************************************************************!*\ !*** ./node_modules/apollo-utilities/node_modules/@wry/equality/lib/equality.esm.js ***! \**************************************************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! export equal [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ /***/ ((__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 */ "equal": () => /* binding */ equal /* harmony export */ }); var _a = Object.prototype, toString = _a.toString, hasOwnProperty = _a.hasOwnProperty; var previousComparisons = new Map(); /** * Performs a deep equality check on two JavaScript values, tolerating cycles. */ function equal(a, b) { try { return check(a, b); } finally { previousComparisons.clear(); } } function check(a, b) { // If the two values are strictly equal, our job is easy. if (a === b) { return true; } // Object.prototype.toString returns a representation of the runtime type of // the given value that is considerably more precise than typeof. var aTag = toString.call(a); var bTag = toString.call(b); // If the runtime types of a and b are different, they could maybe be equal // under some interpretation of equality, but for simplicity and performance // we just return false instead. if (aTag !== bTag) { return false; } switch (aTag) { case '[object Array]': // Arrays are a lot like other objects, but we can cheaply compare their // lengths as a short-cut before comparing their elements. if (a.length !== b.length) return false; // Fall through to object case... case '[object Object]': { if (previouslyCompared(a, b)) return true; var aKeys = Object.keys(a); var bKeys = Object.keys(b); // If `a` and `b` have a different number of enumerable keys, they // must be different. var keyCount = aKeys.length; if (keyCount !== bKeys.length) return false; // Now make sure they have the same keys. for (var k = 0; k < keyCount; ++k) { if (!hasOwnProperty.call(b, aKeys[k])) { return false; } } // Finally, check deep equality of all child properties. for (var k = 0; k < keyCount; ++k) { var key = aKeys[k]; if (!check(a[key], b[key])) { return false; } } return true; } case '[object Error]': return a.name === b.name && a.message === b.message; case '[object Number]': // Handle NaN, which is !== itself. if (a !== a) return b !== b; // Fall through to shared +a === +b case... case '[object Boolean]': case '[object Date]': return +a === +b; case '[object RegExp]': case '[object String]': return a == "" + b; case '[object Map]': case '[object Set]': { if (a.size !== b.size) return false; if (previouslyCompared(a, b)) return true; var aIterator = a.entries(); var isMap = aTag === '[object Map]'; while (true) { var info = aIterator.next(); if (info.done) break; // If a instanceof Set, aValue === aKey. var _a = info.value, aKey = _a[0], aValue = _a[1]; // So this works the same way for both Set and Map. if (!b.has(aKey)) { return false; } // However, we care about deep equality of values only when dealing // with Map structures. if (isMap && !check(aValue, b.get(aKey))) { return false; } } return true; } } // Otherwise the values are not equal. return false; } function previouslyCompared(a, b) { // Though cyclic references can make an object graph appear infinite from the // perspective of a depth-first traversal, the graph still contains a finite // number of distinct object references. We use the previousComparisons cache // to avoid comparing the same pair of object references more than once, which // guarantees termination (even if we end up comparing every object in one // graph to every object in the other graph, which is extremely unlikely), // while still allowing weird isomorphic structures (like rings with different // lengths) a chance to pass the equality test. var bSet = previousComparisons.get(a); if (bSet) { // Return true here because we can be sure false will be returned somewhere // else if the objects are not equivalent. if (bSet.has(b)) return true; } else { previousComparisons.set(a, bSet = new Set); } bSet.add(b); return false; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (equal); //# sourceMappingURL=equality.esm.js.map /***/ }), /***/ "./node_modules/apollo-utilities/node_modules/ts-invariant/lib/invariant.esm.js": /*!**************************************************************************************!*\ !*** ./node_modules/apollo-utilities/node_modules/ts-invariant/lib/invariant.esm.js ***! \**************************************************************************************/ /*! namespace exports */ /*! export InvariantError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! export invariant [provided] [no usage info] [missing usage info prevents renaming] */ /*! export process [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ /***/ ((__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 */ "InvariantError": () => /* binding */ InvariantError, /* harmony export */ "invariant": () => /* binding */ invariant, /* harmony export */ "process": () => /* binding */ processStub /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); ; var genericMessage = "Invariant Violation"; var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { obj.__proto__ = proto; return obj; } : _a; var InvariantError = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(InvariantError, _super); function InvariantError(message) { if (message === void 0) { message = genericMessage; } var _this = _super.call(this, typeof message === "number" ? genericMessage + ": " + message + " (see https://github.com/apollographql/invariant-packages)" : message) || this; _this.framesToPop = 1; _this.name = genericMessage; setPrototypeOf(_this, InvariantError.prototype); return _this; } return InvariantError; }(Error)); function invariant(condition, message) { if (!condition) { throw new InvariantError(message); } } function wrapConsoleMethod(method) { return function () { return console[method].apply(console, arguments); }; } (function (invariant) { invariant.warn = wrapConsoleMethod("warn"); invariant.error = wrapConsoleMethod("error"); })(invariant || (invariant = {})); // Code that uses ts-invariant with rollup-plugin-invariant may want to // import this process stub to avoid errors evaluating process.env.NODE_ENV. // However, because most ESM-to-CJS compilers will rewrite the process import // as tsInvariant.process, which prevents proper replacement by minifiers, we // also attempt to define the stub globally when it is not already defined. var processStub = { env: {} }; if (typeof process === "object") { processStub = process; } else try { // Using Function to evaluate this assignment in global scope also escapes // the strict mode of the current module, thereby allowing the assignment. // Inspired by https://github.com/facebook/regenerator/pull/369. Function("stub", "process = stub")(processStub); } catch (atLeastWeTried) { // The assignment can fail if a Content Security Policy heavy-handedly // forbids Function usage. In those environments, developers should take // extra care to replace process.env.NODE_ENV in their production builds, // or define an appropriate global.process polyfill. } var invariant$1 = invariant; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (invariant$1); //# sourceMappingURL=invariant.esm.js.map /***/ }), /***/ "./node_modules/fast-json-stable-stringify/index.js": /*!**********************************************************!*\ !*** ./node_modules/fast-json-stable-stringify/index.js ***! \**********************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module */ /*! CommonJS bailout: module.exports is used directly at 3:0-14 */ /***/ ((module) => { "use strict"; module.exports = function (data, opts) { if (!opts) opts = {}; if (typeof opts === 'function') opts = { cmp: opts }; var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; var cmp = opts.cmp && (function (f) { return function (node) { return function (a, b) { var aobj = { key: a, value: node[a] }; var bobj = { key: b, value: node[b] }; return f(aobj, bobj); }; }; })(opts.cmp); var seen = []; return (function stringify (node) { if (node && node.toJSON && typeof node.toJSON === 'function') { node = node.toJSON(); } if (node === undefined) return; if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; if (typeof node !== 'object') return JSON.stringify(node); var i, out; if (Array.isArray(node)) { out = '['; for (i = 0; i < node.length; i++) { if (i) out += ','; out += stringify(node[i]) || 'null'; } return out + ']'; } if (node === null) return 'null'; if (seen.indexOf(node) !== -1) { if (cycles) return JSON.stringify('__cycle__'); throw new TypeError('Converting circular structure to JSON'); } var seenIndex = seen.push(node) - 1; var keys = Object.keys(node).sort(cmp && cmp(node)); out = ''; for (i = 0; i < keys.length; i++) { var key = keys[i]; var value = stringify(node[key]); if (!value) continue; if (out) out += ','; out += JSON.stringify(key) + ':' + value; } seen.splice(seenIndex, 1); return '{' + out + '}'; })(data); }; /***/ }), /***/ "./node_modules/graphql-ruby-client/dist/subscriptions/ActionCableLink.js": /*!********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/dist/subscriptions/ActionCableLink.js ***! \********************************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: top-level-this-exports, __webpack_exports__, __webpack_require__ */ /*! CommonJS bailout: this is used directly at 2:17-21 */ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { 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); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); var apollo_link_1 = __webpack_require__(/*! apollo-link */ "./node_modules/apollo-link/lib/bundle.esm.js"); var graphql_1 = __webpack_require__(/*! graphql */ "./node_modules/graphql-ruby-client/node_modules/graphql/index.mjs"); var ActionCableLink = /** @class */ (function (_super) { __extends(ActionCableLink, _super); function ActionCableLink(options) { var _this = _super.call(this) || this; _this.cable = options.cable; _this.channelName = options.channelName || "GraphqlChannel"; _this.actionName = options.actionName || "execute"; _this.connectionParams = options.connectionParams || {}; return _this; } // Interestingly, this link does _not_ call through to `next` because // instead, it sends the request to ActionCable. ActionCableLink.prototype.request = function (operation, _next) { var _this = this; return new apollo_link_1.Observable(function (observer) { var channelId = Math.round(Date.now() + Math.random() * 100000).toString(16); var actionName = _this.actionName; var subscription = _this.cable.subscriptions.create(Object.assign({}, { channel: _this.channelName, channelId: channelId }, _this.connectionParams), { connected: function () { this.perform(actionName, { query: operation.query ? graphql_1.print(operation.query) : null, variables: operation.variables, // This is added for persisted operation support: operationId: operation.operationId, operationName: operation.operationName }); }, received: function (payload) { if (payload.result.data || payload.result.errors) { observer.next(payload.result); } if (!payload.more) { observer.complete(); } } }); // Make the ActionCable subscription behave like an Apollo subscription return Object.assign(subscription, { closed: false }); }); }; return ActionCableLink; }(apollo_link_1.ApolloLink)); exports.default = ActionCableLink; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export GraphQLError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GraphQLError = GraphQLError; exports.printError = printError; var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _location = __webpack_require__(/*! ../language/location */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/location.js"); var _printLocation = __webpack_require__(/*! ../language/printLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printLocation.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function GraphQLError( // eslint-disable-line no-redeclare message, nodes, source, positions, path, originalError, extensions) { // Compute list of blame nodes. var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions. var _source = source; if (!_source && _nodes) { var node = _nodes[0]; _source = node && node.loc && node.loc.source; } var _positions = positions; if (!_positions && _nodes) { _positions = _nodes.reduce(function (list, node) { if (node.loc) { list.push(node.loc.start); } return list; }, []); } if (_positions && _positions.length === 0) { _positions = undefined; } var _locations; if (positions && source) { _locations = positions.map(function (pos) { return (0, _location.getLocation)(source, pos); }); } else if (_nodes) { _locations = _nodes.reduce(function (list, node) { if (node.loc) { list.push((0, _location.getLocation)(node.loc.source, node.loc.start)); } return list; }, []); } var _extensions = extensions; if (_extensions == null && originalError != null) { var originalExtensions = originalError.extensions; if ((0, _isObjectLike.default)(originalExtensions)) { _extensions = originalExtensions; } } Object.defineProperties(this, { message: { value: message, // By being enumerable, JSON.stringify will include `message` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: true, writable: true }, locations: { // Coercing falsey values to undefined ensures they will not be included // in JSON.stringify() when not provided. value: _locations || undefined, // By being enumerable, JSON.stringify will include `locations` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: Boolean(_locations) }, path: { // Coercing falsey values to undefined ensures they will not be included // in JSON.stringify() when not provided. value: path || undefined, // By being enumerable, JSON.stringify will include `path` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: Boolean(path) }, nodes: { value: _nodes || undefined }, source: { value: _source || undefined }, positions: { value: _positions || undefined }, originalError: { value: originalError }, extensions: { // Coercing falsey values to undefined ensures they will not be included // in JSON.stringify() when not provided. value: _extensions || undefined, // By being enumerable, JSON.stringify will include `path` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: Boolean(_extensions) } }); // Include (non-enumerable) stack trace. if (originalError && originalError.stack) { Object.defineProperty(this, 'stack', { value: originalError.stack, writable: true, configurable: true }); } else if (Error.captureStackTrace) { Error.captureStackTrace(this, GraphQLError); } else { Object.defineProperty(this, 'stack', { value: Error().stack, writable: true, configurable: true }); } } GraphQLError.prototype = Object.create(Error.prototype, { constructor: { value: GraphQLError }, name: { value: 'GraphQLError' }, toString: { value: function toString() { return printError(this); } } }); /** * Prints a GraphQLError to a string, representing useful location information * about the error's position in the source. */ function printError(error) { var output = error.message; if (error.nodes) { for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) { var node = _error$nodes2[_i2]; if (node.loc) { output += '\n\n' + (0, _printLocation.printLocation)(node.loc); } } } else if (error.source && error.locations) { for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) { var location = _error$locations2[_i4]; output += '\n\n' + (0, _printLocation.printSourceLocation)(error.source, location); } } return output; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/error/formatError.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/error/formatError.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export formatError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.formatError = formatError; var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Given a GraphQLError, format it according to the rules described by the * Response Format, Errors section of the GraphQL Specification. */ function formatError(error) { error || (0, _devAssert.default)(0, 'Received null or undefined error.'); var message = error.message || 'An unknown error occurred.'; var locations = error.locations; var path = error.path; var extensions = error.extensions; return extensions ? { message: message, locations: locations, path: path, extensions: extensions } : { message: message, locations: locations, path: path }; } /** * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors */ /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js": /*!******************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js ***! \******************************************************************************/ /*! flagged exports */ /*! export GraphQLError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export formatError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export locatedError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export syntaxError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "GraphQLError", ({ enumerable: true, get: function get() { return _GraphQLError.GraphQLError; } })); Object.defineProperty(exports, "printError", ({ enumerable: true, get: function get() { return _GraphQLError.printError; } })); Object.defineProperty(exports, "syntaxError", ({ enumerable: true, get: function get() { return _syntaxError.syntaxError; } })); Object.defineProperty(exports, "locatedError", ({ enumerable: true, get: function get() { return _locatedError.locatedError; } })); Object.defineProperty(exports, "formatError", ({ enumerable: true, get: function get() { return _formatError.formatError; } })); var _GraphQLError = __webpack_require__(/*! ./GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _syntaxError = __webpack_require__(/*! ./syntaxError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/syntaxError.js"); var _locatedError = __webpack_require__(/*! ./locatedError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/locatedError.js"); var _formatError = __webpack_require__(/*! ./formatError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/formatError.js"); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/error/locatedError.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/error/locatedError.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export locatedError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.locatedError = locatedError; var _GraphQLError = __webpack_require__(/*! ./GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); /** * Given an arbitrary Error, presumably thrown while attempting to execute a * GraphQL operation, produce a new GraphQLError aware of the location in the * document responsible for the original Error. */ function locatedError(originalError, nodes, path) { // Note: this uses a brand-check to support GraphQL errors originating from // other contexts. if (originalError && Array.isArray(originalError.path)) { return originalError; } return new _GraphQLError.GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/error/syntaxError.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/error/syntaxError.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export syntaxError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.syntaxError = syntaxError; var _GraphQLError = __webpack_require__(/*! ./GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); /** * Produces a GraphQLError representing a syntax error, containing useful * descriptive information about the syntax error's position in the source. */ function syntaxError(source, position, description) { return new _GraphQLError.GraphQLError("Syntax Error: ".concat(description), undefined, source, [position]); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/execute.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/execution/execute.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertValidExecutionArguments [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildExecutionContext [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildResolveInfo [provided] [no usage info] [missing usage info prevents renaming] */ /*! export collectFields [provided] [no usage info] [missing usage info prevents renaming] */ /*! export defaultFieldResolver [provided] [no usage info] [missing usage info prevents renaming] */ /*! export defaultTypeResolver [provided] [no usage info] [missing usage info prevents renaming] */ /*! export execute [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getFieldDef [provided] [no usage info] [missing usage info prevents renaming] */ /*! export resolveFieldValueOrError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.execute = execute; exports.assertValidExecutionArguments = assertValidExecutionArguments; exports.buildExecutionContext = buildExecutionContext; exports.collectFields = collectFields; exports.buildResolveInfo = buildResolveInfo; exports.resolveFieldValueOrError = resolveFieldValueOrError; exports.getFieldDef = getFieldDef; exports.defaultFieldResolver = exports.defaultTypeResolver = void 0; var _iterall = __webpack_require__(/*! iterall */ "./node_modules/iterall/index.mjs"); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _memoize = _interopRequireDefault(__webpack_require__(/*! ../jsutils/memoize3 */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/memoize3.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _isInvalid = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isInvalid */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isInvalid.js")); var _isNullish = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isNullish */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isNullish.js")); var _isPromise = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isPromise */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isPromise.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _promiseReduce = _interopRequireDefault(__webpack_require__(/*! ../jsutils/promiseReduce */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/promiseReduce.js")); var _promiseForObject = _interopRequireDefault(__webpack_require__(/*! ../jsutils/promiseForObject */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/promiseForObject.js")); var _Path = __webpack_require__(/*! ../jsutils/Path */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/Path.js"); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _locatedError = __webpack_require__(/*! ../error/locatedError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/locatedError.js"); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _validate = __webpack_require__(/*! ../type/validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/validate.js"); var _introspection = __webpack_require__(/*! ../type/introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _directives = __webpack_require__(/*! ../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _typeFromAST = __webpack_require__(/*! ../utilities/typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); var _getOperationRootType = __webpack_require__(/*! ../utilities/getOperationRootType */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationRootType.js"); var _values = __webpack_require__(/*! ./values */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/values.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function execute(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { /* eslint-enable no-redeclare */ // Extract arguments from object args if provided. return arguments.length === 1 ? executeImpl(argsOrSchema) : executeImpl({ schema: argsOrSchema, document: document, rootValue: rootValue, contextValue: contextValue, variableValues: variableValues, operationName: operationName, fieldResolver: fieldResolver, typeResolver: typeResolver }); } function executeImpl(args) { var schema = args.schema, document = args.document, rootValue = args.rootValue, contextValue = args.contextValue, variableValues = args.variableValues, operationName = args.operationName, fieldResolver = args.fieldResolver, typeResolver = args.typeResolver; // If arguments are missing or incorrect, throw an error. assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, // a "Response" with only errors is returned. var exeContext = buildExecutionContext(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver); // Return early errors if execution context failed. if (Array.isArray(exeContext)) { return { errors: exeContext }; } // Return a Promise that will eventually resolve to the data described by // The "Response" section of the GraphQL specification. // // If errors are encountered while executing a GraphQL field, only that // field and its descendants will be omitted, and sibling fields will still // be executed. An execution which encounters errors will still result in a // resolved Promise. var data = executeOperation(exeContext, exeContext.operation, rootValue); return buildResponse(exeContext, data); } /** * Given a completed execution context and data, build the { errors, data } * response defined by the "Response" section of the GraphQL specification. */ function buildResponse(exeContext, data) { if ((0, _isPromise.default)(data)) { return data.then(function (resolved) { return buildResponse(exeContext, resolved); }); } return exeContext.errors.length === 0 ? { data: data } : { errors: exeContext.errors, data: data }; } /** * Essential assertions before executing to provide developer feedback for * improper use of the GraphQL library. */ function assertValidExecutionArguments(schema, document, rawVariableValues) { document || (0, _devAssert.default)(0, 'Must provide document'); // If the schema used for execution is invalid, throw an error. (0, _validate.assertValidSchema)(schema); // Variables, if provided, must be an object. rawVariableValues == null || (0, _isObjectLike.default)(rawVariableValues) || (0, _devAssert.default)(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.'); } /** * Constructs a ExecutionContext object from the arguments passed to * execute, which we will pass throughout the other execution methods. * * Throws a GraphQLError if a valid execution context cannot be created. */ function buildExecutionContext(schema, document, rootValue, contextValue, rawVariableValues, operationName, fieldResolver, typeResolver) { var operation; var hasMultipleAssumedOperations = false; var fragments = Object.create(null); for (var _i2 = 0, _document$definitions2 = document.definitions; _i2 < _document$definitions2.length; _i2++) { var definition = _document$definitions2[_i2]; switch (definition.kind) { case _kinds.Kind.OPERATION_DEFINITION: if (!operationName && operation) { hasMultipleAssumedOperations = true; } else if (!operationName || definition.name && definition.name.value === operationName) { operation = definition; } break; case _kinds.Kind.FRAGMENT_DEFINITION: fragments[definition.name.value] = definition; break; } } if (!operation) { if (operationName) { return [new _GraphQLError.GraphQLError("Unknown operation named \"".concat(operationName, "\"."))]; } return [new _GraphQLError.GraphQLError('Must provide an operation.')]; } if (hasMultipleAssumedOperations) { return [new _GraphQLError.GraphQLError('Must provide operation name if query contains multiple operations.')]; } var coercedVariableValues = (0, _values.getVariableValues)(schema, operation.variableDefinitions || [], rawVariableValues || {}, { maxErrors: 50 }); if (coercedVariableValues.errors) { return coercedVariableValues.errors; } return { schema: schema, fragments: fragments, rootValue: rootValue, contextValue: contextValue, operation: operation, variableValues: coercedVariableValues.coerced, fieldResolver: fieldResolver || defaultFieldResolver, typeResolver: typeResolver || defaultTypeResolver, errors: [] }; } /** * Implements the "Evaluating operations" section of the spec. */ function executeOperation(exeContext, operation, rootValue) { var type = (0, _getOperationRootType.getOperationRootType)(exeContext.schema, operation); var fields = collectFields(exeContext, type, operation.selectionSet, Object.create(null), Object.create(null)); var path = undefined; // Errors from sub-fields of a NonNull type may propagate to the top level, // at which point we still log the error and null the parent field, which // in this case is the entire response. // // Similar to completeValueCatchingError. try { var result = operation.operation === 'mutation' ? executeFieldsSerially(exeContext, type, rootValue, path, fields) : executeFields(exeContext, type, rootValue, path, fields); if ((0, _isPromise.default)(result)) { return result.then(undefined, function (error) { exeContext.errors.push(error); return Promise.resolve(null); }); } return result; } catch (error) { exeContext.errors.push(error); return null; } } /** * Implements the "Evaluating selection sets" section of the spec * for "write" mode. */ function executeFieldsSerially(exeContext, parentType, sourceValue, path, fields) { return (0, _promiseReduce.default)(Object.keys(fields), function (results, responseName) { var fieldNodes = fields[responseName]; var fieldPath = (0, _Path.addPath)(path, responseName); var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); if (result === undefined) { return results; } if ((0, _isPromise.default)(result)) { return result.then(function (resolvedResult) { results[responseName] = resolvedResult; return results; }); } results[responseName] = result; return results; }, Object.create(null)); } /** * Implements the "Evaluating selection sets" section of the spec * for "read" mode. */ function executeFields(exeContext, parentType, sourceValue, path, fields) { var results = Object.create(null); var containsPromise = false; for (var _i4 = 0, _Object$keys2 = Object.keys(fields); _i4 < _Object$keys2.length; _i4++) { var responseName = _Object$keys2[_i4]; var fieldNodes = fields[responseName]; var fieldPath = (0, _Path.addPath)(path, responseName); var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); if (result !== undefined) { results[responseName] = result; if (!containsPromise && (0, _isPromise.default)(result)) { containsPromise = true; } } } // If there are no promises, we can just return the object if (!containsPromise) { return results; } // Otherwise, results is a map from field name to the result of resolving that // field, which is possibly a promise. Return a promise that will return this // same map, but with any promises replaced with the values they resolved to. return (0, _promiseForObject.default)(results); } /** * Given a selectionSet, adds all of the fields in that selection to * the passed in map of fields, and returns it at the end. * * CollectFields requires the "runtime type" of an object. For a field which * returns an Interface or Union type, the "runtime type" will be the actual * Object type returned by that field. */ function collectFields(exeContext, runtimeType, selectionSet, fields, visitedFragmentNames) { for (var _i6 = 0, _selectionSet$selecti2 = selectionSet.selections; _i6 < _selectionSet$selecti2.length; _i6++) { var selection = _selectionSet$selecti2[_i6]; switch (selection.kind) { case _kinds.Kind.FIELD: { if (!shouldIncludeNode(exeContext, selection)) { continue; } var name = getFieldEntryKey(selection); if (!fields[name]) { fields[name] = []; } fields[name].push(selection); break; } case _kinds.Kind.INLINE_FRAGMENT: { if (!shouldIncludeNode(exeContext, selection) || !doesFragmentConditionMatch(exeContext, selection, runtimeType)) { continue; } collectFields(exeContext, runtimeType, selection.selectionSet, fields, visitedFragmentNames); break; } case _kinds.Kind.FRAGMENT_SPREAD: { var fragName = selection.name.value; if (visitedFragmentNames[fragName] || !shouldIncludeNode(exeContext, selection)) { continue; } visitedFragmentNames[fragName] = true; var fragment = exeContext.fragments[fragName]; if (!fragment || !doesFragmentConditionMatch(exeContext, fragment, runtimeType)) { continue; } collectFields(exeContext, runtimeType, fragment.selectionSet, fields, visitedFragmentNames); break; } } } return fields; } /** * Determines if a field should be included based on the @include and @skip * directives, where @skip has higher precedence than @include. */ function shouldIncludeNode(exeContext, node) { var skip = (0, _values.getDirectiveValues)(_directives.GraphQLSkipDirective, node, exeContext.variableValues); if (skip && skip.if === true) { return false; } var include = (0, _values.getDirectiveValues)(_directives.GraphQLIncludeDirective, node, exeContext.variableValues); if (include && include.if === false) { return false; } return true; } /** * Determines if a fragment is applicable to the given type. */ function doesFragmentConditionMatch(exeContext, fragment, type) { var typeConditionNode = fragment.typeCondition; if (!typeConditionNode) { return true; } var conditionalType = (0, _typeFromAST.typeFromAST)(exeContext.schema, typeConditionNode); if (conditionalType === type) { return true; } if ((0, _definition.isAbstractType)(conditionalType)) { return exeContext.schema.isPossibleType(conditionalType, type); } return false; } /** * Implements the logic to compute the key of a given field's entry */ function getFieldEntryKey(node) { return node.alias ? node.alias.value : node.name.value; } /** * Resolves the field on the given source object. In particular, this * figures out the value that the field returns by calling its resolve function, * then calls completeValue to complete promises, serialize scalars, or execute * the sub-selection-set for objects. */ function resolveField(exeContext, parentType, source, fieldNodes, path) { var fieldNode = fieldNodes[0]; var fieldName = fieldNode.name.value; var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); if (!fieldDef) { return; } var resolveFn = fieldDef.resolve || exeContext.fieldResolver; var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path); // Get the resolve function, regardless of if its result is normal // or abrupt (error). var result = resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info); return completeValueCatchingError(exeContext, fieldDef.type, fieldNodes, info, path, result); } function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) { // The resolve function's optional fourth argument is a collection of // information about the current execution state. return { fieldName: fieldDef.name, fieldNodes: fieldNodes, returnType: fieldDef.type, parentType: parentType, path: path, schema: exeContext.schema, fragments: exeContext.fragments, rootValue: exeContext.rootValue, operation: exeContext.operation, variableValues: exeContext.variableValues }; } // Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` // function. Returns the result of resolveFn or the abrupt-return Error object. function resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info) { try { // Build a JS object of arguments from the field.arguments AST, using the // variables scope to fulfill any variable references. // TODO: find a way to memoize, in case this field is within a List type. var args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], exeContext.variableValues); // The resolve function's optional third argument is a context value that // is provided to every resolve function within an execution. It is commonly // used to represent an authenticated user, or request-specific caches. var _contextValue = exeContext.contextValue; var result = resolveFn(source, args, _contextValue, info); return (0, _isPromise.default)(result) ? result.then(undefined, asErrorInstance) : result; } catch (error) { return asErrorInstance(error); } } // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a // consistent Error interface. function asErrorInstance(error) { if (error instanceof Error) { return error; } return new Error('Unexpected error value: ' + (0, _inspect.default)(error)); } // This is a small wrapper around completeValue which detects and logs errors // in the execution context. function completeValueCatchingError(exeContext, returnType, fieldNodes, info, path, result) { try { var completed; if ((0, _isPromise.default)(result)) { completed = result.then(function (resolved) { return completeValue(exeContext, returnType, fieldNodes, info, path, resolved); }); } else { completed = completeValue(exeContext, returnType, fieldNodes, info, path, result); } if ((0, _isPromise.default)(completed)) { // Note: we don't rely on a `catch` method, but we do expect "thenable" // to take a second callback for the error case. return completed.then(undefined, function (error) { return handleFieldError(error, fieldNodes, path, returnType, exeContext); }); } return completed; } catch (error) { return handleFieldError(error, fieldNodes, path, returnType, exeContext); } } function handleFieldError(rawError, fieldNodes, path, returnType, exeContext) { var error = (0, _locatedError.locatedError)(asErrorInstance(rawError), fieldNodes, (0, _Path.pathToArray)(path)); // If the field type is non-nullable, then it is resolved without any // protection from errors, however it still properly locates the error. if ((0, _definition.isNonNullType)(returnType)) { throw error; } // Otherwise, error protection is applied, logging the error and resolving // a null value for this field if one is encountered. exeContext.errors.push(error); return null; } /** * Implements the instructions for completeValue as defined in the * "Field entries" section of the spec. * * If the field type is Non-Null, then this recursively completes the value * for the inner type. It throws a field error if that completion returns null, * as per the "Nullability" section of the spec. * * If the field type is a List, then this recursively completes the value * for the inner type on each item in the list. * * If the field type is a Scalar or Enum, ensures the completed value is a legal * value of the type by calling the `serialize` method of GraphQL type * definition. * * If the field is an abstract type, determine the runtime type of the value * and then complete based on that type * * Otherwise, the field type expects a sub-selection set, and will complete the * value by evaluating all sub-selections. */ function completeValue(exeContext, returnType, fieldNodes, info, path, result) { // If result is an Error, throw a located error. if (result instanceof Error) { throw result; } // If field type is NonNull, complete for inner type, and throw field error // if result is null. if ((0, _definition.isNonNullType)(returnType)) { var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result); if (completed === null) { throw new Error("Cannot return null for non-nullable field ".concat(info.parentType.name, ".").concat(info.fieldName, ".")); } return completed; } // If result value is null-ish (null, undefined, or NaN) then return null. if ((0, _isNullish.default)(result)) { return null; } // If field type is List, complete each item in the list with the inner type if ((0, _definition.isListType)(returnType)) { return completeListValue(exeContext, returnType, fieldNodes, info, path, result); } // If field type is a leaf type, Scalar or Enum, serialize to a valid value, // returning null if serialization is not possible. if ((0, _definition.isLeafType)(returnType)) { return completeLeafValue(returnType, result); } // If field type is an abstract type, Interface or Union, determine the // runtime Object type and complete for that type. if ((0, _definition.isAbstractType)(returnType)) { return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result); } // If field type is Object, execute and complete all sub-selections. /* istanbul ignore else */ if ((0, _definition.isObjectType)(returnType)) { return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result); } // Not reachable. All possible output types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Cannot complete value of unexpected output type: ' + (0, _inspect.default)(returnType)); } /** * Complete a list value by completing each item in the list with the * inner type */ function completeListValue(exeContext, returnType, fieldNodes, info, path, result) { if (!(0, _iterall.isCollection)(result)) { throw new _GraphQLError.GraphQLError("Expected Iterable, but did not find one for field ".concat(info.parentType.name, ".").concat(info.fieldName, ".")); } // This is specified as a simple map, however we're optimizing the path // where the list contains no Promises by avoiding creating another Promise. var itemType = returnType.ofType; var containsPromise = false; var completedResults = []; (0, _iterall.forEach)(result, function (item, index) { // No need to modify the info object containing the path, // since from here on it is not ever accessed by resolver functions. var fieldPath = (0, _Path.addPath)(path, index); var completedItem = completeValueCatchingError(exeContext, itemType, fieldNodes, info, fieldPath, item); if (!containsPromise && (0, _isPromise.default)(completedItem)) { containsPromise = true; } completedResults.push(completedItem); }); return containsPromise ? Promise.all(completedResults) : completedResults; } /** * Complete a Scalar or Enum by serializing to a valid value, returning * null if serialization is not possible. */ function completeLeafValue(returnType, result) { var serializedResult = returnType.serialize(result); if ((0, _isInvalid.default)(serializedResult)) { throw new Error("Expected a value of type \"".concat((0, _inspect.default)(returnType), "\" but ") + "received: ".concat((0, _inspect.default)(result))); } return serializedResult; } /** * Complete a value of an abstract type by determining the runtime object type * of that value, then complete the value for that type. */ function completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result) { var resolveTypeFn = returnType.resolveType || exeContext.typeResolver; var contextValue = exeContext.contextValue; var runtimeType = resolveTypeFn(result, contextValue, info, returnType); if ((0, _isPromise.default)(runtimeType)) { return runtimeType.then(function (resolvedRuntimeType) { return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result); }); } return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result); } function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info, result) { var runtimeType = typeof runtimeTypeOrName === 'string' ? exeContext.schema.getType(runtimeTypeOrName) : runtimeTypeOrName; if (!(0, _definition.isObjectType)(runtimeType)) { throw new _GraphQLError.GraphQLError("Abstract type ".concat(returnType.name, " must resolve to an Object type at runtime for field ").concat(info.parentType.name, ".").concat(info.fieldName, " with ") + "value ".concat((0, _inspect.default)(result), ", received \"").concat((0, _inspect.default)(runtimeType), "\". ") + "Either the ".concat(returnType.name, " type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."), fieldNodes); } if (!exeContext.schema.isPossibleType(returnType, runtimeType)) { throw new _GraphQLError.GraphQLError("Runtime Object type \"".concat(runtimeType.name, "\" is not a possible type for \"").concat(returnType.name, "\"."), fieldNodes); } return runtimeType; } /** * Complete an Object value by executing all sub-selections. */ function completeObjectValue(exeContext, returnType, fieldNodes, info, path, result) { // If there is an isTypeOf predicate function, call it with the // current result. If isTypeOf returns false, then raise an error rather // than continuing execution. if (returnType.isTypeOf) { var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); if ((0, _isPromise.default)(isTypeOf)) { return isTypeOf.then(function (resolvedIsTypeOf) { if (!resolvedIsTypeOf) { throw invalidReturnTypeError(returnType, result, fieldNodes); } return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result); }); } if (!isTypeOf) { throw invalidReturnTypeError(returnType, result, fieldNodes); } } return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result); } function invalidReturnTypeError(returnType, result, fieldNodes) { return new _GraphQLError.GraphQLError("Expected value of type \"".concat(returnType.name, "\" but got: ").concat((0, _inspect.default)(result), "."), fieldNodes); } function collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result) { // Collect sub-fields to execute to complete this value. var subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); return executeFields(exeContext, returnType, result, path, subFieldNodes); } /** * A memoized collection of relevant subfields with regard to the return * type. Memoizing ensures the subfields are not repeatedly calculated, which * saves overhead when resolving lists of values. */ var collectSubfields = (0, _memoize.default)(_collectSubfields); function _collectSubfields(exeContext, returnType, fieldNodes) { var subFieldNodes = Object.create(null); var visitedFragmentNames = Object.create(null); for (var _i8 = 0; _i8 < fieldNodes.length; _i8++) { var node = fieldNodes[_i8]; if (node.selectionSet) { subFieldNodes = collectFields(exeContext, returnType, node.selectionSet, subFieldNodes, visitedFragmentNames); } } return subFieldNodes; } /** * If a resolveType function is not given, then a default resolve behavior is * used which attempts two strategies: * * First, See if the provided value has a `__typename` field defined, if so, use * that value as name of the resolved type. * * Otherwise, test each possible type for the abstract type by calling * isTypeOf for the object being coerced, returning the first type that matches. */ var defaultTypeResolver = function defaultTypeResolver(value, contextValue, info, abstractType) { // First, look for `__typename`. if ((0, _isObjectLike.default)(value) && typeof value.__typename === 'string') { return value.__typename; } // Otherwise, test each possible type. var possibleTypes = info.schema.getPossibleTypes(abstractType); var promisedIsTypeOfResults = []; for (var i = 0; i < possibleTypes.length; i++) { var type = possibleTypes[i]; if (type.isTypeOf) { var isTypeOfResult = type.isTypeOf(value, contextValue, info); if ((0, _isPromise.default)(isTypeOfResult)) { promisedIsTypeOfResults[i] = isTypeOfResult; } else if (isTypeOfResult) { return type; } } } if (promisedIsTypeOfResults.length) { return Promise.all(promisedIsTypeOfResults).then(function (isTypeOfResults) { for (var _i9 = 0; _i9 < isTypeOfResults.length; _i9++) { if (isTypeOfResults[_i9]) { return possibleTypes[_i9]; } } }); } }; /** * If a resolve function is not given, then a default resolve behavior is used * which takes the property of the source object of the same name as the field * and returns it as the result, or if it's a function, returns the result * of calling that function while passing along args and context value. */ exports.defaultTypeResolver = defaultTypeResolver; var defaultFieldResolver = function defaultFieldResolver(source, args, contextValue, info) { // ensure source is a value for which property access is acceptable. if ((0, _isObjectLike.default)(source) || typeof source === 'function') { var property = source[info.fieldName]; if (typeof property === 'function') { return source[info.fieldName](args, contextValue, info); } return property; } }; /** * This method looks up the field on the given type definition. * It has special casing for the two introspection fields, __schema * and __typename. __typename is special because it can always be * queried as a field, even in situations where no other fields * are allowed, like on a Union. __schema could get automatically * added to the query type, but that would require mutating type * definitions, which would cause issues. */ exports.defaultFieldResolver = defaultFieldResolver; function getFieldDef(schema, parentType, fieldName) { if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { return _introspection.SchemaMetaFieldDef; } else if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { return _introspection.TypeMetaFieldDef; } else if (fieldName === _introspection.TypeNameMetaFieldDef.name) { return _introspection.TypeNameMetaFieldDef; } return parentType.getFields()[fieldName]; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js": /*!**********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js ***! \**********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export defaultFieldResolver [provided] [no usage info] [missing usage info prevents renaming] */ /*! export defaultTypeResolver [provided] [no usage info] [missing usage info prevents renaming] */ /*! export execute [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDirectiveValues [provided] [no usage info] [missing usage info prevents renaming] */ /*! export responsePathAsArray [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "responsePathAsArray", ({ enumerable: true, get: function get() { return _Path.pathToArray; } })); Object.defineProperty(exports, "execute", ({ enumerable: true, get: function get() { return _execute.execute; } })); Object.defineProperty(exports, "defaultFieldResolver", ({ enumerable: true, get: function get() { return _execute.defaultFieldResolver; } })); Object.defineProperty(exports, "defaultTypeResolver", ({ enumerable: true, get: function get() { return _execute.defaultTypeResolver; } })); Object.defineProperty(exports, "getDirectiveValues", ({ enumerable: true, get: function get() { return _values.getDirectiveValues; } })); var _Path = __webpack_require__(/*! ../jsutils/Path */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/Path.js"); var _execute = __webpack_require__(/*! ./execute */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/execute.js"); var _values = __webpack_require__(/*! ./values */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/values.js"); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/values.js": /*!***********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/execution/values.js ***! \***********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getArgumentValues [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDirectiveValues [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getVariableValues [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getVariableValues = getVariableValues; exports.getArgumentValues = getArgumentValues; exports.getDirectiveValues = getDirectiveValues; var _find = _interopRequireDefault(__webpack_require__(/*! ../polyfills/find */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/find.js")); var _keyMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _printPathArray = _interopRequireDefault(__webpack_require__(/*! ../jsutils/printPathArray */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/printPathArray.js")); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _printer = __webpack_require__(/*! ../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _typeFromAST = __webpack_require__(/*! ../utilities/typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); var _valueFromAST = __webpack_require__(/*! ../utilities/valueFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromAST.js"); var _coerceInputValue = __webpack_require__(/*! ../utilities/coerceInputValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceInputValue.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Prepares an object map of variableValues of the correct type based on the * provided variable definitions and arbitrary input. If the input cannot be * parsed to match the variable definitions, a GraphQLError will be thrown. * * Note: The returned value is a plain Object with a prototype, since it is * exposed to user code. Care should be taken to not pull values from the * Object prototype. */ function getVariableValues(schema, varDefNodes, inputs, options) { var maxErrors = options && options.maxErrors; var errors = []; try { var coerced = coerceVariableValues(schema, varDefNodes, inputs, function (error) { if (maxErrors != null && errors.length >= maxErrors) { throw new _GraphQLError.GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.'); } errors.push(error); }); if (errors.length === 0) { return { coerced: coerced }; } } catch (error) { errors.push(error); } return { errors: errors }; } function coerceVariableValues(schema, varDefNodes, inputs, onError) { var coercedValues = {}; var _loop = function _loop(_i2) { var varDefNode = varDefNodes[_i2]; var varName = varDefNode.variable.name.value; var varType = (0, _typeFromAST.typeFromAST)(schema, varDefNode.type); if (!(0, _definition.isInputType)(varType)) { // Must use input types for variables. This should be caught during // validation, however is checked again here for safety. var varTypeStr = (0, _printer.print)(varDefNode.type); onError(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" expected value of type \"").concat(varTypeStr, "\" which cannot be used as an input type."), varDefNode.type)); return "continue"; } if (!hasOwnProperty(inputs, varName)) { if (varDefNode.defaultValue) { coercedValues[varName] = (0, _valueFromAST.valueFromAST)(varDefNode.defaultValue, varType); } else if ((0, _definition.isNonNullType)(varType)) { var _varTypeStr = (0, _inspect.default)(varType); onError(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" of required type \"").concat(_varTypeStr, "\" was not provided."), varDefNode)); } return "continue"; } var value = inputs[varName]; if (value === null && (0, _definition.isNonNullType)(varType)) { var _varTypeStr2 = (0, _inspect.default)(varType); onError(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" of non-null type \"").concat(_varTypeStr2, "\" must not be null."), varDefNode)); return "continue"; } coercedValues[varName] = (0, _coerceInputValue.coerceInputValue)(value, varType, function (path, invalidValue, error) { var prefix = "Variable \"$".concat(varName, "\" got invalid value ") + (0, _inspect.default)(invalidValue); if (path.length > 0) { prefix += " at \"".concat(varName).concat((0, _printPathArray.default)(path), "\""); } onError(new _GraphQLError.GraphQLError(prefix + '; ' + error.message, varDefNode, undefined, undefined, undefined, error.originalError)); }); }; for (var _i2 = 0; _i2 < varDefNodes.length; _i2++) { var _ret = _loop(_i2); if (_ret === "continue") continue; } return coercedValues; } /** * Prepares an object map of argument values given a list of argument * definitions and list of argument AST nodes. * * Note: The returned value is a plain Object with a prototype, since it is * exposed to user code. Care should be taken to not pull values from the * Object prototype. */ function getArgumentValues(def, node, variableValues) { var coercedValues = {}; var argNodeMap = (0, _keyMap.default)(node.arguments || [], function (arg) { return arg.name.value; }); for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) { var argDef = _def$args2[_i4]; var name = argDef.name; var argType = argDef.type; var argumentNode = argNodeMap[name]; if (!argumentNode) { if (argDef.defaultValue !== undefined) { coercedValues[name] = argDef.defaultValue; } else if ((0, _definition.isNonNullType)(argType)) { throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of required type \"").concat((0, _inspect.default)(argType), "\" ") + 'was not provided.', node); } continue; } var valueNode = argumentNode.value; var isNull = valueNode.kind === _kinds.Kind.NULL; if (valueNode.kind === _kinds.Kind.VARIABLE) { var variableName = valueNode.name.value; if (variableValues == null || !hasOwnProperty(variableValues, variableName)) { if (argDef.defaultValue !== undefined) { coercedValues[name] = argDef.defaultValue; } else if ((0, _definition.isNonNullType)(argType)) { throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of required type \"").concat((0, _inspect.default)(argType), "\" ") + "was provided the variable \"$".concat(variableName, "\" which was not provided a runtime value."), valueNode); } continue; } isNull = variableValues[variableName] == null; } if (isNull && (0, _definition.isNonNullType)(argType)) { throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of non-null type \"").concat((0, _inspect.default)(argType), "\" ") + 'must not be null.', valueNode); } var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues); if (coercedValue === undefined) { // Note: ValuesOfCorrectType validation should catch this before // execution. This is a runtime check to ensure execution does not // continue with an invalid argument value. throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" has invalid value ").concat((0, _printer.print)(valueNode), "."), valueNode); } coercedValues[name] = coercedValue; } return coercedValues; } /** * Prepares an object map of argument values given a directive definition * and a AST node which may contain directives. Optionally also accepts a map * of variable values. * * If the directive does not exist on the node, returns undefined. * * Note: The returned value is a plain Object with a prototype, since it is * exposed to user code. Care should be taken to not pull values from the * Object prototype. */ function getDirectiveValues(directiveDef, node, variableValues) { var directiveNode = node.directives && (0, _find.default)(node.directives, function (directive) { return directive.name.value === directiveDef.name; }); if (directiveNode) { return getArgumentValues(directiveDef, directiveNode, variableValues); } } function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/graphql.js": /*!**************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/graphql.js ***! \**************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export graphql [provided] [no usage info] [missing usage info prevents renaming] */ /*! export graphqlSync [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.graphql = graphql; exports.graphqlSync = graphqlSync; var _isPromise = _interopRequireDefault(__webpack_require__(/*! ./jsutils/isPromise */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isPromise.js")); var _parser = __webpack_require__(/*! ./language/parser */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/parser.js"); var _validate = __webpack_require__(/*! ./validation/validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/validate.js"); var _validate2 = __webpack_require__(/*! ./type/validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/validate.js"); var _execute = __webpack_require__(/*! ./execution/execute */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/execute.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function graphql(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { var _arguments = arguments; /* eslint-enable no-redeclare */ // Always return a Promise for a consistent API. return new Promise(function (resolve) { return resolve( // Extract arguments from object args if provided. _arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({ schema: argsOrSchema, source: source, rootValue: rootValue, contextValue: contextValue, variableValues: variableValues, operationName: operationName, fieldResolver: fieldResolver, typeResolver: typeResolver })); }); } /** * The graphqlSync function also fulfills GraphQL operations by parsing, * validating, and executing a GraphQL document along side a GraphQL schema. * However, it guarantees to complete synchronously (or throw an error) assuming * that all field resolvers are also synchronous. */ function graphqlSync(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { /* eslint-enable no-redeclare */ // Extract arguments from object args if provided. var result = arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({ schema: argsOrSchema, source: source, rootValue: rootValue, contextValue: contextValue, variableValues: variableValues, operationName: operationName, fieldResolver: fieldResolver, typeResolver: typeResolver }); // Assert that the execution was synchronous. if ((0, _isPromise.default)(result)) { throw new Error('GraphQL execution failed to complete synchronously.'); } return result; } function graphqlImpl(args) { var schema = args.schema, source = args.source, rootValue = args.rootValue, contextValue = args.contextValue, variableValues = args.variableValues, operationName = args.operationName, fieldResolver = args.fieldResolver, typeResolver = args.typeResolver; // Validate Schema var schemaValidationErrors = (0, _validate2.validateSchema)(schema); if (schemaValidationErrors.length > 0) { return { errors: schemaValidationErrors }; } // Parse var document; try { document = (0, _parser.parse)(source); } catch (syntaxError) { return { errors: [syntaxError] }; } // Validate var validationErrors = (0, _validate.validate)(schema, document); if (validationErrors.length > 0) { return { errors: validationErrors }; } // Execute return (0, _execute.execute)({ schema: schema, document: document, rootValue: rootValue, contextValue: contextValue, variableValues: variableValues, operationName: operationName, fieldResolver: fieldResolver, typeResolver: typeResolver }); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/index.mjs": /*!*************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/index.mjs ***! \*************************************************************************/ /*! namespace exports */ /*! export BREAK [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .BREAK */ /*! export BreakingChangeType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .BreakingChangeType */ /*! export DEFAULT_DEPRECATION_REASON [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .DEFAULT_DEPRECATION_REASON */ /*! export DangerousChangeType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .DangerousChangeType */ /*! export DirectiveLocation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .DirectiveLocation */ /*! export ExecutableDefinitionsRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .ExecutableDefinitionsRule */ /*! export FieldsOnCorrectTypeRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .FieldsOnCorrectTypeRule */ /*! export FragmentsOnCompositeTypesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .FragmentsOnCompositeTypesRule */ /*! export GraphQLBoolean [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLBoolean */ /*! export GraphQLDeprecatedDirective [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLDeprecatedDirective */ /*! export GraphQLDirective [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLDirective */ /*! export GraphQLEnumType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLEnumType */ /*! export GraphQLError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js .GraphQLError */ /*! export GraphQLFloat [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLFloat */ /*! export GraphQLID [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLID */ /*! export GraphQLIncludeDirective [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLIncludeDirective */ /*! export GraphQLInputObjectType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLInputObjectType */ /*! export GraphQLInt [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLInt */ /*! export GraphQLInterfaceType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLInterfaceType */ /*! export GraphQLList [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLList */ /*! export GraphQLNonNull [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLNonNull */ /*! export GraphQLObjectType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLObjectType */ /*! export GraphQLScalarType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLScalarType */ /*! export GraphQLSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLSchema */ /*! export GraphQLSkipDirective [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLSkipDirective */ /*! export GraphQLString [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLString */ /*! export GraphQLUnionType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .GraphQLUnionType */ /*! export Kind [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .Kind */ /*! export KnownArgumentNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .KnownArgumentNamesRule */ /*! export KnownDirectivesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .KnownDirectivesRule */ /*! export KnownFragmentNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .KnownFragmentNamesRule */ /*! export KnownTypeNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .KnownTypeNamesRule */ /*! export LoneAnonymousOperationRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .LoneAnonymousOperationRule */ /*! export LoneSchemaDefinitionRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .LoneSchemaDefinitionRule */ /*! export NoFragmentCyclesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .NoFragmentCyclesRule */ /*! export NoUndefinedVariablesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .NoUndefinedVariablesRule */ /*! export NoUnusedFragmentsRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .NoUnusedFragmentsRule */ /*! export NoUnusedVariablesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .NoUnusedVariablesRule */ /*! export OverlappingFieldsCanBeMergedRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .OverlappingFieldsCanBeMergedRule */ /*! export PossibleFragmentSpreadsRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .PossibleFragmentSpreadsRule */ /*! export PossibleTypeExtensionsRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .PossibleTypeExtensionsRule */ /*! export ProvidedRequiredArgumentsRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .ProvidedRequiredArgumentsRule */ /*! export ScalarLeafsRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .ScalarLeafsRule */ /*! export SchemaMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .SchemaMetaFieldDef */ /*! export SingleFieldSubscriptionsRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .SingleFieldSubscriptionsRule */ /*! export Source [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .Source */ /*! export TokenKind [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .TokenKind */ /*! export TypeInfo [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .TypeInfo */ /*! export TypeKind [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .TypeKind */ /*! export TypeMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .TypeMetaFieldDef */ /*! export TypeNameMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .TypeNameMetaFieldDef */ /*! export UniqueArgumentNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueArgumentNamesRule */ /*! export UniqueDirectiveNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueDirectiveNamesRule */ /*! export UniqueDirectivesPerLocationRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueDirectivesPerLocationRule */ /*! export UniqueEnumValueNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueEnumValueNamesRule */ /*! export UniqueFieldDefinitionNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueFieldDefinitionNamesRule */ /*! export UniqueFragmentNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueFragmentNamesRule */ /*! export UniqueInputFieldNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueInputFieldNamesRule */ /*! export UniqueOperationNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueOperationNamesRule */ /*! export UniqueOperationTypesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueOperationTypesRule */ /*! export UniqueTypeNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueTypeNamesRule */ /*! export UniqueVariableNamesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .UniqueVariableNamesRule */ /*! export ValidationContext [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .ValidationContext */ /*! export ValuesOfCorrectTypeRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .ValuesOfCorrectTypeRule */ /*! export VariablesAreInputTypesRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .VariablesAreInputTypesRule */ /*! export VariablesInAllowedPositionRule [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .VariablesInAllowedPositionRule */ /*! export __Directive [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__Directive */ /*! export __DirectiveLocation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__DirectiveLocation */ /*! export __EnumValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__EnumValue */ /*! export __Field [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__Field */ /*! export __InputValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__InputValue */ /*! export __Schema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__Schema */ /*! export __Type [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__Type */ /*! export __TypeKind [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .__TypeKind */ /*! export assertAbstractType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertAbstractType */ /*! export assertCompositeType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertCompositeType */ /*! export assertDirective [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertDirective */ /*! export assertEnumType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertEnumType */ /*! export assertInputObjectType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertInputObjectType */ /*! export assertInputType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertInputType */ /*! export assertInterfaceType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertInterfaceType */ /*! export assertLeafType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertLeafType */ /*! export assertListType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertListType */ /*! export assertNamedType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertNamedType */ /*! export assertNonNullType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertNonNullType */ /*! export assertNullableType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertNullableType */ /*! export assertObjectType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertObjectType */ /*! export assertOutputType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertOutputType */ /*! export assertScalarType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertScalarType */ /*! export assertSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertSchema */ /*! export assertType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertType */ /*! export assertUnionType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertUnionType */ /*! export assertValidName [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .assertValidName */ /*! export assertValidSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertValidSchema */ /*! export assertWrappingType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .assertWrappingType */ /*! export astFromValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .astFromValue */ /*! export buildASTSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .buildASTSchema */ /*! export buildClientSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .buildClientSchema */ /*! export buildSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .buildSchema */ /*! export coerceInputValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .coerceInputValue */ /*! export coerceValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .coerceValue */ /*! export concatAST [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .concatAST */ /*! export createLexer [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .createLexer */ /*! export createSourceEventStream [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/subscription/index.js .createSourceEventStream */ /*! export defaultFieldResolver [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js .defaultFieldResolver */ /*! export defaultTypeResolver [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js .defaultTypeResolver */ /*! export doTypesOverlap [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .doTypesOverlap */ /*! export execute [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js .execute */ /*! export extendSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .extendSchema */ /*! export findBreakingChanges [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .findBreakingChanges */ /*! export findDangerousChanges [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .findDangerousChanges */ /*! export findDeprecatedUsages [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .findDeprecatedUsages */ /*! export formatError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js .formatError */ /*! export getDescription [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .getDescription */ /*! export getDirectiveValues [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js .getDirectiveValues */ /*! export getIntrospectionQuery [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .getIntrospectionQuery */ /*! export getLocation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .getLocation */ /*! export getNamedType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .getNamedType */ /*! export getNullableType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .getNullableType */ /*! export getOperationAST [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .getOperationAST */ /*! export getOperationRootType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .getOperationRootType */ /*! export getVisitFn [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .getVisitFn */ /*! export graphql [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/graphql.js .graphql */ /*! export graphqlSync [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/graphql.js .graphqlSync */ /*! export introspectionFromSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .introspectionFromSchema */ /*! export introspectionQuery [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .introspectionQuery */ /*! export introspectionTypes [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .introspectionTypes */ /*! export isAbstractType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isAbstractType */ /*! export isCompositeType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isCompositeType */ /*! export isDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isDefinitionNode */ /*! export isDirective [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isDirective */ /*! export isEnumType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isEnumType */ /*! export isEqualType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .isEqualType */ /*! export isExecutableDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isExecutableDefinitionNode */ /*! export isInputObjectType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isInputObjectType */ /*! export isInputType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isInputType */ /*! export isInterfaceType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isInterfaceType */ /*! export isIntrospectionType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isIntrospectionType */ /*! export isLeafType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isLeafType */ /*! export isListType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isListType */ /*! export isNamedType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isNamedType */ /*! export isNonNullType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isNonNullType */ /*! export isNullableType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isNullableType */ /*! export isObjectType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isObjectType */ /*! export isOutputType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isOutputType */ /*! export isRequiredArgument [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isRequiredArgument */ /*! export isRequiredInputField [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isRequiredInputField */ /*! export isScalarType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isScalarType */ /*! export isSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isSchema */ /*! export isSelectionNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isSelectionNode */ /*! export isSpecifiedDirective [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isSpecifiedDirective */ /*! export isSpecifiedScalarType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isSpecifiedScalarType */ /*! export isType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isType */ /*! export isTypeDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isTypeDefinitionNode */ /*! export isTypeExtensionNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isTypeExtensionNode */ /*! export isTypeNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isTypeNode */ /*! export isTypeSubTypeOf [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .isTypeSubTypeOf */ /*! export isTypeSystemDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isTypeSystemDefinitionNode */ /*! export isTypeSystemExtensionNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isTypeSystemExtensionNode */ /*! export isUnionType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isUnionType */ /*! export isValidJSValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .isValidJSValue */ /*! export isValidLiteralValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .isValidLiteralValue */ /*! export isValidNameError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .isValidNameError */ /*! export isValueNode [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .isValueNode */ /*! export isWrappingType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .isWrappingType */ /*! export lexicographicSortSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .lexicographicSortSchema */ /*! export locatedError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js .locatedError */ /*! export parse [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .parse */ /*! export parseType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .parseType */ /*! export parseValue [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .parseValue */ /*! export print [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .print */ /*! export printError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js .printError */ /*! export printIntrospectionSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .printIntrospectionSchema */ /*! export printLocation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .printLocation */ /*! export printSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .printSchema */ /*! export printSourceLocation [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .printSourceLocation */ /*! export printType [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .printType */ /*! export responsePathAsArray [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js .responsePathAsArray */ /*! export separateOperations [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .separateOperations */ /*! export specifiedDirectives [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .specifiedDirectives */ /*! export specifiedRules [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .specifiedRules */ /*! export specifiedScalarTypes [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .specifiedScalarTypes */ /*! export stripIgnoredCharacters [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .stripIgnoredCharacters */ /*! export subscribe [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/subscription/index.js .subscribe */ /*! export syntaxError [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js .syntaxError */ /*! export typeFromAST [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .typeFromAST */ /*! export validate [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js .validate */ /*! export validateSchema [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js .validateSchema */ /*! export valueFromAST [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .valueFromAST */ /*! export valueFromASTUntyped [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js .valueFromASTUntyped */ /*! export version [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/version.js .version */ /*! export versionInfo [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/version.js .versionInfo */ /*! export visit [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .visit */ /*! export visitInParallel [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .visitInParallel */ /*! export visitWithTypeInfo [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js .visitWithTypeInfo */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "version": () => /* reexport safe */ _version__WEBPACK_IMPORTED_MODULE_0__.version, /* harmony export */ "versionInfo": () => /* reexport safe */ _version__WEBPACK_IMPORTED_MODULE_0__.versionInfo, /* harmony export */ "graphql": () => /* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.graphql, /* harmony export */ "graphqlSync": () => /* reexport safe */ _graphql__WEBPACK_IMPORTED_MODULE_1__.graphqlSync, /* harmony export */ "GraphQLSchema": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLSchema, /* harmony export */ "GraphQLDirective": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLDirective, /* harmony export */ "GraphQLScalarType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLScalarType, /* harmony export */ "GraphQLObjectType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLObjectType, /* harmony export */ "GraphQLInterfaceType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLInterfaceType, /* harmony export */ "GraphQLUnionType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLUnionType, /* harmony export */ "GraphQLEnumType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLEnumType, /* harmony export */ "GraphQLInputObjectType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLInputObjectType, /* harmony export */ "GraphQLList": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLList, /* harmony export */ "GraphQLNonNull": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLNonNull, /* harmony export */ "specifiedScalarTypes": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.specifiedScalarTypes, /* harmony export */ "GraphQLInt": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLInt, /* harmony export */ "GraphQLFloat": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLFloat, /* harmony export */ "GraphQLString": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLString, /* harmony export */ "GraphQLBoolean": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLBoolean, /* harmony export */ "GraphQLID": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLID, /* harmony export */ "specifiedDirectives": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.specifiedDirectives, /* harmony export */ "GraphQLIncludeDirective": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLIncludeDirective, /* harmony export */ "GraphQLSkipDirective": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLSkipDirective, /* harmony export */ "GraphQLDeprecatedDirective": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.GraphQLDeprecatedDirective, /* harmony export */ "TypeKind": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.TypeKind, /* harmony export */ "DEFAULT_DEPRECATION_REASON": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_DEPRECATION_REASON, /* harmony export */ "introspectionTypes": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.introspectionTypes, /* harmony export */ "__Schema": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__Schema, /* harmony export */ "__Directive": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__Directive, /* harmony export */ "__DirectiveLocation": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__DirectiveLocation, /* harmony export */ "__Type": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__Type, /* harmony export */ "__Field": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__Field, /* harmony export */ "__InputValue": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__InputValue, /* harmony export */ "__EnumValue": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__EnumValue, /* harmony export */ "__TypeKind": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.__TypeKind, /* harmony export */ "SchemaMetaFieldDef": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.SchemaMetaFieldDef, /* harmony export */ "TypeMetaFieldDef": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.TypeMetaFieldDef, /* harmony export */ "TypeNameMetaFieldDef": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.TypeNameMetaFieldDef, /* harmony export */ "isSchema": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isSchema, /* harmony export */ "isDirective": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isDirective, /* harmony export */ "isType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isType, /* harmony export */ "isScalarType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isScalarType, /* harmony export */ "isObjectType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isObjectType, /* harmony export */ "isInterfaceType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType, /* harmony export */ "isUnionType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isUnionType, /* harmony export */ "isEnumType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isEnumType, /* harmony export */ "isInputObjectType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isInputObjectType, /* harmony export */ "isListType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isListType, /* harmony export */ "isNonNullType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isNonNullType, /* harmony export */ "isInputType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isInputType, /* harmony export */ "isOutputType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isOutputType, /* harmony export */ "isLeafType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isLeafType, /* harmony export */ "isCompositeType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isCompositeType, /* harmony export */ "isAbstractType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isAbstractType, /* harmony export */ "isWrappingType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isWrappingType, /* harmony export */ "isNullableType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isNullableType, /* harmony export */ "isNamedType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isNamedType, /* harmony export */ "isRequiredArgument": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isRequiredArgument, /* harmony export */ "isRequiredInputField": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isRequiredInputField, /* harmony export */ "isSpecifiedScalarType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isSpecifiedScalarType, /* harmony export */ "isIntrospectionType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isIntrospectionType, /* harmony export */ "isSpecifiedDirective": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.isSpecifiedDirective, /* harmony export */ "assertSchema": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertSchema, /* harmony export */ "assertDirective": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertDirective, /* harmony export */ "assertType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertType, /* harmony export */ "assertScalarType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertScalarType, /* harmony export */ "assertObjectType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertObjectType, /* harmony export */ "assertInterfaceType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertInterfaceType, /* harmony export */ "assertUnionType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertUnionType, /* harmony export */ "assertEnumType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertEnumType, /* harmony export */ "assertInputObjectType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertInputObjectType, /* harmony export */ "assertListType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertListType, /* harmony export */ "assertNonNullType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertNonNullType, /* harmony export */ "assertInputType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertInputType, /* harmony export */ "assertOutputType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertOutputType, /* harmony export */ "assertLeafType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertLeafType, /* harmony export */ "assertCompositeType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertCompositeType, /* harmony export */ "assertAbstractType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertAbstractType, /* harmony export */ "assertWrappingType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertWrappingType, /* harmony export */ "assertNullableType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertNullableType, /* harmony export */ "assertNamedType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertNamedType, /* harmony export */ "getNullableType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.getNullableType, /* harmony export */ "getNamedType": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.getNamedType, /* harmony export */ "validateSchema": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.validateSchema, /* harmony export */ "assertValidSchema": () => /* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_2__.assertValidSchema, /* harmony export */ "Source": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.Source, /* harmony export */ "getLocation": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.getLocation, /* harmony export */ "printLocation": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.printLocation, /* harmony export */ "printSourceLocation": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.printSourceLocation, /* harmony export */ "createLexer": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.createLexer, /* harmony export */ "TokenKind": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.TokenKind, /* harmony export */ "parse": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.parse, /* harmony export */ "parseValue": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.parseValue, /* harmony export */ "parseType": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.parseType, /* harmony export */ "print": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.print, /* harmony export */ "visit": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.visit, /* harmony export */ "visitInParallel": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.visitInParallel, /* harmony export */ "visitWithTypeInfo": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.visitWithTypeInfo, /* harmony export */ "getVisitFn": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.getVisitFn, /* harmony export */ "BREAK": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.BREAK, /* harmony export */ "Kind": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.Kind, /* harmony export */ "DirectiveLocation": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.DirectiveLocation, /* harmony export */ "isDefinitionNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isDefinitionNode, /* harmony export */ "isExecutableDefinitionNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isExecutableDefinitionNode, /* harmony export */ "isSelectionNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isSelectionNode, /* harmony export */ "isValueNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isValueNode, /* harmony export */ "isTypeNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isTypeNode, /* harmony export */ "isTypeSystemDefinitionNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isTypeSystemDefinitionNode, /* harmony export */ "isTypeDefinitionNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isTypeDefinitionNode, /* harmony export */ "isTypeSystemExtensionNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isTypeSystemExtensionNode, /* harmony export */ "isTypeExtensionNode": () => /* reexport safe */ _language__WEBPACK_IMPORTED_MODULE_3__.isTypeExtensionNode, /* harmony export */ "execute": () => /* reexport safe */ _execution__WEBPACK_IMPORTED_MODULE_4__.execute, /* harmony export */ "defaultFieldResolver": () => /* reexport safe */ _execution__WEBPACK_IMPORTED_MODULE_4__.defaultFieldResolver, /* harmony export */ "defaultTypeResolver": () => /* reexport safe */ _execution__WEBPACK_IMPORTED_MODULE_4__.defaultTypeResolver, /* harmony export */ "responsePathAsArray": () => /* reexport safe */ _execution__WEBPACK_IMPORTED_MODULE_4__.responsePathAsArray, /* harmony export */ "getDirectiveValues": () => /* reexport safe */ _execution__WEBPACK_IMPORTED_MODULE_4__.getDirectiveValues, /* harmony export */ "subscribe": () => /* reexport safe */ _subscription__WEBPACK_IMPORTED_MODULE_5__.subscribe, /* harmony export */ "createSourceEventStream": () => /* reexport safe */ _subscription__WEBPACK_IMPORTED_MODULE_5__.createSourceEventStream, /* harmony export */ "validate": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.validate, /* harmony export */ "ValidationContext": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.ValidationContext, /* harmony export */ "specifiedRules": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.specifiedRules, /* harmony export */ "ExecutableDefinitionsRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.ExecutableDefinitionsRule, /* harmony export */ "FieldsOnCorrectTypeRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.FieldsOnCorrectTypeRule, /* harmony export */ "FragmentsOnCompositeTypesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.FragmentsOnCompositeTypesRule, /* harmony export */ "KnownArgumentNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.KnownArgumentNamesRule, /* harmony export */ "KnownDirectivesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.KnownDirectivesRule, /* harmony export */ "KnownFragmentNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.KnownFragmentNamesRule, /* harmony export */ "KnownTypeNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.KnownTypeNamesRule, /* harmony export */ "LoneAnonymousOperationRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.LoneAnonymousOperationRule, /* harmony export */ "NoFragmentCyclesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.NoFragmentCyclesRule, /* harmony export */ "NoUndefinedVariablesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.NoUndefinedVariablesRule, /* harmony export */ "NoUnusedFragmentsRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.NoUnusedFragmentsRule, /* harmony export */ "NoUnusedVariablesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.NoUnusedVariablesRule, /* harmony export */ "OverlappingFieldsCanBeMergedRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.OverlappingFieldsCanBeMergedRule, /* harmony export */ "PossibleFragmentSpreadsRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.PossibleFragmentSpreadsRule, /* harmony export */ "ProvidedRequiredArgumentsRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.ProvidedRequiredArgumentsRule, /* harmony export */ "ScalarLeafsRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.ScalarLeafsRule, /* harmony export */ "SingleFieldSubscriptionsRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.SingleFieldSubscriptionsRule, /* harmony export */ "UniqueArgumentNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueArgumentNamesRule, /* harmony export */ "UniqueDirectivesPerLocationRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueDirectivesPerLocationRule, /* harmony export */ "UniqueFragmentNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueFragmentNamesRule, /* harmony export */ "UniqueInputFieldNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueInputFieldNamesRule, /* harmony export */ "UniqueOperationNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueOperationNamesRule, /* harmony export */ "UniqueVariableNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueVariableNamesRule, /* harmony export */ "ValuesOfCorrectTypeRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.ValuesOfCorrectTypeRule, /* harmony export */ "VariablesAreInputTypesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.VariablesAreInputTypesRule, /* harmony export */ "VariablesInAllowedPositionRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.VariablesInAllowedPositionRule, /* harmony export */ "LoneSchemaDefinitionRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.LoneSchemaDefinitionRule, /* harmony export */ "UniqueOperationTypesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueOperationTypesRule, /* harmony export */ "UniqueTypeNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueTypeNamesRule, /* harmony export */ "UniqueEnumValueNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueEnumValueNamesRule, /* harmony export */ "UniqueFieldDefinitionNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueFieldDefinitionNamesRule, /* harmony export */ "UniqueDirectiveNamesRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.UniqueDirectiveNamesRule, /* harmony export */ "PossibleTypeExtensionsRule": () => /* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.PossibleTypeExtensionsRule, /* harmony export */ "GraphQLError": () => /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_7__.GraphQLError, /* harmony export */ "syntaxError": () => /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_7__.syntaxError, /* harmony export */ "locatedError": () => /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_7__.locatedError, /* harmony export */ "printError": () => /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_7__.printError, /* harmony export */ "formatError": () => /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_7__.formatError, /* harmony export */ "getIntrospectionQuery": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.getIntrospectionQuery, /* harmony export */ "introspectionQuery": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.introspectionQuery, /* harmony export */ "getOperationAST": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.getOperationAST, /* harmony export */ "getOperationRootType": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.getOperationRootType, /* harmony export */ "introspectionFromSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.introspectionFromSchema, /* harmony export */ "buildClientSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.buildClientSchema, /* harmony export */ "buildASTSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.buildASTSchema, /* harmony export */ "buildSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.buildSchema, /* harmony export */ "getDescription": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.getDescription, /* harmony export */ "extendSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.extendSchema, /* harmony export */ "lexicographicSortSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.lexicographicSortSchema, /* harmony export */ "printSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.printSchema, /* harmony export */ "printType": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.printType, /* harmony export */ "printIntrospectionSchema": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.printIntrospectionSchema, /* harmony export */ "typeFromAST": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.typeFromAST, /* harmony export */ "valueFromAST": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.valueFromAST, /* harmony export */ "valueFromASTUntyped": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.valueFromASTUntyped, /* harmony export */ "astFromValue": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.astFromValue, /* harmony export */ "TypeInfo": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.TypeInfo, /* harmony export */ "coerceInputValue": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.coerceInputValue, /* harmony export */ "coerceValue": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.coerceValue, /* harmony export */ "isValidJSValue": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.isValidJSValue, /* harmony export */ "isValidLiteralValue": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.isValidLiteralValue, /* harmony export */ "concatAST": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.concatAST, /* harmony export */ "separateOperations": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.separateOperations, /* harmony export */ "stripIgnoredCharacters": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.stripIgnoredCharacters, /* harmony export */ "isEqualType": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.isEqualType, /* harmony export */ "isTypeSubTypeOf": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.isTypeSubTypeOf, /* harmony export */ "doTypesOverlap": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.doTypesOverlap, /* harmony export */ "assertValidName": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.assertValidName, /* harmony export */ "isValidNameError": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.isValidNameError, /* harmony export */ "BreakingChangeType": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.BreakingChangeType, /* harmony export */ "DangerousChangeType": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.DangerousChangeType, /* harmony export */ "findBreakingChanges": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.findBreakingChanges, /* harmony export */ "findDangerousChanges": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.findDangerousChanges, /* harmony export */ "findDeprecatedUsages": () => /* reexport safe */ _utilities__WEBPACK_IMPORTED_MODULE_8__.findDeprecatedUsages /* harmony export */ }); /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version */ "./node_modules/graphql-ruby-client/node_modules/graphql/version.js"); /* harmony import */ var _graphql__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./graphql */ "./node_modules/graphql-ruby-client/node_modules/graphql/graphql.js"); /* harmony import */ var _type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./type */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js"); /* harmony import */ var _language__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./language */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js"); /* harmony import */ var _execution__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./execution */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/index.js"); /* harmony import */ var _subscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./subscription */ "./node_modules/graphql-ruby-client/node_modules/graphql/subscription/index.js"); /* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./validation */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js"); /* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./error */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/index.js"); /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utilities */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js"); /** * GraphQL.js provides a reference implementation for the GraphQL specification * but is also a useful utility for operating on GraphQL files and building * sophisticated tools. * * This primary module exports a general purpose function for fulfilling all * steps of the GraphQL specification in a single operation, but also includes * utilities for every part of the GraphQL specification: * * - Parsing the GraphQL language. * - Building a GraphQL type schema. * - Validating a GraphQL request against a type schema. * - Executing a GraphQL request against a type schema. * * This also includes utility functions for operating on GraphQL types and * GraphQL documents to facilitate building tools. * * You may also import from each sub-directory directly. For example, the * following two import statements are equivalent: * * import { parse } from 'graphql'; * import { parse } from 'graphql/language'; */ // The GraphQL.js version info. // The primary entry point into fulfilling a GraphQL request. // Create and operate on GraphQL type definitions and schema. // Parse and operate on GraphQL language source files. // Execute GraphQL queries. // Validate GraphQL documents. // Create, format, and print GraphQL errors. // Utilities for operating on GraphQL type schema and parsed sources. /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/Path.js": /*!*******************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/Path.js ***! \*******************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export addPath [provided] [no usage info] [missing usage info prevents renaming] */ /*! export pathToArray [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addPath = addPath; exports.pathToArray = pathToArray; /** * Given a Path and a key, return a new Path containing the new key. */ function addPath(prev, key) { return { prev: prev, key: key }; } /** * Given a Path, return an Array of the path keys. */ function pathToArray(path) { var flattened = []; var curr = path; while (curr) { flattened.push(curr.key); curr = curr.prev; } return flattened.reverse(); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToJSON.js": /*!***************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToJSON.js ***! \***************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = defineToJSON; var _nodejsCustomInspectSymbol = _interopRequireDefault(__webpack_require__(/*! ./nodejsCustomInspectSymbol */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * The `defineToJSON()` function defines toJSON() and inspect() prototype * methods, if no function provided they become aliases for toString(). */ function defineToJSON(classObject) { var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString; classObject.prototype.toJSON = fn; classObject.prototype.inspect = fn; if (_nodejsCustomInspectSymbol.default) { classObject.prototype[_nodejsCustomInspectSymbol.default] = fn; } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToStringTag.js": /*!********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToStringTag.js ***! \********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = defineToStringTag; /** * The `defineToStringTag()` function checks first to see if the runtime * supports the `Symbol` class and then if the `Symbol.toStringTag` constant * is defined as a `Symbol` instance. If both conditions are met, the * Symbol.toStringTag property is defined as a getter that returns the * supplied class constructor's name. * * @method defineToStringTag * * @param {Class} classObject a class such as Object, String, Number but * typically one of your own creation through the class keyword; `class A {}`, * for example. */ function defineToStringTag(classObject) { if (typeof Symbol === 'function' && Symbol.toStringTag) { Object.defineProperty(classObject.prototype, Symbol.toStringTag, { get: function get() { return this.constructor.name; } }); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = devAssert; function devAssert(condition, message) { var booleanCondition = Boolean(condition); if (!booleanCondition) { throw new Error(message); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = didYouMean; var MAX_SUGGESTIONS = 5; /** * Given [ A, B, C ] return ' Did you mean A, B, or C?'. */ // eslint-disable-next-line no-redeclare function didYouMean(firstArg, secondArg) { var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg], subMessage = _ref[0], suggestions = _ref[1]; var message = ' Did you mean '; if (subMessage) { message += subMessage + ' '; } switch (suggestions.length) { case 0: return ''; case 1: return message + suggestions[0] + '?'; case 2: return message + suggestions[0] + ' or ' + suggestions[1] + '?'; } var selected = suggestions.slice(0, MAX_SUGGESTIONS); var lastItem = selected.pop(); return message + selected.join(', ') + ', or ' + lastItem + '?'; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/identityFunc.js": /*!***************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/identityFunc.js ***! \***************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = identityFunc; /** * Returns the first argument it receives. */ function identityFunc(x) { return x; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js": /*!**********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js ***! \**********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = inspect; var _nodejsCustomInspectSymbol = _interopRequireDefault(__webpack_require__(/*! ./nodejsCustomInspectSymbol */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var MAX_ARRAY_LENGTH = 10; var MAX_RECURSIVE_DEPTH = 2; /** * Used to print values in error messages. */ function inspect(value) { return formatValue(value, []); } function formatValue(value, seenValues) { switch (_typeof(value)) { case 'string': return JSON.stringify(value); case 'function': return value.name ? "[function ".concat(value.name, "]") : '[function]'; case 'object': if (value === null) { return 'null'; } return formatObjectValue(value, seenValues); default: return String(value); } } function formatObjectValue(value, previouslySeenValues) { if (previouslySeenValues.indexOf(value) !== -1) { return '[Circular]'; } var seenValues = [].concat(previouslySeenValues, [value]); var customInspectFn = getCustomFn(value); if (customInspectFn !== undefined) { // $FlowFixMe(>=0.90.0) var customValue = customInspectFn.call(value); // check for infinite recursion if (customValue !== value) { return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues); } } else if (Array.isArray(value)) { return formatArray(value, seenValues); } return formatObject(value, seenValues); } function formatObject(object, seenValues) { var keys = Object.keys(object); if (keys.length === 0) { return '{}'; } if (seenValues.length > MAX_RECURSIVE_DEPTH) { return '[' + getObjectTag(object) + ']'; } var properties = keys.map(function (key) { var value = formatValue(object[key], seenValues); return key + ': ' + value; }); return '{ ' + properties.join(', ') + ' }'; } function formatArray(array, seenValues) { if (array.length === 0) { return '[]'; } if (seenValues.length > MAX_RECURSIVE_DEPTH) { return '[Array]'; } var len = Math.min(MAX_ARRAY_LENGTH, array.length); var remaining = array.length - len; var items = []; for (var i = 0; i < len; ++i) { items.push(formatValue(array[i], seenValues)); } if (remaining === 1) { items.push('... 1 more item'); } else if (remaining > 1) { items.push("... ".concat(remaining, " more items")); } return '[' + items.join(', ') + ']'; } function getCustomFn(object) { var customInspectFn = object[String(_nodejsCustomInspectSymbol.default)]; if (typeof customInspectFn === 'function') { return customInspectFn; } if (typeof object.inspect === 'function') { return object.inspect; } } function getObjectTag(object) { var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); if (tag === 'Object' && typeof object.constructor === 'function') { var name = object.constructor.name; if (typeof name === 'string' && name !== '') { return name; } } return tag; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/instanceOf.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/instanceOf.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; /** * A replacement for instanceof which includes an error warning when multi-realm * constructors are detected. */ // See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production // See: https://webpack.js.org/guides/production/ var _default = false ? // eslint-disable-next-line no-shadow 0 : // eslint-disable-next-line no-shadow function instanceOf(value, constructor) { if (value instanceof constructor) { return true; } if (value) { var valueClass = value.constructor; var className = constructor.name; if (className && valueClass && valueClass.name === className) { throw new Error("Cannot use ".concat(className, " \"").concat(value, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); } } return false; }; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = invariant; function invariant(condition, message) { var booleanCondition = Boolean(condition); if (!booleanCondition) { throw new Error(message || 'Unexpected invariant triggered'); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isInvalid.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isInvalid.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = isInvalid; /** * Returns true if a value is undefined, or NaN. */ function isInvalid(value) { return value === undefined || value !== value; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isNullish.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isNullish.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = isNullish; /** * Returns true if a value is null, undefined, or NaN. */ function isNullish(value) { return value === null || value === undefined || value !== value; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js": /*!***************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js ***! \***************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = isObjectLike; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** * Return true if `value` is object-like. A value is object-like if it's not * `null` and has a `typeof` result of "object". */ function isObjectLike(value) { return _typeof(value) == 'object' && value !== null; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isPromise.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isPromise.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = isPromise; /** * Returns true if the value acts like a Promise, i.e. has a "then" function, * otherwise returns false. */ // eslint-disable-next-line no-redeclare function isPromise(value) { return Boolean(value && typeof value.then === 'function'); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js": /*!*********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js ***! \*********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = keyMap; /** * Creates a keyed JS object from an array, given a function to produce the keys * for each value in the array. * * This provides a convenient lookup for the array items if the key function * produces unique results. * * const phoneBook = [ * { name: 'Jon', num: '555-1234' }, * { name: 'Jenny', num: '867-5309' } * ] * * // { Jon: { name: 'Jon', num: '555-1234' }, * // Jenny: { name: 'Jenny', num: '867-5309' } } * const entriesByName = keyMap( * phoneBook, * entry => entry.name * ) * * // { name: 'Jenny', num: '857-6309' } * const jennyEntry = entriesByName['Jenny'] * */ function keyMap(list, keyFn) { return list.reduce(function (map, item) { map[keyFn(item)] = item; return map; }, Object.create(null)); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = keyValMap; /** * Creates a keyed JS object from an array, given a function to produce the keys * and a function to produce the values from each item in the array. * * const phoneBook = [ * { name: 'Jon', num: '555-1234' }, * { name: 'Jenny', num: '867-5309' } * ] * * // { Jon: '555-1234', Jenny: '867-5309' } * const phonesByName = keyValMap( * phoneBook, * entry => entry.name, * entry => entry.num * ) * */ function keyValMap(list, keyFn, valFn) { return list.reduce(function (map, item) { map[keyFn(item)] = valFn(item); return map; }, Object.create(null)); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/mapValue.js": /*!***********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/mapValue.js ***! \***********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = mapValue; var _objectEntries3 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectEntries */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Creates an object map with the same keys as `map` and values generated by * running each value of `map` thru `fn`. */ function mapValue(map, fn) { var result = Object.create(null); for (var _i2 = 0, _objectEntries2 = (0, _objectEntries3.default)(map); _i2 < _objectEntries2.length; _i2++) { var _ref2 = _objectEntries2[_i2]; var _key = _ref2[0]; var _value = _ref2[1]; result[_key] = fn(_value, _key); } return result; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/memoize3.js": /*!***********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/memoize3.js ***! \***********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = memoize3; /** * Memoizes the provided three-argument function. */ function memoize3(fn) { var cache0; function memoized(a1, a2, a3) { if (!cache0) { cache0 = new WeakMap(); } var cache1 = cache0.get(a1); var cache2; if (cache1) { cache2 = cache1.get(a2); if (cache2) { var cachedValue = cache2.get(a3); if (cachedValue !== undefined) { return cachedValue; } } } else { cache1 = new WeakMap(); cache0.set(a1, cache1); } if (!cache2) { cache2 = new WeakMap(); cache1.set(a2, cache2); } var newValue = fn(a1, a2, a3); cache2.set(a3, newValue); return newValue; } return memoized; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js": /*!****************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js ***! \****************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; var _default = nodejsCustomInspectSymbol; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/printPathArray.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/printPathArray.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = printPathArray; /** * Build a string describing the path. */ function printPathArray(path) { return path.map(function (key) { return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key; }).join(''); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/promiseForObject.js": /*!*******************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/promiseForObject.js ***! \*******************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = promiseForObject; /** * This function transforms a JS object `ObjMap>` into * a `Promise>` * * This is akin to bluebird's `Promise.props`, but implemented only using * `Promise.all` so it will work with any implementation of ES6 promises. */ function promiseForObject(object) { var keys = Object.keys(object); var valuesAndPromises = keys.map(function (name) { return object[name]; }); return Promise.all(valuesAndPromises).then(function (values) { return values.reduce(function (resolvedObject, value, i) { resolvedObject[keys[i]] = value; return resolvedObject; }, Object.create(null)); }); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/promiseReduce.js": /*!****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/promiseReduce.js ***! \****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = promiseReduce; var _isPromise = _interopRequireDefault(__webpack_require__(/*! ./isPromise */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isPromise.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Similar to Array.prototype.reduce(), however the reducing callback may return * a Promise, in which case reduction will continue after each promise resolves. * * If the callback does not return a Promise, then this function will also not * return a Promise. */ function promiseReduce(values, callback, initialValue) { return values.reduce(function (previous, value) { return (0, _isPromise.default)(previous) ? previous.then(function (resolved) { return callback(resolved, value); }) : callback(previous, value); }, initialValue); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = suggestionList; /** * Given an invalid input string and a list of valid options, returns a filtered * list of valid options sorted based on their similarity with the input. */ function suggestionList(input, options) { var optionsByDistance = Object.create(null); var inputThreshold = input.length / 2; for (var _i2 = 0; _i2 < options.length; _i2++) { var option = options[_i2]; var distance = lexicalDistance(input, option); var threshold = Math.max(inputThreshold, option.length / 2, 1); if (distance <= threshold) { optionsByDistance[option] = distance; } } return Object.keys(optionsByDistance).sort(function (a, b) { return optionsByDistance[a] - optionsByDistance[b]; }); } /** * Computes the lexical distance between strings A and B. * * The "distance" between two strings is given by counting the minimum number * of edits needed to transform string A into string B. An edit can be an * insertion, deletion, or substitution of a single character, or a swap of two * adjacent characters. * * Includes a custom alteration from Damerau-Levenshtein to treat case changes * as a single edit which helps identify mis-cased values with an edit distance * of 1. * * This distance can be useful for detecting typos in input or sorting * * @param {string} a * @param {string} b * @return {int} distance in number of edits */ function lexicalDistance(aStr, bStr) { if (aStr === bStr) { return 0; } var d = []; var a = aStr.toLowerCase(); var b = bStr.toLowerCase(); var aLength = a.length; var bLength = b.length; // Any case change counts as a single edit if (a === b) { return 1; } for (var i = 0; i <= aLength; i++) { d[i] = [i]; } for (var j = 1; j <= bLength; j++) { d[0][j] = j; } for (var _i3 = 1; _i3 <= aLength; _i3++) { for (var _j = 1; _j <= bLength; _j++) { var cost = a[_i3 - 1] === b[_j - 1] ? 0 : 1; d[_i3][_j] = Math.min(d[_i3 - 1][_j] + 1, d[_i3][_j - 1] + 1, d[_i3 - 1][_j - 1] + cost); if (_i3 > 1 && _j > 1 && a[_i3 - 1] === b[_j - 2] && a[_i3 - 2] === b[_j - 1]) { d[_i3][_j] = Math.min(d[_i3][_j], d[_i3 - 2][_j - 2] + cost); } } } return d[aLength][bLength]; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/toObjMap.js": /*!***********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/toObjMap.js ***! \***********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = toObjMap; var _objectEntries3 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectEntries */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function toObjMap(obj) { /* eslint-enable no-redeclare */ if (Object.getPrototypeOf(obj) === null) { return obj; } var map = Object.create(null); for (var _i2 = 0, _objectEntries2 = (0, _objectEntries3.default)(obj); _i2 < _objectEntries2.length; _i2++) { var _ref2 = _objectEntries2[_i2]; var key = _ref2[0]; var value = _ref2[1]; map[key] = value; } return map; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/blockString.js": /*!***************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/blockString.js ***! \***************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export dedentBlockStringValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getBlockStringIndentation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printBlockString [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.dedentBlockStringValue = dedentBlockStringValue; exports.getBlockStringIndentation = getBlockStringIndentation; exports.printBlockString = printBlockString; /** * Produces the value of a block string from its parsed raw value, similar to * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. * * This implements the GraphQL spec's BlockStringValue() static algorithm. */ function dedentBlockStringValue(rawString) { // Expand a block string's raw value into independent lines. var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first. var commonIndent = getBlockStringIndentation(lines); if (commonIndent !== 0) { for (var i = 1; i < lines.length; i++) { lines[i] = lines[i].slice(commonIndent); } } // Remove leading and trailing blank lines. while (lines.length > 0 && isBlank(lines[0])) { lines.shift(); } while (lines.length > 0 && isBlank(lines[lines.length - 1])) { lines.pop(); } // Return a string of the lines joined with U+000A. return lines.join('\n'); } // @internal function getBlockStringIndentation(lines) { var commonIndent = null; for (var i = 1; i < lines.length; i++) { var line = lines[i]; var indent = leadingWhitespace(line); if (indent === line.length) { continue; // skip empty lines } if (commonIndent === null || indent < commonIndent) { commonIndent = indent; if (commonIndent === 0) { break; } } } return commonIndent === null ? 0 : commonIndent; } function leadingWhitespace(str) { var i = 0; while (i < str.length && (str[i] === ' ' || str[i] === '\t')) { i++; } return i; } function isBlank(str) { return leadingWhitespace(str) === str.length; } /** * Print a block string in the indented block form by adding a leading and * trailing blank line. However, if a block string starts with whitespace and is * a single-line, adding a leading blank line would strip that whitespace. */ function printBlockString(value) { var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isSingleLine = value.indexOf('\n') === -1; var hasLeadingSpace = value[0] === ' ' || value[0] === '\t'; var hasTrailingQuote = value[value.length - 1] === '"'; var printAsMultipleLines = !isSingleLine || hasTrailingQuote || preferMultipleLines; var result = ''; // Format a multi-line block quote to account for leading space. if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) { result += '\n' + indentation; } result += indentation ? value.replace(/\n/g, '\n' + indentation) : value; if (printAsMultipleLines) { result += '\n'; } return '"""' + result.replace(/"""/g, '\\"""') + '"""'; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/directiveLocation.js": /*!*********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/directiveLocation.js ***! \*********************************************************************************************/ /*! flagged exports */ /*! export DirectiveLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DirectiveLocation = void 0; /** * The set of allowed directive location values. */ var DirectiveLocation = Object.freeze({ // Request Definitions QUERY: 'QUERY', MUTATION: 'MUTATION', SUBSCRIPTION: 'SUBSCRIPTION', FIELD: 'FIELD', FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', INLINE_FRAGMENT: 'INLINE_FRAGMENT', VARIABLE_DEFINITION: 'VARIABLE_DEFINITION', // Type System Definitions SCHEMA: 'SCHEMA', SCALAR: 'SCALAR', OBJECT: 'OBJECT', FIELD_DEFINITION: 'FIELD_DEFINITION', ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', INTERFACE: 'INTERFACE', UNION: 'UNION', ENUM: 'ENUM', ENUM_VALUE: 'ENUM_VALUE', INPUT_OBJECT: 'INPUT_OBJECT', INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION' }); /** * The enum type representing the directive location values. */ exports.DirectiveLocation = DirectiveLocation; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js": /*!*********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/index.js ***! \*********************************************************************************/ /*! flagged exports */ /*! export BREAK [provided] [no usage info] [missing usage info prevents renaming] */ /*! export DirectiveLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export Kind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export Source [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TokenKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createLexer [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getVisitFn [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isExecutableDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSelectionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeExtensionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeSystemDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeSystemExtensionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValueNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parse [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parseType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parseValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export print [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printSourceLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visit [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visitInParallel [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visitWithTypeInfo [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "Source", ({ enumerable: true, get: function get() { return _source.Source; } })); Object.defineProperty(exports, "getLocation", ({ enumerable: true, get: function get() { return _location.getLocation; } })); Object.defineProperty(exports, "printLocation", ({ enumerable: true, get: function get() { return _printLocation.printLocation; } })); Object.defineProperty(exports, "printSourceLocation", ({ enumerable: true, get: function get() { return _printLocation.printSourceLocation; } })); Object.defineProperty(exports, "Kind", ({ enumerable: true, get: function get() { return _kinds.Kind; } })); Object.defineProperty(exports, "TokenKind", ({ enumerable: true, get: function get() { return _tokenKind.TokenKind; } })); Object.defineProperty(exports, "createLexer", ({ enumerable: true, get: function get() { return _lexer.createLexer; } })); Object.defineProperty(exports, "parse", ({ enumerable: true, get: function get() { return _parser.parse; } })); Object.defineProperty(exports, "parseValue", ({ enumerable: true, get: function get() { return _parser.parseValue; } })); Object.defineProperty(exports, "parseType", ({ enumerable: true, get: function get() { return _parser.parseType; } })); Object.defineProperty(exports, "print", ({ enumerable: true, get: function get() { return _printer.print; } })); Object.defineProperty(exports, "visit", ({ enumerable: true, get: function get() { return _visitor.visit; } })); Object.defineProperty(exports, "visitInParallel", ({ enumerable: true, get: function get() { return _visitor.visitInParallel; } })); Object.defineProperty(exports, "visitWithTypeInfo", ({ enumerable: true, get: function get() { return _visitor.visitWithTypeInfo; } })); Object.defineProperty(exports, "getVisitFn", ({ enumerable: true, get: function get() { return _visitor.getVisitFn; } })); Object.defineProperty(exports, "BREAK", ({ enumerable: true, get: function get() { return _visitor.BREAK; } })); Object.defineProperty(exports, "isDefinitionNode", ({ enumerable: true, get: function get() { return _predicates.isDefinitionNode; } })); Object.defineProperty(exports, "isExecutableDefinitionNode", ({ enumerable: true, get: function get() { return _predicates.isExecutableDefinitionNode; } })); Object.defineProperty(exports, "isSelectionNode", ({ enumerable: true, get: function get() { return _predicates.isSelectionNode; } })); Object.defineProperty(exports, "isValueNode", ({ enumerable: true, get: function get() { return _predicates.isValueNode; } })); Object.defineProperty(exports, "isTypeNode", ({ enumerable: true, get: function get() { return _predicates.isTypeNode; } })); Object.defineProperty(exports, "isTypeSystemDefinitionNode", ({ enumerable: true, get: function get() { return _predicates.isTypeSystemDefinitionNode; } })); Object.defineProperty(exports, "isTypeDefinitionNode", ({ enumerable: true, get: function get() { return _predicates.isTypeDefinitionNode; } })); Object.defineProperty(exports, "isTypeSystemExtensionNode", ({ enumerable: true, get: function get() { return _predicates.isTypeSystemExtensionNode; } })); Object.defineProperty(exports, "isTypeExtensionNode", ({ enumerable: true, get: function get() { return _predicates.isTypeExtensionNode; } })); Object.defineProperty(exports, "DirectiveLocation", ({ enumerable: true, get: function get() { return _directiveLocation.DirectiveLocation; } })); var _source = __webpack_require__(/*! ./source */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/source.js"); var _location = __webpack_require__(/*! ./location */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/location.js"); var _printLocation = __webpack_require__(/*! ./printLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printLocation.js"); var _kinds = __webpack_require__(/*! ./kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _tokenKind = __webpack_require__(/*! ./tokenKind */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/tokenKind.js"); var _lexer = __webpack_require__(/*! ./lexer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/lexer.js"); var _parser = __webpack_require__(/*! ./parser */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/parser.js"); var _printer = __webpack_require__(/*! ./printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _visitor = __webpack_require__(/*! ./visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); var _predicates = __webpack_require__(/*! ./predicates */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js"); var _directiveLocation = __webpack_require__(/*! ./directiveLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/directiveLocation.js"); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js": /*!*********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js ***! \*********************************************************************************/ /*! flagged exports */ /*! export Kind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Kind = void 0; /** * The set of allowed kind values for AST nodes. */ var Kind = Object.freeze({ // Name NAME: 'Name', // Document DOCUMENT: 'Document', OPERATION_DEFINITION: 'OperationDefinition', VARIABLE_DEFINITION: 'VariableDefinition', SELECTION_SET: 'SelectionSet', FIELD: 'Field', ARGUMENT: 'Argument', // Fragments FRAGMENT_SPREAD: 'FragmentSpread', INLINE_FRAGMENT: 'InlineFragment', FRAGMENT_DEFINITION: 'FragmentDefinition', // Values VARIABLE: 'Variable', INT: 'IntValue', FLOAT: 'FloatValue', STRING: 'StringValue', BOOLEAN: 'BooleanValue', NULL: 'NullValue', ENUM: 'EnumValue', LIST: 'ListValue', OBJECT: 'ObjectValue', OBJECT_FIELD: 'ObjectField', // Directives DIRECTIVE: 'Directive', // Types NAMED_TYPE: 'NamedType', LIST_TYPE: 'ListType', NON_NULL_TYPE: 'NonNullType', // Type System Definitions SCHEMA_DEFINITION: 'SchemaDefinition', OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition', // Type Definitions SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition', OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition', FIELD_DEFINITION: 'FieldDefinition', INPUT_VALUE_DEFINITION: 'InputValueDefinition', INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition', UNION_TYPE_DEFINITION: 'UnionTypeDefinition', ENUM_TYPE_DEFINITION: 'EnumTypeDefinition', ENUM_VALUE_DEFINITION: 'EnumValueDefinition', INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition', // Directive Definitions DIRECTIVE_DEFINITION: 'DirectiveDefinition', // Type System Extensions SCHEMA_EXTENSION: 'SchemaExtension', // Type Extensions SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension', OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension', INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension', UNION_TYPE_EXTENSION: 'UnionTypeExtension', ENUM_TYPE_EXTENSION: 'EnumTypeExtension', INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension' }); /** * The enum type representing the possible kind values of AST nodes. */ exports.Kind = Kind; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/lexer.js": /*!*********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/lexer.js ***! \*********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createLexer [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isPunctuatorToken [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createLexer = createLexer; exports.isPunctuatorToken = isPunctuatorToken; var _defineToJSON = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToJSON */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToJSON.js")); var _syntaxError = __webpack_require__(/*! ../error/syntaxError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/syntaxError.js"); var _blockString = __webpack_require__(/*! ./blockString */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/blockString.js"); var _tokenKind = __webpack_require__(/*! ./tokenKind */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/tokenKind.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Given a Source object, this returns a Lexer for that source. * A Lexer is a stateful stream generator in that every time * it is advanced, it returns the next token in the Source. Assuming the * source lexes, the final Token emitted by the lexer will be of kind * EOF, after which the lexer will repeatedly return the same EOF token * whenever called. */ function createLexer(source, options) { var startOfFileToken = new Tok(_tokenKind.TokenKind.SOF, 0, 0, 0, 0, null); var lexer = { source: source, options: options, lastToken: startOfFileToken, token: startOfFileToken, line: 1, lineStart: 0, advance: advanceLexer, lookahead: lookahead }; return lexer; } function advanceLexer() { this.lastToken = this.token; var token = this.token = this.lookahead(); return token; } function lookahead() { var token = this.token; if (token.kind !== _tokenKind.TokenKind.EOF) { do { // Note: next is only mutable during parsing, so we cast to allow this. token = token.next || (token.next = readToken(this, token)); } while (token.kind === _tokenKind.TokenKind.COMMENT); } return token; } /** * The return type of createLexer. */ // @internal function isPunctuatorToken(token) { var kind = token.kind; return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKind.AMP || kind === _tokenKind.TokenKind.PAREN_L || kind === _tokenKind.TokenKind.PAREN_R || kind === _tokenKind.TokenKind.SPREAD || kind === _tokenKind.TokenKind.COLON || kind === _tokenKind.TokenKind.EQUALS || kind === _tokenKind.TokenKind.AT || kind === _tokenKind.TokenKind.BRACKET_L || kind === _tokenKind.TokenKind.BRACKET_R || kind === _tokenKind.TokenKind.BRACE_L || kind === _tokenKind.TokenKind.PIPE || kind === _tokenKind.TokenKind.BRACE_R; } /** * Helper function for constructing the Token object. */ function Tok(kind, start, end, line, column, prev, value) { this.kind = kind; this.start = start; this.end = end; this.line = line; this.column = column; this.value = value; this.prev = prev; this.next = null; } // Print a simplified form when appearing in JSON/util.inspect. (0, _defineToJSON.default)(Tok, function () { return { kind: this.kind, value: this.value, line: this.line, column: this.column }; }); function printCharCode(code) { return (// NaN/undefined represents access beyond the end of the file. isNaN(code) ? _tokenKind.TokenKind.EOF : // Trust JSON for ASCII. code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form. "\"\\u".concat(('00' + code.toString(16).toUpperCase()).slice(-4), "\"") ); } /** * Gets the next token from the source starting at the given position. * * This skips over whitespace until it finds the next lexable token, then lexes * punctuators immediately or calls the appropriate helper function for more * complicated tokens. */ function readToken(lexer, prev) { var source = lexer.source; var body = source.body; var bodyLength = body.length; var pos = positionAfterWhitespace(body, prev.end, lexer); var line = lexer.line; var col = 1 + pos - lexer.lineStart; if (pos >= bodyLength) { return new Tok(_tokenKind.TokenKind.EOF, bodyLength, bodyLength, line, col, prev); } var code = body.charCodeAt(pos); // SourceCharacter switch (code) { // ! case 33: return new Tok(_tokenKind.TokenKind.BANG, pos, pos + 1, line, col, prev); // # case 35: return readComment(source, pos, line, col, prev); // $ case 36: return new Tok(_tokenKind.TokenKind.DOLLAR, pos, pos + 1, line, col, prev); // & case 38: return new Tok(_tokenKind.TokenKind.AMP, pos, pos + 1, line, col, prev); // ( case 40: return new Tok(_tokenKind.TokenKind.PAREN_L, pos, pos + 1, line, col, prev); // ) case 41: return new Tok(_tokenKind.TokenKind.PAREN_R, pos, pos + 1, line, col, prev); // . case 46: if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) { return new Tok(_tokenKind.TokenKind.SPREAD, pos, pos + 3, line, col, prev); } break; // : case 58: return new Tok(_tokenKind.TokenKind.COLON, pos, pos + 1, line, col, prev); // = case 61: return new Tok(_tokenKind.TokenKind.EQUALS, pos, pos + 1, line, col, prev); // @ case 64: return new Tok(_tokenKind.TokenKind.AT, pos, pos + 1, line, col, prev); // [ case 91: return new Tok(_tokenKind.TokenKind.BRACKET_L, pos, pos + 1, line, col, prev); // ] case 93: return new Tok(_tokenKind.TokenKind.BRACKET_R, pos, pos + 1, line, col, prev); // { case 123: return new Tok(_tokenKind.TokenKind.BRACE_L, pos, pos + 1, line, col, prev); // | case 124: return new Tok(_tokenKind.TokenKind.PIPE, pos, pos + 1, line, col, prev); // } case 125: return new Tok(_tokenKind.TokenKind.BRACE_R, pos, pos + 1, line, col, prev); // A-Z _ a-z case 65: case 66: case 67: case 68: case 69: case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: case 78: case 79: case 80: case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88: case 89: case 90: case 95: case 97: case 98: case 99: case 100: case 101: case 102: case 103: case 104: case 105: case 106: case 107: case 108: case 109: case 110: case 111: case 112: case 113: case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: case 122: return readName(source, pos, line, col, prev); // - 0-9 case 45: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: return readNumber(source, pos, code, line, col, prev); // " case 34: if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) { return readBlockString(source, pos, line, col, prev, lexer); } return readString(source, pos, line, col, prev); } throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code)); } /** * Report a message that an unexpected character was encountered. */ function unexpectedCharacterMessage(code) { if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { return "Cannot contain the invalid character ".concat(printCharCode(code), "."); } if (code === 39) { // ' return 'Unexpected single quote character (\'), did you mean to use a double quote (")?'; } return "Cannot parse the unexpected character ".concat(printCharCode(code), "."); } /** * Reads from body starting at startPosition until it finds a non-whitespace * character, then returns the position of that character for lexing. */ function positionAfterWhitespace(body, startPosition, lexer) { var bodyLength = body.length; var position = startPosition; while (position < bodyLength) { var code = body.charCodeAt(position); // tab | space | comma | BOM if (code === 9 || code === 32 || code === 44 || code === 0xfeff) { ++position; } else if (code === 10) { // new line ++position; ++lexer.line; lexer.lineStart = position; } else if (code === 13) { // carriage return if (body.charCodeAt(position + 1) === 10) { position += 2; } else { ++position; } ++lexer.line; lexer.lineStart = position; } else { break; } } return position; } /** * Reads a comment token from the source file. * * #[\u0009\u0020-\uFFFF]* */ function readComment(source, start, line, col, prev) { var body = source.body; var code; var position = start; do { code = body.charCodeAt(++position); } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator code > 0x001f || code === 0x0009)); return new Tok(_tokenKind.TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position)); } /** * Reads a number token from the source file, either a float * or an int depending on whether a decimal point appears. * * Int: -?(0|[1-9][0-9]*) * Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? */ function readNumber(source, start, firstCode, line, col, prev) { var body = source.body; var code = firstCode; var position = start; var isFloat = false; if (code === 45) { // - code = body.charCodeAt(++position); } if (code === 48) { // 0 code = body.charCodeAt(++position); if (code >= 48 && code <= 57) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), ".")); } } else { position = readDigits(source, position, code); code = body.charCodeAt(position); } if (code === 46) { // . isFloat = true; code = body.charCodeAt(++position); position = readDigits(source, position, code); code = body.charCodeAt(position); } if (code === 69 || code === 101) { // E e isFloat = true; code = body.charCodeAt(++position); if (code === 43 || code === 45) { // + - code = body.charCodeAt(++position); } position = readDigits(source, position, code); code = body.charCodeAt(position); } // Numbers cannot be followed by . or e if (code === 46 || code === 69 || code === 101) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); } return new Tok(isFloat ? _tokenKind.TokenKind.FLOAT : _tokenKind.TokenKind.INT, start, position, line, col, prev, body.slice(start, position)); } /** * Returns the new position in the source after reading digits. */ function readDigits(source, start, firstCode) { var body = source.body; var position = start; var code = firstCode; if (code >= 48 && code <= 57) { // 0 - 9 do { code = body.charCodeAt(++position); } while (code >= 48 && code <= 57); // 0 - 9 return position; } throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); } /** * Reads a string token from the source file. * * "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*" */ function readString(source, start, line, col, prev) { var body = source.body; var position = start + 1; var chunkStart = position; var code = 0; var value = ''; while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator code !== 0x000a && code !== 0x000d) { // Closing Quote (") if (code === 34) { value += body.slice(chunkStart, position); return new Tok(_tokenKind.TokenKind.STRING, start, position + 1, line, col, prev, value); } // SourceCharacter if (code < 0x0020 && code !== 0x0009) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); } ++position; if (code === 92) { // \ value += body.slice(chunkStart, position - 1); code = body.charCodeAt(position); switch (code) { case 34: value += '"'; break; case 47: value += '/'; break; case 92: value += '\\'; break; case 98: value += '\b'; break; case 102: value += '\f'; break; case 110: value += '\n'; break; case 114: value += '\r'; break; case 116: value += '\t'; break; case 117: { // uXXXX var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4)); if (charCode < 0) { var invalidSequence = body.slice(position + 1, position + 5); throw (0, _syntaxError.syntaxError)(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, ".")); } value += String.fromCharCode(charCode); position += 4; break; } default: throw (0, _syntaxError.syntaxError)(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), ".")); } ++position; chunkStart = position; } } throw (0, _syntaxError.syntaxError)(source, position, 'Unterminated string.'); } /** * Reads a block string token from the source file. * * """("?"?(\\"""|\\(?!=""")|[^"\\]))*""" */ function readBlockString(source, start, line, col, prev, lexer) { var body = source.body; var position = start + 3; var chunkStart = position; var code = 0; var rawValue = ''; while (position < body.length && !isNaN(code = body.charCodeAt(position))) { // Closing Triple-Quote (""") if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) { rawValue += body.slice(chunkStart, position); return new Tok(_tokenKind.TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, (0, _blockString.dedentBlockStringValue)(rawValue)); } // SourceCharacter if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); } if (code === 10) { // new line ++position; ++lexer.line; lexer.lineStart = position; } else if (code === 13) { // carriage return if (body.charCodeAt(position + 1) === 10) { position += 2; } else { ++position; } ++lexer.line; lexer.lineStart = position; } else if ( // Escape Triple-Quote (\""") code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) { rawValue += body.slice(chunkStart, position) + '"""'; position += 4; chunkStart = position; } else { ++position; } } throw (0, _syntaxError.syntaxError)(source, position, 'Unterminated string.'); } /** * Converts four hexadecimal chars to the integer that the * string represents. For example, uniCharCode('0','0','0','f') * will return 15, and uniCharCode('0','0','f','f') returns 255. * * Returns a negative number on error, if a char was invalid. * * This is implemented by noting that char2hex() returns -1 on error, * which means the result of ORing the char2hex() will also be negative. */ function uniCharCode(a, b, c, d) { return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d); } /** * Converts a hex character to its integer value. * '0' becomes 0, '9' becomes 9 * 'A' becomes 10, 'F' becomes 15 * 'a' becomes 10, 'f' becomes 15 * * Returns -1 on error. */ function char2hex(a) { return a >= 48 && a <= 57 ? a - 48 // 0-9 : a >= 65 && a <= 70 ? a - 55 // A-F : a >= 97 && a <= 102 ? a - 87 // a-f : -1; } /** * Reads an alphanumeric + underscore name from the source. * * [_A-Za-z][_0-9A-Za-z]* */ function readName(source, start, line, col, prev) { var body = source.body; var bodyLength = body.length; var position = start + 1; var code = 0; while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _ code >= 48 && code <= 57 || // 0-9 code >= 65 && code <= 90 || // A-Z code >= 97 && code <= 122) // a-z ) { ++position; } return new Tok(_tokenKind.TokenKind.NAME, start, position, line, col, prev, body.slice(start, position)); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/location.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/location.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getLocation = getLocation; /** * Represents a location in a Source. */ /** * Takes a Source and a UTF-8 character offset, and returns the corresponding * line and column as a SourceLocation. */ function getLocation(source, position) { var lineRegexp = /\r\n|[\n\r]/g; var line = 1; var column = position + 1; var match; while ((match = lineRegexp.exec(source.body)) && match.index < position) { line += 1; column = position + 1 - (match.index + match[0].length); } return { line: line, column: column }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/parser.js": /*!**********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/parser.js ***! \**********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parse [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parseType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parseValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.parse = parse; exports.parseValue = parseValue; exports.parseType = parseType; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _defineToJSON = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToJSON */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToJSON.js")); var _syntaxError = __webpack_require__(/*! ../error/syntaxError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/syntaxError.js"); var _kinds = __webpack_require__(/*! ./kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _source = __webpack_require__(/*! ./source */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/source.js"); var _lexer = __webpack_require__(/*! ./lexer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/lexer.js"); var _directiveLocation = __webpack_require__(/*! ./directiveLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/directiveLocation.js"); var _tokenKind = __webpack_require__(/*! ./tokenKind */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/tokenKind.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Given a GraphQL source, parses it into a Document. * Throws GraphQLError if a syntax error is encountered. */ function parse(source, options) { var parser = new Parser(source, options); return parser.parseDocument(); } /** * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for * that value. * Throws GraphQLError if a syntax error is encountered. * * This is useful within tools that operate upon GraphQL Values directly and * in isolation of complete GraphQL documents. * * Consider providing the results to the utility function: valueFromAST(). */ function parseValue(source, options) { var parser = new Parser(source, options); parser.expectToken(_tokenKind.TokenKind.SOF); var value = parser.parseValueLiteral(false); parser.expectToken(_tokenKind.TokenKind.EOF); return value; } /** * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for * that type. * Throws GraphQLError if a syntax error is encountered. * * This is useful within tools that operate upon GraphQL Types directly and * in isolation of complete GraphQL documents. * * Consider providing the results to the utility function: typeFromAST(). */ function parseType(source, options) { var parser = new Parser(source, options); parser.expectToken(_tokenKind.TokenKind.SOF); var type = parser.parseTypeReference(); parser.expectToken(_tokenKind.TokenKind.EOF); return type; } var Parser = /*#__PURE__*/ function () { function Parser(source, options) { var sourceObj = typeof source === 'string' ? new _source.Source(source) : source; sourceObj instanceof _source.Source || (0, _devAssert.default)(0, "Must provide Source. Received: ".concat((0, _inspect.default)(sourceObj))); this._lexer = (0, _lexer.createLexer)(sourceObj); this._options = options || {}; } /** * Converts a name lex token into a name parse node. */ var _proto = Parser.prototype; _proto.parseName = function parseName() { var token = this.expectToken(_tokenKind.TokenKind.NAME); return { kind: _kinds.Kind.NAME, value: token.value, loc: this.loc(token) }; } // Implements the parsing rules in the Document section. /** * Document : Definition+ */ ; _proto.parseDocument = function parseDocument() { var start = this._lexer.token; return { kind: _kinds.Kind.DOCUMENT, definitions: this.many(_tokenKind.TokenKind.SOF, this.parseDefinition, _tokenKind.TokenKind.EOF), loc: this.loc(start) }; } /** * Definition : * - ExecutableDefinition * - TypeSystemDefinition * - TypeSystemExtension * * ExecutableDefinition : * - OperationDefinition * - FragmentDefinition */ ; _proto.parseDefinition = function parseDefinition() { if (this.peek(_tokenKind.TokenKind.NAME)) { switch (this._lexer.token.value) { case 'query': case 'mutation': case 'subscription': return this.parseOperationDefinition(); case 'fragment': return this.parseFragmentDefinition(); case 'schema': case 'scalar': case 'type': case 'interface': case 'union': case 'enum': case 'input': case 'directive': return this.parseTypeSystemDefinition(); case 'extend': return this.parseTypeSystemExtension(); } } else if (this.peek(_tokenKind.TokenKind.BRACE_L)) { return this.parseOperationDefinition(); } else if (this.peekDescription()) { return this.parseTypeSystemDefinition(); } throw this.unexpected(); } // Implements the parsing rules in the Operations section. /** * OperationDefinition : * - SelectionSet * - OperationType Name? VariableDefinitions? Directives? SelectionSet */ ; _proto.parseOperationDefinition = function parseOperationDefinition() { var start = this._lexer.token; if (this.peek(_tokenKind.TokenKind.BRACE_L)) { return { kind: _kinds.Kind.OPERATION_DEFINITION, operation: 'query', name: undefined, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } var operation = this.parseOperationType(); var name; if (this.peek(_tokenKind.TokenKind.NAME)) { name = this.parseName(); } return { kind: _kinds.Kind.OPERATION_DEFINITION, operation: operation, name: name, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } /** * OperationType : one of query mutation subscription */ ; _proto.parseOperationType = function parseOperationType() { var operationToken = this.expectToken(_tokenKind.TokenKind.NAME); switch (operationToken.value) { case 'query': return 'query'; case 'mutation': return 'mutation'; case 'subscription': return 'subscription'; } throw this.unexpected(operationToken); } /** * VariableDefinitions : ( VariableDefinition+ ) */ ; _proto.parseVariableDefinitions = function parseVariableDefinitions() { return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseVariableDefinition, _tokenKind.TokenKind.PAREN_R); } /** * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? */ ; _proto.parseVariableDefinition = function parseVariableDefinition() { var start = this._lexer.token; return { kind: _kinds.Kind.VARIABLE_DEFINITION, variable: this.parseVariable(), type: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined, directives: this.parseDirectives(true), loc: this.loc(start) }; } /** * Variable : $ Name */ ; _proto.parseVariable = function parseVariable() { var start = this._lexer.token; this.expectToken(_tokenKind.TokenKind.DOLLAR); return { kind: _kinds.Kind.VARIABLE, name: this.parseName(), loc: this.loc(start) }; } /** * SelectionSet : { Selection+ } */ ; _proto.parseSelectionSet = function parseSelectionSet() { var start = this._lexer.token; return { kind: _kinds.Kind.SELECTION_SET, selections: this.many(_tokenKind.TokenKind.BRACE_L, this.parseSelection, _tokenKind.TokenKind.BRACE_R), loc: this.loc(start) }; } /** * Selection : * - Field * - FragmentSpread * - InlineFragment */ ; _proto.parseSelection = function parseSelection() { return this.peek(_tokenKind.TokenKind.SPREAD) ? this.parseFragment() : this.parseField(); } /** * Field : Alias? Name Arguments? Directives? SelectionSet? * * Alias : Name : */ ; _proto.parseField = function parseField() { var start = this._lexer.token; var nameOrAlias = this.parseName(); var alias; var name; if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) { alias = nameOrAlias; name = this.parseName(); } else { name = nameOrAlias; } return { kind: _kinds.Kind.FIELD, alias: alias, name: name, arguments: this.parseArguments(false), directives: this.parseDirectives(false), selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined, loc: this.loc(start) }; } /** * Arguments[Const] : ( Argument[?Const]+ ) */ ; _proto.parseArguments = function parseArguments(isConst) { var item = isConst ? this.parseConstArgument : this.parseArgument; return this.optionalMany(_tokenKind.TokenKind.PAREN_L, item, _tokenKind.TokenKind.PAREN_R); } /** * Argument[Const] : Name : Value[?Const] */ ; _proto.parseArgument = function parseArgument() { var start = this._lexer.token; var name = this.parseName(); this.expectToken(_tokenKind.TokenKind.COLON); return { kind: _kinds.Kind.ARGUMENT, name: name, value: this.parseValueLiteral(false), loc: this.loc(start) }; }; _proto.parseConstArgument = function parseConstArgument() { var start = this._lexer.token; return { kind: _kinds.Kind.ARGUMENT, name: this.parseName(), value: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseValueLiteral(true)), loc: this.loc(start) }; } // Implements the parsing rules in the Fragments section. /** * Corresponds to both FragmentSpread and InlineFragment in the spec. * * FragmentSpread : ... FragmentName Directives? * * InlineFragment : ... TypeCondition? Directives? SelectionSet */ ; _proto.parseFragment = function parseFragment() { var start = this._lexer.token; this.expectToken(_tokenKind.TokenKind.SPREAD); var hasTypeCondition = this.expectOptionalKeyword('on'); if (!hasTypeCondition && this.peek(_tokenKind.TokenKind.NAME)) { return { kind: _kinds.Kind.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(false), loc: this.loc(start) }; } return { kind: _kinds.Kind.INLINE_FRAGMENT, typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } /** * FragmentDefinition : * - fragment FragmentName on TypeCondition Directives? SelectionSet * * TypeCondition : NamedType */ ; _proto.parseFragmentDefinition = function parseFragmentDefinition() { var start = this._lexer.token; this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes // the grammar of FragmentDefinition: // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet if (this._options.experimentalFragmentVariables) { return { kind: _kinds.Kind.FRAGMENT_DEFINITION, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword('on'), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } return { kind: _kinds.Kind.FRAGMENT_DEFINITION, name: this.parseFragmentName(), typeCondition: (this.expectKeyword('on'), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } /** * FragmentName : Name but not `on` */ ; _proto.parseFragmentName = function parseFragmentName() { if (this._lexer.token.value === 'on') { throw this.unexpected(); } return this.parseName(); } // Implements the parsing rules in the Values section. /** * Value[Const] : * - [~Const] Variable * - IntValue * - FloatValue * - StringValue * - BooleanValue * - NullValue * - EnumValue * - ListValue[?Const] * - ObjectValue[?Const] * * BooleanValue : one of `true` `false` * * NullValue : `null` * * EnumValue : Name but not `true`, `false` or `null` */ ; _proto.parseValueLiteral = function parseValueLiteral(isConst) { var token = this._lexer.token; switch (token.kind) { case _tokenKind.TokenKind.BRACKET_L: return this.parseList(isConst); case _tokenKind.TokenKind.BRACE_L: return this.parseObject(isConst); case _tokenKind.TokenKind.INT: this._lexer.advance(); return { kind: _kinds.Kind.INT, value: token.value, loc: this.loc(token) }; case _tokenKind.TokenKind.FLOAT: this._lexer.advance(); return { kind: _kinds.Kind.FLOAT, value: token.value, loc: this.loc(token) }; case _tokenKind.TokenKind.STRING: case _tokenKind.TokenKind.BLOCK_STRING: return this.parseStringLiteral(); case _tokenKind.TokenKind.NAME: if (token.value === 'true' || token.value === 'false') { this._lexer.advance(); return { kind: _kinds.Kind.BOOLEAN, value: token.value === 'true', loc: this.loc(token) }; } else if (token.value === 'null') { this._lexer.advance(); return { kind: _kinds.Kind.NULL, loc: this.loc(token) }; } this._lexer.advance(); return { kind: _kinds.Kind.ENUM, value: token.value, loc: this.loc(token) }; case _tokenKind.TokenKind.DOLLAR: if (!isConst) { return this.parseVariable(); } break; } throw this.unexpected(); }; _proto.parseStringLiteral = function parseStringLiteral() { var token = this._lexer.token; this._lexer.advance(); return { kind: _kinds.Kind.STRING, value: token.value, block: token.kind === _tokenKind.TokenKind.BLOCK_STRING, loc: this.loc(token) }; } /** * ListValue[Const] : * - [ ] * - [ Value[?Const]+ ] */ ; _proto.parseList = function parseList(isConst) { var _this = this; var start = this._lexer.token; var item = function item() { return _this.parseValueLiteral(isConst); }; return { kind: _kinds.Kind.LIST, values: this.any(_tokenKind.TokenKind.BRACKET_L, item, _tokenKind.TokenKind.BRACKET_R), loc: this.loc(start) }; } /** * ObjectValue[Const] : * - { } * - { ObjectField[?Const]+ } */ ; _proto.parseObject = function parseObject(isConst) { var _this2 = this; var start = this._lexer.token; var item = function item() { return _this2.parseObjectField(isConst); }; return { kind: _kinds.Kind.OBJECT, fields: this.any(_tokenKind.TokenKind.BRACE_L, item, _tokenKind.TokenKind.BRACE_R), loc: this.loc(start) }; } /** * ObjectField[Const] : Name : Value[?Const] */ ; _proto.parseObjectField = function parseObjectField(isConst) { var start = this._lexer.token; var name = this.parseName(); this.expectToken(_tokenKind.TokenKind.COLON); return { kind: _kinds.Kind.OBJECT_FIELD, name: name, value: this.parseValueLiteral(isConst), loc: this.loc(start) }; } // Implements the parsing rules in the Directives section. /** * Directives[Const] : Directive[?Const]+ */ ; _proto.parseDirectives = function parseDirectives(isConst) { var directives = []; while (this.peek(_tokenKind.TokenKind.AT)) { directives.push(this.parseDirective(isConst)); } return directives; } /** * Directive[Const] : @ Name Arguments[?Const]? */ ; _proto.parseDirective = function parseDirective(isConst) { var start = this._lexer.token; this.expectToken(_tokenKind.TokenKind.AT); return { kind: _kinds.Kind.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(isConst), loc: this.loc(start) }; } // Implements the parsing rules in the Types section. /** * Type : * - NamedType * - ListType * - NonNullType */ ; _proto.parseTypeReference = function parseTypeReference() { var start = this._lexer.token; var type; if (this.expectOptionalToken(_tokenKind.TokenKind.BRACKET_L)) { type = this.parseTypeReference(); this.expectToken(_tokenKind.TokenKind.BRACKET_R); type = { kind: _kinds.Kind.LIST_TYPE, type: type, loc: this.loc(start) }; } else { type = this.parseNamedType(); } if (this.expectOptionalToken(_tokenKind.TokenKind.BANG)) { return { kind: _kinds.Kind.NON_NULL_TYPE, type: type, loc: this.loc(start) }; } return type; } /** * NamedType : Name */ ; _proto.parseNamedType = function parseNamedType() { var start = this._lexer.token; return { kind: _kinds.Kind.NAMED_TYPE, name: this.parseName(), loc: this.loc(start) }; } // Implements the parsing rules in the Type Definition section. /** * TypeSystemDefinition : * - SchemaDefinition * - TypeDefinition * - DirectiveDefinition * * TypeDefinition : * - ScalarTypeDefinition * - ObjectTypeDefinition * - InterfaceTypeDefinition * - UnionTypeDefinition * - EnumTypeDefinition * - InputObjectTypeDefinition */ ; _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() { // Many definitions begin with a description and require a lookahead. var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token; if (keywordToken.kind === _tokenKind.TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return this.parseSchemaDefinition(); case 'scalar': return this.parseScalarTypeDefinition(); case 'type': return this.parseObjectTypeDefinition(); case 'interface': return this.parseInterfaceTypeDefinition(); case 'union': return this.parseUnionTypeDefinition(); case 'enum': return this.parseEnumTypeDefinition(); case 'input': return this.parseInputObjectTypeDefinition(); case 'directive': return this.parseDirectiveDefinition(); } } throw this.unexpected(keywordToken); }; _proto.peekDescription = function peekDescription() { return this.peek(_tokenKind.TokenKind.STRING) || this.peek(_tokenKind.TokenKind.BLOCK_STRING); } /** * Description : StringValue */ ; _proto.parseDescription = function parseDescription() { if (this.peekDescription()) { return this.parseStringLiteral(); } } /** * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ } */ ; _proto.parseSchemaDefinition = function parseSchemaDefinition() { var start = this._lexer.token; this.expectKeyword('schema'); var directives = this.parseDirectives(true); var operationTypes = this.many(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); return { kind: _kinds.Kind.SCHEMA_DEFINITION, directives: directives, operationTypes: operationTypes, loc: this.loc(start) }; } /** * OperationTypeDefinition : OperationType : NamedType */ ; _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() { var start = this._lexer.token; var operation = this.parseOperationType(); this.expectToken(_tokenKind.TokenKind.COLON); var type = this.parseNamedType(); return { kind: _kinds.Kind.OPERATION_TYPE_DEFINITION, operation: operation, type: type, loc: this.loc(start) }; } /** * ScalarTypeDefinition : Description? scalar Name Directives[Const]? */ ; _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('scalar'); var name = this.parseName(); var directives = this.parseDirectives(true); return { kind: _kinds.Kind.SCALAR_TYPE_DEFINITION, description: description, name: name, directives: directives, loc: this.loc(start) }; } /** * ObjectTypeDefinition : * Description? * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? */ ; _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('type'); var name = this.parseName(); var interfaces = this.parseImplementsInterfaces(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); return { kind: _kinds.Kind.OBJECT_TYPE_DEFINITION, description: description, name: name, interfaces: interfaces, directives: directives, fields: fields, loc: this.loc(start) }; } /** * ImplementsInterfaces : * - implements `&`? NamedType * - ImplementsInterfaces & NamedType */ ; _proto.parseImplementsInterfaces = function parseImplementsInterfaces() { var types = []; if (this.expectOptionalKeyword('implements')) { // Optional leading ampersand this.expectOptionalToken(_tokenKind.TokenKind.AMP); do { types.push(this.parseNamedType()); } while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || // Legacy support for the SDL? this._options.allowLegacySDLImplementsInterfaces && this.peek(_tokenKind.TokenKind.NAME)); } return types; } /** * FieldsDefinition : { FieldDefinition+ } */ ; _proto.parseFieldsDefinition = function parseFieldsDefinition() { // Legacy support for the SDL? if (this._options.allowLegacySDLEmptyFields && this.peek(_tokenKind.TokenKind.BRACE_L) && this._lexer.lookahead().kind === _tokenKind.TokenKind.BRACE_R) { this._lexer.advance(); this._lexer.advance(); return []; } return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseFieldDefinition, _tokenKind.TokenKind.BRACE_R); } /** * FieldDefinition : * - Description? Name ArgumentsDefinition? : Type Directives[Const]? */ ; _proto.parseFieldDefinition = function parseFieldDefinition() { var start = this._lexer.token; var description = this.parseDescription(); var name = this.parseName(); var args = this.parseArgumentDefs(); this.expectToken(_tokenKind.TokenKind.COLON); var type = this.parseTypeReference(); var directives = this.parseDirectives(true); return { kind: _kinds.Kind.FIELD_DEFINITION, description: description, name: name, arguments: args, type: type, directives: directives, loc: this.loc(start) }; } /** * ArgumentsDefinition : ( InputValueDefinition+ ) */ ; _proto.parseArgumentDefs = function parseArgumentDefs() { return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseInputValueDef, _tokenKind.TokenKind.PAREN_R); } /** * InputValueDefinition : * - Description? Name : Type DefaultValue? Directives[Const]? */ ; _proto.parseInputValueDef = function parseInputValueDef() { var start = this._lexer.token; var description = this.parseDescription(); var name = this.parseName(); this.expectToken(_tokenKind.TokenKind.COLON); var type = this.parseTypeReference(); var defaultValue; if (this.expectOptionalToken(_tokenKind.TokenKind.EQUALS)) { defaultValue = this.parseValueLiteral(true); } var directives = this.parseDirectives(true); return { kind: _kinds.Kind.INPUT_VALUE_DEFINITION, description: description, name: name, type: type, defaultValue: defaultValue, directives: directives, loc: this.loc(start) }; } /** * InterfaceTypeDefinition : * - Description? interface Name Directives[Const]? FieldsDefinition? */ ; _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('interface'); var name = this.parseName(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); return { kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION, description: description, name: name, directives: directives, fields: fields, loc: this.loc(start) }; } /** * UnionTypeDefinition : * - Description? union Name Directives[Const]? UnionMemberTypes? */ ; _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('union'); var name = this.parseName(); var directives = this.parseDirectives(true); var types = this.parseUnionMemberTypes(); return { kind: _kinds.Kind.UNION_TYPE_DEFINITION, description: description, name: name, directives: directives, types: types, loc: this.loc(start) }; } /** * UnionMemberTypes : * - = `|`? NamedType * - UnionMemberTypes | NamedType */ ; _proto.parseUnionMemberTypes = function parseUnionMemberTypes() { var types = []; if (this.expectOptionalToken(_tokenKind.TokenKind.EQUALS)) { // Optional leading pipe this.expectOptionalToken(_tokenKind.TokenKind.PIPE); do { types.push(this.parseNamedType()); } while (this.expectOptionalToken(_tokenKind.TokenKind.PIPE)); } return types; } /** * EnumTypeDefinition : * - Description? enum Name Directives[Const]? EnumValuesDefinition? */ ; _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('enum'); var name = this.parseName(); var directives = this.parseDirectives(true); var values = this.parseEnumValuesDefinition(); return { kind: _kinds.Kind.ENUM_TYPE_DEFINITION, description: description, name: name, directives: directives, values: values, loc: this.loc(start) }; } /** * EnumValuesDefinition : { EnumValueDefinition+ } */ ; _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() { return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseEnumValueDefinition, _tokenKind.TokenKind.BRACE_R); } /** * EnumValueDefinition : Description? EnumValue Directives[Const]? * * EnumValue : Name */ ; _proto.parseEnumValueDefinition = function parseEnumValueDefinition() { var start = this._lexer.token; var description = this.parseDescription(); var name = this.parseName(); var directives = this.parseDirectives(true); return { kind: _kinds.Kind.ENUM_VALUE_DEFINITION, description: description, name: name, directives: directives, loc: this.loc(start) }; } /** * InputObjectTypeDefinition : * - Description? input Name Directives[Const]? InputFieldsDefinition? */ ; _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('input'); var name = this.parseName(); var directives = this.parseDirectives(true); var fields = this.parseInputFieldsDefinition(); return { kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, description: description, name: name, directives: directives, fields: fields, loc: this.loc(start) }; } /** * InputFieldsDefinition : { InputValueDefinition+ } */ ; _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() { return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseInputValueDef, _tokenKind.TokenKind.BRACE_R); } /** * TypeSystemExtension : * - SchemaExtension * - TypeExtension * * TypeExtension : * - ScalarTypeExtension * - ObjectTypeExtension * - InterfaceTypeExtension * - UnionTypeExtension * - EnumTypeExtension * - InputObjectTypeDefinition */ ; _proto.parseTypeSystemExtension = function parseTypeSystemExtension() { var keywordToken = this._lexer.lookahead(); if (keywordToken.kind === _tokenKind.TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return this.parseSchemaExtension(); case 'scalar': return this.parseScalarTypeExtension(); case 'type': return this.parseObjectTypeExtension(); case 'interface': return this.parseInterfaceTypeExtension(); case 'union': return this.parseUnionTypeExtension(); case 'enum': return this.parseEnumTypeExtension(); case 'input': return this.parseInputObjectTypeExtension(); } } throw this.unexpected(keywordToken); } /** * SchemaExtension : * - extend schema Directives[Const]? { OperationTypeDefinition+ } * - extend schema Directives[Const] */ ; _proto.parseSchemaExtension = function parseSchemaExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('schema'); var directives = this.parseDirectives(true); var operationTypes = this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); if (directives.length === 0 && operationTypes.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.SCHEMA_EXTENSION, directives: directives, operationTypes: operationTypes, loc: this.loc(start) }; } /** * ScalarTypeExtension : * - extend scalar Name Directives[Const] */ ; _proto.parseScalarTypeExtension = function parseScalarTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('scalar'); var name = this.parseName(); var directives = this.parseDirectives(true); if (directives.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.SCALAR_TYPE_EXTENSION, name: name, directives: directives, loc: this.loc(start) }; } /** * ObjectTypeExtension : * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition * - extend type Name ImplementsInterfaces? Directives[Const] * - extend type Name ImplementsInterfaces */ ; _proto.parseObjectTypeExtension = function parseObjectTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('type'); var name = this.parseName(); var interfaces = this.parseImplementsInterfaces(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.OBJECT_TYPE_EXTENSION, name: name, interfaces: interfaces, directives: directives, fields: fields, loc: this.loc(start) }; } /** * InterfaceTypeExtension : * - extend interface Name Directives[Const]? FieldsDefinition * - extend interface Name Directives[Const] */ ; _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('interface'); var name = this.parseName(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); if (directives.length === 0 && fields.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION, name: name, directives: directives, fields: fields, loc: this.loc(start) }; } /** * UnionTypeExtension : * - extend union Name Directives[Const]? UnionMemberTypes * - extend union Name Directives[Const] */ ; _proto.parseUnionTypeExtension = function parseUnionTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('union'); var name = this.parseName(); var directives = this.parseDirectives(true); var types = this.parseUnionMemberTypes(); if (directives.length === 0 && types.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.UNION_TYPE_EXTENSION, name: name, directives: directives, types: types, loc: this.loc(start) }; } /** * EnumTypeExtension : * - extend enum Name Directives[Const]? EnumValuesDefinition * - extend enum Name Directives[Const] */ ; _proto.parseEnumTypeExtension = function parseEnumTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('enum'); var name = this.parseName(); var directives = this.parseDirectives(true); var values = this.parseEnumValuesDefinition(); if (directives.length === 0 && values.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.ENUM_TYPE_EXTENSION, name: name, directives: directives, values: values, loc: this.loc(start) }; } /** * InputObjectTypeExtension : * - extend input Name Directives[Const]? InputFieldsDefinition * - extend input Name Directives[Const] */ ; _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('input'); var name = this.parseName(); var directives = this.parseDirectives(true); var fields = this.parseInputFieldsDefinition(); if (directives.length === 0 && fields.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION, name: name, directives: directives, fields: fields, loc: this.loc(start) }; } /** * DirectiveDefinition : * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations */ ; _proto.parseDirectiveDefinition = function parseDirectiveDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('directive'); this.expectToken(_tokenKind.TokenKind.AT); var name = this.parseName(); var args = this.parseArgumentDefs(); var repeatable = this.expectOptionalKeyword('repeatable'); this.expectKeyword('on'); var locations = this.parseDirectiveLocations(); return { kind: _kinds.Kind.DIRECTIVE_DEFINITION, description: description, name: name, arguments: args, repeatable: repeatable, locations: locations, loc: this.loc(start) }; } /** * DirectiveLocations : * - `|`? DirectiveLocation * - DirectiveLocations | DirectiveLocation */ ; _proto.parseDirectiveLocations = function parseDirectiveLocations() { // Optional leading pipe this.expectOptionalToken(_tokenKind.TokenKind.PIPE); var locations = []; do { locations.push(this.parseDirectiveLocation()); } while (this.expectOptionalToken(_tokenKind.TokenKind.PIPE)); return locations; } /* * DirectiveLocation : * - ExecutableDirectiveLocation * - TypeSystemDirectiveLocation * * ExecutableDirectiveLocation : one of * `QUERY` * `MUTATION` * `SUBSCRIPTION` * `FIELD` * `FRAGMENT_DEFINITION` * `FRAGMENT_SPREAD` * `INLINE_FRAGMENT` * * TypeSystemDirectiveLocation : one of * `SCHEMA` * `SCALAR` * `OBJECT` * `FIELD_DEFINITION` * `ARGUMENT_DEFINITION` * `INTERFACE` * `UNION` * `ENUM` * `ENUM_VALUE` * `INPUT_OBJECT` * `INPUT_FIELD_DEFINITION` */ ; _proto.parseDirectiveLocation = function parseDirectiveLocation() { var start = this._lexer.token; var name = this.parseName(); if (_directiveLocation.DirectiveLocation[name.value] !== undefined) { return name; } throw this.unexpected(start); } // Core parsing utility functions /** * Returns a location object, used to identify the place in * the source that created a given parsed object. */ ; _proto.loc = function loc(startToken) { if (!this._options.noLocation) { return new Loc(startToken, this._lexer.lastToken, this._lexer.source); } } /** * Determines if the next token is of a given kind */ ; _proto.peek = function peek(kind) { return this._lexer.token.kind === kind; } /** * If the next token is of the given kind, return that token after advancing * the lexer. Otherwise, do not change the parser state and throw an error. */ ; _proto.expectToken = function expectToken(kind) { var token = this._lexer.token; if (token.kind === kind) { this._lexer.advance(); return token; } throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, "Expected ".concat(kind, ", found ").concat(getTokenDesc(token))); } /** * If the next token is of the given kind, return that token after advancing * the lexer. Otherwise, do not change the parser state and return undefined. */ ; _proto.expectOptionalToken = function expectOptionalToken(kind) { var token = this._lexer.token; if (token.kind === kind) { this._lexer.advance(); return token; } return undefined; } /** * If the next token is a given keyword, advance the lexer. * Otherwise, do not change the parser state and throw an error. */ ; _proto.expectKeyword = function expectKeyword(value) { var token = this._lexer.token; if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { this._lexer.advance(); } else { throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat(getTokenDesc(token))); } } /** * If the next token is a given keyword, return "true" after advancing * the lexer. Otherwise, do not change the parser state and return "false". */ ; _proto.expectOptionalKeyword = function expectOptionalKeyword(value) { var token = this._lexer.token; if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { this._lexer.advance(); return true; } return false; } /** * Helper function for creating an error when an unexpected lexed token * is encountered. */ ; _proto.unexpected = function unexpected(atToken) { var token = atToken || this._lexer.token; return (0, _syntaxError.syntaxError)(this._lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token))); } /** * Returns a possibly empty list of parse nodes, determined by * the parseFn. This list begins with a lex token of openKind * and ends with a lex token of closeKind. Advances the parser * to the next lex token after the closing token. */ ; _proto.any = function any(openKind, parseFn, closeKind) { this.expectToken(openKind); var nodes = []; while (!this.expectOptionalToken(closeKind)) { nodes.push(parseFn.call(this)); } return nodes; } /** * Returns a list of parse nodes, determined by the parseFn. * It can be empty only if open token is missing otherwise it will always * return non-empty list that begins with a lex token of openKind and ends * with a lex token of closeKind. Advances the parser to the next lex token * after the closing token. */ ; _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) { if (this.expectOptionalToken(openKind)) { var nodes = []; do { nodes.push(parseFn.call(this)); } while (!this.expectOptionalToken(closeKind)); return nodes; } return []; } /** * Returns a non-empty list of parse nodes, determined by * the parseFn. This list begins with a lex token of openKind * and ends with a lex token of closeKind. Advances the parser * to the next lex token after the closing token. */ ; _proto.many = function many(openKind, parseFn, closeKind) { this.expectToken(openKind); var nodes = []; do { nodes.push(parseFn.call(this)); } while (!this.expectOptionalToken(closeKind)); return nodes; }; return Parser; }(); function Loc(startToken, endToken, source) { this.start = startToken.start; this.end = endToken.end; this.startToken = startToken; this.endToken = endToken; this.source = source; } // Print a simplified form when appearing in JSON/util.inspect. (0, _defineToJSON.default)(Loc, function () { return { start: this.start, end: this.end }; }); /** * A helper function to describe a token as a string for debugging */ function getTokenDesc(token) { var value = token.value; return value ? "".concat(token.kind, " \"").concat(value, "\"") : token.kind; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js": /*!**************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js ***! \**************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isExecutableDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSelectionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeExtensionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeSystemDefinitionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeSystemExtensionNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValueNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isDefinitionNode = isDefinitionNode; exports.isExecutableDefinitionNode = isExecutableDefinitionNode; exports.isSelectionNode = isSelectionNode; exports.isValueNode = isValueNode; exports.isTypeNode = isTypeNode; exports.isTypeSystemDefinitionNode = isTypeSystemDefinitionNode; exports.isTypeDefinitionNode = isTypeDefinitionNode; exports.isTypeSystemExtensionNode = isTypeSystemExtensionNode; exports.isTypeExtensionNode = isTypeExtensionNode; var _kinds = __webpack_require__(/*! ./kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); function isDefinitionNode(node) { return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node); } function isExecutableDefinitionNode(node) { return node.kind === _kinds.Kind.OPERATION_DEFINITION || node.kind === _kinds.Kind.FRAGMENT_DEFINITION; } function isSelectionNode(node) { return node.kind === _kinds.Kind.FIELD || node.kind === _kinds.Kind.FRAGMENT_SPREAD || node.kind === _kinds.Kind.INLINE_FRAGMENT; } function isValueNode(node) { return node.kind === _kinds.Kind.VARIABLE || node.kind === _kinds.Kind.INT || node.kind === _kinds.Kind.FLOAT || node.kind === _kinds.Kind.STRING || node.kind === _kinds.Kind.BOOLEAN || node.kind === _kinds.Kind.NULL || node.kind === _kinds.Kind.ENUM || node.kind === _kinds.Kind.LIST || node.kind === _kinds.Kind.OBJECT; } function isTypeNode(node) { return node.kind === _kinds.Kind.NAMED_TYPE || node.kind === _kinds.Kind.LIST_TYPE || node.kind === _kinds.Kind.NON_NULL_TYPE; } function isTypeSystemDefinitionNode(node) { return node.kind === _kinds.Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === _kinds.Kind.DIRECTIVE_DEFINITION; } function isTypeDefinitionNode(node) { return node.kind === _kinds.Kind.SCALAR_TYPE_DEFINITION || node.kind === _kinds.Kind.OBJECT_TYPE_DEFINITION || node.kind === _kinds.Kind.INTERFACE_TYPE_DEFINITION || node.kind === _kinds.Kind.UNION_TYPE_DEFINITION || node.kind === _kinds.Kind.ENUM_TYPE_DEFINITION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION; } function isTypeSystemExtensionNode(node) { return node.kind === _kinds.Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); } function isTypeExtensionNode(node) { return node.kind === _kinds.Kind.SCALAR_TYPE_EXTENSION || node.kind === _kinds.Kind.OBJECT_TYPE_EXTENSION || node.kind === _kinds.Kind.INTERFACE_TYPE_EXTENSION || node.kind === _kinds.Kind.UNION_TYPE_EXTENSION || node.kind === _kinds.Kind.ENUM_TYPE_EXTENSION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printLocation.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/printLocation.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printSourceLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.printLocation = printLocation; exports.printSourceLocation = printSourceLocation; var _location = __webpack_require__(/*! ../language/location */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/location.js"); /** * Render a helpful description of the location in the GraphQL Source document. */ function printLocation(location) { return printSourceLocation(location.source, (0, _location.getLocation)(location.source, location.start)); } /** * Render a helpful description of the location in the GraphQL Source document. */ function printSourceLocation(source, sourceLocation) { var firstLineColumnOffset = source.locationOffset.column - 1; var body = whitespace(firstLineColumnOffset) + source.body; var lineIndex = sourceLocation.line - 1; var lineOffset = source.locationOffset.line - 1; var lineNum = sourceLocation.line + lineOffset; var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; var columnNum = sourceLocation.column + columnOffset; var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n"); var lines = body.split(/\r\n|[\n\r]/g); var locationLine = lines[lineIndex]; // Special case for minified documents if (locationLine.length > 120) { var sublineIndex = Math.floor(columnNum / 80); var sublineColumnNum = columnNum % 80; var sublines = []; for (var i = 0; i < locationLine.length; i += 80) { sublines.push(locationLine.slice(i, i + 80)); } return locationStr + printPrefixedLines([["".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) { return ['', subline]; }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]])); } return locationStr + printPrefixedLines([// Lines specified like this: ["prefix", "string"], ["".concat(lineNum - 1), lines[lineIndex - 1]], ["".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], ["".concat(lineNum + 1), lines[lineIndex + 1]]]); } function printPrefixedLines(lines) { var existingLines = lines.filter(function (_ref) { var _ = _ref[0], line = _ref[1]; return line !== undefined; }); var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) { var prefix = _ref2[0]; return prefix.length; })); return existingLines.map(function (_ref3) { var prefix = _ref3[0], line = _ref3[1]; return lpad(padLen, prefix) + (line ? ' | ' + line : ' |'); }).join('\n'); } function whitespace(len) { return Array(len + 1).join(' '); } function lpad(len, str) { return whitespace(len - str.length) + str; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js": /*!***********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js ***! \***********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export print [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.print = print; var _visitor = __webpack_require__(/*! ./visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); var _blockString = __webpack_require__(/*! ./blockString */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/blockString.js"); /** * Converts an AST into a string, using one set of reasonable * formatting rules. */ function print(ast) { return (0, _visitor.visit)(ast, { leave: printDocASTReducer }); } // TODO: provide better type coverage in future var printDocASTReducer = { Name: function Name(node) { return node.value; }, Variable: function Variable(node) { return '$' + node.name; }, // Document Document: function Document(node) { return join(node.definitions, '\n\n') + '\n'; }, OperationDefinition: function OperationDefinition(node) { var op = node.operation; var name = node.name; var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); var directives = join(node.directives, ' '); var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use // the query short form. return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' '); }, VariableDefinition: function VariableDefinition(_ref) { var variable = _ref.variable, type = _ref.type, defaultValue = _ref.defaultValue, directives = _ref.directives; return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')); }, SelectionSet: function SelectionSet(_ref2) { var selections = _ref2.selections; return block(selections); }, Field: function Field(_ref3) { var alias = _ref3.alias, name = _ref3.name, args = _ref3.arguments, directives = _ref3.directives, selectionSet = _ref3.selectionSet; return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' '); }, Argument: function Argument(_ref4) { var name = _ref4.name, value = _ref4.value; return name + ': ' + value; }, // Fragments FragmentSpread: function FragmentSpread(_ref5) { var name = _ref5.name, directives = _ref5.directives; return '...' + name + wrap(' ', join(directives, ' ')); }, InlineFragment: function InlineFragment(_ref6) { var typeCondition = _ref6.typeCondition, directives = _ref6.directives, selectionSet = _ref6.selectionSet; return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' '); }, FragmentDefinition: function FragmentDefinition(_ref7) { var name = _ref7.name, typeCondition = _ref7.typeCondition, variableDefinitions = _ref7.variableDefinitions, directives = _ref7.directives, selectionSet = _ref7.selectionSet; return (// Note: fragment variable definitions are experimental and may be changed // or removed in the future. "fragment ".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), " ") + "on ".concat(typeCondition, " ").concat(wrap('', join(directives, ' '), ' ')) + selectionSet ); }, // Value IntValue: function IntValue(_ref8) { var value = _ref8.value; return value; }, FloatValue: function FloatValue(_ref9) { var value = _ref9.value; return value; }, StringValue: function StringValue(_ref10, key) { var value = _ref10.value, isBlockString = _ref10.block; return isBlockString ? (0, _blockString.printBlockString)(value, key === 'description' ? '' : ' ') : JSON.stringify(value); }, BooleanValue: function BooleanValue(_ref11) { var value = _ref11.value; return value ? 'true' : 'false'; }, NullValue: function NullValue() { return 'null'; }, EnumValue: function EnumValue(_ref12) { var value = _ref12.value; return value; }, ListValue: function ListValue(_ref13) { var values = _ref13.values; return '[' + join(values, ', ') + ']'; }, ObjectValue: function ObjectValue(_ref14) { var fields = _ref14.fields; return '{' + join(fields, ', ') + '}'; }, ObjectField: function ObjectField(_ref15) { var name = _ref15.name, value = _ref15.value; return name + ': ' + value; }, // Directive Directive: function Directive(_ref16) { var name = _ref16.name, args = _ref16.arguments; return '@' + name + wrap('(', join(args, ', '), ')'); }, // Type NamedType: function NamedType(_ref17) { var name = _ref17.name; return name; }, ListType: function ListType(_ref18) { var type = _ref18.type; return '[' + type + ']'; }, NonNullType: function NonNullType(_ref19) { var type = _ref19.type; return type + '!'; }, // Type System Definitions SchemaDefinition: function SchemaDefinition(_ref20) { var directives = _ref20.directives, operationTypes = _ref20.operationTypes; return join(['schema', join(directives, ' '), block(operationTypes)], ' '); }, OperationTypeDefinition: function OperationTypeDefinition(_ref21) { var operation = _ref21.operation, type = _ref21.type; return operation + ': ' + type; }, ScalarTypeDefinition: addDescription(function (_ref22) { var name = _ref22.name, directives = _ref22.directives; return join(['scalar', name, join(directives, ' ')], ' '); }), ObjectTypeDefinition: addDescription(function (_ref23) { var name = _ref23.name, interfaces = _ref23.interfaces, directives = _ref23.directives, fields = _ref23.fields; return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); }), FieldDefinition: addDescription(function (_ref24) { var name = _ref24.name, args = _ref24.arguments, type = _ref24.type, directives = _ref24.directives; return name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' ')); }), InputValueDefinition: addDescription(function (_ref25) { var name = _ref25.name, type = _ref25.type, defaultValue = _ref25.defaultValue, directives = _ref25.directives; return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '); }), InterfaceTypeDefinition: addDescription(function (_ref26) { var name = _ref26.name, directives = _ref26.directives, fields = _ref26.fields; return join(['interface', name, join(directives, ' '), block(fields)], ' '); }), UnionTypeDefinition: addDescription(function (_ref27) { var name = _ref27.name, directives = _ref27.directives, types = _ref27.types; return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); }), EnumTypeDefinition: addDescription(function (_ref28) { var name = _ref28.name, directives = _ref28.directives, values = _ref28.values; return join(['enum', name, join(directives, ' '), block(values)], ' '); }), EnumValueDefinition: addDescription(function (_ref29) { var name = _ref29.name, directives = _ref29.directives; return join([name, join(directives, ' ')], ' '); }), InputObjectTypeDefinition: addDescription(function (_ref30) { var name = _ref30.name, directives = _ref30.directives, fields = _ref30.fields; return join(['input', name, join(directives, ' '), block(fields)], ' '); }), DirectiveDefinition: addDescription(function (_ref31) { var name = _ref31.name, args = _ref31.arguments, repeatable = _ref31.repeatable, locations = _ref31.locations; return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | '); }), SchemaExtension: function SchemaExtension(_ref32) { var directives = _ref32.directives, operationTypes = _ref32.operationTypes; return join(['extend schema', join(directives, ' '), block(operationTypes)], ' '); }, ScalarTypeExtension: function ScalarTypeExtension(_ref33) { var name = _ref33.name, directives = _ref33.directives; return join(['extend scalar', name, join(directives, ' ')], ' '); }, ObjectTypeExtension: function ObjectTypeExtension(_ref34) { var name = _ref34.name, interfaces = _ref34.interfaces, directives = _ref34.directives, fields = _ref34.fields; return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); }, InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) { var name = _ref35.name, directives = _ref35.directives, fields = _ref35.fields; return join(['extend interface', name, join(directives, ' '), block(fields)], ' '); }, UnionTypeExtension: function UnionTypeExtension(_ref36) { var name = _ref36.name, directives = _ref36.directives, types = _ref36.types; return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); }, EnumTypeExtension: function EnumTypeExtension(_ref37) { var name = _ref37.name, directives = _ref37.directives, values = _ref37.values; return join(['extend enum', name, join(directives, ' '), block(values)], ' '); }, InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) { var name = _ref38.name, directives = _ref38.directives, fields = _ref38.fields; return join(['extend input', name, join(directives, ' '), block(fields)], ' '); } }; function addDescription(cb) { return function (node) { return join([node.description, cb(node)], '\n'); }; } /** * Given maybeArray, print an empty string if it is null or empty, otherwise * print all items together separated by separator if provided */ function join(maybeArray, separator) { return maybeArray ? maybeArray.filter(function (x) { return x; }).join(separator || '') : ''; } /** * Given array, print each item on its own line, wrapped in an * indented "{ }" block. */ function block(array) { return array && array.length !== 0 ? '{\n' + indent(join(array, '\n')) + '\n}' : ''; } /** * If maybeString is not null or empty, then wrap with start and end, otherwise * print an empty string. */ function wrap(start, maybeString, end) { return maybeString ? start + maybeString + (end || '') : ''; } function indent(maybeString) { return maybeString && ' ' + maybeString.replace(/\n/g, '\n '); } function isMultiline(string) { return string.indexOf('\n') !== -1; } function hasMultilineItems(maybeArray) { return maybeArray && maybeArray.some(isMultiline); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/source.js": /*!**********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/source.js ***! \**********************************************************************************/ /*! flagged exports */ /*! export Source [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Source = void 0; var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _defineToStringTag = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToStringTag */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToStringTag.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * A representation of source input to GraphQL. * `name` and `locationOffset` are optional. They are useful for clients who * store GraphQL documents in source files; for example, if the GraphQL input * starts at line 40 in a file named Foo.graphql, it might be useful for name to * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`. * line and column in locationOffset are 1-indexed */ var Source = function Source(body, name, locationOffset) { this.body = body; this.name = name || 'GraphQL request'; this.locationOffset = locationOffset || { line: 1, column: 1 }; this.locationOffset.line > 0 || (0, _devAssert.default)(0, 'line in locationOffset is 1-indexed and must be positive'); this.locationOffset.column > 0 || (0, _devAssert.default)(0, 'column in locationOffset is 1-indexed and must be positive'); }; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.Source = Source; (0, _defineToStringTag.default)(Source); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/tokenKind.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/tokenKind.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export TokenKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TokenKind = void 0; /** * An exported enum describing the different kinds of tokens that the * lexer emits. */ var TokenKind = Object.freeze({ SOF: '', EOF: '', BANG: '!', DOLLAR: '$', AMP: '&', PAREN_L: '(', PAREN_R: ')', SPREAD: '...', COLON: ':', EQUALS: '=', AT: '@', BRACKET_L: '[', BRACKET_R: ']', BRACE_L: '{', PIPE: '|', BRACE_R: '}', NAME: 'Name', INT: 'Int', FLOAT: 'Float', STRING: 'String', BLOCK_STRING: 'BlockString', COMMENT: 'Comment' }); /** * The enum type representing the token kinds values. */ exports.TokenKind = TokenKind; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js": /*!***********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js ***! \***********************************************************************************/ /*! flagged exports */ /*! export BREAK [provided] [no usage info] [missing usage info prevents renaming] */ /*! export QueryDocumentKeys [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getVisitFn [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visit [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visitInParallel [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visitWithTypeInfo [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.visit = visit; exports.visitInParallel = visitInParallel; exports.visitWithTypeInfo = visitWithTypeInfo; exports.getVisitFn = getVisitFn; exports.BREAK = exports.QueryDocumentKeys = void 0; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var QueryDocumentKeys = { Name: [], Document: ['definitions'], OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'], VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], Variable: ['name'], SelectionSet: ['selections'], Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], Argument: ['name', 'value'], FragmentSpread: ['name', 'directives'], InlineFragment: ['typeCondition', 'directives', 'selectionSet'], FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed // or removed in the future. 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ['values'], ObjectValue: ['fields'], ObjectField: ['name', 'value'], Directive: ['name', 'arguments'], NamedType: ['name'], ListType: ['type'], NonNullType: ['type'], SchemaDefinition: ['directives', 'operationTypes'], OperationTypeDefinition: ['type'], ScalarTypeDefinition: ['description', 'name', 'directives'], ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'], InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'], UnionTypeDefinition: ['description', 'name', 'directives', 'types'], EnumTypeDefinition: ['description', 'name', 'directives', 'values'], EnumValueDefinition: ['description', 'name', 'directives'], InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], SchemaExtension: ['directives', 'operationTypes'], ScalarTypeExtension: ['name', 'directives'], ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], InterfaceTypeExtension: ['name', 'directives', 'fields'], UnionTypeExtension: ['name', 'directives', 'types'], EnumTypeExtension: ['name', 'directives', 'values'], InputObjectTypeExtension: ['name', 'directives', 'fields'] }; exports.QueryDocumentKeys = QueryDocumentKeys; var BREAK = Object.freeze({}); /** * visit() will walk through an AST using a depth first traversal, calling * the visitor's enter function at each node in the traversal, and calling the * leave function after visiting that node and all of its child nodes. * * By returning different values from the enter and leave functions, the * behavior of the visitor can be altered, including skipping over a sub-tree of * the AST (by returning false), editing the AST by returning a value or null * to remove the value, or to stop the whole traversal by returning BREAK. * * When using visit() to edit an AST, the original AST will not be modified, and * a new version of the AST with the changes applied will be returned from the * visit function. * * const editedAST = visit(ast, { * enter(node, key, parent, path, ancestors) { * // @return * // undefined: no action * // false: skip visiting this node * // visitor.BREAK: stop visiting altogether * // null: delete this node * // any value: replace this node with the returned value * }, * leave(node, key, parent, path, ancestors) { * // @return * // undefined: no action * // false: no action * // visitor.BREAK: stop visiting altogether * // null: delete this node * // any value: replace this node with the returned value * } * }); * * Alternatively to providing enter() and leave() functions, a visitor can * instead provide functions named the same as the kinds of AST nodes, or * enter/leave visitors at a named key, leading to four permutations of * visitor API: * * 1) Named visitors triggered when entering a node a specific kind. * * visit(ast, { * Kind(node) { * // enter the "Kind" node * } * }) * * 2) Named visitors that trigger upon entering and leaving a node of * a specific kind. * * visit(ast, { * Kind: { * enter(node) { * // enter the "Kind" node * } * leave(node) { * // leave the "Kind" node * } * } * }) * * 3) Generic visitors that trigger upon entering and leaving any node. * * visit(ast, { * enter(node) { * // enter any node * }, * leave(node) { * // leave any node * } * }) * * 4) Parallel visitors for entering and leaving nodes of a specific kind. * * visit(ast, { * enter: { * Kind(node) { * // enter the "Kind" node * } * }, * leave: { * Kind(node) { * // leave the "Kind" node * } * } * }) */ exports.BREAK = BREAK; function visit(root, visitor) { var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys; /* eslint-disable no-undef-init */ var stack = undefined; var inArray = Array.isArray(root); var keys = [root]; var index = -1; var edits = []; var node = undefined; var key = undefined; var parent = undefined; var path = []; var ancestors = []; var newRoot = root; /* eslint-enable no-undef-init */ do { index++; var isLeaving = index === keys.length; var isEdited = isLeaving && edits.length !== 0; if (isLeaving) { key = ancestors.length === 0 ? undefined : path[path.length - 1]; node = parent; parent = ancestors.pop(); if (isEdited) { if (inArray) { node = node.slice(); } else { var clone = {}; for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) { var k = _Object$keys2[_i2]; clone[k] = node[k]; } node = clone; } var editOffset = 0; for (var ii = 0; ii < edits.length; ii++) { var editKey = edits[ii][0]; var editValue = edits[ii][1]; if (inArray) { editKey -= editOffset; } if (inArray && editValue === null) { node.splice(editKey, 1); editOffset++; } else { node[editKey] = editValue; } } } index = stack.index; keys = stack.keys; edits = stack.edits; inArray = stack.inArray; stack = stack.prev; } else { key = parent ? inArray ? index : keys[index] : undefined; node = parent ? parent[key] : newRoot; if (node === null || node === undefined) { continue; } if (parent) { path.push(key); } } var result = void 0; if (!Array.isArray(node)) { if (!isNode(node)) { throw new Error('Invalid AST Node: ' + (0, _inspect.default)(node)); } var visitFn = getVisitFn(visitor, node.kind, isLeaving); if (visitFn) { result = visitFn.call(visitor, node, key, parent, path, ancestors); if (result === BREAK) { break; } if (result === false) { if (!isLeaving) { path.pop(); continue; } } else if (result !== undefined) { edits.push([key, result]); if (!isLeaving) { if (isNode(result)) { node = result; } else { path.pop(); continue; } } } } } if (result === undefined && isEdited) { edits.push([key, node]); } if (isLeaving) { path.pop(); } else { stack = { inArray: inArray, index: index, keys: keys, edits: edits, prev: stack }; inArray = Array.isArray(node); keys = inArray ? node : visitorKeys[node.kind] || []; index = -1; edits = []; if (parent) { ancestors.push(parent); } parent = node; } } while (stack !== undefined); if (edits.length !== 0) { newRoot = edits[edits.length - 1][1]; } return newRoot; } function isNode(maybeNode) { return Boolean(maybeNode && typeof maybeNode.kind === 'string'); } /** * Creates a new visitor instance which delegates to many visitors to run in * parallel. Each visitor will be visited for each node before moving on. * * If a prior visitor edits a node, no following visitors will see that node. */ function visitInParallel(visitors) { var skipping = new Array(visitors.length); return { enter: function enter(node) { for (var i = 0; i < visitors.length; i++) { if (!skipping[i]) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ false); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === false) { skipping[i] = node; } else if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined) { return result; } } } } }, leave: function leave(node) { for (var i = 0; i < visitors.length; i++) { if (!skipping[i]) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ true); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined && result !== false) { return result; } } } else if (skipping[i] === node) { skipping[i] = null; } } } }; } /** * Creates a new visitor instance which maintains a provided TypeInfo instance * along with visiting visitor. */ function visitWithTypeInfo(typeInfo, visitor) { return { enter: function enter(node) { typeInfo.enter(node); var fn = getVisitFn(visitor, node.kind, /* isLeaving */ false); if (fn) { var result = fn.apply(visitor, arguments); if (result !== undefined) { typeInfo.leave(node); if (isNode(result)) { typeInfo.enter(result); } } return result; } }, leave: function leave(node) { var fn = getVisitFn(visitor, node.kind, /* isLeaving */ true); var result; if (fn) { result = fn.apply(visitor, arguments); } typeInfo.leave(node); return result; } }; } /** * Given a visitor instance, if it is leaving or not, and a node kind, return * the function the visitor runtime should call. */ function getVisitFn(visitor, kind, isLeaving) { var kindVisitor = visitor[kind]; if (kindVisitor) { if (!isLeaving && typeof kindVisitor === 'function') { // { Kind() {} } return kindVisitor; } var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter; if (typeof kindSpecificVisitor === 'function') { // { Kind: { enter() {}, leave() {} } } return kindSpecificVisitor; } } else { var specificVisitor = isLeaving ? visitor.leave : visitor.enter; if (specificVisitor) { if (typeof specificVisitor === 'function') { // { enter() {}, leave() {} } return specificVisitor; } var specificKindVisitor = specificVisitor[kind]; if (typeof specificKindVisitor === 'function') { // { enter: { Kind() {} }, leave: { Kind() {} } } return specificKindVisitor; } } } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/find.js": /*!*********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/find.js ***! \*********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; /* eslint-disable no-redeclare */ // $FlowFixMe var find = Array.prototype.find ? function (list, predicate) { return Array.prototype.find.call(list, predicate); } : function (list, predicate) { for (var _i2 = 0; _i2 < list.length; _i2++) { var value = list[_i2]; if (predicate(value)) { return value; } } }; var _default = find; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/flatMap.js": /*!************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/flatMap.js ***! \************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; // Workaround to make older Flow versions happy var flatMapMethod = Array.prototype.flatMap; /* eslint-disable no-redeclare */ // $FlowFixMe var flatMap = flatMapMethod ? function (list, fn) { return flatMapMethod.call(list, fn); } : function (list, fn) { var result = []; for (var _i2 = 0; _i2 < list.length; _i2++) { var _item = list[_i2]; var value = fn(_item); if (Array.isArray(value)) { result = result.concat(value); } else { result.push(value); } } return result; }; var _default = flatMap; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/isFinite.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/isFinite.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; /* eslint-disable no-redeclare */ // $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 var isFinitePolyfill = Number.isFinite || function (value) { return typeof value === 'number' && isFinite(value); }; var _default = isFinitePolyfill; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/isInteger.js": /*!**************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/isInteger.js ***! \**************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; /* eslint-disable no-redeclare */ // $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 var isInteger = Number.isInteger || function (value) { return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; }; var _default = isInteger; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js": /*!******************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js ***! \******************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; /* eslint-disable no-redeclare */ // $FlowFixMe workaround for: https://github.com/facebook/flow/issues/5838 var objectEntries = Object.entries || function (obj) { return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); }; var _default = objectEntries; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; /* eslint-disable no-redeclare */ // $FlowFixMe workaround for: https://github.com/facebook/flow/issues/2221 var objectValues = Object.values || function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); }; var _default = objectValues; exports.default = _default; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/subscription/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/subscription/index.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createSourceEventStream [provided] [no usage info] [missing usage info prevents renaming] */ /*! export subscribe [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "subscribe", ({ enumerable: true, get: function get() { return _subscribe.subscribe; } })); Object.defineProperty(exports, "createSourceEventStream", ({ enumerable: true, get: function get() { return _subscribe.createSourceEventStream; } })); var _subscribe = __webpack_require__(/*! ./subscribe */ "./node_modules/graphql-ruby-client/node_modules/graphql/subscription/subscribe.js"); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/subscription/mapAsyncIterator.js": /*!************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/subscription/mapAsyncIterator.js ***! \************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = mapAsyncIterator; var _iterall = __webpack_require__(/*! iterall */ "./node_modules/iterall/index.mjs"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Given an AsyncIterable and a callback function, return an AsyncIterator * which produces values mapped via calling the callback function. */ function mapAsyncIterator(iterable, callback, rejectCallback) { var iterator = (0, _iterall.getAsyncIterator)(iterable); var $return; var abruptClose; // $FlowFixMe(>=0.68.0) if (typeof iterator.return === 'function') { $return = iterator.return; abruptClose = function abruptClose(error) { var rethrow = function rethrow() { return Promise.reject(error); }; return $return.call(iterator).then(rethrow, rethrow); }; } function mapResult(result) { return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose); } var mapReject; if (rejectCallback) { // Capture rejectCallback to ensure it cannot be null. var reject = rejectCallback; mapReject = function mapReject(error) { return asyncMapValue(error, reject).then(iteratorResult, abruptClose); }; } /* TODO: Flow doesn't support symbols as keys: https://github.com/facebook/flow/issues/3258 */ return _defineProperty({ next: function next() { return iterator.next().then(mapResult, mapReject); }, return: function _return() { return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({ value: undefined, done: true }); }, throw: function _throw(error) { // $FlowFixMe(>=0.68.0) if (typeof iterator.throw === 'function') { return iterator.throw(error).then(mapResult, mapReject); } return Promise.reject(error).catch(abruptClose); } }, _iterall.$$asyncIterator, function () { return this; }); } function asyncMapValue(value, callback) { return new Promise(function (resolve) { return resolve(callback(value)); }); } function iteratorResult(value) { return { value: value, done: false }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/subscription/subscribe.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/subscription/subscribe.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createSourceEventStream [provided] [no usage info] [missing usage info prevents renaming] */ /*! export subscribe [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.subscribe = subscribe; exports.createSourceEventStream = createSourceEventStream; var _iterall = __webpack_require__(/*! iterall */ "./node_modules/iterall/index.mjs"); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _Path = __webpack_require__(/*! ../jsutils/Path */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/Path.js"); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _locatedError = __webpack_require__(/*! ../error/locatedError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/locatedError.js"); var _execute = __webpack_require__(/*! ../execution/execute */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/execute.js"); var _getOperationRootType = __webpack_require__(/*! ../utilities/getOperationRootType */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationRootType.js"); var _mapAsyncIterator = _interopRequireDefault(__webpack_require__(/*! ./mapAsyncIterator */ "./node_modules/graphql-ruby-client/node_modules/graphql/subscription/mapAsyncIterator.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function subscribe(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) { /* eslint-enable no-redeclare */ // Extract arguments from object args if provided. return arguments.length === 1 ? subscribeImpl(argsOrSchema) : subscribeImpl({ schema: argsOrSchema, document: document, rootValue: rootValue, contextValue: contextValue, variableValues: variableValues, operationName: operationName, fieldResolver: fieldResolver, subscribeFieldResolver: subscribeFieldResolver }); } /** * This function checks if the error is a GraphQLError. If it is, report it as * an ExecutionResult, containing only errors and no data. Otherwise treat the * error as a system-class error and re-throw it. */ function reportGraphQLError(error) { if (error instanceof _GraphQLError.GraphQLError) { return { errors: [error] }; } throw error; } function subscribeImpl(args) { var schema = args.schema, document = args.document, rootValue = args.rootValue, contextValue = args.contextValue, variableValues = args.variableValues, operationName = args.operationName, fieldResolver = args.fieldResolver, subscribeFieldResolver = args.subscribeFieldResolver; var sourcePromise = createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver); // For each payload yielded from a subscription, map it over the normal // GraphQL `execute` function, with `payload` as the rootValue. // This implements the "MapSourceToResponseEvent" algorithm described in // the GraphQL specification. The `execute` function provides the // "ExecuteSubscriptionEvent" algorithm, as it is nearly identical to the // "ExecuteQuery" algorithm, for which `execute` is also used. var mapSourceToResponse = function mapSourceToResponse(payload) { return (0, _execute.execute)(schema, document, payload, contextValue, variableValues, operationName, fieldResolver); }; // Resolve the Source Stream, then map every source value to a // ExecutionResult value as described above. return sourcePromise.then(function (resultOrStream) { return (// Note: Flow can't refine isAsyncIterable, so explicit casts are used. (0, _iterall.isAsyncIterable)(resultOrStream) ? (0, _mapAsyncIterator.default)(resultOrStream, mapSourceToResponse, reportGraphQLError) : resultOrStream ); }); } /** * Implements the "CreateSourceEventStream" algorithm described in the * GraphQL specification, resolving the subscription source event stream. * * Returns a Promise which resolves to either an AsyncIterable (if successful) * or an ExecutionResult (error). The promise will be rejected if the schema or * other arguments to this function are invalid, or if the resolved event stream * is not an async iterable. * * If the client-provided arguments to this function do not result in a * compliant subscription, a GraphQL Response (ExecutionResult) with * descriptive errors and no data will be returned. * * If the the source stream could not be created due to faulty subscription * resolver logic or underlying systems, the promise will resolve to a single * ExecutionResult containing `errors` and no `data`. * * If the operation succeeded, the promise resolves to the AsyncIterable for the * event stream returned by the resolver. * * A Source Event Stream represents a sequence of events, each of which triggers * a GraphQL execution for that event. * * This may be useful when hosting the stateful subscription service in a * different process or machine than the stateless GraphQL execution engine, * or otherwise separating these two steps. For more on this, see the * "Supporting Subscriptions at Scale" information in the GraphQL specification. */ function createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver) { // If arguments are missing or incorrectly typed, this is an internal // developer mistake which should throw an early error. (0, _execute.assertValidExecutionArguments)(schema, document, variableValues); try { // If a valid context cannot be created due to incorrect arguments, // this will throw an error. var exeContext = (0, _execute.buildExecutionContext)(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver); // Return early errors if execution context failed. if (Array.isArray(exeContext)) { return Promise.resolve({ errors: exeContext }); } var type = (0, _getOperationRootType.getOperationRootType)(schema, exeContext.operation); var fields = (0, _execute.collectFields)(exeContext, type, exeContext.operation.selectionSet, Object.create(null), Object.create(null)); var responseNames = Object.keys(fields); var responseName = responseNames[0]; var fieldNodes = fields[responseName]; var fieldNode = fieldNodes[0]; var fieldName = fieldNode.name.value; var fieldDef = (0, _execute.getFieldDef)(schema, type, fieldName); if (!fieldDef) { throw new _GraphQLError.GraphQLError("The subscription field \"".concat(fieldName, "\" is not defined."), fieldNodes); } // Call the `subscribe()` resolver or the default resolver to produce an // AsyncIterable yielding raw payloads. var resolveFn = fieldDef.subscribe || exeContext.fieldResolver; var path = (0, _Path.addPath)(undefined, responseName); var info = (0, _execute.buildResolveInfo)(exeContext, fieldDef, fieldNodes, type, path); // resolveFieldValueOrError implements the "ResolveFieldEventStream" // algorithm from GraphQL specification. It differs from // "ResolveFieldValue" due to providing a different `resolveFn`. var result = (0, _execute.resolveFieldValueOrError)(exeContext, fieldDef, fieldNodes, resolveFn, rootValue, info); // Coerce to Promise for easier error handling and consistent return type. return Promise.resolve(result).then(function (eventStream) { // If eventStream is an Error, rethrow a located error. if (eventStream instanceof Error) { return { errors: [(0, _locatedError.locatedError)(eventStream, fieldNodes, (0, _Path.pathToArray)(path))] }; } // Assert field returned an event stream, otherwise yield an error. if ((0, _iterall.isAsyncIterable)(eventStream)) { // Note: isAsyncIterable above ensures this will be correct. return eventStream; } throw new Error('Subscription field must return Async Iterable. Received: ' + (0, _inspect.default)(eventStream)); }); } catch (error) { // As with reportGraphQLError above, if the error is a GraphQLError, report // it as an ExecutionResult; otherwise treat it as a system-class error and // re-throw it. return error instanceof _GraphQLError.GraphQLError ? Promise.resolve({ errors: [error] }) : Promise.reject(error); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js": /*!**********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js ***! \**********************************************************************************/ /*! flagged exports */ /*! export GraphQLEnumType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLInputObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLInterfaceType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLList [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLNonNull [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLUnionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export argsToArgsConfig [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertAbstractType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertCompositeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertEnumType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertInputObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertInputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertInterfaceType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertLeafType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertListType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertNamedType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertNonNullType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertNullableType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertOutputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertUnionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertWrappingType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getNamedType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getNullableType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isAbstractType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isCompositeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isEnumType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInputObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInterfaceType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isLeafType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isListType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNamedType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNonNullType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNullableType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isOutputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isRequiredArgument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isRequiredInputField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isUnionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isWrappingType [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isType = isType; exports.assertType = assertType; exports.isScalarType = isScalarType; exports.assertScalarType = assertScalarType; exports.isObjectType = isObjectType; exports.assertObjectType = assertObjectType; exports.isInterfaceType = isInterfaceType; exports.assertInterfaceType = assertInterfaceType; exports.isUnionType = isUnionType; exports.assertUnionType = assertUnionType; exports.isEnumType = isEnumType; exports.assertEnumType = assertEnumType; exports.isInputObjectType = isInputObjectType; exports.assertInputObjectType = assertInputObjectType; exports.isListType = isListType; exports.assertListType = assertListType; exports.isNonNullType = isNonNullType; exports.assertNonNullType = assertNonNullType; exports.isInputType = isInputType; exports.assertInputType = assertInputType; exports.isOutputType = isOutputType; exports.assertOutputType = assertOutputType; exports.isLeafType = isLeafType; exports.assertLeafType = assertLeafType; exports.isCompositeType = isCompositeType; exports.assertCompositeType = assertCompositeType; exports.isAbstractType = isAbstractType; exports.assertAbstractType = assertAbstractType; exports.GraphQLList = GraphQLList; exports.GraphQLNonNull = GraphQLNonNull; exports.isWrappingType = isWrappingType; exports.assertWrappingType = assertWrappingType; exports.isNullableType = isNullableType; exports.assertNullableType = assertNullableType; exports.getNullableType = getNullableType; exports.isNamedType = isNamedType; exports.assertNamedType = assertNamedType; exports.getNamedType = getNamedType; exports.argsToArgsConfig = argsToArgsConfig; exports.isRequiredArgument = isRequiredArgument; exports.isRequiredInputField = isRequiredInputField; exports.GraphQLInputObjectType = exports.GraphQLEnumType = exports.GraphQLUnionType = exports.GraphQLInterfaceType = exports.GraphQLObjectType = exports.GraphQLScalarType = void 0; var _objectEntries = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectEntries */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _keyMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js")); var _mapValue = _interopRequireDefault(__webpack_require__(/*! ../jsutils/mapValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/mapValue.js")); var _toObjMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/toObjMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/toObjMap.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _keyValMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyValMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js")); var _instanceOf = _interopRequireDefault(__webpack_require__(/*! ../jsutils/instanceOf */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/instanceOf.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _identityFunc = _interopRequireDefault(__webpack_require__(/*! ../jsutils/identityFunc */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/identityFunc.js")); var _defineToJSON = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToJSON */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToJSON.js")); var _defineToStringTag = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToStringTag */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToStringTag.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _valueFromASTUntyped = __webpack_require__(/*! ../utilities/valueFromASTUntyped */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromASTUntyped.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function isType(type) { return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type); } function assertType(type) { if (!isType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL type.")); } return type; } /** * There are predicates for each kind of GraphQL type. */ // eslint-disable-next-line no-redeclare function isScalarType(type) { return (0, _instanceOf.default)(type, GraphQLScalarType); } function assertScalarType(type) { if (!isScalarType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Scalar type.")); } return type; } // eslint-disable-next-line no-redeclare function isObjectType(type) { return (0, _instanceOf.default)(type, GraphQLObjectType); } function assertObjectType(type) { if (!isObjectType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Object type.")); } return type; } // eslint-disable-next-line no-redeclare function isInterfaceType(type) { return (0, _instanceOf.default)(type, GraphQLInterfaceType); } function assertInterfaceType(type) { if (!isInterfaceType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Interface type.")); } return type; } // eslint-disable-next-line no-redeclare function isUnionType(type) { return (0, _instanceOf.default)(type, GraphQLUnionType); } function assertUnionType(type) { if (!isUnionType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Union type.")); } return type; } // eslint-disable-next-line no-redeclare function isEnumType(type) { return (0, _instanceOf.default)(type, GraphQLEnumType); } function assertEnumType(type) { if (!isEnumType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type.")); } return type; } // eslint-disable-next-line no-redeclare function isInputObjectType(type) { return (0, _instanceOf.default)(type, GraphQLInputObjectType); } function assertInputObjectType(type) { if (!isInputObjectType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Input Object type.")); } return type; } // eslint-disable-next-line no-redeclare function isListType(type) { return (0, _instanceOf.default)(type, GraphQLList); } function assertListType(type) { if (!isListType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL List type.")); } return type; } // eslint-disable-next-line no-redeclare function isNonNullType(type) { return (0, _instanceOf.default)(type, GraphQLNonNull); } function assertNonNullType(type) { if (!isNonNullType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Non-Null type.")); } return type; } /** * These types may be used as input types for arguments and directives. */ function isInputType(type) { return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType); } function assertInputType(type) { if (!isInputType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL input type.")); } return type; } /** * These types may be used as output types as the result of fields. */ function isOutputType(type) { return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType); } function assertOutputType(type) { if (!isOutputType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL output type.")); } return type; } /** * These types may describe types which may be leaf values. */ function isLeafType(type) { return isScalarType(type) || isEnumType(type); } function assertLeafType(type) { if (!isLeafType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL leaf type.")); } return type; } /** * These types may describe the parent context of a selection set. */ function isCompositeType(type) { return isObjectType(type) || isInterfaceType(type) || isUnionType(type); } function assertCompositeType(type) { if (!isCompositeType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL composite type.")); } return type; } /** * These types may describe the parent context of a selection set. */ function isAbstractType(type) { return isInterfaceType(type) || isUnionType(type); } function assertAbstractType(type) { if (!isAbstractType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type.")); } return type; } /** * List Type Wrapper * * A list is a wrapping type which points to another type. * Lists are often created within the context of defining the fields of * an object type. * * Example: * * const PersonType = new GraphQLObjectType({ * name: 'Person', * fields: () => ({ * parents: { type: GraphQLList(PersonType) }, * children: { type: GraphQLList(PersonType) }, * }) * }) * */ // eslint-disable-next-line no-redeclare function GraphQLList(ofType) { if (this instanceof GraphQLList) { this.ofType = assertType(ofType); } else { return new GraphQLList(ofType); } } // Need to cast through any to alter the prototype. GraphQLList.prototype.toString = function toString() { return '[' + String(this.ofType) + ']'; }; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported (0, _defineToStringTag.default)(GraphQLList); (0, _defineToJSON.default)(GraphQLList); /** * Non-Null Type Wrapper * * A non-null is a wrapping type which points to another type. * Non-null types enforce that their values are never null and can ensure * an error is raised if this ever occurs during a request. It is useful for * fields which you can make a strong guarantee on non-nullability, for example * usually the id field of a database row will never be null. * * Example: * * const RowType = new GraphQLObjectType({ * name: 'Row', * fields: () => ({ * id: { type: GraphQLNonNull(GraphQLString) }, * }) * }) * * Note: the enforcement of non-nullability occurs within the executor. */ // eslint-disable-next-line no-redeclare function GraphQLNonNull(ofType) { if (this instanceof GraphQLNonNull) { this.ofType = assertNullableType(ofType); } else { return new GraphQLNonNull(ofType); } } // Need to cast through any to alter the prototype. GraphQLNonNull.prototype.toString = function toString() { return String(this.ofType) + '!'; }; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported (0, _defineToStringTag.default)(GraphQLNonNull); (0, _defineToJSON.default)(GraphQLNonNull); /** * These types wrap and modify other types */ function isWrappingType(type) { return isListType(type) || isNonNullType(type); } function assertWrappingType(type) { if (!isWrappingType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL wrapping type.")); } return type; } /** * These types can all accept null as a value. */ function isNullableType(type) { return isType(type) && !isNonNullType(type); } function assertNullableType(type) { if (!isNullableType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL nullable type.")); } return type; } /* eslint-disable no-redeclare */ function getNullableType(type) { /* eslint-enable no-redeclare */ if (type) { return isNonNullType(type) ? type.ofType : type; } } /** * These named types do not include modifiers like List or NonNull. */ function isNamedType(type) { return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type); } function assertNamedType(type) { if (!isNamedType(type)) { throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL named type.")); } return type; } /* eslint-disable no-redeclare */ function getNamedType(type) { /* eslint-enable no-redeclare */ if (type) { var unwrappedType = type; while (isWrappingType(unwrappedType)) { unwrappedType = unwrappedType.ofType; } return unwrappedType; } } /** * Used while defining GraphQL types to allow for circular references in * otherwise immutable type definitions. */ function resolveThunk(thunk) { // $FlowFixMe(>=0.90.0) return typeof thunk === 'function' ? thunk() : thunk; } function undefineIfEmpty(arr) { return arr && arr.length > 0 ? arr : undefined; } /** * Scalar Type Definition * * The leaf values of any request and input values to arguments are * Scalars (or Enums) and are defined with a name and a series of functions * used to parse input from ast or variables and to ensure validity. * * If a type's serialize function does not return a value (i.e. it returns * `undefined`) then an error will be raised and a `null` value will be returned * in the response. If the serialize function returns `null`, then no error will * be included in the response. * * Example: * * const OddType = new GraphQLScalarType({ * name: 'Odd', * serialize(value) { * if (value % 2 === 1) { * return value; * } * } * }); * */ var GraphQLScalarType = /*#__PURE__*/ function () { function GraphQLScalarType(config) { var parseValue = config.parseValue || _identityFunc.default; this.name = config.name; this.description = config.description; this.serialize = config.serialize || _identityFunc.default; this.parseValue = parseValue; this.parseLiteral = config.parseLiteral || function (node) { return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node)); }; this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); config.serialize == null || typeof config.serialize === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"serialize\" function. If this custom Scalar is also used as an input type, ensure \"parseValue\" and \"parseLiteral\" functions are also provided.")); if (config.parseLiteral) { typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide both \"parseValue\" and \"parseLiteral\" functions.")); } } var _proto = GraphQLScalarType.prototype; _proto.toConfig = function toConfig() { return { name: this.name, description: this.description, serialize: this.serialize, parseValue: this.parseValue, parseLiteral: this.parseLiteral, extensions: this.extensions, astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [] }; }; _proto.toString = function toString() { return this.name; }; return GraphQLScalarType; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLScalarType = GraphQLScalarType; (0, _defineToStringTag.default)(GraphQLScalarType); (0, _defineToJSON.default)(GraphQLScalarType); /** * Object Type Definition * * Almost all of the GraphQL types you define will be object types. Object types * have a name, but most importantly describe their fields. * * Example: * * const AddressType = new GraphQLObjectType({ * name: 'Address', * fields: { * street: { type: GraphQLString }, * number: { type: GraphQLInt }, * formatted: { * type: GraphQLString, * resolve(obj) { * return obj.number + ' ' + obj.street * } * } * } * }); * * When two types need to refer to each other, or a type needs to refer to * itself in a field, you can use a function expression (aka a closure or a * thunk) to supply the fields lazily. * * Example: * * const PersonType = new GraphQLObjectType({ * name: 'Person', * fields: () => ({ * name: { type: GraphQLString }, * bestFriend: { type: PersonType }, * }) * }); * */ var GraphQLObjectType = /*#__PURE__*/ function () { function GraphQLObjectType(config) { this.name = config.name; this.description = config.description; this.isTypeOf = config.isTypeOf; this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); this._fields = defineFieldMap.bind(undefined, config); this._interfaces = defineInterfaces.bind(undefined, config); typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); config.isTypeOf == null || typeof config.isTypeOf === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"isTypeOf\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.isTypeOf), ".")); } var _proto2 = GraphQLObjectType.prototype; _proto2.getFields = function getFields() { if (typeof this._fields === 'function') { this._fields = this._fields(); } return this._fields; }; _proto2.getInterfaces = function getInterfaces() { if (typeof this._interfaces === 'function') { this._interfaces = this._interfaces(); } return this._interfaces; }; _proto2.toConfig = function toConfig() { return { name: this.name, description: this.description, interfaces: this.getInterfaces(), fields: fieldsToFieldsConfig(this.getFields()), isTypeOf: this.isTypeOf, extensions: this.extensions, astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [] }; }; _proto2.toString = function toString() { return this.name; }; return GraphQLObjectType; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLObjectType = GraphQLObjectType; (0, _defineToStringTag.default)(GraphQLObjectType); (0, _defineToJSON.default)(GraphQLObjectType); function defineInterfaces(config) { var interfaces = resolveThunk(config.interfaces) || []; Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config.name, " interfaces must be an Array or a function which returns an Array.")); return interfaces; } function defineFieldMap(config) { var fieldMap = resolveThunk(config.fields) || {}; isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")); return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) { isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " field config must be an object")); !('isDeprecated' in fieldConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")); fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), ".")); var argsConfig = fieldConfig.args || {}; isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " args must be an object with argument names as keys.")); var args = (0, _objectEntries.default)(argsConfig).map(function (_ref) { var argName = _ref[0], arg = _ref[1]; return { name: argName, description: arg.description === undefined ? null : arg.description, type: arg.type, defaultValue: arg.defaultValue, extensions: arg.extensions && (0, _toObjMap.default)(arg.extensions), astNode: arg.astNode }; }); return _objectSpread({}, fieldConfig, { name: fieldName, description: fieldConfig.description, type: fieldConfig.type, args: args, resolve: fieldConfig.resolve, subscribe: fieldConfig.subscribe, isDeprecated: Boolean(fieldConfig.deprecationReason), deprecationReason: fieldConfig.deprecationReason, extensions: fieldConfig.extensions && (0, _toObjMap.default)(fieldConfig.extensions), astNode: fieldConfig.astNode }); }); } function isPlainObj(obj) { return (0, _isObjectLike.default)(obj) && !Array.isArray(obj); } function fieldsToFieldsConfig(fields) { return (0, _mapValue.default)(fields, function (field) { return { description: field.description, type: field.type, args: argsToArgsConfig(field.args), resolve: field.resolve, subscribe: field.subscribe, deprecationReason: field.deprecationReason, extensions: field.extensions, astNode: field.astNode }; }); } function argsToArgsConfig(args) { return (0, _keyValMap.default)(args, function (arg) { return arg.name; }, function (arg) { return { description: arg.description, type: arg.type, defaultValue: arg.defaultValue, extensions: arg.extensions, astNode: arg.astNode }; }); } function isRequiredArgument(arg) { return isNonNullType(arg.type) && arg.defaultValue === undefined; } /** * Interface Type Definition * * When a field can return one of a heterogeneous set of types, a Interface type * is used to describe what types are possible, what fields are in common across * all types, as well as a function to determine which type is actually used * when the field is resolved. * * Example: * * const EntityType = new GraphQLInterfaceType({ * name: 'Entity', * fields: { * name: { type: GraphQLString } * } * }); * */ var GraphQLInterfaceType = /*#__PURE__*/ function () { function GraphQLInterfaceType(config) { this.name = config.name; this.description = config.description; this.resolveType = config.resolveType; this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); this._fields = defineFieldMap.bind(undefined, config); typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.resolveType), ".")); } var _proto3 = GraphQLInterfaceType.prototype; _proto3.getFields = function getFields() { if (typeof this._fields === 'function') { this._fields = this._fields(); } return this._fields; }; _proto3.toConfig = function toConfig() { return { name: this.name, description: this.description, fields: fieldsToFieldsConfig(this.getFields()), resolveType: this.resolveType, extensions: this.extensions, astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [] }; }; _proto3.toString = function toString() { return this.name; }; return GraphQLInterfaceType; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLInterfaceType = GraphQLInterfaceType; (0, _defineToStringTag.default)(GraphQLInterfaceType); (0, _defineToJSON.default)(GraphQLInterfaceType); /** * Union Type Definition * * When a field can return one of a heterogeneous set of types, a Union type * is used to describe what types are possible as well as providing a function * to determine which type is actually used when the field is resolved. * * Example: * * const PetType = new GraphQLUnionType({ * name: 'Pet', * types: [ DogType, CatType ], * resolveType(value) { * if (value instanceof Dog) { * return DogType; * } * if (value instanceof Cat) { * return CatType; * } * } * }); * */ var GraphQLUnionType = /*#__PURE__*/ function () { function GraphQLUnionType(config) { this.name = config.name; this.description = config.description; this.resolveType = config.resolveType; this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); this._types = defineTypes.bind(undefined, config); typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.resolveType), ".")); } var _proto4 = GraphQLUnionType.prototype; _proto4.getTypes = function getTypes() { if (typeof this._types === 'function') { this._types = this._types(); } return this._types; }; _proto4.toConfig = function toConfig() { return { name: this.name, description: this.description, types: this.getTypes(), resolveType: this.resolveType, extensions: this.extensions, astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [] }; }; _proto4.toString = function toString() { return this.name; }; return GraphQLUnionType; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLUnionType = GraphQLUnionType; (0, _defineToStringTag.default)(GraphQLUnionType); (0, _defineToJSON.default)(GraphQLUnionType); function defineTypes(config) { var types = resolveThunk(config.types) || []; Array.isArray(types) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config.name, ".")); return types; } /** * Enum Type Definition * * Some leaf values of requests and input values are Enums. GraphQL serializes * Enum values as strings, however internally Enums can be represented by any * kind of type, often integers. * * Example: * * const RGBType = new GraphQLEnumType({ * name: 'RGB', * values: { * RED: { value: 0 }, * GREEN: { value: 1 }, * BLUE: { value: 2 } * } * }); * * Note: If a value is not provided in a definition, the name of the enum value * will be used as its internal value. */ var GraphQLEnumType /* */ = /*#__PURE__*/ function () { function GraphQLEnumType(config) { this.name = config.name; this.description = config.description; this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); this._values = defineEnumValues(this.name, config.values); this._valueLookup = new Map(this._values.map(function (enumValue) { return [enumValue.value, enumValue]; })); this._nameLookup = (0, _keyMap.default)(this._values, function (value) { return value.name; }); typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); } var _proto5 = GraphQLEnumType.prototype; _proto5.getValues = function getValues() { return this._values; }; _proto5.getValue = function getValue(name) { return this._nameLookup[name]; }; _proto5.serialize = function serialize(value) { var enumValue = this._valueLookup.get(value); if (enumValue) { return enumValue.name; } }; _proto5.parseValue = function parseValue(value) /* T */ { if (typeof value === 'string') { var enumValue = this.getValue(value); if (enumValue) { return enumValue.value; } } }; _proto5.parseLiteral = function parseLiteral(valueNode, _variables) /* T */ { // Note: variables will be resolved to a value before calling this function. if (valueNode.kind === _kinds.Kind.ENUM) { var enumValue = this.getValue(valueNode.value); if (enumValue) { return enumValue.value; } } }; _proto5.toConfig = function toConfig() { var values = (0, _keyValMap.default)(this.getValues(), function (value) { return value.name; }, function (value) { return { description: value.description, value: value.value, deprecationReason: value.deprecationReason, extensions: value.extensions, astNode: value.astNode }; }); return { name: this.name, description: this.description, values: values, extensions: this.extensions, astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [] }; }; _proto5.toString = function toString() { return this.name; }; return GraphQLEnumType; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLEnumType = GraphQLEnumType; (0, _defineToStringTag.default)(GraphQLEnumType); (0, _defineToJSON.default)(GraphQLEnumType); function defineEnumValues(typeName, valueMap) { isPlainObj(valueMap) || (0, _devAssert.default)(0, "".concat(typeName, " values must be an object with value names as keys.")); return (0, _objectEntries.default)(valueMap).map(function (_ref2) { var valueName = _ref2[0], value = _ref2[1]; isPlainObj(value) || (0, _devAssert.default)(0, "".concat(typeName, ".").concat(valueName, " must refer to an object with a \"value\" key ") + "representing an internal value but got: ".concat((0, _inspect.default)(value), ".")); !('isDeprecated' in value) || (0, _devAssert.default)(0, "".concat(typeName, ".").concat(valueName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")); return { name: valueName, description: value.description, value: 'value' in value ? value.value : valueName, isDeprecated: Boolean(value.deprecationReason), deprecationReason: value.deprecationReason, extensions: value.extensions && (0, _toObjMap.default)(value.extensions), astNode: value.astNode }; }); } /** * Input Object Type Definition * * An input object defines a structured collection of fields which may be * supplied to a field argument. * * Using `NonNull` will ensure that a value must be provided by the query * * Example: * * const GeoPoint = new GraphQLInputObjectType({ * name: 'GeoPoint', * fields: { * lat: { type: GraphQLNonNull(GraphQLFloat) }, * lon: { type: GraphQLNonNull(GraphQLFloat) }, * alt: { type: GraphQLFloat, defaultValue: 0 }, * } * }); * */ var GraphQLInputObjectType = /*#__PURE__*/ function () { function GraphQLInputObjectType(config) { this.name = config.name; this.description = config.description; this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); this._fields = defineInputFieldMap.bind(undefined, config); typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); } var _proto6 = GraphQLInputObjectType.prototype; _proto6.getFields = function getFields() { if (typeof this._fields === 'function') { this._fields = this._fields(); } return this._fields; }; _proto6.toConfig = function toConfig() { var fields = (0, _mapValue.default)(this.getFields(), function (field) { return { description: field.description, type: field.type, defaultValue: field.defaultValue, extensions: field.extensions, astNode: field.astNode }; }); return { name: this.name, description: this.description, fields: fields, extensions: this.extensions, astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [] }; }; _proto6.toString = function toString() { return this.name; }; return GraphQLInputObjectType; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLInputObjectType = GraphQLInputObjectType; (0, _defineToStringTag.default)(GraphQLInputObjectType); (0, _defineToJSON.default)(GraphQLInputObjectType); function defineInputFieldMap(config) { var fieldMap = resolveThunk(config.fields) || {}; isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")); return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) { !('resolve' in fieldConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers.")); return _objectSpread({}, fieldConfig, { name: fieldName, description: fieldConfig.description, type: fieldConfig.type, defaultValue: fieldConfig.defaultValue, extensions: fieldConfig.extensions && (0, _toObjMap.default)(fieldConfig.extensions), astNode: fieldConfig.astNode }); }); } function isRequiredInputField(field) { return isNonNullType(field.type) && field.defaultValue === undefined; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js": /*!**********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js ***! \**********************************************************************************/ /*! flagged exports */ /*! export DEFAULT_DEPRECATION_REASON [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLDeprecatedDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLIncludeDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLSkipDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSpecifiedDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export specifiedDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isDirective = isDirective; exports.assertDirective = assertDirective; exports.isSpecifiedDirective = isSpecifiedDirective; exports.specifiedDirectives = exports.GraphQLDeprecatedDirective = exports.DEFAULT_DEPRECATION_REASON = exports.GraphQLSkipDirective = exports.GraphQLIncludeDirective = exports.GraphQLDirective = void 0; var _objectEntries = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectEntries */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _toObjMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/toObjMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/toObjMap.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _instanceOf = _interopRequireDefault(__webpack_require__(/*! ../jsutils/instanceOf */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/instanceOf.js")); var _defineToJSON = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToJSON */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToJSON.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _defineToStringTag = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToStringTag */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToStringTag.js")); var _directiveLocation = __webpack_require__(/*! ../language/directiveLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/directiveLocation.js"); var _scalars = __webpack_require__(/*! ./scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _definition = __webpack_require__(/*! ./definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // eslint-disable-next-line no-redeclare function isDirective(directive) { return (0, _instanceOf.default)(directive, GraphQLDirective); } function assertDirective(directive) { if (!isDirective(directive)) { throw new Error("Expected ".concat((0, _inspect.default)(directive), " to be a GraphQL directive.")); } return directive; } /** * Directives are used by the GraphQL runtime as a way of modifying execution * behavior. Type system creators will usually not create these directly. */ var GraphQLDirective = /*#__PURE__*/ function () { function GraphQLDirective(config) { this.name = config.name; this.description = config.description; this.locations = config.locations; this.isRepeatable = config.isRepeatable != null && config.isRepeatable; this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; config.name || (0, _devAssert.default)(0, 'Directive must be named.'); Array.isArray(config.locations) || (0, _devAssert.default)(0, "@".concat(config.name, " locations must be an Array.")); var args = config.args || {}; (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config.name, " args must be an object with argument names as keys.")); this.args = (0, _objectEntries.default)(args).map(function (_ref) { var argName = _ref[0], arg = _ref[1]; return { name: argName, description: arg.description === undefined ? null : arg.description, type: arg.type, defaultValue: arg.defaultValue, extensions: arg.extensions && (0, _toObjMap.default)(arg.extensions), astNode: arg.astNode }; }); } var _proto = GraphQLDirective.prototype; _proto.toString = function toString() { return '@' + this.name; }; _proto.toConfig = function toConfig() { return { name: this.name, description: this.description, locations: this.locations, args: (0, _definition.argsToArgsConfig)(this.args), isRepeatable: this.isRepeatable, extensions: this.extensions, astNode: this.astNode }; }; return GraphQLDirective; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLDirective = GraphQLDirective; (0, _defineToStringTag.default)(GraphQLDirective); (0, _defineToJSON.default)(GraphQLDirective); /** * Used to conditionally include fields or fragments. */ var GraphQLIncludeDirective = new GraphQLDirective({ name: 'include', description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], args: { if: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), description: 'Included when true.' } } }); /** * Used to conditionally skip (exclude) fields or fragments. */ exports.GraphQLIncludeDirective = GraphQLIncludeDirective; var GraphQLSkipDirective = new GraphQLDirective({ name: 'skip', description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], args: { if: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), description: 'Skipped when true.' } } }); /** * Constant string used for default reason for a deprecation. */ exports.GraphQLSkipDirective = GraphQLSkipDirective; var DEFAULT_DEPRECATION_REASON = 'No longer supported'; /** * Used to declare element of a GraphQL schema as deprecated. */ exports.DEFAULT_DEPRECATION_REASON = DEFAULT_DEPRECATION_REASON; var GraphQLDeprecatedDirective = new GraphQLDirective({ name: 'deprecated', description: 'Marks an element of a GraphQL schema as no longer supported.', locations: [_directiveLocation.DirectiveLocation.FIELD_DEFINITION, _directiveLocation.DirectiveLocation.ENUM_VALUE], args: { reason: { type: _scalars.GraphQLString, description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).', defaultValue: DEFAULT_DEPRECATION_REASON } } }); /** * The full list of specified directives. */ exports.GraphQLDeprecatedDirective = GraphQLDeprecatedDirective; var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective]); exports.specifiedDirectives = specifiedDirectives; function isSpecifiedDirective(directive) { return isDirective(directive) && specifiedDirectives.some(function (_ref2) { var name = _ref2.name; return name === directive.name; }); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js": /*!*****************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/type/index.js ***! \*****************************************************************************/ /*! flagged exports */ /*! export DEFAULT_DEPRECATION_REASON [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLBoolean [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLDeprecatedDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLEnumType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLFloat [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLID [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLIncludeDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLInputObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLInt [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLInterfaceType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLList [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLNonNull [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLSkipDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLString [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLUnionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export SchemaMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TypeKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TypeMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TypeNameMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Directive [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __DirectiveLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __EnumValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Field [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __InputValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Schema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Type [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __TypeKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertAbstractType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertCompositeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertEnumType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertInputObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertInputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertInterfaceType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertLeafType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertListType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertNamedType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertNonNullType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertNullableType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertOutputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertUnionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertValidSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertWrappingType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getNamedType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getNullableType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export introspectionTypes [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isAbstractType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isCompositeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isEnumType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInputObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isInterfaceType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isIntrospectionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isLeafType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isListType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNamedType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNonNullType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNullableType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isObjectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isOutputType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isRequiredArgument [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isRequiredInputField [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSpecifiedDirective [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSpecifiedScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isUnionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isWrappingType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export specifiedDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export specifiedScalarTypes [provided] [no usage info] [missing usage info prevents renaming] */ /*! export validateSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "isSchema", ({ enumerable: true, get: function get() { return _schema.isSchema; } })); Object.defineProperty(exports, "assertSchema", ({ enumerable: true, get: function get() { return _schema.assertSchema; } })); Object.defineProperty(exports, "GraphQLSchema", ({ enumerable: true, get: function get() { return _schema.GraphQLSchema; } })); Object.defineProperty(exports, "isType", ({ enumerable: true, get: function get() { return _definition.isType; } })); Object.defineProperty(exports, "isScalarType", ({ enumerable: true, get: function get() { return _definition.isScalarType; } })); Object.defineProperty(exports, "isObjectType", ({ enumerable: true, get: function get() { return _definition.isObjectType; } })); Object.defineProperty(exports, "isInterfaceType", ({ enumerable: true, get: function get() { return _definition.isInterfaceType; } })); Object.defineProperty(exports, "isUnionType", ({ enumerable: true, get: function get() { return _definition.isUnionType; } })); Object.defineProperty(exports, "isEnumType", ({ enumerable: true, get: function get() { return _definition.isEnumType; } })); Object.defineProperty(exports, "isInputObjectType", ({ enumerable: true, get: function get() { return _definition.isInputObjectType; } })); Object.defineProperty(exports, "isListType", ({ enumerable: true, get: function get() { return _definition.isListType; } })); Object.defineProperty(exports, "isNonNullType", ({ enumerable: true, get: function get() { return _definition.isNonNullType; } })); Object.defineProperty(exports, "isInputType", ({ enumerable: true, get: function get() { return _definition.isInputType; } })); Object.defineProperty(exports, "isOutputType", ({ enumerable: true, get: function get() { return _definition.isOutputType; } })); Object.defineProperty(exports, "isLeafType", ({ enumerable: true, get: function get() { return _definition.isLeafType; } })); Object.defineProperty(exports, "isCompositeType", ({ enumerable: true, get: function get() { return _definition.isCompositeType; } })); Object.defineProperty(exports, "isAbstractType", ({ enumerable: true, get: function get() { return _definition.isAbstractType; } })); Object.defineProperty(exports, "isWrappingType", ({ enumerable: true, get: function get() { return _definition.isWrappingType; } })); Object.defineProperty(exports, "isNullableType", ({ enumerable: true, get: function get() { return _definition.isNullableType; } })); Object.defineProperty(exports, "isNamedType", ({ enumerable: true, get: function get() { return _definition.isNamedType; } })); Object.defineProperty(exports, "isRequiredArgument", ({ enumerable: true, get: function get() { return _definition.isRequiredArgument; } })); Object.defineProperty(exports, "isRequiredInputField", ({ enumerable: true, get: function get() { return _definition.isRequiredInputField; } })); Object.defineProperty(exports, "assertType", ({ enumerable: true, get: function get() { return _definition.assertType; } })); Object.defineProperty(exports, "assertScalarType", ({ enumerable: true, get: function get() { return _definition.assertScalarType; } })); Object.defineProperty(exports, "assertObjectType", ({ enumerable: true, get: function get() { return _definition.assertObjectType; } })); Object.defineProperty(exports, "assertInterfaceType", ({ enumerable: true, get: function get() { return _definition.assertInterfaceType; } })); Object.defineProperty(exports, "assertUnionType", ({ enumerable: true, get: function get() { return _definition.assertUnionType; } })); Object.defineProperty(exports, "assertEnumType", ({ enumerable: true, get: function get() { return _definition.assertEnumType; } })); Object.defineProperty(exports, "assertInputObjectType", ({ enumerable: true, get: function get() { return _definition.assertInputObjectType; } })); Object.defineProperty(exports, "assertListType", ({ enumerable: true, get: function get() { return _definition.assertListType; } })); Object.defineProperty(exports, "assertNonNullType", ({ enumerable: true, get: function get() { return _definition.assertNonNullType; } })); Object.defineProperty(exports, "assertInputType", ({ enumerable: true, get: function get() { return _definition.assertInputType; } })); Object.defineProperty(exports, "assertOutputType", ({ enumerable: true, get: function get() { return _definition.assertOutputType; } })); Object.defineProperty(exports, "assertLeafType", ({ enumerable: true, get: function get() { return _definition.assertLeafType; } })); Object.defineProperty(exports, "assertCompositeType", ({ enumerable: true, get: function get() { return _definition.assertCompositeType; } })); Object.defineProperty(exports, "assertAbstractType", ({ enumerable: true, get: function get() { return _definition.assertAbstractType; } })); Object.defineProperty(exports, "assertWrappingType", ({ enumerable: true, get: function get() { return _definition.assertWrappingType; } })); Object.defineProperty(exports, "assertNullableType", ({ enumerable: true, get: function get() { return _definition.assertNullableType; } })); Object.defineProperty(exports, "assertNamedType", ({ enumerable: true, get: function get() { return _definition.assertNamedType; } })); Object.defineProperty(exports, "getNullableType", ({ enumerable: true, get: function get() { return _definition.getNullableType; } })); Object.defineProperty(exports, "getNamedType", ({ enumerable: true, get: function get() { return _definition.getNamedType; } })); Object.defineProperty(exports, "GraphQLScalarType", ({ enumerable: true, get: function get() { return _definition.GraphQLScalarType; } })); Object.defineProperty(exports, "GraphQLObjectType", ({ enumerable: true, get: function get() { return _definition.GraphQLObjectType; } })); Object.defineProperty(exports, "GraphQLInterfaceType", ({ enumerable: true, get: function get() { return _definition.GraphQLInterfaceType; } })); Object.defineProperty(exports, "GraphQLUnionType", ({ enumerable: true, get: function get() { return _definition.GraphQLUnionType; } })); Object.defineProperty(exports, "GraphQLEnumType", ({ enumerable: true, get: function get() { return _definition.GraphQLEnumType; } })); Object.defineProperty(exports, "GraphQLInputObjectType", ({ enumerable: true, get: function get() { return _definition.GraphQLInputObjectType; } })); Object.defineProperty(exports, "GraphQLList", ({ enumerable: true, get: function get() { return _definition.GraphQLList; } })); Object.defineProperty(exports, "GraphQLNonNull", ({ enumerable: true, get: function get() { return _definition.GraphQLNonNull; } })); Object.defineProperty(exports, "isDirective", ({ enumerable: true, get: function get() { return _directives.isDirective; } })); Object.defineProperty(exports, "assertDirective", ({ enumerable: true, get: function get() { return _directives.assertDirective; } })); Object.defineProperty(exports, "GraphQLDirective", ({ enumerable: true, get: function get() { return _directives.GraphQLDirective; } })); Object.defineProperty(exports, "isSpecifiedDirective", ({ enumerable: true, get: function get() { return _directives.isSpecifiedDirective; } })); Object.defineProperty(exports, "specifiedDirectives", ({ enumerable: true, get: function get() { return _directives.specifiedDirectives; } })); Object.defineProperty(exports, "GraphQLIncludeDirective", ({ enumerable: true, get: function get() { return _directives.GraphQLIncludeDirective; } })); Object.defineProperty(exports, "GraphQLSkipDirective", ({ enumerable: true, get: function get() { return _directives.GraphQLSkipDirective; } })); Object.defineProperty(exports, "GraphQLDeprecatedDirective", ({ enumerable: true, get: function get() { return _directives.GraphQLDeprecatedDirective; } })); Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", ({ enumerable: true, get: function get() { return _directives.DEFAULT_DEPRECATION_REASON; } })); Object.defineProperty(exports, "isSpecifiedScalarType", ({ enumerable: true, get: function get() { return _scalars.isSpecifiedScalarType; } })); Object.defineProperty(exports, "specifiedScalarTypes", ({ enumerable: true, get: function get() { return _scalars.specifiedScalarTypes; } })); Object.defineProperty(exports, "GraphQLInt", ({ enumerable: true, get: function get() { return _scalars.GraphQLInt; } })); Object.defineProperty(exports, "GraphQLFloat", ({ enumerable: true, get: function get() { return _scalars.GraphQLFloat; } })); Object.defineProperty(exports, "GraphQLString", ({ enumerable: true, get: function get() { return _scalars.GraphQLString; } })); Object.defineProperty(exports, "GraphQLBoolean", ({ enumerable: true, get: function get() { return _scalars.GraphQLBoolean; } })); Object.defineProperty(exports, "GraphQLID", ({ enumerable: true, get: function get() { return _scalars.GraphQLID; } })); Object.defineProperty(exports, "isIntrospectionType", ({ enumerable: true, get: function get() { return _introspection.isIntrospectionType; } })); Object.defineProperty(exports, "introspectionTypes", ({ enumerable: true, get: function get() { return _introspection.introspectionTypes; } })); Object.defineProperty(exports, "__Schema", ({ enumerable: true, get: function get() { return _introspection.__Schema; } })); Object.defineProperty(exports, "__Directive", ({ enumerable: true, get: function get() { return _introspection.__Directive; } })); Object.defineProperty(exports, "__DirectiveLocation", ({ enumerable: true, get: function get() { return _introspection.__DirectiveLocation; } })); Object.defineProperty(exports, "__Type", ({ enumerable: true, get: function get() { return _introspection.__Type; } })); Object.defineProperty(exports, "__Field", ({ enumerable: true, get: function get() { return _introspection.__Field; } })); Object.defineProperty(exports, "__InputValue", ({ enumerable: true, get: function get() { return _introspection.__InputValue; } })); Object.defineProperty(exports, "__EnumValue", ({ enumerable: true, get: function get() { return _introspection.__EnumValue; } })); Object.defineProperty(exports, "__TypeKind", ({ enumerable: true, get: function get() { return _introspection.__TypeKind; } })); Object.defineProperty(exports, "TypeKind", ({ enumerable: true, get: function get() { return _introspection.TypeKind; } })); Object.defineProperty(exports, "SchemaMetaFieldDef", ({ enumerable: true, get: function get() { return _introspection.SchemaMetaFieldDef; } })); Object.defineProperty(exports, "TypeMetaFieldDef", ({ enumerable: true, get: function get() { return _introspection.TypeMetaFieldDef; } })); Object.defineProperty(exports, "TypeNameMetaFieldDef", ({ enumerable: true, get: function get() { return _introspection.TypeNameMetaFieldDef; } })); Object.defineProperty(exports, "validateSchema", ({ enumerable: true, get: function get() { return _validate.validateSchema; } })); Object.defineProperty(exports, "assertValidSchema", ({ enumerable: true, get: function get() { return _validate.assertValidSchema; } })); var _schema = __webpack_require__(/*! ./schema */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js"); var _definition = __webpack_require__(/*! ./definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _directives = __webpack_require__(/*! ./directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _scalars = __webpack_require__(/*! ./scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _introspection = __webpack_require__(/*! ./introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _validate = __webpack_require__(/*! ./validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/validate.js"); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export SchemaMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TypeKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TypeMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TypeNameMetaFieldDef [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Directive [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __DirectiveLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __EnumValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Field [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __InputValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Schema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __Type [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __TypeKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export introspectionTypes [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isIntrospectionType [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isIntrospectionType = isIntrospectionType; exports.introspectionTypes = exports.TypeNameMetaFieldDef = exports.TypeMetaFieldDef = exports.SchemaMetaFieldDef = exports.__TypeKind = exports.TypeKind = exports.__EnumValue = exports.__InputValue = exports.__Field = exports.__Type = exports.__DirectiveLocation = exports.__Directive = exports.__Schema = void 0; var _objectValues = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _printer = __webpack_require__(/*! ../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _directiveLocation = __webpack_require__(/*! ../language/directiveLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/directiveLocation.js"); var _astFromValue = __webpack_require__(/*! ../utilities/astFromValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/astFromValue.js"); var _scalars = __webpack_require__(/*! ./scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _definition = __webpack_require__(/*! ./definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var __Schema = new _definition.GraphQLObjectType({ name: '__Schema', description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', fields: function fields() { return { types: { description: 'A list of all types supported by this server.', type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type))), resolve: function resolve(schema) { return (0, _objectValues.default)(schema.getTypeMap()); } }, queryType: { description: 'The type that query operations will be rooted at.', type: (0, _definition.GraphQLNonNull)(__Type), resolve: function resolve(schema) { return schema.getQueryType(); } }, mutationType: { description: 'If this server supports mutation, the type that mutation operations will be rooted at.', type: __Type, resolve: function resolve(schema) { return schema.getMutationType(); } }, subscriptionType: { description: 'If this server support subscription, the type that subscription operations will be rooted at.', type: __Type, resolve: function resolve(schema) { return schema.getSubscriptionType(); } }, directives: { description: 'A list of all directives supported by this server.', type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Directive))), resolve: function resolve(schema) { return schema.getDirectives(); } } }; } }); exports.__Schema = __Schema; var __Directive = new _definition.GraphQLObjectType({ name: '__Directive', description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", fields: function fields() { return { name: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), resolve: function resolve(obj) { return obj.name; } }, description: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.description; } }, locations: { type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__DirectiveLocation))), resolve: function resolve(obj) { return obj.locations; } }, args: { type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue))), resolve: function resolve(directive) { return directive.args; } } }; } }); exports.__Directive = __Directive; var __DirectiveLocation = new _definition.GraphQLEnumType({ name: '__DirectiveLocation', description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', values: { QUERY: { value: _directiveLocation.DirectiveLocation.QUERY, description: 'Location adjacent to a query operation.' }, MUTATION: { value: _directiveLocation.DirectiveLocation.MUTATION, description: 'Location adjacent to a mutation operation.' }, SUBSCRIPTION: { value: _directiveLocation.DirectiveLocation.SUBSCRIPTION, description: 'Location adjacent to a subscription operation.' }, FIELD: { value: _directiveLocation.DirectiveLocation.FIELD, description: 'Location adjacent to a field.' }, FRAGMENT_DEFINITION: { value: _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION, description: 'Location adjacent to a fragment definition.' }, FRAGMENT_SPREAD: { value: _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, description: 'Location adjacent to a fragment spread.' }, INLINE_FRAGMENT: { value: _directiveLocation.DirectiveLocation.INLINE_FRAGMENT, description: 'Location adjacent to an inline fragment.' }, VARIABLE_DEFINITION: { value: _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION, description: 'Location adjacent to a variable definition.' }, SCHEMA: { value: _directiveLocation.DirectiveLocation.SCHEMA, description: 'Location adjacent to a schema definition.' }, SCALAR: { value: _directiveLocation.DirectiveLocation.SCALAR, description: 'Location adjacent to a scalar definition.' }, OBJECT: { value: _directiveLocation.DirectiveLocation.OBJECT, description: 'Location adjacent to an object type definition.' }, FIELD_DEFINITION: { value: _directiveLocation.DirectiveLocation.FIELD_DEFINITION, description: 'Location adjacent to a field definition.' }, ARGUMENT_DEFINITION: { value: _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION, description: 'Location adjacent to an argument definition.' }, INTERFACE: { value: _directiveLocation.DirectiveLocation.INTERFACE, description: 'Location adjacent to an interface definition.' }, UNION: { value: _directiveLocation.DirectiveLocation.UNION, description: 'Location adjacent to a union definition.' }, ENUM: { value: _directiveLocation.DirectiveLocation.ENUM, description: 'Location adjacent to an enum definition.' }, ENUM_VALUE: { value: _directiveLocation.DirectiveLocation.ENUM_VALUE, description: 'Location adjacent to an enum value definition.' }, INPUT_OBJECT: { value: _directiveLocation.DirectiveLocation.INPUT_OBJECT, description: 'Location adjacent to an input object type definition.' }, INPUT_FIELD_DEFINITION: { value: _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION, description: 'Location adjacent to an input object field definition.' } } }); exports.__DirectiveLocation = __DirectiveLocation; var __Type = new _definition.GraphQLObjectType({ name: '__Type', description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', fields: function fields() { return { kind: { type: (0, _definition.GraphQLNonNull)(__TypeKind), resolve: function resolve(type) { if ((0, _definition.isScalarType)(type)) { return TypeKind.SCALAR; } else if ((0, _definition.isObjectType)(type)) { return TypeKind.OBJECT; } else if ((0, _definition.isInterfaceType)(type)) { return TypeKind.INTERFACE; } else if ((0, _definition.isUnionType)(type)) { return TypeKind.UNION; } else if ((0, _definition.isEnumType)(type)) { return TypeKind.ENUM; } else if ((0, _definition.isInputObjectType)(type)) { return TypeKind.INPUT_OBJECT; } else if ((0, _definition.isListType)(type)) { return TypeKind.LIST; } else if ((0, _definition.isNonNullType)(type)) { return TypeKind.NON_NULL; } // Not reachable. All possible types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, "Unexpected type: \"".concat((0, _inspect.default)(type), "\".")); } }, name: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.name !== undefined ? obj.name : undefined; } }, description: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.description !== undefined ? obj.description : undefined; } }, fields: { type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Field)), args: { includeDeprecated: { type: _scalars.GraphQLBoolean, defaultValue: false } }, resolve: function resolve(type, _ref) { var includeDeprecated = _ref.includeDeprecated; if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { var fields = (0, _objectValues.default)(type.getFields()); if (!includeDeprecated) { fields = fields.filter(function (field) { return !field.deprecationReason; }); } return fields; } return null; } }, interfaces: { type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type)), resolve: function resolve(type) { if ((0, _definition.isObjectType)(type)) { return type.getInterfaces(); } } }, possibleTypes: { type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type)), resolve: function resolve(type, args, context, _ref2) { var schema = _ref2.schema; if ((0, _definition.isAbstractType)(type)) { return schema.getPossibleTypes(type); } } }, enumValues: { type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__EnumValue)), args: { includeDeprecated: { type: _scalars.GraphQLBoolean, defaultValue: false } }, resolve: function resolve(type, _ref3) { var includeDeprecated = _ref3.includeDeprecated; if ((0, _definition.isEnumType)(type)) { var values = type.getValues(); if (!includeDeprecated) { values = values.filter(function (value) { return !value.deprecationReason; }); } return values; } } }, inputFields: { type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue)), resolve: function resolve(type) { if ((0, _definition.isInputObjectType)(type)) { return (0, _objectValues.default)(type.getFields()); } } }, ofType: { type: __Type, resolve: function resolve(obj) { return obj.ofType !== undefined ? obj.ofType : undefined; } } }; } }); exports.__Type = __Type; var __Field = new _definition.GraphQLObjectType({ name: '__Field', description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', fields: function fields() { return { name: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), resolve: function resolve(obj) { return obj.name; } }, description: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.description; } }, args: { type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue))), resolve: function resolve(field) { return field.args; } }, type: { type: (0, _definition.GraphQLNonNull)(__Type), resolve: function resolve(obj) { return obj.type; } }, isDeprecated: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), resolve: function resolve(obj) { return obj.isDeprecated; } }, deprecationReason: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.deprecationReason; } } }; } }); exports.__Field = __Field; var __InputValue = new _definition.GraphQLObjectType({ name: '__InputValue', description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', fields: function fields() { return { name: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), resolve: function resolve(obj) { return obj.name; } }, description: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.description; } }, type: { type: (0, _definition.GraphQLNonNull)(__Type), resolve: function resolve(obj) { return obj.type; } }, defaultValue: { type: _scalars.GraphQLString, description: 'A GraphQL-formatted string representing the default value for this input value.', resolve: function resolve(inputVal) { var valueAST = (0, _astFromValue.astFromValue)(inputVal.defaultValue, inputVal.type); return valueAST ? (0, _printer.print)(valueAST) : null; } } }; } }); exports.__InputValue = __InputValue; var __EnumValue = new _definition.GraphQLObjectType({ name: '__EnumValue', description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', fields: function fields() { return { name: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), resolve: function resolve(obj) { return obj.name; } }, description: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.description; } }, isDeprecated: { type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), resolve: function resolve(obj) { return obj.isDeprecated; } }, deprecationReason: { type: _scalars.GraphQLString, resolve: function resolve(obj) { return obj.deprecationReason; } } }; } }); exports.__EnumValue = __EnumValue; var TypeKind = Object.freeze({ SCALAR: 'SCALAR', OBJECT: 'OBJECT', INTERFACE: 'INTERFACE', UNION: 'UNION', ENUM: 'ENUM', INPUT_OBJECT: 'INPUT_OBJECT', LIST: 'LIST', NON_NULL: 'NON_NULL' }); exports.TypeKind = TypeKind; var __TypeKind = new _definition.GraphQLEnumType({ name: '__TypeKind', description: 'An enum describing what kind of type a given `__Type` is.', values: { SCALAR: { value: TypeKind.SCALAR, description: 'Indicates this type is a scalar.' }, OBJECT: { value: TypeKind.OBJECT, description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.' }, INTERFACE: { value: TypeKind.INTERFACE, description: 'Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.' }, UNION: { value: TypeKind.UNION, description: 'Indicates this type is a union. `possibleTypes` is a valid field.' }, ENUM: { value: TypeKind.ENUM, description: 'Indicates this type is an enum. `enumValues` is a valid field.' }, INPUT_OBJECT: { value: TypeKind.INPUT_OBJECT, description: 'Indicates this type is an input object. `inputFields` is a valid field.' }, LIST: { value: TypeKind.LIST, description: 'Indicates this type is a list. `ofType` is a valid field.' }, NON_NULL: { value: TypeKind.NON_NULL, description: 'Indicates this type is a non-null. `ofType` is a valid field.' } } }); /** * Note that these are GraphQLField and not GraphQLFieldConfig, * so the format for args is different. */ exports.__TypeKind = __TypeKind; var SchemaMetaFieldDef = { name: '__schema', type: (0, _definition.GraphQLNonNull)(__Schema), description: 'Access the current type schema of this server.', args: [], resolve: function resolve(source, args, context, _ref4) { var schema = _ref4.schema; return schema; }, deprecationReason: undefined, extensions: undefined, astNode: undefined }; exports.SchemaMetaFieldDef = SchemaMetaFieldDef; var TypeMetaFieldDef = { name: '__type', type: __Type, description: 'Request the type information of a single type.', args: [{ name: 'name', description: undefined, type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), defaultValue: undefined, extensions: undefined, astNode: undefined }], resolve: function resolve(source, _ref5, context, _ref6) { var name = _ref5.name; var schema = _ref6.schema; return schema.getType(name); }, deprecationReason: undefined, extensions: undefined, astNode: undefined }; exports.TypeMetaFieldDef = TypeMetaFieldDef; var TypeNameMetaFieldDef = { name: '__typename', type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), description: 'The name of the current Object type at runtime.', args: [], resolve: function resolve(source, args, context, _ref7) { var parentType = _ref7.parentType; return parentType.name; }, deprecationReason: undefined, extensions: undefined, astNode: undefined }; exports.TypeNameMetaFieldDef = TypeNameMetaFieldDef; var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); exports.introspectionTypes = introspectionTypes; function isIntrospectionType(type) { return (0, _definition.isNamedType)(type) && introspectionTypes.some(function (_ref8) { var name = _ref8.name; return type.name === name; }); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js": /*!*******************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js ***! \*******************************************************************************/ /*! flagged exports */ /*! export GraphQLBoolean [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLFloat [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLID [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLInt [provided] [no usage info] [missing usage info prevents renaming] */ /*! export GraphQLString [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSpecifiedScalarType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export specifiedScalarTypes [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isSpecifiedScalarType = isSpecifiedScalarType; exports.specifiedScalarTypes = exports.GraphQLID = exports.GraphQLBoolean = exports.GraphQLString = exports.GraphQLFloat = exports.GraphQLInt = void 0; var _isFinite = _interopRequireDefault(__webpack_require__(/*! ../polyfills/isFinite */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/isFinite.js")); var _isInteger = _interopRequireDefault(__webpack_require__(/*! ../polyfills/isInteger */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/isInteger.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _definition = __webpack_require__(/*! ./definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // As per the GraphQL Spec, Integers are only treated as valid when a valid // 32-bit signed integer, providing the broadest support across platforms. // // n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because // they are internally represented as IEEE 754 doubles. var MAX_INT = 2147483647; var MIN_INT = -2147483648; function serializeInt(value) { if (typeof value === 'boolean') { return value ? 1 : 0; } var num = value; if (typeof value === 'string' && value !== '') { num = Number(value); } if (!(0, _isInteger.default)(num)) { throw new TypeError("Int cannot represent non-integer value: ".concat((0, _inspect.default)(value))); } if (num > MAX_INT || num < MIN_INT) { throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat((0, _inspect.default)(value))); } return num; } function coerceInt(value) { if (!(0, _isInteger.default)(value)) { throw new TypeError("Int cannot represent non-integer value: ".concat((0, _inspect.default)(value))); } if (value > MAX_INT || value < MIN_INT) { throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat((0, _inspect.default)(value))); } return value; } var GraphQLInt = new _definition.GraphQLScalarType({ name: 'Int', description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', serialize: serializeInt, parseValue: coerceInt, parseLiteral: function parseLiteral(ast) { if (ast.kind === _kinds.Kind.INT) { var num = parseInt(ast.value, 10); if (num <= MAX_INT && num >= MIN_INT) { return num; } } return undefined; } }); exports.GraphQLInt = GraphQLInt; function serializeFloat(value) { if (typeof value === 'boolean') { return value ? 1 : 0; } var num = value; if (typeof value === 'string' && value !== '') { num = Number(value); } if (!(0, _isFinite.default)(num)) { throw new TypeError("Float cannot represent non numeric value: ".concat((0, _inspect.default)(value))); } return num; } function coerceFloat(value) { if (!(0, _isFinite.default)(value)) { throw new TypeError("Float cannot represent non numeric value: ".concat((0, _inspect.default)(value))); } return value; } var GraphQLFloat = new _definition.GraphQLScalarType({ name: 'Float', description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', serialize: serializeFloat, parseValue: coerceFloat, parseLiteral: function parseLiteral(ast) { return ast.kind === _kinds.Kind.FLOAT || ast.kind === _kinds.Kind.INT ? parseFloat(ast.value) : undefined; } }); // Support serializing objects with custom valueOf() or toJSON() functions - // a common way to represent a complex value which can be represented as // a string (ex: MongoDB id objects). exports.GraphQLFloat = GraphQLFloat; function serializeObject(value) { if ((0, _isObjectLike.default)(value)) { if (typeof value.valueOf === 'function') { var valueOfResult = value.valueOf(); if (!(0, _isObjectLike.default)(valueOfResult)) { return valueOfResult; } } if (typeof value.toJSON === 'function') { // $FlowFixMe(>=0.90.0) return value.toJSON(); } } return value; } function serializeString(rawValue) { var value = serializeObject(rawValue); // Serialize string, boolean and number values to a string, but do not // attempt to coerce object, function, symbol, or other types as strings. if (typeof value === 'string') { return value; } if (typeof value === 'boolean') { return value ? 'true' : 'false'; } if ((0, _isFinite.default)(value)) { return value.toString(); } throw new TypeError("String cannot represent value: ".concat((0, _inspect.default)(rawValue))); } function coerceString(value) { if (typeof value !== 'string') { throw new TypeError("String cannot represent a non string value: ".concat((0, _inspect.default)(value))); } return value; } var GraphQLString = new _definition.GraphQLScalarType({ name: 'String', description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', serialize: serializeString, parseValue: coerceString, parseLiteral: function parseLiteral(ast) { return ast.kind === _kinds.Kind.STRING ? ast.value : undefined; } }); exports.GraphQLString = GraphQLString; function serializeBoolean(value) { if (typeof value === 'boolean') { return value; } if ((0, _isFinite.default)(value)) { return value !== 0; } throw new TypeError("Boolean cannot represent a non boolean value: ".concat((0, _inspect.default)(value))); } function coerceBoolean(value) { if (typeof value !== 'boolean') { throw new TypeError("Boolean cannot represent a non boolean value: ".concat((0, _inspect.default)(value))); } return value; } var GraphQLBoolean = new _definition.GraphQLScalarType({ name: 'Boolean', description: 'The `Boolean` scalar type represents `true` or `false`.', serialize: serializeBoolean, parseValue: coerceBoolean, parseLiteral: function parseLiteral(ast) { return ast.kind === _kinds.Kind.BOOLEAN ? ast.value : undefined; } }); exports.GraphQLBoolean = GraphQLBoolean; function serializeID(rawValue) { var value = serializeObject(rawValue); if (typeof value === 'string') { return value; } if ((0, _isInteger.default)(value)) { return String(value); } throw new TypeError("ID cannot represent value: ".concat((0, _inspect.default)(rawValue))); } function coerceID(value) { if (typeof value === 'string') { return value; } if ((0, _isInteger.default)(value)) { return value.toString(); } throw new TypeError("ID cannot represent value: ".concat((0, _inspect.default)(value))); } var GraphQLID = new _definition.GraphQLScalarType({ name: 'ID', description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', serialize: serializeID, parseValue: coerceID, parseLiteral: function parseLiteral(ast) { return ast.kind === _kinds.Kind.STRING || ast.kind === _kinds.Kind.INT ? ast.value : undefined; } }); exports.GraphQLID = GraphQLID; var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); exports.specifiedScalarTypes = specifiedScalarTypes; function isSpecifiedScalarType(type) { return (0, _definition.isScalarType)(type) && specifiedScalarTypes.some(function (_ref) { var name = _ref.name; return type.name === name; }); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js": /*!******************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js ***! \******************************************************************************/ /*! flagged exports */ /*! export GraphQLSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isSchema = isSchema; exports.assertSchema = assertSchema; exports.GraphQLSchema = void 0; var _find = _interopRequireDefault(__webpack_require__(/*! ../polyfills/find */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/find.js")); var _objectValues7 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _toObjMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/toObjMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/toObjMap.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _instanceOf = _interopRequireDefault(__webpack_require__(/*! ../jsutils/instanceOf */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/instanceOf.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _defineToStringTag = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineToStringTag */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/defineToStringTag.js")); var _introspection = __webpack_require__(/*! ./introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _directives = __webpack_require__(/*! ./directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _definition = __webpack_require__(/*! ./definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // eslint-disable-next-line no-redeclare function isSchema(schema) { return (0, _instanceOf.default)(schema, GraphQLSchema); } function assertSchema(schema) { if (!isSchema(schema)) { throw new Error("Expected ".concat((0, _inspect.default)(schema), " to be a GraphQL schema.")); } return schema; } /** * Schema Definition * * A Schema is created by supplying the root types of each type of operation, * query and mutation (optional). A schema definition is then supplied to the * validator and executor. * * Example: * * const MyAppSchema = new GraphQLSchema({ * query: MyAppQueryRootType, * mutation: MyAppMutationRootType, * }) * * Note: When the schema is constructed, by default only the types that are * reachable by traversing the root types are included, other types must be * explicitly referenced. * * Example: * * const characterInterface = new GraphQLInterfaceType({ * name: 'Character', * ... * }); * * const humanType = new GraphQLObjectType({ * name: 'Human', * interfaces: [characterInterface], * ... * }); * * const droidType = new GraphQLObjectType({ * name: 'Droid', * interfaces: [characterInterface], * ... * }); * * const schema = new GraphQLSchema({ * query: new GraphQLObjectType({ * name: 'Query', * fields: { * hero: { type: characterInterface, ... }, * } * }), * ... * // Since this schema references only the `Character` interface it's * // necessary to explicitly list the types that implement it if * // you want them to be included in the final schema. * types: [humanType, droidType], * }) * * Note: If an array of `directives` are provided to GraphQLSchema, that will be * the exact list of directives represented and allowed. If `directives` is not * provided then a default set of the specified directives (e.g. @include and * @skip) will be used. If you wish to provide *additional* directives to these * specified directives, you must explicitly declare them. Example: * * const MyAppSchema = new GraphQLSchema({ * ... * directives: specifiedDirectives.concat([ myCustomDirective ]), * }) * */ var GraphQLSchema = /*#__PURE__*/ function () { // Used as a cache for validateSchema(). // Referenced by validateSchema(). function GraphQLSchema(config) { // If this schema was built from a source known to be valid, then it may be // marked with assumeValid to avoid an additional type system validation. if (config && config.assumeValid) { this.__validationErrors = []; } else { this.__validationErrors = undefined; // Otherwise check for common mistakes during construction to produce // clear and early error messages. (0, _isObjectLike.default)(config) || (0, _devAssert.default)(0, 'Must provide configuration object.'); !config.types || Array.isArray(config.types) || (0, _devAssert.default)(0, "\"types\" must be Array if provided but got: ".concat((0, _inspect.default)(config.types), ".")); !config.directives || Array.isArray(config.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config.directives), ".")); !config.allowedLegacyNames || Array.isArray(config.allowedLegacyNames) || (0, _devAssert.default)(0, '"allowedLegacyNames" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config.allowedLegacyNames), ".")); } this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = config.extensionASTNodes; this.__allowedLegacyNames = config.allowedLegacyNames || []; this._queryType = config.query; this._mutationType = config.mutation; this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default. this._directives = config.directives || _directives.specifiedDirectives; // Build type map now to detect any errors within this schema. var initialTypes = [this._queryType, this._mutationType, this._subscriptionType, _introspection.__Schema].concat(config.types); // Keep track of all types referenced within the schema. var typeMap = Object.create(null); // First by deeply visiting all initial types. typeMap = initialTypes.reduce(typeMapReducer, typeMap); // Then by deeply visiting all directive types. typeMap = this._directives.reduce(typeMapDirectiveReducer, typeMap); // Storing the resulting map for reference by the schema. this._typeMap = typeMap; this._possibleTypeMap = Object.create(null); // Keep track of all implementations by interface name. this._implementations = Object.create(null); for (var _i2 = 0, _objectValues2 = (0, _objectValues7.default)(this._typeMap); _i2 < _objectValues2.length; _i2++) { var type = _objectValues2[_i2]; if ((0, _definition.isObjectType)(type)) { for (var _i4 = 0, _type$getInterfaces2 = type.getInterfaces(); _i4 < _type$getInterfaces2.length; _i4++) { var iface = _type$getInterfaces2[_i4]; if ((0, _definition.isInterfaceType)(iface)) { var impls = this._implementations[iface.name]; if (impls) { impls.push(type); } else { this._implementations[iface.name] = [type]; } } } } } } var _proto = GraphQLSchema.prototype; _proto.getQueryType = function getQueryType() { return this._queryType; }; _proto.getMutationType = function getMutationType() { return this._mutationType; }; _proto.getSubscriptionType = function getSubscriptionType() { return this._subscriptionType; }; _proto.getTypeMap = function getTypeMap() { return this._typeMap; }; _proto.getType = function getType(name) { return this.getTypeMap()[name]; }; _proto.getPossibleTypes = function getPossibleTypes(abstractType) { if ((0, _definition.isUnionType)(abstractType)) { return abstractType.getTypes(); } return this._implementations[abstractType.name] || []; }; _proto.isPossibleType = function isPossibleType(abstractType, possibleType) { if (this._possibleTypeMap[abstractType.name] == null) { var map = Object.create(null); for (var _i6 = 0, _this$getPossibleType2 = this.getPossibleTypes(abstractType); _i6 < _this$getPossibleType2.length; _i6++) { var type = _this$getPossibleType2[_i6]; map[type.name] = true; } this._possibleTypeMap[abstractType.name] = map; } return Boolean(this._possibleTypeMap[abstractType.name][possibleType.name]); }; _proto.getDirectives = function getDirectives() { return this._directives; }; _proto.getDirective = function getDirective(name) { return (0, _find.default)(this.getDirectives(), function (directive) { return directive.name === name; }); }; _proto.toConfig = function toConfig() { return { query: this.getQueryType(), mutation: this.getMutationType(), subscription: this.getSubscriptionType(), types: (0, _objectValues7.default)(this.getTypeMap()), directives: this.getDirectives().slice(), extensions: this.extensions, astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [], assumeValid: this.__validationErrors !== undefined, allowedLegacyNames: this.__allowedLegacyNames }; }; return GraphQLSchema; }(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported exports.GraphQLSchema = GraphQLSchema; (0, _defineToStringTag.default)(GraphQLSchema); function typeMapReducer(map, type) { if (!type) { return map; } var namedType = (0, _definition.getNamedType)(type); var seenType = map[namedType.name]; if (seenType) { if (seenType !== namedType) { throw new Error("Schema must contain uniquely named types but contains multiple types named \"".concat(namedType.name, "\".")); } return map; } map[namedType.name] = namedType; var reducedMap = map; if ((0, _definition.isUnionType)(namedType)) { reducedMap = namedType.getTypes().reduce(typeMapReducer, reducedMap); } if ((0, _definition.isObjectType)(namedType)) { reducedMap = namedType.getInterfaces().reduce(typeMapReducer, reducedMap); } if ((0, _definition.isObjectType)(namedType) || (0, _definition.isInterfaceType)(namedType)) { for (var _i8 = 0, _objectValues4 = (0, _objectValues7.default)(namedType.getFields()); _i8 < _objectValues4.length; _i8++) { var field = _objectValues4[_i8]; var fieldArgTypes = field.args.map(function (arg) { return arg.type; }); reducedMap = fieldArgTypes.reduce(typeMapReducer, reducedMap); reducedMap = typeMapReducer(reducedMap, field.type); } } if ((0, _definition.isInputObjectType)(namedType)) { for (var _i10 = 0, _objectValues6 = (0, _objectValues7.default)(namedType.getFields()); _i10 < _objectValues6.length; _i10++) { var _field = _objectValues6[_i10]; reducedMap = typeMapReducer(reducedMap, _field.type); } } return reducedMap; } function typeMapDirectiveReducer(map, directive) { // Directives are not validated until validateSchema() is called. if (!(0, _directives.isDirective)(directive)) { return map; } return directive.args.reduce(function (_map, arg) { return typeMapReducer(_map, arg.type); }, map); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/type/validate.js": /*!********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/type/validate.js ***! \********************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertValidSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export validateSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateSchema = validateSchema; exports.assertValidSchema = assertValidSchema; var _find = _interopRequireDefault(__webpack_require__(/*! ../polyfills/find */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/find.js")); var _flatMap = _interopRequireDefault(__webpack_require__(/*! ../polyfills/flatMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/flatMap.js")); var _objectValues3 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _objectEntries3 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectEntries */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _assertValidName = __webpack_require__(/*! ../utilities/assertValidName */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/assertValidName.js"); var _typeComparators = __webpack_require__(/*! ../utilities/typeComparators */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeComparators.js"); var _directives = __webpack_require__(/*! ./directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _introspection = __webpack_require__(/*! ./introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _schema = __webpack_require__(/*! ./schema */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js"); var _definition = __webpack_require__(/*! ./definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Implements the "Type Validation" sub-sections of the specification's * "Type System" section. * * Validation runs synchronously, returning an array of encountered errors, or * an empty array if no errors were encountered and the Schema is valid. */ function validateSchema(schema) { // First check to ensure the provided value is in fact a GraphQLSchema. (0, _schema.assertSchema)(schema); // If this Schema has already been validated, return the previous results. if (schema.__validationErrors) { return schema.__validationErrors; } // Validate the schema, producing a list of errors. var context = new SchemaValidationContext(schema); validateRootTypes(context); validateDirectives(context); validateTypes(context); // Persist the results of validation before returning to ensure validation // does not run multiple times for this schema. var errors = context.getErrors(); schema.__validationErrors = errors; return errors; } /** * Utility function which asserts a schema is valid by throwing an error if * it is invalid. */ function assertValidSchema(schema) { var errors = validateSchema(schema); if (errors.length !== 0) { throw new Error(errors.map(function (error) { return error.message; }).join('\n\n')); } } var SchemaValidationContext = /*#__PURE__*/ function () { function SchemaValidationContext(schema) { this._errors = []; this.schema = schema; } var _proto = SchemaValidationContext.prototype; _proto.reportError = function reportError(message, nodes) { var _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; this.addError(new _GraphQLError.GraphQLError(message, _nodes)); }; _proto.addError = function addError(error) { this._errors.push(error); }; _proto.getErrors = function getErrors() { return this._errors; }; return SchemaValidationContext; }(); function validateRootTypes(context) { var schema = context.schema; var queryType = schema.getQueryType(); if (!queryType) { context.reportError('Query root type must be provided.', schema.astNode); } else if (!(0, _definition.isObjectType)(queryType)) { context.reportError("Query root type must be Object type, it cannot be ".concat((0, _inspect.default)(queryType), "."), getOperationTypeNode(schema, queryType, 'query')); } var mutationType = schema.getMutationType(); if (mutationType && !(0, _definition.isObjectType)(mutationType)) { context.reportError('Mutation root type must be Object type if provided, it cannot be ' + "".concat((0, _inspect.default)(mutationType), "."), getOperationTypeNode(schema, mutationType, 'mutation')); } var subscriptionType = schema.getSubscriptionType(); if (subscriptionType && !(0, _definition.isObjectType)(subscriptionType)) { context.reportError('Subscription root type must be Object type if provided, it cannot be ' + "".concat((0, _inspect.default)(subscriptionType), "."), getOperationTypeNode(schema, subscriptionType, 'subscription')); } } function getOperationTypeNode(schema, type, operation) { var operationNodes = getAllSubNodes(schema, function (node) { return node.operationTypes; }); for (var _i2 = 0; _i2 < operationNodes.length; _i2++) { var node = operationNodes[_i2]; if (node.operation === operation) { return node.type; } } return type.astNode; } function validateDirectives(context) { for (var _i4 = 0, _context$schema$getDi2 = context.schema.getDirectives(); _i4 < _context$schema$getDi2.length; _i4++) { var directive = _context$schema$getDi2[_i4]; // Ensure all directives are in fact GraphQL directives. if (!(0, _directives.isDirective)(directive)) { context.reportError("Expected directive but got: ".concat((0, _inspect.default)(directive), "."), directive && directive.astNode); continue; } // Ensure they are named correctly. validateName(context, directive); // TODO: Ensure proper locations. // Ensure the arguments are valid. var argNames = Object.create(null); var _loop = function _loop(_i6, _directive$args2) { var arg = _directive$args2[_i6]; var argName = arg.name; // Ensure they are named correctly. validateName(context, arg); // Ensure they are unique per directive. if (argNames[argName]) { context.reportError("Argument @".concat(directive.name, "(").concat(argName, ":) can only be defined once."), directive.astNode && directive.args.filter(function (_ref) { var name = _ref.name; return name === argName; }).map(function (_ref2) { var astNode = _ref2.astNode; return astNode; })); return "continue"; } argNames[argName] = true; // Ensure the type is an input type. if (!(0, _definition.isInputType)(arg.type)) { context.reportError("The type of @".concat(directive.name, "(").concat(argName, ":) must be Input Type ") + "but got: ".concat((0, _inspect.default)(arg.type), "."), arg.astNode); } }; for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) { var _ret = _loop(_i6, _directive$args2); if (_ret === "continue") continue; } } } function validateName(context, node) { // If a schema explicitly allows some legacy name which is no longer valid, // allow it to be assumed valid. if (context.schema.__allowedLegacyNames.indexOf(node.name) !== -1) { return; } // Ensure names are valid, however introspection types opt out. var error = (0, _assertValidName.isValidNameError)(node.name, node.astNode || undefined); if (error) { context.addError(error); } } function validateTypes(context) { var validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context); var typeMap = context.schema.getTypeMap(); for (var _i8 = 0, _objectValues2 = (0, _objectValues3.default)(typeMap); _i8 < _objectValues2.length; _i8++) { var type = _objectValues2[_i8]; // Ensure all provided types are in fact GraphQL type. if (!(0, _definition.isNamedType)(type)) { context.reportError("Expected GraphQL named type but got: ".concat((0, _inspect.default)(type), "."), type && type.astNode); continue; } // Ensure it is named correctly (excluding introspection types). if (!(0, _introspection.isIntrospectionType)(type)) { validateName(context, type); } if ((0, _definition.isObjectType)(type)) { // Ensure fields are valid validateFields(context, type); // Ensure objects implement the interfaces they claim to. validateObjectInterfaces(context, type); } else if ((0, _definition.isInterfaceType)(type)) { // Ensure fields are valid. validateFields(context, type); } else if ((0, _definition.isUnionType)(type)) { // Ensure Unions include valid member types. validateUnionMembers(context, type); } else if ((0, _definition.isEnumType)(type)) { // Ensure Enums have valid values. validateEnumValues(context, type); } else if ((0, _definition.isInputObjectType)(type)) { // Ensure Input Object fields are valid. validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references validateInputObjectCircularRefs(type); } } } function validateFields(context, type) { var fields = (0, _objectValues3.default)(type.getFields()); // Objects and Interfaces both must define one or more fields. if (fields.length === 0) { context.reportError("Type ".concat(type.name, " must define one or more fields."), getAllNodes(type)); } for (var _i10 = 0; _i10 < fields.length; _i10++) { var field = fields[_i10]; // Ensure they are named correctly. validateName(context, field); // Ensure the type is an output type if (!(0, _definition.isOutputType)(field.type)) { context.reportError("The type of ".concat(type.name, ".").concat(field.name, " must be Output Type ") + "but got: ".concat((0, _inspect.default)(field.type), "."), field.astNode && field.astNode.type); } // Ensure the arguments are valid var argNames = Object.create(null); var _loop2 = function _loop2(_i12, _field$args2) { var arg = _field$args2[_i12]; var argName = arg.name; // Ensure they are named correctly. validateName(context, arg); // Ensure they are unique per field. if (argNames[argName]) { context.reportError("Field argument ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) can only be defined once."), field.args.filter(function (_ref3) { var name = _ref3.name; return name === argName; }).map(function (_ref4) { var astNode = _ref4.astNode; return astNode; })); } argNames[argName] = true; // Ensure the type is an input type if (!(0, _definition.isInputType)(arg.type)) { context.reportError("The type of ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) must be Input ") + "Type but got: ".concat((0, _inspect.default)(arg.type), "."), arg.astNode && arg.astNode.type); } }; for (var _i12 = 0, _field$args2 = field.args; _i12 < _field$args2.length; _i12++) { _loop2(_i12, _field$args2); } } } function validateObjectInterfaces(context, object) { var implementedTypeNames = Object.create(null); for (var _i14 = 0, _object$getInterfaces2 = object.getInterfaces(); _i14 < _object$getInterfaces2.length; _i14++) { var iface = _object$getInterfaces2[_i14]; if (!(0, _definition.isInterfaceType)(iface)) { context.reportError("Type ".concat((0, _inspect.default)(object), " must only implement Interface types, ") + "it cannot implement ".concat((0, _inspect.default)(iface), "."), getAllImplementsInterfaceNodes(object, iface)); continue; } if (implementedTypeNames[iface.name]) { context.reportError("Type ".concat(object.name, " can only implement ").concat(iface.name, " once."), getAllImplementsInterfaceNodes(object, iface)); continue; } implementedTypeNames[iface.name] = true; validateObjectImplementsInterface(context, object, iface); } } function validateObjectImplementsInterface(context, object, iface) { var objectFieldMap = object.getFields(); var ifaceFieldMap = iface.getFields(); // Assert each interface field is implemented. for (var _i16 = 0, _objectEntries2 = (0, _objectEntries3.default)(ifaceFieldMap); _i16 < _objectEntries2.length; _i16++) { var _ref6 = _objectEntries2[_i16]; var fieldName = _ref6[0]; var ifaceField = _ref6[1]; var objectField = objectFieldMap[fieldName]; // Assert interface field exists on object. if (!objectField) { context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expected but ").concat(object.name, " does not provide it."), [ifaceField.astNode].concat(getAllNodes(object))); continue; } // Assert interface field type is satisfied by object field type, by being // a valid subtype. (covariant) if (!(0, _typeComparators.isTypeSubTypeOf)(context.schema, objectField.type, ifaceField.type)) { context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expects type ") + "".concat((0, _inspect.default)(ifaceField.type), " but ").concat(object.name, ".").concat(fieldName, " ") + "is type ".concat((0, _inspect.default)(objectField.type), "."), [ifaceField.astNode && ifaceField.astNode.type, objectField.astNode && objectField.astNode.type]); } // Assert each interface field arg is implemented. var _loop3 = function _loop3(_i18, _ifaceField$args2) { var ifaceArg = _ifaceField$args2[_i18]; var argName = ifaceArg.name; var objectArg = (0, _find.default)(objectField.args, function (arg) { return arg.name === argName; }); // Assert interface field arg exists on object field. if (!objectArg) { context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) expected but ").concat(object.name, ".").concat(fieldName, " does not provide it."), [ifaceArg.astNode, objectField.astNode]); return "continue"; } // Assert interface field arg type matches object field arg type. // (invariant) // TODO: change to contravariant? if (!(0, _typeComparators.isEqualType)(ifaceArg.type, objectArg.type)) { context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) ") + "expects type ".concat((0, _inspect.default)(ifaceArg.type), " but ") + "".concat(object.name, ".").concat(fieldName, "(").concat(argName, ":) is type ") + "".concat((0, _inspect.default)(objectArg.type), "."), [ifaceArg.astNode && ifaceArg.astNode.type, objectArg.astNode && objectArg.astNode.type]); } // TODO: validate default values? }; for (var _i18 = 0, _ifaceField$args2 = ifaceField.args; _i18 < _ifaceField$args2.length; _i18++) { var _ret2 = _loop3(_i18, _ifaceField$args2); if (_ret2 === "continue") continue; } // Assert additional arguments must not be required. var _loop4 = function _loop4(_i20, _objectField$args2) { var objectArg = _objectField$args2[_i20]; var argName = objectArg.name; var ifaceArg = (0, _find.default)(ifaceField.args, function (arg) { return arg.name === argName; }); if (!ifaceArg && (0, _definition.isRequiredArgument)(objectArg)) { context.reportError("Object field ".concat(object.name, ".").concat(fieldName, " includes required argument ").concat(argName, " that is missing from the Interface field ").concat(iface.name, ".").concat(fieldName, "."), [objectArg.astNode, ifaceField.astNode]); } }; for (var _i20 = 0, _objectField$args2 = objectField.args; _i20 < _objectField$args2.length; _i20++) { _loop4(_i20, _objectField$args2); } } } function validateUnionMembers(context, union) { var memberTypes = union.getTypes(); if (memberTypes.length === 0) { context.reportError("Union type ".concat(union.name, " must define one or more member types."), getAllNodes(union)); } var includedTypeNames = Object.create(null); for (var _i22 = 0; _i22 < memberTypes.length; _i22++) { var memberType = memberTypes[_i22]; if (includedTypeNames[memberType.name]) { context.reportError("Union type ".concat(union.name, " can only include type ").concat(memberType.name, " once."), getUnionMemberTypeNodes(union, memberType.name)); continue; } includedTypeNames[memberType.name] = true; if (!(0, _definition.isObjectType)(memberType)) { context.reportError("Union type ".concat(union.name, " can only include Object types, ") + "it cannot include ".concat((0, _inspect.default)(memberType), "."), getUnionMemberTypeNodes(union, String(memberType))); } } } function validateEnumValues(context, enumType) { var enumValues = enumType.getValues(); if (enumValues.length === 0) { context.reportError("Enum type ".concat(enumType.name, " must define one or more values."), getAllNodes(enumType)); } for (var _i24 = 0; _i24 < enumValues.length; _i24++) { var enumValue = enumValues[_i24]; var valueName = enumValue.name; // Ensure valid name. validateName(context, enumValue); if (valueName === 'true' || valueName === 'false' || valueName === 'null') { context.reportError("Enum type ".concat(enumType.name, " cannot include value: ").concat(valueName, "."), enumValue.astNode); } } } function validateInputFields(context, inputObj) { var fields = (0, _objectValues3.default)(inputObj.getFields()); if (fields.length === 0) { context.reportError("Input Object type ".concat(inputObj.name, " must define one or more fields."), getAllNodes(inputObj)); } // Ensure the arguments are valid for (var _i26 = 0; _i26 < fields.length; _i26++) { var field = fields[_i26]; // Ensure they are named correctly. validateName(context, field); // Ensure the type is an input type if (!(0, _definition.isInputType)(field.type)) { context.reportError("The type of ".concat(inputObj.name, ".").concat(field.name, " must be Input Type ") + "but got: ".concat((0, _inspect.default)(field.type), "."), field.astNode && field.astNode.type); } } } function createInputObjectCircularRefsValidator(context) { // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. // Tracks already visited types to maintain O(N) and to ensure that cycles // are not redundantly reported. var visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors var fieldPath = []; // Position in the type path var fieldPathIndexByTypeName = Object.create(null); return detectCycleRecursive; // This does a straight-forward DFS to find cycles. // It does not terminate when a cycle was found but continues to explore // the graph to find all possible cycles. function detectCycleRecursive(inputObj) { if (visitedTypes[inputObj.name]) { return; } visitedTypes[inputObj.name] = true; fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; var fields = (0, _objectValues3.default)(inputObj.getFields()); for (var _i28 = 0; _i28 < fields.length; _i28++) { var field = fields[_i28]; if ((0, _definition.isNonNullType)(field.type) && (0, _definition.isInputObjectType)(field.type.ofType)) { var fieldType = field.type.ofType; var cycleIndex = fieldPathIndexByTypeName[fieldType.name]; fieldPath.push(field); if (cycleIndex === undefined) { detectCycleRecursive(fieldType); } else { var cyclePath = fieldPath.slice(cycleIndex); var pathStr = cyclePath.map(function (fieldObj) { return fieldObj.name; }).join('.'); context.reportError("Cannot reference Input Object \"".concat(fieldType.name, "\" within itself through a series of non-null fields: \"").concat(pathStr, "\"."), cyclePath.map(function (fieldObj) { return fieldObj.astNode; })); } fieldPath.pop(); } } fieldPathIndexByTypeName[inputObj.name] = undefined; } } function getAllNodes(object) { var astNode = object.astNode, extensionASTNodes = object.extensionASTNodes; return astNode ? extensionASTNodes ? [astNode].concat(extensionASTNodes) : [astNode] : extensionASTNodes || []; } function getAllSubNodes(object, getter) { return (0, _flatMap.default)(getAllNodes(object), function (item) { return getter(item) || []; }); } function getAllImplementsInterfaceNodes(type, iface) { return getAllSubNodes(type, function (typeNode) { return typeNode.interfaces; }).filter(function (ifaceNode) { return ifaceNode.name.value === iface.name; }); } function getUnionMemberTypeNodes(union, typeName) { return getAllSubNodes(union, function (unionNode) { return unionNode.types; }).filter(function (typeNode) { return typeNode.name.value === typeName; }); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/TypeInfo.js": /*!*************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/TypeInfo.js ***! \*************************************************************************************/ /*! flagged exports */ /*! export TypeInfo [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TypeInfo = void 0; var _find = _interopRequireDefault(__webpack_require__(/*! ../polyfills/find */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/find.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _introspection = __webpack_require__(/*! ../type/introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _typeFromAST = __webpack_require__(/*! ./typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * TypeInfo is a utility class which, given a GraphQL schema, can keep track * of the current field and type definitions at any point in a GraphQL document * AST during a recursive descent by calling `enter(node)` and `leave(node)`. */ var TypeInfo = /*#__PURE__*/ function () { function TypeInfo(schema, // NOTE: this experimental optional second parameter is only needed in order // to support non-spec-compliant codebases. You should never need to use it. // It may disappear in the future. getFieldDefFn, // Initial type may be provided in rare cases to facilitate traversals // beginning somewhere other than documents. initialType) { this._schema = schema; this._typeStack = []; this._parentTypeStack = []; this._inputTypeStack = []; this._fieldDefStack = []; this._defaultValueStack = []; this._directive = null; this._argument = null; this._enumValue = null; this._getFieldDef = getFieldDefFn || getFieldDef; if (initialType) { if ((0, _definition.isInputType)(initialType)) { this._inputTypeStack.push(initialType); } if ((0, _definition.isCompositeType)(initialType)) { this._parentTypeStack.push(initialType); } if ((0, _definition.isOutputType)(initialType)) { this._typeStack.push(initialType); } } } var _proto = TypeInfo.prototype; _proto.getType = function getType() { if (this._typeStack.length > 0) { return this._typeStack[this._typeStack.length - 1]; } }; _proto.getParentType = function getParentType() { if (this._parentTypeStack.length > 0) { return this._parentTypeStack[this._parentTypeStack.length - 1]; } }; _proto.getInputType = function getInputType() { if (this._inputTypeStack.length > 0) { return this._inputTypeStack[this._inputTypeStack.length - 1]; } }; _proto.getParentInputType = function getParentInputType() { if (this._inputTypeStack.length > 1) { return this._inputTypeStack[this._inputTypeStack.length - 2]; } }; _proto.getFieldDef = function getFieldDef() { if (this._fieldDefStack.length > 0) { return this._fieldDefStack[this._fieldDefStack.length - 1]; } }; _proto.getDefaultValue = function getDefaultValue() { if (this._defaultValueStack.length > 0) { return this._defaultValueStack[this._defaultValueStack.length - 1]; } }; _proto.getDirective = function getDirective() { return this._directive; }; _proto.getArgument = function getArgument() { return this._argument; }; _proto.getEnumValue = function getEnumValue() { return this._enumValue; }; _proto.enter = function enter(node) { var schema = this._schema; // Note: many of the types below are explicitly typed as "mixed" to drop // any assumptions of a valid schema to ensure runtime types are properly // checked before continuing since TypeInfo is used as part of validation // which occurs before guarantees of schema and document validity. switch (node.kind) { case _kinds.Kind.SELECTION_SET: { var namedType = (0, _definition.getNamedType)(this.getType()); this._parentTypeStack.push((0, _definition.isCompositeType)(namedType) ? namedType : undefined); break; } case _kinds.Kind.FIELD: { var parentType = this.getParentType(); var fieldDef; var fieldType; if (parentType) { fieldDef = this._getFieldDef(schema, parentType, node); if (fieldDef) { fieldType = fieldDef.type; } } this._fieldDefStack.push(fieldDef); this._typeStack.push((0, _definition.isOutputType)(fieldType) ? fieldType : undefined); break; } case _kinds.Kind.DIRECTIVE: this._directive = schema.getDirective(node.name.value); break; case _kinds.Kind.OPERATION_DEFINITION: { var type; if (node.operation === 'query') { type = schema.getQueryType(); } else if (node.operation === 'mutation') { type = schema.getMutationType(); } else if (node.operation === 'subscription') { type = schema.getSubscriptionType(); } this._typeStack.push((0, _definition.isObjectType)(type) ? type : undefined); break; } case _kinds.Kind.INLINE_FRAGMENT: case _kinds.Kind.FRAGMENT_DEFINITION: { var typeConditionAST = node.typeCondition; var outputType = typeConditionAST ? (0, _typeFromAST.typeFromAST)(schema, typeConditionAST) : (0, _definition.getNamedType)(this.getType()); this._typeStack.push((0, _definition.isOutputType)(outputType) ? outputType : undefined); break; } case _kinds.Kind.VARIABLE_DEFINITION: { var inputType = (0, _typeFromAST.typeFromAST)(schema, node.type); this._inputTypeStack.push((0, _definition.isInputType)(inputType) ? inputType : undefined); break; } case _kinds.Kind.ARGUMENT: { var argDef; var argType; var fieldOrDirective = this.getDirective() || this.getFieldDef(); if (fieldOrDirective) { argDef = (0, _find.default)(fieldOrDirective.args, function (arg) { return arg.name === node.name.value; }); if (argDef) { argType = argDef.type; } } this._argument = argDef; this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); this._inputTypeStack.push((0, _definition.isInputType)(argType) ? argType : undefined); break; } case _kinds.Kind.LIST: { var listType = (0, _definition.getNullableType)(this.getInputType()); var itemType = (0, _definition.isListType)(listType) ? listType.ofType : listType; // List positions never have a default value. this._defaultValueStack.push(undefined); this._inputTypeStack.push((0, _definition.isInputType)(itemType) ? itemType : undefined); break; } case _kinds.Kind.OBJECT_FIELD: { var objectType = (0, _definition.getNamedType)(this.getInputType()); var inputFieldType; var inputField; if ((0, _definition.isInputObjectType)(objectType)) { inputField = objectType.getFields()[node.name.value]; if (inputField) { inputFieldType = inputField.type; } } this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined); this._inputTypeStack.push((0, _definition.isInputType)(inputFieldType) ? inputFieldType : undefined); break; } case _kinds.Kind.ENUM: { var enumType = (0, _definition.getNamedType)(this.getInputType()); var enumValue; if ((0, _definition.isEnumType)(enumType)) { enumValue = enumType.getValue(node.value); } this._enumValue = enumValue; break; } } }; _proto.leave = function leave(node) { switch (node.kind) { case _kinds.Kind.SELECTION_SET: this._parentTypeStack.pop(); break; case _kinds.Kind.FIELD: this._fieldDefStack.pop(); this._typeStack.pop(); break; case _kinds.Kind.DIRECTIVE: this._directive = null; break; case _kinds.Kind.OPERATION_DEFINITION: case _kinds.Kind.INLINE_FRAGMENT: case _kinds.Kind.FRAGMENT_DEFINITION: this._typeStack.pop(); break; case _kinds.Kind.VARIABLE_DEFINITION: this._inputTypeStack.pop(); break; case _kinds.Kind.ARGUMENT: this._argument = null; this._defaultValueStack.pop(); this._inputTypeStack.pop(); break; case _kinds.Kind.LIST: case _kinds.Kind.OBJECT_FIELD: this._defaultValueStack.pop(); this._inputTypeStack.pop(); break; case _kinds.Kind.ENUM: this._enumValue = null; break; } }; return TypeInfo; }(); /** * Not exactly the same as the executor's definition of getFieldDef, in this * statically evaluated environment we do not always have an Object type, * and need to handle Interface and Union types. */ exports.TypeInfo = TypeInfo; function getFieldDef(schema, parentType, fieldNode) { var name = fieldNode.name.value; if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { return _introspection.SchemaMetaFieldDef; } if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { return _introspection.TypeMetaFieldDef; } if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) { return _introspection.TypeNameMetaFieldDef; } if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { return parentType.getFields()[name]; } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/assertValidName.js": /*!********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/assertValidName.js ***! \********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertValidName [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValidNameError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.assertValidName = assertValidName; exports.isValidNameError = isValidNameError; var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/; /** * Upholds the spec rules about naming. */ function assertValidName(name) { var error = isValidNameError(name); if (error) { throw error; } return name; } /** * Returns an Error if a name is invalid. */ function isValidNameError(name, node) { typeof name === 'string' || (0, _devAssert.default)(0, 'Expected string'); if (name.length > 1 && name[0] === '_' && name[1] === '_') { return new _GraphQLError.GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection."), node); } if (!NAME_RX.test(name)) { return new _GraphQLError.GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not."), node); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/astFromValue.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/astFromValue.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export astFromValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.astFromValue = astFromValue; var _iterall = __webpack_require__(/*! iterall */ "./node_modules/iterall/index.mjs"); var _objectValues3 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _isNullish = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isNullish */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isNullish.js")); var _isInvalid = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isInvalid */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isInvalid.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _scalars = __webpack_require__(/*! ../type/scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Produces a GraphQL Value AST given a JavaScript value. * * A GraphQL type must be provided, which will be used to interpret different * JavaScript values. * * | JSON Value | GraphQL Value | * | ------------- | -------------------- | * | Object | Input Object | * | Array | List | * | Boolean | Boolean | * | String | String / Enum Value | * | Number | Int / Float | * | Mixed | Enum Value | * | null | NullValue | * */ function astFromValue(value, type) { if ((0, _definition.isNonNullType)(type)) { var astValue = astFromValue(value, type.ofType); if (astValue && astValue.kind === _kinds.Kind.NULL) { return null; } return astValue; } // only explicit null, not undefined, NaN if (value === null) { return { kind: _kinds.Kind.NULL }; } // undefined, NaN if ((0, _isInvalid.default)(value)) { return null; } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but // the value is not an array, convert the value using the list's item type. if ((0, _definition.isListType)(type)) { var itemType = type.ofType; if ((0, _iterall.isCollection)(value)) { var valuesNodes = []; (0, _iterall.forEach)(value, function (item) { var itemNode = astFromValue(item, itemType); if (itemNode) { valuesNodes.push(itemNode); } }); return { kind: _kinds.Kind.LIST, values: valuesNodes }; } return astFromValue(value, itemType); } // Populate the fields of the input object by creating ASTs from each value // in the JavaScript object according to the fields in the input type. if ((0, _definition.isInputObjectType)(type)) { if (!(0, _isObjectLike.default)(value)) { return null; } var fieldNodes = []; for (var _i2 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i2 < _objectValues2.length; _i2++) { var field = _objectValues2[_i2]; var fieldValue = astFromValue(value[field.name], field.type); if (fieldValue) { fieldNodes.push({ kind: _kinds.Kind.OBJECT_FIELD, name: { kind: _kinds.Kind.NAME, value: field.name }, value: fieldValue }); } } return { kind: _kinds.Kind.OBJECT, fields: fieldNodes }; } /* istanbul ignore else */ if ((0, _definition.isLeafType)(type)) { // Since value is an internally represented value, it must be serialized // to an externally represented value before converting into an AST. var serialized = type.serialize(value); if ((0, _isNullish.default)(serialized)) { return null; } // Others serialize based on their corresponding JavaScript scalar types. if (typeof serialized === 'boolean') { return { kind: _kinds.Kind.BOOLEAN, value: serialized }; } // JavaScript numbers can be Int or Float values. if (typeof serialized === 'number') { var stringNum = String(serialized); return integerStringRegExp.test(stringNum) ? { kind: _kinds.Kind.INT, value: stringNum } : { kind: _kinds.Kind.FLOAT, value: stringNum }; } if (typeof serialized === 'string') { // Enum types use Enum literals. if ((0, _definition.isEnumType)(type)) { return { kind: _kinds.Kind.ENUM, value: serialized }; } // ID types can use Int literals. if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) { return { kind: _kinds.Kind.INT, value: serialized }; } return { kind: _kinds.Kind.STRING, value: serialized }; } throw new TypeError("Cannot convert value to AST: ".concat((0, _inspect.default)(serialized))); } // Not reachable. All possible input types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected input type: ' + (0, _inspect.default)(type)); } /** * IntValue: * - NegativeSign? 0 * - NegativeSign? NonZeroDigit ( Digit+ )? */ var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/buildASTSchema.js": /*!*******************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/buildASTSchema.js ***! \*******************************************************************************************/ /*! flagged exports */ /*! export ASTDefinitionBuilder [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildASTSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDescription [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildASTSchema = buildASTSchema; exports.getDescription = getDescription; exports.buildSchema = buildSchema; exports.ASTDefinitionBuilder = void 0; var _objectValues = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _keyMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _keyValMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyValMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _tokenKind = __webpack_require__(/*! ../language/tokenKind */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/tokenKind.js"); var _parser = __webpack_require__(/*! ../language/parser */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/parser.js"); var _predicates = __webpack_require__(/*! ../language/predicates */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js"); var _blockString = __webpack_require__(/*! ../language/blockString */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/blockString.js"); var _validate = __webpack_require__(/*! ../validation/validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/validate.js"); var _values = __webpack_require__(/*! ../execution/values */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/values.js"); var _scalars = __webpack_require__(/*! ../type/scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _introspection = __webpack_require__(/*! ../type/introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _schema = __webpack_require__(/*! ../type/schema */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js"); var _directives = __webpack_require__(/*! ../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _valueFromAST = __webpack_require__(/*! ./valueFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromAST.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * This takes the ast of a schema document produced by the parse function in * src/language/parser.js. * * If no schema definition is provided, then it will look for types named Query * and Mutation. * * Given that AST it constructs a GraphQLSchema. The resulting schema * has no resolve methods, so execution will use default resolvers. * * Accepts options as a second argument: * * - commentDescriptions: * Provide true to use preceding comments as the description. * */ function buildASTSchema(documentAST, options) { documentAST && documentAST.kind === _kinds.Kind.DOCUMENT || (0, _devAssert.default)(0, 'Must provide valid Document AST'); if (!options || !(options.assumeValid || options.assumeValidSDL)) { (0, _validate.assertValidSDL)(documentAST); } var schemaDef; var typeDefs = []; var directiveDefs = []; for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { var def = _documentAST$definiti2[_i2]; if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) { schemaDef = def; } else if ((0, _predicates.isTypeDefinitionNode)(def)) { typeDefs.push(def); } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { directiveDefs.push(def); } } var astBuilder = new ASTDefinitionBuilder(options, function (typeName) { var type = typeMap[typeName]; if (type === undefined) { throw new Error("Type \"".concat(typeName, "\" not found in document.")); } return type; }); var typeMap = keyByNameNode(typeDefs, function (node) { return astBuilder.buildType(node); }); var operationTypes = schemaDef ? getOperationTypes(schemaDef) : { query: 'Query', mutation: 'Mutation', subscription: 'Subscription' }; var directives = directiveDefs.map(function (def) { return astBuilder.buildDirective(def); }); // If specified directives were not explicitly declared, add them. if (!directives.some(function (directive) { return directive.name === 'skip'; })) { directives.push(_directives.GraphQLSkipDirective); } if (!directives.some(function (directive) { return directive.name === 'include'; })) { directives.push(_directives.GraphQLIncludeDirective); } if (!directives.some(function (directive) { return directive.name === 'deprecated'; })) { directives.push(_directives.GraphQLDeprecatedDirective); } return new _schema.GraphQLSchema({ // Note: While this could make early assertions to get the correctly // typed values below, that would throw immediately while type system // validation with validateSchema() will produce more actionable results. query: operationTypes.query ? typeMap[operationTypes.query] : null, mutation: operationTypes.mutation ? typeMap[operationTypes.mutation] : null, subscription: operationTypes.subscription ? typeMap[operationTypes.subscription] : null, types: (0, _objectValues.default)(typeMap), directives: directives, astNode: schemaDef, assumeValid: options && options.assumeValid, allowedLegacyNames: options && options.allowedLegacyNames }); function getOperationTypes(schema) { var opTypes = {}; for (var _i4 = 0, _schema$operationType2 = schema.operationTypes; _i4 < _schema$operationType2.length; _i4++) { var operationType = _schema$operationType2[_i4]; opTypes[operationType.operation] = operationType.type.name.value; } return opTypes; } } var stdTypeMap = (0, _keyMap.default)(_scalars.specifiedScalarTypes.concat(_introspection.introspectionTypes), function (type) { return type.name; }); var ASTDefinitionBuilder = /*#__PURE__*/ function () { function ASTDefinitionBuilder(options, resolveType) { this._options = options; this._resolveType = resolveType; } var _proto = ASTDefinitionBuilder.prototype; _proto.getNamedType = function getNamedType(node) { var name = node.name.value; return stdTypeMap[name] || this._resolveType(name); }; _proto.getWrappedType = function getWrappedType(node) { if (node.kind === _kinds.Kind.LIST_TYPE) { return new _definition.GraphQLList(this.getWrappedType(node.type)); } if (node.kind === _kinds.Kind.NON_NULL_TYPE) { return new _definition.GraphQLNonNull(this.getWrappedType(node.type)); } return this.getNamedType(node); }; _proto.buildDirective = function buildDirective(directive) { var _this = this; var locations = directive.locations.map(function (_ref) { var value = _ref.value; return value; }); return new _directives.GraphQLDirective({ name: directive.name.value, description: getDescription(directive, this._options), locations: locations, isRepeatable: directive.repeatable, args: keyByNameNode(directive.arguments || [], function (arg) { return _this.buildArg(arg); }), astNode: directive }); }; _proto.buildField = function buildField(field) { var _this2 = this; return { // Note: While this could make assertions to get the correctly typed // value, that would throw immediately while type system validation // with validateSchema() will produce more actionable results. type: this.getWrappedType(field.type), description: getDescription(field, this._options), args: keyByNameNode(field.arguments || [], function (arg) { return _this2.buildArg(arg); }), deprecationReason: getDeprecationReason(field), astNode: field }; }; _proto.buildArg = function buildArg(value) { // Note: While this could make assertions to get the correctly typed // value, that would throw immediately while type system validation // with validateSchema() will produce more actionable results. var type = this.getWrappedType(value.type); return { type: type, description: getDescription(value, this._options), defaultValue: (0, _valueFromAST.valueFromAST)(value.defaultValue, type), astNode: value }; }; _proto.buildInputField = function buildInputField(value) { // Note: While this could make assertions to get the correctly typed // value, that would throw immediately while type system validation // with validateSchema() will produce more actionable results. var type = this.getWrappedType(value.type); return { type: type, description: getDescription(value, this._options), defaultValue: (0, _valueFromAST.valueFromAST)(value.defaultValue, type), astNode: value }; }; _proto.buildEnumValue = function buildEnumValue(value) { return { description: getDescription(value, this._options), deprecationReason: getDeprecationReason(value), astNode: value }; }; _proto.buildType = function buildType(astNode) { var name = astNode.name.value; if (stdTypeMap[name]) { return stdTypeMap[name]; } switch (astNode.kind) { case _kinds.Kind.OBJECT_TYPE_DEFINITION: return this._makeTypeDef(astNode); case _kinds.Kind.INTERFACE_TYPE_DEFINITION: return this._makeInterfaceDef(astNode); case _kinds.Kind.ENUM_TYPE_DEFINITION: return this._makeEnumDef(astNode); case _kinds.Kind.UNION_TYPE_DEFINITION: return this._makeUnionDef(astNode); case _kinds.Kind.SCALAR_TYPE_DEFINITION: return this._makeScalarDef(astNode); case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: return this._makeInputObjectDef(astNode); } // Not reachable. All possible type definition nodes have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected type definition node: ' + (0, _inspect.default)(astNode)); }; _proto._makeTypeDef = function _makeTypeDef(astNode) { var _this3 = this; var interfaceNodes = astNode.interfaces; var fieldNodes = astNode.fields; // Note: While this could make assertions to get the correctly typed // values below, that would throw immediately while type system // validation with validateSchema() will produce more actionable results. var interfaces = interfaceNodes && interfaceNodes.length > 0 ? function () { return interfaceNodes.map(function (ref) { return _this3.getNamedType(ref); }); } : []; var fields = fieldNodes && fieldNodes.length > 0 ? function () { return keyByNameNode(fieldNodes, function (field) { return _this3.buildField(field); }); } : Object.create(null); return new _definition.GraphQLObjectType({ name: astNode.name.value, description: getDescription(astNode, this._options), interfaces: interfaces, fields: fields, astNode: astNode }); }; _proto._makeInterfaceDef = function _makeInterfaceDef(astNode) { var _this4 = this; var fieldNodes = astNode.fields; var fields = fieldNodes && fieldNodes.length > 0 ? function () { return keyByNameNode(fieldNodes, function (field) { return _this4.buildField(field); }); } : Object.create(null); return new _definition.GraphQLInterfaceType({ name: astNode.name.value, description: getDescription(astNode, this._options), fields: fields, astNode: astNode }); }; _proto._makeEnumDef = function _makeEnumDef(astNode) { var _this5 = this; var valueNodes = astNode.values || []; return new _definition.GraphQLEnumType({ name: astNode.name.value, description: getDescription(astNode, this._options), values: keyByNameNode(valueNodes, function (value) { return _this5.buildEnumValue(value); }), astNode: astNode }); }; _proto._makeUnionDef = function _makeUnionDef(astNode) { var _this6 = this; var typeNodes = astNode.types; // Note: While this could make assertions to get the correctly typed // values below, that would throw immediately while type system // validation with validateSchema() will produce more actionable results. var types = typeNodes && typeNodes.length > 0 ? function () { return typeNodes.map(function (ref) { return _this6.getNamedType(ref); }); } : []; return new _definition.GraphQLUnionType({ name: astNode.name.value, description: getDescription(astNode, this._options), types: types, astNode: astNode }); }; _proto._makeScalarDef = function _makeScalarDef(astNode) { return new _definition.GraphQLScalarType({ name: astNode.name.value, description: getDescription(astNode, this._options), astNode: astNode }); }; _proto._makeInputObjectDef = function _makeInputObjectDef(def) { var _this7 = this; var fields = def.fields; return new _definition.GraphQLInputObjectType({ name: def.name.value, description: getDescription(def, this._options), fields: fields ? function () { return keyByNameNode(fields, function (field) { return _this7.buildInputField(field); }); } : Object.create(null), astNode: def }); }; return ASTDefinitionBuilder; }(); exports.ASTDefinitionBuilder = ASTDefinitionBuilder; function keyByNameNode(list, valFn) { return (0, _keyValMap.default)(list, function (_ref2) { var name = _ref2.name; return name.value; }, valFn); } /** * Given a field or enum value node, returns the string value for the * deprecation reason. */ function getDeprecationReason(node) { var deprecated = (0, _values.getDirectiveValues)(_directives.GraphQLDeprecatedDirective, node); return deprecated && deprecated.reason; } /** * Given an ast node, returns its string description. * @deprecated: provided to ease adoption and will be removed in v16. * * Accepts options as a second argument: * * - commentDescriptions: * Provide true to use preceding comments as the description. * */ function getDescription(node, options) { if (node.description) { return node.description.value; } if (options && options.commentDescriptions) { var rawValue = getLeadingCommentBlock(node); if (rawValue !== undefined) { return (0, _blockString.dedentBlockStringValue)('\n' + rawValue); } } } function getLeadingCommentBlock(node) { var loc = node.loc; if (!loc) { return; } var comments = []; var token = loc.startToken.prev; while (token && token.kind === _tokenKind.TokenKind.COMMENT && token.next && token.prev && token.line + 1 === token.next.line && token.line !== token.prev.line) { var value = String(token.value); comments.push(value); token = token.prev; } return comments.reverse().join('\n'); } /** * A helper function to build a GraphQLSchema directly from a source * document. */ function buildSchema(source, options) { return buildASTSchema((0, _parser.parse)(source, options), options); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/buildClientSchema.js": /*!**********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/buildClientSchema.js ***! \**********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildClientSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildClientSchema = buildClientSchema; var _objectValues = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _keyValMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyValMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _parser = __webpack_require__(/*! ../language/parser */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/parser.js"); var _directives = __webpack_require__(/*! ../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _scalars = __webpack_require__(/*! ../type/scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _introspection = __webpack_require__(/*! ../type/introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _schema = __webpack_require__(/*! ../type/schema */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _valueFromAST = __webpack_require__(/*! ./valueFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromAST.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Build a GraphQLSchema for use by client tools. * * Given the result of a client running the introspection query, creates and * returns a GraphQLSchema instance which can be then used with all graphql-js * tools, but cannot be used to execute a query, as introspection does not * represent the "resolver", "parse" or "serialize" functions or any other * server-internal mechanisms. * * This function expects a complete introspection result. Don't forget to check * the "errors" field of a server response before calling this function. */ function buildClientSchema(introspection, options) { (0, _isObjectLike.default)(introspection) && (0, _isObjectLike.default)(introspection.__schema) || (0, _devAssert.default)(0, 'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ' + (0, _inspect.default)(introspection)); // Get the schema from the introspection result. var schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each. var typeMap = (0, _keyValMap.default)(schemaIntrospection.types, function (typeIntrospection) { return typeIntrospection.name; }, function (typeIntrospection) { return buildType(typeIntrospection); }); for (var _i2 = 0, _ref2 = [].concat(_scalars.specifiedScalarTypes, _introspection.introspectionTypes); _i2 < _ref2.length; _i2++) { var stdType = _ref2[_i2]; if (typeMap[stdType.name]) { typeMap[stdType.name] = stdType; } } // Get the root Query, Mutation, and Subscription types. var queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null; var mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null; var subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; // Get the directives supported by Introspection, assuming empty-set if // directives were not queried for. var directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; // Then produce and return a Schema with these types. return new _schema.GraphQLSchema({ query: queryType, mutation: mutationType, subscription: subscriptionType, types: (0, _objectValues.default)(typeMap), directives: directives, assumeValid: options && options.assumeValid, allowedLegacyNames: options && options.allowedLegacyNames }); // Given a type reference in introspection, return the GraphQLType instance. // preferring cached instances before building new instances. function getType(typeRef) { if (typeRef.kind === _introspection.TypeKind.LIST) { var itemRef = typeRef.ofType; if (!itemRef) { throw new Error('Decorated type deeper than introspection query.'); } return (0, _definition.GraphQLList)(getType(itemRef)); } if (typeRef.kind === _introspection.TypeKind.NON_NULL) { var nullableRef = typeRef.ofType; if (!nullableRef) { throw new Error('Decorated type deeper than introspection query.'); } var nullableType = getType(nullableRef); return (0, _definition.GraphQLNonNull)((0, _definition.assertNullableType)(nullableType)); } if (!typeRef.name) { throw new Error('Unknown type reference: ' + (0, _inspect.default)(typeRef)); } return getNamedType(typeRef.name); } function getNamedType(typeName) { var type = typeMap[typeName]; if (!type) { throw new Error("Invalid or incomplete schema, unknown type: ".concat(typeName, ". Ensure that a full introspection query is used in order to build a client schema.")); } return type; } function getInputType(typeRef) { var type = getType(typeRef); if ((0, _definition.isInputType)(type)) { return type; } throw new Error('Introspection must provide input type for arguments, but received: ' + (0, _inspect.default)(type) + '.'); } function getOutputType(typeRef) { var type = getType(typeRef); if ((0, _definition.isOutputType)(type)) { return type; } throw new Error('Introspection must provide output type for fields, but received: ' + (0, _inspect.default)(type) + '.'); } function getObjectType(typeRef) { var type = getType(typeRef); return (0, _definition.assertObjectType)(type); } function getInterfaceType(typeRef) { var type = getType(typeRef); return (0, _definition.assertInterfaceType)(type); } // Given a type's introspection result, construct the correct // GraphQLType instance. function buildType(type) { if (type && type.name && type.kind) { switch (type.kind) { case _introspection.TypeKind.SCALAR: return buildScalarDef(type); case _introspection.TypeKind.OBJECT: return buildObjectDef(type); case _introspection.TypeKind.INTERFACE: return buildInterfaceDef(type); case _introspection.TypeKind.UNION: return buildUnionDef(type); case _introspection.TypeKind.ENUM: return buildEnumDef(type); case _introspection.TypeKind.INPUT_OBJECT: return buildInputObjectDef(type); } } throw new Error('Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema:' + (0, _inspect.default)(type)); } function buildScalarDef(scalarIntrospection) { return new _definition.GraphQLScalarType({ name: scalarIntrospection.name, description: scalarIntrospection.description }); } function buildObjectDef(objectIntrospection) { if (!objectIntrospection.interfaces) { throw new Error('Introspection result missing interfaces: ' + (0, _inspect.default)(objectIntrospection)); } return new _definition.GraphQLObjectType({ name: objectIntrospection.name, description: objectIntrospection.description, interfaces: function interfaces() { return objectIntrospection.interfaces.map(getInterfaceType); }, fields: function fields() { return buildFieldDefMap(objectIntrospection); } }); } function buildInterfaceDef(interfaceIntrospection) { return new _definition.GraphQLInterfaceType({ name: interfaceIntrospection.name, description: interfaceIntrospection.description, fields: function fields() { return buildFieldDefMap(interfaceIntrospection); } }); } function buildUnionDef(unionIntrospection) { if (!unionIntrospection.possibleTypes) { throw new Error('Introspection result missing possibleTypes: ' + (0, _inspect.default)(unionIntrospection)); } return new _definition.GraphQLUnionType({ name: unionIntrospection.name, description: unionIntrospection.description, types: function types() { return unionIntrospection.possibleTypes.map(getObjectType); } }); } function buildEnumDef(enumIntrospection) { if (!enumIntrospection.enumValues) { throw new Error('Introspection result missing enumValues: ' + (0, _inspect.default)(enumIntrospection)); } return new _definition.GraphQLEnumType({ name: enumIntrospection.name, description: enumIntrospection.description, values: (0, _keyValMap.default)(enumIntrospection.enumValues, function (valueIntrospection) { return valueIntrospection.name; }, function (valueIntrospection) { return { description: valueIntrospection.description, deprecationReason: valueIntrospection.deprecationReason }; }) }); } function buildInputObjectDef(inputObjectIntrospection) { if (!inputObjectIntrospection.inputFields) { throw new Error('Introspection result missing inputFields: ' + (0, _inspect.default)(inputObjectIntrospection)); } return new _definition.GraphQLInputObjectType({ name: inputObjectIntrospection.name, description: inputObjectIntrospection.description, fields: function fields() { return buildInputValueDefMap(inputObjectIntrospection.inputFields); } }); } function buildFieldDefMap(typeIntrospection) { if (!typeIntrospection.fields) { throw new Error('Introspection result missing fields: ' + (0, _inspect.default)(typeIntrospection)); } return (0, _keyValMap.default)(typeIntrospection.fields, function (fieldIntrospection) { return fieldIntrospection.name; }, function (fieldIntrospection) { if (!fieldIntrospection.args) { throw new Error('Introspection result missing field args: ' + (0, _inspect.default)(fieldIntrospection)); } return { description: fieldIntrospection.description, deprecationReason: fieldIntrospection.deprecationReason, type: getOutputType(fieldIntrospection.type), args: buildInputValueDefMap(fieldIntrospection.args) }; }); } function buildInputValueDefMap(inputValueIntrospections) { return (0, _keyValMap.default)(inputValueIntrospections, function (inputValue) { return inputValue.name; }, buildInputValue); } function buildInputValue(inputValueIntrospection) { var type = getInputType(inputValueIntrospection.type); var defaultValue = inputValueIntrospection.defaultValue ? (0, _valueFromAST.valueFromAST)((0, _parser.parseValue)(inputValueIntrospection.defaultValue), type) : undefined; return { description: inputValueIntrospection.description, type: type, defaultValue: defaultValue }; } function buildDirective(directiveIntrospection) { if (!directiveIntrospection.args) { throw new Error('Introspection result missing directive args: ' + (0, _inspect.default)(directiveIntrospection)); } if (!directiveIntrospection.locations) { throw new Error('Introspection result missing directive locations: ' + (0, _inspect.default)(directiveIntrospection)); } return new _directives.GraphQLDirective({ name: directiveIntrospection.name, description: directiveIntrospection.description, locations: directiveIntrospection.locations.slice(), args: buildInputValueDefMap(directiveIntrospection.args) }); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceInputValue.js": /*!*********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceInputValue.js ***! \*********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export coerceInputValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.coerceInputValue = coerceInputValue; var _iterall = __webpack_require__(/*! iterall */ "./node_modules/iterall/index.mjs"); var _objectValues3 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _didYouMean = _interopRequireDefault(__webpack_require__(/*! ../jsutils/didYouMean */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js")); var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isObjectLike.js")); var _suggestionList = _interopRequireDefault(__webpack_require__(/*! ../jsutils/suggestionList */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js")); var _printPathArray = _interopRequireDefault(__webpack_require__(/*! ../jsutils/printPathArray */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/printPathArray.js")); var _Path = __webpack_require__(/*! ../jsutils/Path */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/Path.js"); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Coerces a JavaScript value given a GraphQL Input Type. */ function coerceInputValue(inputValue, type) { var onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultOnError; return coerceInputValueImpl(inputValue, type, onError); } function defaultOnError(path, invalidValue, error) { var errorPrefix = 'Invalid value ' + (0, _inspect.default)(invalidValue); if (path.length > 0) { errorPrefix += " at \"value".concat((0, _printPathArray.default)(path), "\": "); } error.message = errorPrefix + ': ' + error.message; throw error; } function coerceInputValueImpl(inputValue, type, onError, path) { if ((0, _definition.isNonNullType)(type)) { if (inputValue != null) { return coerceInputValueImpl(inputValue, type.ofType, onError, path); } onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected non-nullable type ".concat((0, _inspect.default)(type), " not to be null."))); return; } if (inputValue == null) { // Explicitly return the value null. return null; } if ((0, _definition.isListType)(type)) { var itemType = type.ofType; if ((0, _iterall.isCollection)(inputValue)) { var coercedValue = []; (0, _iterall.forEach)(inputValue, function (itemValue, index) { coercedValue.push(coerceInputValueImpl(itemValue, itemType, onError, (0, _Path.addPath)(path, index))); }); return coercedValue; } // Lists accept a non-list value as a list of one. return [coerceInputValueImpl(inputValue, itemType, onError, path)]; } if ((0, _definition.isInputObjectType)(type)) { if (!(0, _isObjectLike.default)(inputValue)) { onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected type ".concat(type.name, " to be an object."))); return; } var _coercedValue = {}; var fieldDefs = type.getFields(); for (var _i2 = 0, _objectValues2 = (0, _objectValues3.default)(fieldDefs); _i2 < _objectValues2.length; _i2++) { var field = _objectValues2[_i2]; var fieldValue = inputValue[field.name]; if (fieldValue === undefined) { if (field.defaultValue !== undefined) { _coercedValue[field.name] = field.defaultValue; } else if ((0, _definition.isNonNullType)(field.type)) { var typeStr = (0, _inspect.default)(field.type); onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Field ".concat(field.name, " of required type ").concat(typeStr, " was not provided."))); } continue; } _coercedValue[field.name] = coerceInputValueImpl(fieldValue, field.type, onError, (0, _Path.addPath)(path, field.name)); } // Ensure every provided field is defined. for (var _i4 = 0, _Object$keys2 = Object.keys(inputValue); _i4 < _Object$keys2.length; _i4++) { var fieldName = _Object$keys2[_i4]; if (!fieldDefs[fieldName]) { var suggestions = (0, _suggestionList.default)(fieldName, Object.keys(type.getFields())); onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Field \"".concat(fieldName, "\" is not defined by type ").concat(type.name, ".") + (0, _didYouMean.default)(suggestions))); } } return _coercedValue; } if ((0, _definition.isScalarType)(type)) { var parseResult; // Scalars determine if a input value is valid via parseValue(), which can // throw to indicate failure. If it throws, maintain a reference to // the original error. try { parseResult = type.parseValue(inputValue); } catch (error) { onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected type ".concat(type.name, ". ") + error.message, undefined, undefined, undefined, undefined, error)); return; } if (parseResult === undefined) { onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected type ".concat(type.name, "."))); } return parseResult; } /* istanbul ignore else */ if ((0, _definition.isEnumType)(type)) { if (typeof inputValue === 'string') { var enumValue = type.getValue(inputValue); if (enumValue) { return enumValue.value; } } var _suggestions = (0, _suggestionList.default)(String(inputValue), type.getValues().map(function (enumValue) { return enumValue.name; })); onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected type ".concat(type.name, ".") + (0, _didYouMean.default)(_suggestions))); return; } // Not reachable. All possible input types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected input type: ' + (0, _inspect.default)(type)); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceValue.js": /*!****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceValue.js ***! \****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export coerceValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.coerceValue = coerceValue; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _printPathArray = _interopRequireDefault(__webpack_require__(/*! ../jsutils/printPathArray */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/printPathArray.js")); var _Path = __webpack_require__(/*! ../jsutils/Path */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/Path.js"); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _coerceInputValue = __webpack_require__(/*! ./coerceInputValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceInputValue.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* istanbul ignore file */ /** * Deprecated. Use coerceInputValue() directly for richer information. * * This function will be removed in v15 */ function coerceValue(inputValue, type, blameNode, path) { var errors = []; var value = (0, _coerceInputValue.coerceInputValue)(inputValue, type, function (errorPath, invalidValue, error) { var errorPrefix = 'Invalid value ' + (0, _inspect.default)(invalidValue); var pathArray = [].concat((0, _Path.pathToArray)(path), errorPath); if (pathArray.length > 0) { errorPrefix += " at \"value".concat((0, _printPathArray.default)(pathArray), "\""); } errors.push(new _GraphQLError.GraphQLError(errorPrefix + ': ' + error.message, blameNode, undefined, undefined, undefined, error.originalError)); }); return errors.length > 0 ? { errors: errors, value: undefined } : { errors: undefined, value: value }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/concatAST.js": /*!**************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/concatAST.js ***! \**************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export concatAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.concatAST = concatAST; var _flatMap = _interopRequireDefault(__webpack_require__(/*! ../polyfills/flatMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/flatMap.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Provided a collection of ASTs, presumably each from different files, * concatenate the ASTs together into batched AST, useful for validating many * GraphQL source files which together represent one conceptual application. */ function concatAST(asts) { return { kind: 'Document', definitions: (0, _flatMap.default)(asts, function (ast) { return ast.definitions; }) }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/extendSchema.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/extendSchema.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export extendSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extendSchema = extendSchema; var _flatMap = _interopRequireDefault(__webpack_require__(/*! ../polyfills/flatMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/flatMap.js")); var _objectValues = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _mapValue = _interopRequireDefault(__webpack_require__(/*! ../jsutils/mapValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/mapValue.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _keyValMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyValMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _predicates = __webpack_require__(/*! ../language/predicates */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js"); var _validate = __webpack_require__(/*! ../validation/validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/validate.js"); var _directives = __webpack_require__(/*! ../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _scalars = __webpack_require__(/*! ../type/scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _introspection = __webpack_require__(/*! ../type/introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _schema = __webpack_require__(/*! ../type/schema */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _buildASTSchema = __webpack_require__(/*! ./buildASTSchema */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/buildASTSchema.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Produces a new schema given an existing schema and a document which may * contain GraphQL type extensions and definitions. The original schema will * remain unaltered. * * Because a schema represents a graph of references, a schema cannot be * extended without effectively making an entire copy. We do not know until it's * too late if subgraphs remain unchanged. * * This algorithm copies the provided schema, applying extensions while * producing the copy. The original schema remains unaltered. * * Accepts options as a third argument: * * - commentDescriptions: * Provide true to use preceding comments as the description. * */ function extendSchema(schema, documentAST, options) { (0, _schema.assertSchema)(schema); documentAST && documentAST.kind === _kinds.Kind.DOCUMENT || (0, _devAssert.default)(0, 'Must provide valid Document AST'); if (!options || !(options.assumeValid || options.assumeValidSDL)) { (0, _validate.assertValidSDLExtension)(documentAST, schema); } // Collect the type definitions and extensions found in the document. var typeDefs = []; var typeExtsMap = Object.create(null); // New directives and types are separate because a directives and types can // have the same name. For example, a type named "skip". var directiveDefs = []; var schemaDef; // Schema extensions are collected which may add additional operation types. var schemaExts = []; for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { var def = _documentAST$definiti2[_i2]; if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) { schemaDef = def; } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) { schemaExts.push(def); } else if ((0, _predicates.isTypeDefinitionNode)(def)) { typeDefs.push(def); } else if ((0, _predicates.isTypeExtensionNode)(def)) { var extendedTypeName = def.name.value; var existingTypeExts = typeExtsMap[extendedTypeName]; typeExtsMap[extendedTypeName] = existingTypeExts ? existingTypeExts.concat([def]) : [def]; } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { directiveDefs.push(def); } } // If this document contains no new types, extensions, or directives then // return the same unmodified GraphQLSchema instance. if (Object.keys(typeExtsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExts.length === 0 && !schemaDef) { return schema; } var schemaConfig = schema.toConfig(); var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(options, function (typeName) { var type = typeMap[typeName]; if (type === undefined) { throw new Error("Unknown type: \"".concat(typeName, "\".")); } return type; }); var typeMap = (0, _keyValMap.default)(typeDefs, function (node) { return node.name.value; }, function (node) { return astBuilder.buildType(node); }); for (var _i4 = 0, _schemaConfig$types2 = schemaConfig.types; _i4 < _schemaConfig$types2.length; _i4++) { var existingType = _schemaConfig$types2[_i4]; typeMap[existingType.name] = extendNamedType(existingType); } // Get the extended root operation types. var operationTypes = { query: schemaConfig.query && schemaConfig.query.name, mutation: schemaConfig.mutation && schemaConfig.mutation.name, subscription: schemaConfig.subscription && schemaConfig.subscription.name }; if (schemaDef) { for (var _i6 = 0, _schemaDef$operationT2 = schemaDef.operationTypes; _i6 < _schemaDef$operationT2.length; _i6++) { var _ref2 = _schemaDef$operationT2[_i6]; var operation = _ref2.operation; var type = _ref2.type; operationTypes[operation] = type.name.value; } } // Then, incorporate schema definition and all schema extensions. for (var _i8 = 0; _i8 < schemaExts.length; _i8++) { var schemaExt = schemaExts[_i8]; if (schemaExt.operationTypes) { for (var _i10 = 0, _schemaExt$operationT2 = schemaExt.operationTypes; _i10 < _schemaExt$operationT2.length; _i10++) { var _ref4 = _schemaExt$operationT2[_i10]; var _operation = _ref4.operation; var _type = _ref4.type; operationTypes[_operation] = _type.name.value; } } } // Support both original legacy names and extended legacy names. var allowedLegacyNames = schemaConfig.allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types. return new _schema.GraphQLSchema({ // Note: While this could make early assertions to get the correctly // typed values, that would throw immediately while type system // validation with validateSchema() will produce more actionable results. query: getMaybeTypeByName(operationTypes.query), mutation: getMaybeTypeByName(operationTypes.mutation), subscription: getMaybeTypeByName(operationTypes.subscription), types: (0, _objectValues.default)(typeMap), directives: getMergedDirectives(), astNode: schemaDef || schemaConfig.astNode, extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts), allowedLegacyNames: allowedLegacyNames }); // Below are functions used for producing this schema that have closed over // this scope and have access to the schema, cache, and newly defined types. function replaceType(type) { if ((0, _definition.isListType)(type)) { return new _definition.GraphQLList(replaceType(type.ofType)); } else if ((0, _definition.isNonNullType)(type)) { return new _definition.GraphQLNonNull(replaceType(type.ofType)); } return replaceNamedType(type); } function replaceNamedType(type) { return typeMap[type.name]; } function getMaybeTypeByName(typeName) { return typeName ? typeMap[typeName] : null; } function getMergedDirectives() { var existingDirectives = schema.getDirectives().map(extendDirective); existingDirectives || (0, _devAssert.default)(0, 'schema must have default directives'); return existingDirectives.concat(directiveDefs.map(function (node) { return astBuilder.buildDirective(node); })); } function extendNamedType(type) { if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) { // Builtin types are not extended. return type; } else if ((0, _definition.isScalarType)(type)) { return extendScalarType(type); } else if ((0, _definition.isObjectType)(type)) { return extendObjectType(type); } else if ((0, _definition.isInterfaceType)(type)) { return extendInterfaceType(type); } else if ((0, _definition.isUnionType)(type)) { return extendUnionType(type); } else if ((0, _definition.isEnumType)(type)) { return extendEnumType(type); } else if ((0, _definition.isInputObjectType)(type)) { return extendInputObjectType(type); } // Not reachable. All possible types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected type: ' + (0, _inspect.default)(type)); } function extendDirective(directive) { var config = directive.toConfig(); return new _directives.GraphQLDirective(_objectSpread({}, config, { args: (0, _mapValue.default)(config.args, extendArg) })); } function extendInputObjectType(type) { var config = type.toConfig(); var extensions = typeExtsMap[config.name] || []; var fieldNodes = (0, _flatMap.default)(extensions, function (node) { return node.fields || []; }); return new _definition.GraphQLInputObjectType(_objectSpread({}, config, { fields: function fields() { return _objectSpread({}, (0, _mapValue.default)(config.fields, function (field) { return _objectSpread({}, field, { type: replaceType(field.type) }); }), {}, (0, _keyValMap.default)(fieldNodes, function (field) { return field.name.value; }, function (field) { return astBuilder.buildInputField(field); })); }, extensionASTNodes: config.extensionASTNodes.concat(extensions) })); } function extendEnumType(type) { var config = type.toConfig(); var extensions = typeExtsMap[type.name] || []; var valueNodes = (0, _flatMap.default)(extensions, function (node) { return node.values || []; }); return new _definition.GraphQLEnumType(_objectSpread({}, config, { values: _objectSpread({}, config.values, {}, (0, _keyValMap.default)(valueNodes, function (value) { return value.name.value; }, function (value) { return astBuilder.buildEnumValue(value); })), extensionASTNodes: config.extensionASTNodes.concat(extensions) })); } function extendScalarType(type) { var config = type.toConfig(); var extensions = typeExtsMap[config.name] || []; return new _definition.GraphQLScalarType(_objectSpread({}, config, { extensionASTNodes: config.extensionASTNodes.concat(extensions) })); } function extendObjectType(type) { var config = type.toConfig(); var extensions = typeExtsMap[config.name] || []; var interfaceNodes = (0, _flatMap.default)(extensions, function (node) { return node.interfaces || []; }); var fieldNodes = (0, _flatMap.default)(extensions, function (node) { return node.fields || []; }); return new _definition.GraphQLObjectType(_objectSpread({}, config, { interfaces: function interfaces() { return [].concat(type.getInterfaces().map(replaceNamedType), interfaceNodes.map(function (node) { return astBuilder.getNamedType(node); })); }, fields: function fields() { return _objectSpread({}, (0, _mapValue.default)(config.fields, extendField), {}, (0, _keyValMap.default)(fieldNodes, function (node) { return node.name.value; }, function (node) { return astBuilder.buildField(node); })); }, extensionASTNodes: config.extensionASTNodes.concat(extensions) })); } function extendInterfaceType(type) { var config = type.toConfig(); var extensions = typeExtsMap[config.name] || []; var fieldNodes = (0, _flatMap.default)(extensions, function (node) { return node.fields || []; }); return new _definition.GraphQLInterfaceType(_objectSpread({}, config, { fields: function fields() { return _objectSpread({}, (0, _mapValue.default)(config.fields, extendField), {}, (0, _keyValMap.default)(fieldNodes, function (node) { return node.name.value; }, function (node) { return astBuilder.buildField(node); })); }, extensionASTNodes: config.extensionASTNodes.concat(extensions) })); } function extendUnionType(type) { var config = type.toConfig(); var extensions = typeExtsMap[config.name] || []; var typeNodes = (0, _flatMap.default)(extensions, function (node) { return node.types || []; }); return new _definition.GraphQLUnionType(_objectSpread({}, config, { types: function types() { return [].concat(type.getTypes().map(replaceNamedType), typeNodes.map(function (node) { return astBuilder.getNamedType(node); })); }, extensionASTNodes: config.extensionASTNodes.concat(extensions) })); } function extendField(field) { return _objectSpread({}, field, { type: replaceType(field.type), args: (0, _mapValue.default)(field.args, extendArg) }); } function extendArg(arg) { return _objectSpread({}, arg, { type: replaceType(arg.type) }); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/findBreakingChanges.js": /*!************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/findBreakingChanges.js ***! \************************************************************************************************/ /*! flagged exports */ /*! export BreakingChangeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export DangerousChangeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export findBreakingChanges [provided] [no usage info] [missing usage info prevents renaming] */ /*! export findDangerousChanges [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findBreakingChanges = findBreakingChanges; exports.findDangerousChanges = findDangerousChanges; exports.DangerousChangeType = exports.BreakingChangeType = void 0; var _objectValues = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _keyMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _printer = __webpack_require__(/*! ../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _visitor = __webpack_require__(/*! ../language/visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _astFromValue = __webpack_require__(/*! ./astFromValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/astFromValue.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var BreakingChangeType = Object.freeze({ TYPE_REMOVED: 'TYPE_REMOVED', TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED', INTERFACE_REMOVED_FROM_OBJECT: 'INTERFACE_REMOVED_FROM_OBJECT', FIELD_REMOVED: 'FIELD_REMOVED', FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED', ARG_REMOVED: 'ARG_REMOVED', ARG_CHANGED_KIND: 'ARG_CHANGED_KIND', DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED', DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED', REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED', DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED' }); exports.BreakingChangeType = BreakingChangeType; var DangerousChangeType = Object.freeze({ VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM', TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION', OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', INTERFACE_ADDED_TO_OBJECT: 'INTERFACE_ADDED_TO_OBJECT', ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE' }); exports.DangerousChangeType = DangerousChangeType; /** * Given two schemas, returns an Array containing descriptions of all the types * of breaking changes covered by the other functions down below. */ function findBreakingChanges(oldSchema, newSchema) { var breakingChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) { return change.type in BreakingChangeType; }); return breakingChanges; } /** * Given two schemas, returns an Array containing descriptions of all the types * of potentially dangerous changes covered by the other functions down below. */ function findDangerousChanges(oldSchema, newSchema) { var dangerousChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) { return change.type in DangerousChangeType; }); return dangerousChanges; } function findSchemaChanges(oldSchema, newSchema) { return [].concat(findTypeChanges(oldSchema, newSchema), findDirectiveChanges(oldSchema, newSchema)); } function findDirectiveChanges(oldSchema, newSchema) { var schemaChanges = []; var directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives()); for (var _i2 = 0, _directivesDiff$remov2 = directivesDiff.removed; _i2 < _directivesDiff$remov2.length; _i2++) { var oldDirective = _directivesDiff$remov2[_i2]; schemaChanges.push({ type: BreakingChangeType.DIRECTIVE_REMOVED, description: "".concat(oldDirective.name, " was removed.") }); } for (var _i4 = 0, _directivesDiff$persi2 = directivesDiff.persisted; _i4 < _directivesDiff$persi2.length; _i4++) { var _ref2 = _directivesDiff$persi2[_i4]; var _oldDirective = _ref2[0]; var newDirective = _ref2[1]; var argsDiff = diff(_oldDirective.args, newDirective.args); for (var _i6 = 0, _argsDiff$added2 = argsDiff.added; _i6 < _argsDiff$added2.length; _i6++) { var newArg = _argsDiff$added2[_i6]; if ((0, _definition.isRequiredArgument)(newArg)) { schemaChanges.push({ type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, description: "A required arg ".concat(newArg.name, " on directive ").concat(_oldDirective.name, " was added.") }); } } for (var _i8 = 0, _argsDiff$removed2 = argsDiff.removed; _i8 < _argsDiff$removed2.length; _i8++) { var oldArg = _argsDiff$removed2[_i8]; schemaChanges.push({ type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, description: "".concat(oldArg.name, " was removed from ").concat(_oldDirective.name, ".") }); } for (var _i10 = 0, _oldDirective$locatio2 = _oldDirective.locations; _i10 < _oldDirective$locatio2.length; _i10++) { var location = _oldDirective$locatio2[_i10]; if (newDirective.locations.indexOf(location) === -1) { schemaChanges.push({ type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, description: "".concat(location, " was removed from ").concat(_oldDirective.name, ".") }); } } } return schemaChanges; } function findTypeChanges(oldSchema, newSchema) { var schemaChanges = []; var typesDiff = diff((0, _objectValues.default)(oldSchema.getTypeMap()), (0, _objectValues.default)(newSchema.getTypeMap())); for (var _i12 = 0, _typesDiff$removed2 = typesDiff.removed; _i12 < _typesDiff$removed2.length; _i12++) { var oldType = _typesDiff$removed2[_i12]; schemaChanges.push({ type: BreakingChangeType.TYPE_REMOVED, description: "".concat(oldType.name, " was removed.") }); } for (var _i14 = 0, _typesDiff$persisted2 = typesDiff.persisted; _i14 < _typesDiff$persisted2.length; _i14++) { var _ref4 = _typesDiff$persisted2[_i14]; var _oldType = _ref4[0]; var newType = _ref4[1]; if ((0, _definition.isEnumType)(_oldType) && (0, _definition.isEnumType)(newType)) { schemaChanges.push.apply(schemaChanges, findEnumTypeChanges(_oldType, newType)); } else if ((0, _definition.isUnionType)(_oldType) && (0, _definition.isUnionType)(newType)) { schemaChanges.push.apply(schemaChanges, findUnionTypeChanges(_oldType, newType)); } else if ((0, _definition.isInputObjectType)(_oldType) && (0, _definition.isInputObjectType)(newType)) { schemaChanges.push.apply(schemaChanges, findInputObjectTypeChanges(_oldType, newType)); } else if ((0, _definition.isObjectType)(_oldType) && (0, _definition.isObjectType)(newType)) { schemaChanges.push.apply(schemaChanges, findObjectTypeChanges(_oldType, newType)); } else if ((0, _definition.isInterfaceType)(_oldType) && (0, _definition.isInterfaceType)(newType)) { schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType)); } else if (_oldType.constructor !== newType.constructor) { schemaChanges.push({ type: BreakingChangeType.TYPE_CHANGED_KIND, description: "".concat(_oldType.name, " changed from ") + "".concat(typeKindName(_oldType), " to ").concat(typeKindName(newType), ".") }); } } return schemaChanges; } function findInputObjectTypeChanges(oldType, newType) { var schemaChanges = []; var fieldsDiff = diff((0, _objectValues.default)(oldType.getFields()), (0, _objectValues.default)(newType.getFields())); for (var _i16 = 0, _fieldsDiff$added2 = fieldsDiff.added; _i16 < _fieldsDiff$added2.length; _i16++) { var newField = _fieldsDiff$added2[_i16]; if ((0, _definition.isRequiredInputField)(newField)) { schemaChanges.push({ type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, description: "A required field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.") }); } else { schemaChanges.push({ type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, description: "An optional field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.") }); } } for (var _i18 = 0, _fieldsDiff$removed2 = fieldsDiff.removed; _i18 < _fieldsDiff$removed2.length; _i18++) { var oldField = _fieldsDiff$removed2[_i18]; schemaChanges.push({ type: BreakingChangeType.FIELD_REMOVED, description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") }); } for (var _i20 = 0, _fieldsDiff$persisted2 = fieldsDiff.persisted; _i20 < _fieldsDiff$persisted2.length; _i20++) { var _ref6 = _fieldsDiff$persisted2[_i20]; var _oldField = _ref6[0]; var _newField = _ref6[1]; var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldField.type, _newField.type); if (!isSafe) { schemaChanges.push({ type: BreakingChangeType.FIELD_CHANGED_KIND, description: "".concat(oldType.name, ".").concat(_oldField.name, " changed type from ") + "".concat(String(_oldField.type), " to ").concat(String(_newField.type), ".") }); } } return schemaChanges; } function findUnionTypeChanges(oldType, newType) { var schemaChanges = []; var possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); for (var _i22 = 0, _possibleTypesDiff$ad2 = possibleTypesDiff.added; _i22 < _possibleTypesDiff$ad2.length; _i22++) { var newPossibleType = _possibleTypesDiff$ad2[_i22]; schemaChanges.push({ type: DangerousChangeType.TYPE_ADDED_TO_UNION, description: "".concat(newPossibleType.name, " was added to union type ").concat(oldType.name, ".") }); } for (var _i24 = 0, _possibleTypesDiff$re2 = possibleTypesDiff.removed; _i24 < _possibleTypesDiff$re2.length; _i24++) { var oldPossibleType = _possibleTypesDiff$re2[_i24]; schemaChanges.push({ type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, description: "".concat(oldPossibleType.name, " was removed from union type ").concat(oldType.name, ".") }); } return schemaChanges; } function findEnumTypeChanges(oldType, newType) { var schemaChanges = []; var valuesDiff = diff(oldType.getValues(), newType.getValues()); for (var _i26 = 0, _valuesDiff$added2 = valuesDiff.added; _i26 < _valuesDiff$added2.length; _i26++) { var newValue = _valuesDiff$added2[_i26]; schemaChanges.push({ type: DangerousChangeType.VALUE_ADDED_TO_ENUM, description: "".concat(newValue.name, " was added to enum type ").concat(oldType.name, ".") }); } for (var _i28 = 0, _valuesDiff$removed2 = valuesDiff.removed; _i28 < _valuesDiff$removed2.length; _i28++) { var oldValue = _valuesDiff$removed2[_i28]; schemaChanges.push({ type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, description: "".concat(oldValue.name, " was removed from enum type ").concat(oldType.name, ".") }); } return schemaChanges; } function findObjectTypeChanges(oldType, newType) { var schemaChanges = findFieldChanges(oldType, newType); var interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); for (var _i30 = 0, _interfacesDiff$added2 = interfacesDiff.added; _i30 < _interfacesDiff$added2.length; _i30++) { var newInterface = _interfacesDiff$added2[_i30]; schemaChanges.push({ type: DangerousChangeType.INTERFACE_ADDED_TO_OBJECT, description: "".concat(newInterface.name, " added to interfaces implemented by ").concat(oldType.name, ".") }); } for (var _i32 = 0, _interfacesDiff$remov2 = interfacesDiff.removed; _i32 < _interfacesDiff$remov2.length; _i32++) { var oldInterface = _interfacesDiff$remov2[_i32]; schemaChanges.push({ type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT, description: "".concat(oldType.name, " no longer implements interface ").concat(oldInterface.name, ".") }); } return schemaChanges; } function findFieldChanges(oldType, newType) { var schemaChanges = []; var fieldsDiff = diff((0, _objectValues.default)(oldType.getFields()), (0, _objectValues.default)(newType.getFields())); for (var _i34 = 0, _fieldsDiff$removed4 = fieldsDiff.removed; _i34 < _fieldsDiff$removed4.length; _i34++) { var oldField = _fieldsDiff$removed4[_i34]; schemaChanges.push({ type: BreakingChangeType.FIELD_REMOVED, description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") }); } for (var _i36 = 0, _fieldsDiff$persisted4 = fieldsDiff.persisted; _i36 < _fieldsDiff$persisted4.length; _i36++) { var _ref8 = _fieldsDiff$persisted4[_i36]; var _oldField2 = _ref8[0]; var newField = _ref8[1]; schemaChanges.push.apply(schemaChanges, findArgChanges(oldType, _oldField2, newField)); var isSafe = isChangeSafeForObjectOrInterfaceField(_oldField2.type, newField.type); if (!isSafe) { schemaChanges.push({ type: BreakingChangeType.FIELD_CHANGED_KIND, description: "".concat(oldType.name, ".").concat(_oldField2.name, " changed type from ") + "".concat(String(_oldField2.type), " to ").concat(String(newField.type), ".") }); } } return schemaChanges; } function findArgChanges(oldType, oldField, newField) { var schemaChanges = []; var argsDiff = diff(oldField.args, newField.args); for (var _i38 = 0, _argsDiff$removed4 = argsDiff.removed; _i38 < _argsDiff$removed4.length; _i38++) { var oldArg = _argsDiff$removed4[_i38]; schemaChanges.push({ type: BreakingChangeType.ARG_REMOVED, description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(oldArg.name, " was removed.") }); } for (var _i40 = 0, _argsDiff$persisted2 = argsDiff.persisted; _i40 < _argsDiff$persisted2.length; _i40++) { var _ref10 = _argsDiff$persisted2[_i40]; var _oldArg = _ref10[0]; var newArg = _ref10[1]; var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldArg.type, newArg.type); if (!isSafe) { schemaChanges.push({ type: BreakingChangeType.ARG_CHANGED_KIND, description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed type from ") + "".concat(String(_oldArg.type), " to ").concat(String(newArg.type), ".") }); } else if (_oldArg.defaultValue !== undefined) { if (newArg.defaultValue === undefined) { schemaChanges.push({ type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " defaultValue was removed.") }); } else { // Since we looking only for client's observable changes we should // compare default values in the same representation as they are // represented inside introspection. var oldValueStr = stringifyValue(_oldArg.defaultValue, _oldArg.type); var newValueStr = stringifyValue(newArg.defaultValue, newArg.type); if (oldValueStr !== newValueStr) { schemaChanges.push({ type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed defaultValue from ").concat(oldValueStr, " to ").concat(newValueStr, ".") }); } } } } for (var _i42 = 0, _argsDiff$added4 = argsDiff.added; _i42 < _argsDiff$added4.length; _i42++) { var _newArg = _argsDiff$added4[_i42]; if ((0, _definition.isRequiredArgument)(_newArg)) { schemaChanges.push({ type: BreakingChangeType.REQUIRED_ARG_ADDED, description: "A required arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.") }); } else { schemaChanges.push({ type: DangerousChangeType.OPTIONAL_ARG_ADDED, description: "An optional arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.") }); } } return schemaChanges; } function isChangeSafeForObjectOrInterfaceField(oldType, newType) { if ((0, _definition.isListType)(oldType)) { return (// if they're both lists, make sure the underlying types are compatible (0, _definition.isListType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || // moving from nullable to non-null of the same underlying type is safe (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) ); } if ((0, _definition.isNonNullType)(oldType)) { // if they're both non-null, make sure the underlying types are compatible return (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType); } return (// if they're both named types, see if their names are equivalent (0, _definition.isNamedType)(newType) && oldType.name === newType.name || // moving from nullable to non-null of the same underlying type is safe (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) ); } function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { if ((0, _definition.isListType)(oldType)) { // if they're both lists, make sure the underlying types are compatible return (0, _definition.isListType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType); } if ((0, _definition.isNonNullType)(oldType)) { return (// if they're both non-null, make sure the underlying types are // compatible (0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || // moving from non-null to nullable of the same underlying type is safe !(0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType) ); } // if they're both named types, see if their names are equivalent return (0, _definition.isNamedType)(newType) && oldType.name === newType.name; } function typeKindName(type) { if ((0, _definition.isScalarType)(type)) { return 'a Scalar type'; } if ((0, _definition.isObjectType)(type)) { return 'an Object type'; } if ((0, _definition.isInterfaceType)(type)) { return 'an Interface type'; } if ((0, _definition.isUnionType)(type)) { return 'a Union type'; } if ((0, _definition.isEnumType)(type)) { return 'an Enum type'; } /* istanbul ignore else */ if ((0, _definition.isInputObjectType)(type)) { return 'an Input type'; } // Not reachable. All possible named types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected type: ' + (0, _inspect.default)(type)); } function stringifyValue(value, type) { var ast = (0, _astFromValue.astFromValue)(value, type); /* istanbul ignore next */ ast != null || (0, _invariant.default)(0); var sortedAST = (0, _visitor.visit)(ast, { ObjectValue: function ObjectValue(objectNode) { var fields = [].concat(objectNode.fields).sort(function (fieldA, fieldB) { return fieldA.name.value.localeCompare(fieldB.name.value); }); return _objectSpread({}, objectNode, { fields: fields }); } }); return (0, _printer.print)(sortedAST); } function diff(oldArray, newArray) { var added = []; var removed = []; var persisted = []; var oldMap = (0, _keyMap.default)(oldArray, function (_ref11) { var name = _ref11.name; return name; }); var newMap = (0, _keyMap.default)(newArray, function (_ref12) { var name = _ref12.name; return name; }); for (var _i44 = 0; _i44 < oldArray.length; _i44++) { var oldItem = oldArray[_i44]; var newItem = newMap[oldItem.name]; if (newItem === undefined) { removed.push(oldItem); } else { persisted.push([oldItem, newItem]); } } for (var _i46 = 0; _i46 < newArray.length; _i46++) { var _newItem = newArray[_i46]; if (oldMap[_newItem.name] === undefined) { added.push(_newItem); } } return { added: added, persisted: persisted, removed: removed }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/findDeprecatedUsages.js": /*!*************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/findDeprecatedUsages.js ***! \*************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export findDeprecatedUsages [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findDeprecatedUsages = findDeprecatedUsages; var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _visitor = __webpack_require__(/*! ../language/visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _TypeInfo = __webpack_require__(/*! ./TypeInfo */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/TypeInfo.js"); /** * A validation rule which reports deprecated usages. * * Returns a list of GraphQLError instances describing each deprecated use. */ function findDeprecatedUsages(schema, ast) { var errors = []; var typeInfo = new _TypeInfo.TypeInfo(schema); (0, _visitor.visit)(ast, (0, _visitor.visitWithTypeInfo)(typeInfo, { Field: function Field(node) { var fieldDef = typeInfo.getFieldDef(); if (fieldDef && fieldDef.isDeprecated) { var parentType = typeInfo.getParentType(); if (parentType) { var reason = fieldDef.deprecationReason; errors.push(new _GraphQLError.GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated.") + (reason ? ' ' + reason : ''), node)); } } }, EnumValue: function EnumValue(node) { var enumVal = typeInfo.getEnumValue(); if (enumVal && enumVal.isDeprecated) { var type = (0, _definition.getNamedType)(typeInfo.getInputType()); if (type) { var reason = enumVal.deprecationReason; errors.push(new _GraphQLError.GraphQLError("The enum value ".concat(type.name, ".").concat(enumVal.name, " is deprecated.") + (reason ? ' ' + reason : ''), node)); } } } })); return errors; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationAST.js": /*!********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationAST.js ***! \********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOperationAST = getOperationAST; var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); /** * Returns an operation AST given a document AST and optionally an operation * name. If a name is not provided, an operation is only returned if only one is * provided in the document. */ function getOperationAST(documentAST, operationName) { var operation = null; for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { var definition = _documentAST$definiti2[_i2]; if (definition.kind === _kinds.Kind.OPERATION_DEFINITION) { if (!operationName) { // If no operation name was provided, only return an Operation if there // is one defined in the document. Upon encountering the second, return // null. if (operation) { return null; } operation = definition; } else if (definition.name && definition.name.value === operationName) { return definition; } } } return operation; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationRootType.js": /*!*************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationRootType.js ***! \*************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationRootType [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOperationRootType = getOperationRootType; var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); /** * Extracts the root type of the operation from the schema. */ function getOperationRootType(schema, operation) { if (operation.operation === 'query') { var queryType = schema.getQueryType(); if (!queryType) { throw new _GraphQLError.GraphQLError('Schema does not define the required query root type.', operation); } return queryType; } if (operation.operation === 'mutation') { var mutationType = schema.getMutationType(); if (!mutationType) { throw new _GraphQLError.GraphQLError('Schema is not configured for mutations.', operation); } return mutationType; } if (operation.operation === 'subscription') { var subscriptionType = schema.getSubscriptionType(); if (!subscriptionType) { throw new _GraphQLError.GraphQLError('Schema is not configured for subscriptions.', operation); } return subscriptionType; } throw new _GraphQLError.GraphQLError('Can only have query, mutation and subscription operations.', operation); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js": /*!**********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/index.js ***! \**********************************************************************************/ /*! flagged exports */ /*! export BreakingChangeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export DangerousChangeType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TypeInfo [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertValidName [provided] [no usage info] [missing usage info prevents renaming] */ /*! export astFromValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildASTSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildClientSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export buildSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export coerceInputValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export coerceValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export concatAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! export doTypesOverlap [provided] [no usage info] [missing usage info prevents renaming] */ /*! export extendSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export findBreakingChanges [provided] [no usage info] [missing usage info prevents renaming] */ /*! export findDangerousChanges [provided] [no usage info] [missing usage info prevents renaming] */ /*! export findDeprecatedUsages [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getDescription [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getIntrospectionQuery [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getOperationRootType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export introspectionFromSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export introspectionQuery [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isEqualType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeSubTypeOf [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValidJSValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValidLiteralValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValidNameError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export lexicographicSortSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printIntrospectionSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export separateOperations [provided] [no usage info] [missing usage info prevents renaming] */ /*! export stripIgnoredCharacters [provided] [no usage info] [missing usage info prevents renaming] */ /*! export typeFromAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! export valueFromAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! export valueFromASTUntyped [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "getIntrospectionQuery", ({ enumerable: true, get: function get() { return _introspectionQuery.getIntrospectionQuery; } })); Object.defineProperty(exports, "introspectionQuery", ({ enumerable: true, get: function get() { return _introspectionQuery.introspectionQuery; } })); Object.defineProperty(exports, "getOperationAST", ({ enumerable: true, get: function get() { return _getOperationAST.getOperationAST; } })); Object.defineProperty(exports, "getOperationRootType", ({ enumerable: true, get: function get() { return _getOperationRootType.getOperationRootType; } })); Object.defineProperty(exports, "introspectionFromSchema", ({ enumerable: true, get: function get() { return _introspectionFromSchema.introspectionFromSchema; } })); Object.defineProperty(exports, "buildClientSchema", ({ enumerable: true, get: function get() { return _buildClientSchema.buildClientSchema; } })); Object.defineProperty(exports, "buildASTSchema", ({ enumerable: true, get: function get() { return _buildASTSchema.buildASTSchema; } })); Object.defineProperty(exports, "buildSchema", ({ enumerable: true, get: function get() { return _buildASTSchema.buildSchema; } })); Object.defineProperty(exports, "getDescription", ({ enumerable: true, get: function get() { return _buildASTSchema.getDescription; } })); Object.defineProperty(exports, "extendSchema", ({ enumerable: true, get: function get() { return _extendSchema.extendSchema; } })); Object.defineProperty(exports, "lexicographicSortSchema", ({ enumerable: true, get: function get() { return _lexicographicSortSchema.lexicographicSortSchema; } })); Object.defineProperty(exports, "printSchema", ({ enumerable: true, get: function get() { return _schemaPrinter.printSchema; } })); Object.defineProperty(exports, "printType", ({ enumerable: true, get: function get() { return _schemaPrinter.printType; } })); Object.defineProperty(exports, "printIntrospectionSchema", ({ enumerable: true, get: function get() { return _schemaPrinter.printIntrospectionSchema; } })); Object.defineProperty(exports, "typeFromAST", ({ enumerable: true, get: function get() { return _typeFromAST.typeFromAST; } })); Object.defineProperty(exports, "valueFromAST", ({ enumerable: true, get: function get() { return _valueFromAST.valueFromAST; } })); Object.defineProperty(exports, "valueFromASTUntyped", ({ enumerable: true, get: function get() { return _valueFromASTUntyped.valueFromASTUntyped; } })); Object.defineProperty(exports, "astFromValue", ({ enumerable: true, get: function get() { return _astFromValue.astFromValue; } })); Object.defineProperty(exports, "TypeInfo", ({ enumerable: true, get: function get() { return _TypeInfo.TypeInfo; } })); Object.defineProperty(exports, "coerceInputValue", ({ enumerable: true, get: function get() { return _coerceInputValue.coerceInputValue; } })); Object.defineProperty(exports, "coerceValue", ({ enumerable: true, get: function get() { return _coerceValue.coerceValue; } })); Object.defineProperty(exports, "isValidJSValue", ({ enumerable: true, get: function get() { return _isValidJSValue.isValidJSValue; } })); Object.defineProperty(exports, "isValidLiteralValue", ({ enumerable: true, get: function get() { return _isValidLiteralValue.isValidLiteralValue; } })); Object.defineProperty(exports, "concatAST", ({ enumerable: true, get: function get() { return _concatAST.concatAST; } })); Object.defineProperty(exports, "separateOperations", ({ enumerable: true, get: function get() { return _separateOperations.separateOperations; } })); Object.defineProperty(exports, "stripIgnoredCharacters", ({ enumerable: true, get: function get() { return _stripIgnoredCharacters.stripIgnoredCharacters; } })); Object.defineProperty(exports, "isEqualType", ({ enumerable: true, get: function get() { return _typeComparators.isEqualType; } })); Object.defineProperty(exports, "isTypeSubTypeOf", ({ enumerable: true, get: function get() { return _typeComparators.isTypeSubTypeOf; } })); Object.defineProperty(exports, "doTypesOverlap", ({ enumerable: true, get: function get() { return _typeComparators.doTypesOverlap; } })); Object.defineProperty(exports, "assertValidName", ({ enumerable: true, get: function get() { return _assertValidName.assertValidName; } })); Object.defineProperty(exports, "isValidNameError", ({ enumerable: true, get: function get() { return _assertValidName.isValidNameError; } })); Object.defineProperty(exports, "BreakingChangeType", ({ enumerable: true, get: function get() { return _findBreakingChanges.BreakingChangeType; } })); Object.defineProperty(exports, "DangerousChangeType", ({ enumerable: true, get: function get() { return _findBreakingChanges.DangerousChangeType; } })); Object.defineProperty(exports, "findBreakingChanges", ({ enumerable: true, get: function get() { return _findBreakingChanges.findBreakingChanges; } })); Object.defineProperty(exports, "findDangerousChanges", ({ enumerable: true, get: function get() { return _findBreakingChanges.findDangerousChanges; } })); Object.defineProperty(exports, "findDeprecatedUsages", ({ enumerable: true, get: function get() { return _findDeprecatedUsages.findDeprecatedUsages; } })); var _introspectionQuery = __webpack_require__(/*! ./introspectionQuery */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/introspectionQuery.js"); var _getOperationAST = __webpack_require__(/*! ./getOperationAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationAST.js"); var _getOperationRootType = __webpack_require__(/*! ./getOperationRootType */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/getOperationRootType.js"); var _introspectionFromSchema = __webpack_require__(/*! ./introspectionFromSchema */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/introspectionFromSchema.js"); var _buildClientSchema = __webpack_require__(/*! ./buildClientSchema */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/buildClientSchema.js"); var _buildASTSchema = __webpack_require__(/*! ./buildASTSchema */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/buildASTSchema.js"); var _extendSchema = __webpack_require__(/*! ./extendSchema */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/extendSchema.js"); var _lexicographicSortSchema = __webpack_require__(/*! ./lexicographicSortSchema */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/lexicographicSortSchema.js"); var _schemaPrinter = __webpack_require__(/*! ./schemaPrinter */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/schemaPrinter.js"); var _typeFromAST = __webpack_require__(/*! ./typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); var _valueFromAST = __webpack_require__(/*! ./valueFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromAST.js"); var _valueFromASTUntyped = __webpack_require__(/*! ./valueFromASTUntyped */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromASTUntyped.js"); var _astFromValue = __webpack_require__(/*! ./astFromValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/astFromValue.js"); var _TypeInfo = __webpack_require__(/*! ./TypeInfo */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/TypeInfo.js"); var _coerceInputValue = __webpack_require__(/*! ./coerceInputValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceInputValue.js"); var _coerceValue = __webpack_require__(/*! ./coerceValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceValue.js"); var _isValidJSValue = __webpack_require__(/*! ./isValidJSValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/isValidJSValue.js"); var _isValidLiteralValue = __webpack_require__(/*! ./isValidLiteralValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/isValidLiteralValue.js"); var _concatAST = __webpack_require__(/*! ./concatAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/concatAST.js"); var _separateOperations = __webpack_require__(/*! ./separateOperations */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/separateOperations.js"); var _stripIgnoredCharacters = __webpack_require__(/*! ./stripIgnoredCharacters */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/stripIgnoredCharacters.js"); var _typeComparators = __webpack_require__(/*! ./typeComparators */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeComparators.js"); var _assertValidName = __webpack_require__(/*! ./assertValidName */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/assertValidName.js"); var _findBreakingChanges = __webpack_require__(/*! ./findBreakingChanges */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/findBreakingChanges.js"); var _findDeprecatedUsages = __webpack_require__(/*! ./findDeprecatedUsages */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/findDeprecatedUsages.js"); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/introspectionFromSchema.js": /*!****************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/introspectionFromSchema.js ***! \****************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export introspectionFromSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.introspectionFromSchema = introspectionFromSchema; var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _isPromise = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isPromise */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isPromise.js")); var _parser = __webpack_require__(/*! ../language/parser */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/parser.js"); var _execute = __webpack_require__(/*! ../execution/execute */ "./node_modules/graphql-ruby-client/node_modules/graphql/execution/execute.js"); var _introspectionQuery = __webpack_require__(/*! ./introspectionQuery */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/introspectionQuery.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Build an IntrospectionQuery from a GraphQLSchema * * IntrospectionQuery is useful for utilities that care about type and field * relationships, but do not need to traverse through those relationships. * * This is the inverse of buildClientSchema. The primary use case is outside * of the server context, for instance when doing schema comparisons. */ function introspectionFromSchema(schema, options) { var queryAST = (0, _parser.parse)((0, _introspectionQuery.getIntrospectionQuery)(options)); var result = (0, _execute.execute)(schema, queryAST); /* istanbul ignore next */ !(0, _isPromise.default)(result) && !result.errors && result.data || (0, _invariant.default)(0); return result.data; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/introspectionQuery.js": /*!***********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/introspectionQuery.js ***! \***********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getIntrospectionQuery [provided] [no usage info] [missing usage info prevents renaming] */ /*! export introspectionQuery [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIntrospectionQuery = getIntrospectionQuery; exports.introspectionQuery = void 0; function getIntrospectionQuery(options) { var descriptions = !(options && options.descriptions === false); return "\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ".concat(descriptions ? 'description' : '', "\n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ").concat(descriptions ? 'description' : '', "\n fields(includeDeprecated: true) {\n name\n ").concat(descriptions ? 'description' : '', "\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ").concat(descriptions ? 'description' : '', "\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ").concat(descriptions ? 'description' : '', "\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n "); } /** * Deprecated, call getIntrospectionQuery directly. * * This function will be removed in v15 */ var introspectionQuery = getIntrospectionQuery(); exports.introspectionQuery = introspectionQuery; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/isValidJSValue.js": /*!*******************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/isValidJSValue.js ***! \*******************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValidJSValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isValidJSValue = isValidJSValue; var _coerceValue = __webpack_require__(/*! ./coerceValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/coerceValue.js"); /* istanbul ignore file */ /** * Deprecated. Use coerceInputValue() directly for richer information. * * This function will be removed in v15 */ function isValidJSValue(value, type) { var errors = (0, _coerceValue.coerceValue)(value, type).errors; return errors ? errors.map(function (error) { return error.message; }) : []; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/isValidLiteralValue.js": /*!************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/isValidLiteralValue.js ***! \************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isValidLiteralValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isValidLiteralValue = isValidLiteralValue; var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _visitor = __webpack_require__(/*! ../language/visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); var _ValuesOfCorrectType = __webpack_require__(/*! ../validation/rules/ValuesOfCorrectType */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ValuesOfCorrectType.js"); var _ValidationContext = __webpack_require__(/*! ../validation/ValidationContext */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/ValidationContext.js"); var _schema = __webpack_require__(/*! ../type/schema */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js"); var _TypeInfo = __webpack_require__(/*! ./TypeInfo */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/TypeInfo.js"); /** * Utility which determines if a value literal node is valid for an input type. * * Deprecated. Rely on validation for documents containing literal values. * * This function will be removed in v15 */ function isValidLiteralValue(type, valueNode) { var emptySchema = new _schema.GraphQLSchema({}); var emptyDoc = { kind: _kinds.Kind.DOCUMENT, definitions: [] }; var typeInfo = new _TypeInfo.TypeInfo(emptySchema, undefined, type); var context = new _ValidationContext.ValidationContext(emptySchema, emptyDoc, typeInfo); var visitor = (0, _ValuesOfCorrectType.ValuesOfCorrectType)(context); (0, _visitor.visit)(valueNode, (0, _visitor.visitWithTypeInfo)(typeInfo, visitor)); return context.getErrors(); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/lexicographicSortSchema.js": /*!****************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/lexicographicSortSchema.js ***! \****************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export lexicographicSortSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.lexicographicSortSchema = lexicographicSortSchema; var _objectValues = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _keyValMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyValMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js")); var _schema = __webpack_require__(/*! ../type/schema */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/schema.js"); var _directives = __webpack_require__(/*! ../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _introspection = __webpack_require__(/*! ../type/introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Sort GraphQLSchema. */ function lexicographicSortSchema(schema) { var schemaConfig = schema.toConfig(); var typeMap = (0, _keyValMap.default)(sortByName(schemaConfig.types), function (type) { return type.name; }, sortNamedType); return new _schema.GraphQLSchema(_objectSpread({}, schemaConfig, { types: (0, _objectValues.default)(typeMap), directives: sortByName(schemaConfig.directives).map(sortDirective), query: replaceMaybeType(schemaConfig.query), mutation: replaceMaybeType(schemaConfig.mutation), subscription: replaceMaybeType(schemaConfig.subscription) })); function replaceType(type) { if ((0, _definition.isListType)(type)) { return new _definition.GraphQLList(replaceType(type.ofType)); } else if ((0, _definition.isNonNullType)(type)) { return new _definition.GraphQLNonNull(replaceType(type.ofType)); } return replaceNamedType(type); } function replaceNamedType(type) { return typeMap[type.name]; } function replaceMaybeType(maybeType) { return maybeType && replaceNamedType(maybeType); } function sortDirective(directive) { var config = directive.toConfig(); return new _directives.GraphQLDirective(_objectSpread({}, config, { locations: sortBy(config.locations, function (x) { return x; }), args: sortArgs(config.args) })); } function sortArgs(args) { return sortObjMap(args, function (arg) { return _objectSpread({}, arg, { type: replaceType(arg.type) }); }); } function sortFields(fieldsMap) { return sortObjMap(fieldsMap, function (field) { return _objectSpread({}, field, { type: replaceType(field.type), args: sortArgs(field.args) }); }); } function sortInputFields(fieldsMap) { return sortObjMap(fieldsMap, function (field) { return _objectSpread({}, field, { type: replaceType(field.type) }); }); } function sortTypes(arr) { return sortByName(arr).map(replaceNamedType); } function sortNamedType(type) { if ((0, _definition.isScalarType)(type) || (0, _introspection.isIntrospectionType)(type)) { return type; } else if ((0, _definition.isObjectType)(type)) { var config = type.toConfig(); return new _definition.GraphQLObjectType(_objectSpread({}, config, { interfaces: function interfaces() { return sortTypes(config.interfaces); }, fields: function fields() { return sortFields(config.fields); } })); } else if ((0, _definition.isInterfaceType)(type)) { var _config = type.toConfig(); return new _definition.GraphQLInterfaceType(_objectSpread({}, _config, { fields: function fields() { return sortFields(_config.fields); } })); } else if ((0, _definition.isUnionType)(type)) { var _config2 = type.toConfig(); return new _definition.GraphQLUnionType(_objectSpread({}, _config2, { types: function types() { return sortTypes(_config2.types); } })); } else if ((0, _definition.isEnumType)(type)) { var _config3 = type.toConfig(); return new _definition.GraphQLEnumType(_objectSpread({}, _config3, { values: sortObjMap(_config3.values) })); } else if ((0, _definition.isInputObjectType)(type)) { var _config4 = type.toConfig(); return new _definition.GraphQLInputObjectType(_objectSpread({}, _config4, { fields: function fields() { return sortInputFields(_config4.fields); } })); } // Not reachable. All possible types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected type: ' + (0, _inspect.default)(type)); } } function sortObjMap(map, sortValueFn) { var sortedMap = Object.create(null); var sortedKeys = sortBy(Object.keys(map), function (x) { return x; }); for (var _i2 = 0; _i2 < sortedKeys.length; _i2++) { var key = sortedKeys[_i2]; var value = map[key]; sortedMap[key] = sortValueFn ? sortValueFn(value) : value; } return sortedMap; } function sortByName(array) { return sortBy(array, function (obj) { return obj.name; }); } function sortBy(array, mapToKey) { return array.slice().sort(function (obj1, obj2) { var key1 = mapToKey(obj1); var key2 = mapToKey(obj2); return key1.localeCompare(key2); }); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/schemaPrinter.js": /*!******************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/schemaPrinter.js ***! \******************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printIntrospectionSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printSchema [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printType [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.printSchema = printSchema; exports.printIntrospectionSchema = printIntrospectionSchema; exports.printType = printType; var _flatMap = _interopRequireDefault(__webpack_require__(/*! ../polyfills/flatMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/flatMap.js")); var _objectValues = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _printer = __webpack_require__(/*! ../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _blockString = __webpack_require__(/*! ../language/blockString */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/blockString.js"); var _introspection = __webpack_require__(/*! ../type/introspection */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/introspection.js"); var _scalars = __webpack_require__(/*! ../type/scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); var _directives = __webpack_require__(/*! ../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _astFromValue = __webpack_require__(/*! ../utilities/astFromValue */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/astFromValue.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Accepts options as a second argument: * * - commentDescriptions: * Provide true to use preceding comments as the description. * */ function printSchema(schema, options) { return printFilteredSchema(schema, function (n) { return !(0, _directives.isSpecifiedDirective)(n); }, isDefinedType, options); } function printIntrospectionSchema(schema, options) { return printFilteredSchema(schema, _directives.isSpecifiedDirective, _introspection.isIntrospectionType, options); } function isDefinedType(type) { return !(0, _scalars.isSpecifiedScalarType)(type) && !(0, _introspection.isIntrospectionType)(type); } function printFilteredSchema(schema, directiveFilter, typeFilter, options) { var directives = schema.getDirectives().filter(directiveFilter); var typeMap = schema.getTypeMap(); var types = (0, _objectValues.default)(typeMap).sort(function (type1, type2) { return type1.name.localeCompare(type2.name); }).filter(typeFilter); return [printSchemaDefinition(schema)].concat(directives.map(function (directive) { return printDirective(directive, options); }), types.map(function (type) { return printType(type, options); })).filter(Boolean).join('\n\n') + '\n'; } function printSchemaDefinition(schema) { if (isSchemaOfCommonNames(schema)) { return; } var operationTypes = []; var queryType = schema.getQueryType(); if (queryType) { operationTypes.push(" query: ".concat(queryType.name)); } var mutationType = schema.getMutationType(); if (mutationType) { operationTypes.push(" mutation: ".concat(mutationType.name)); } var subscriptionType = schema.getSubscriptionType(); if (subscriptionType) { operationTypes.push(" subscription: ".concat(subscriptionType.name)); } return "schema {\n".concat(operationTypes.join('\n'), "\n}"); } /** * GraphQL schema define root types for each type of operation. These types are * the same as any other type and can be named in any manner, however there is * a common naming convention: * * schema { * query: Query * mutation: Mutation * } * * When using this naming convention, the schema description can be omitted. */ function isSchemaOfCommonNames(schema) { var queryType = schema.getQueryType(); if (queryType && queryType.name !== 'Query') { return false; } var mutationType = schema.getMutationType(); if (mutationType && mutationType.name !== 'Mutation') { return false; } var subscriptionType = schema.getSubscriptionType(); if (subscriptionType && subscriptionType.name !== 'Subscription') { return false; } return true; } function printType(type, options) { if ((0, _definition.isScalarType)(type)) { return printScalar(type, options); } else if ((0, _definition.isObjectType)(type)) { return printObject(type, options); } else if ((0, _definition.isInterfaceType)(type)) { return printInterface(type, options); } else if ((0, _definition.isUnionType)(type)) { return printUnion(type, options); } else if ((0, _definition.isEnumType)(type)) { return printEnum(type, options); } else if ((0, _definition.isInputObjectType)(type)) { return printInputObject(type, options); } // Not reachable. All possible types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected type: ' + (0, _inspect.default)(type)); } function printScalar(type, options) { return printDescription(options, type) + "scalar ".concat(type.name); } function printObject(type, options) { var interfaces = type.getInterfaces(); var implementedInterfaces = interfaces.length ? ' implements ' + interfaces.map(function (i) { return i.name; }).join(' & ') : ''; return printDescription(options, type) + "type ".concat(type.name).concat(implementedInterfaces) + printFields(options, type); } function printInterface(type, options) { return printDescription(options, type) + "interface ".concat(type.name) + printFields(options, type); } function printUnion(type, options) { var types = type.getTypes(); var possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; return printDescription(options, type) + 'union ' + type.name + possibleTypes; } function printEnum(type, options) { var values = type.getValues().map(function (value, i) { return printDescription(options, value, ' ', !i) + ' ' + value.name + printDeprecated(value); }); return printDescription(options, type) + "enum ".concat(type.name) + printBlock(values); } function printInputObject(type, options) { var fields = (0, _objectValues.default)(type.getFields()).map(function (f, i) { return printDescription(options, f, ' ', !i) + ' ' + printInputValue(f); }); return printDescription(options, type) + "input ".concat(type.name) + printBlock(fields); } function printFields(options, type) { var fields = (0, _objectValues.default)(type.getFields()).map(function (f, i) { return printDescription(options, f, ' ', !i) + ' ' + f.name + printArgs(options, f.args, ' ') + ': ' + String(f.type) + printDeprecated(f); }); return printBlock(fields); } function printBlock(items) { return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; } function printArgs(options, args) { var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; if (args.length === 0) { return ''; } // If every arg does not have a description, print them on one line. if (args.every(function (arg) { return !arg.description; })) { return '(' + args.map(printInputValue).join(', ') + ')'; } return '(\n' + args.map(function (arg, i) { return printDescription(options, arg, ' ' + indentation, !i) + ' ' + indentation + printInputValue(arg); }).join('\n') + '\n' + indentation + ')'; } function printInputValue(arg) { var defaultAST = (0, _astFromValue.astFromValue)(arg.defaultValue, arg.type); var argDecl = arg.name + ': ' + String(arg.type); if (defaultAST) { argDecl += " = ".concat((0, _printer.print)(defaultAST)); } return argDecl; } function printDirective(directive, options) { return printDescription(options, directive) + 'directive @' + directive.name + printArgs(options, directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | '); } function printDeprecated(fieldOrEnumVal) { if (!fieldOrEnumVal.isDeprecated) { return ''; } var reason = fieldOrEnumVal.deprecationReason; var reasonAST = (0, _astFromValue.astFromValue)(reason, _scalars.GraphQLString); if (reasonAST && reason !== '' && reason !== _directives.DEFAULT_DEPRECATION_REASON) { return ' @deprecated(reason: ' + (0, _printer.print)(reasonAST) + ')'; } return ' @deprecated'; } function printDescription(options, def) { var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; var firstInBlock = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; if (!def.description) { return ''; } var lines = descriptionLines(def.description, 120 - indentation.length); if (options && options.commentDescriptions) { return printDescriptionWithComments(lines, indentation, firstInBlock); } var text = lines.join('\n'); var preferMultipleLines = text.length > 70; var blockString = (0, _blockString.printBlockString)(text, '', preferMultipleLines); var prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; } function printDescriptionWithComments(lines, indentation, firstInBlock) { var description = indentation && !firstInBlock ? '\n' : ''; for (var _i2 = 0; _i2 < lines.length; _i2++) { var line = lines[_i2]; if (line === '') { description += indentation + '#\n'; } else { description += indentation + '# ' + line + '\n'; } } return description; } function descriptionLines(description, maxLen) { var rawLines = description.split('\n'); return (0, _flatMap.default)(rawLines, function (line) { if (line.length < maxLen + 5) { return line; } // For > 120 character long lines, cut at space boundaries into sublines // of ~80 chars. return breakLine(line, maxLen); }); } function breakLine(line, maxLen) { var parts = line.split(new RegExp("((?: |^).{15,".concat(maxLen - 40, "}(?= |$))"))); if (parts.length < 4) { return [line]; } var sublines = [parts[0] + parts[1] + parts[2]]; for (var i = 3; i < parts.length; i += 2) { sublines.push(parts[i].slice(1) + parts[i + 1]); } return sublines; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/separateOperations.js": /*!***********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/separateOperations.js ***! \***********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export separateOperations [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.separateOperations = separateOperations; var _visitor = __webpack_require__(/*! ../language/visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); /** * separateOperations accepts a single AST document which may contain many * operations and fragments and returns a collection of AST documents each of * which contains a single operation as well the fragment definitions it * refers to. */ function separateOperations(documentAST) { var operations = []; var fragments = Object.create(null); var positions = new Map(); var depGraph = Object.create(null); var fromName; var idx = 0; // Populate metadata and build a dependency graph. (0, _visitor.visit)(documentAST, { OperationDefinition: function OperationDefinition(node) { fromName = opName(node); operations.push(node); positions.set(node, idx++); }, FragmentDefinition: function FragmentDefinition(node) { fromName = node.name.value; fragments[fromName] = node; positions.set(node, idx++); }, FragmentSpread: function FragmentSpread(node) { var toName = node.name.value; (depGraph[fromName] || (depGraph[fromName] = Object.create(null)))[toName] = true; } }); // For each operation, produce a new synthesized AST which includes only what // is necessary for completing that operation. var separatedDocumentASTs = Object.create(null); for (var _i2 = 0; _i2 < operations.length; _i2++) { var operation = operations[_i2]; var operationName = opName(operation); var dependencies = Object.create(null); collectTransitiveDependencies(dependencies, depGraph, operationName); // The list of definition nodes to be included for this operation, sorted // to retain the same order as the original document. var definitions = [operation]; for (var _i4 = 0, _Object$keys2 = Object.keys(dependencies); _i4 < _Object$keys2.length; _i4++) { var name = _Object$keys2[_i4]; definitions.push(fragments[name]); } definitions.sort(function (n1, n2) { return (positions.get(n1) || 0) - (positions.get(n2) || 0); }); separatedDocumentASTs[operationName] = { kind: 'Document', definitions: definitions }; } return separatedDocumentASTs; } // Provides the empty string for anonymous operations. function opName(operation) { return operation.name ? operation.name.value : ''; } // From a dependency graph, collects a list of transitive dependencies by // recursing through a dependency graph. function collectTransitiveDependencies(collected, depGraph, fromName) { var immediateDeps = depGraph[fromName]; if (immediateDeps) { for (var _i6 = 0, _Object$keys4 = Object.keys(immediateDeps); _i6 < _Object$keys4.length; _i6++) { var toName = _Object$keys4[_i6]; if (!collected[toName]) { collected[toName] = true; collectTransitiveDependencies(collected, depGraph, toName); } } } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/stripIgnoredCharacters.js": /*!***************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/stripIgnoredCharacters.js ***! \***************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export stripIgnoredCharacters [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.stripIgnoredCharacters = stripIgnoredCharacters; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _source = __webpack_require__(/*! ../language/source */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/source.js"); var _tokenKind = __webpack_require__(/*! ../language/tokenKind */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/tokenKind.js"); var _lexer = __webpack_require__(/*! ../language/lexer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/lexer.js"); var _blockString = __webpack_require__(/*! ../language/blockString */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/blockString.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Strips characters that are not significant to the validity or execution * of a GraphQL document: * - UnicodeBOM * - WhiteSpace * - LineTerminator * - Comment * - Comma * - BlockString indentation * * Note: It is required to have a delimiter character between neighboring * non-punctuator tokens and this function always uses single space as delimiter. * * It is guaranteed that both input and output documents if parsed would result * in the exact same AST except for nodes location. * * Warning: It is guaranteed that this function will always produce stable results. * However, it's not guaranteed that it will stay the same between different * releases due to bugfixes or changes in the GraphQL specification. * * Query example: * * query SomeQuery($foo: String!, $bar: String) { * someField(foo: $foo, bar: $bar) { * a * b { * c * d * } * } * } * * Becomes: * * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} * * SDL example: * * """ * Type description * """ * type Foo { * """ * Field description * """ * bar: String * } * * Becomes: * * """Type description""" type Foo{"""Field description""" bar:String} */ function stripIgnoredCharacters(source) { var sourceObj = typeof source === 'string' ? new _source.Source(source) : source; if (!(sourceObj instanceof _source.Source)) { throw new TypeError("Must provide string or Source. Received: ".concat((0, _inspect.default)(sourceObj))); } var body = sourceObj.body; var lexer = (0, _lexer.createLexer)(sourceObj); var strippedBody = ''; var wasLastAddedTokenNonPunctuator = false; while (lexer.advance().kind !== _tokenKind.TokenKind.EOF) { var currentToken = lexer.token; var tokenKind = currentToken.kind; /** * Every two non-punctuator tokens should have space between them. * Also prevent case of non-punctuator token following by spread resulting * in invalid token (e.g. `1...` is invalid Float token). */ var isNonPunctuator = !(0, _lexer.isPunctuatorToken)(currentToken); if (wasLastAddedTokenNonPunctuator) { if (isNonPunctuator || currentToken.kind === _tokenKind.TokenKind.SPREAD) { strippedBody += ' '; } } var tokenBody = body.slice(currentToken.start, currentToken.end); if (tokenKind === _tokenKind.TokenKind.BLOCK_STRING) { strippedBody += dedentBlockString(tokenBody); } else { strippedBody += tokenBody; } wasLastAddedTokenNonPunctuator = isNonPunctuator; } return strippedBody; } function dedentBlockString(blockStr) { // skip leading and trailing triple quotations var rawStr = blockStr.slice(3, -3); var body = (0, _blockString.dedentBlockStringValue)(rawStr); var lines = body.split(/\r\n|[\n\r]/g); if ((0, _blockString.getBlockStringIndentation)(lines) > 0) { body = '\n' + body; } var lastChar = body[body.length - 1]; var hasTrailingQuote = lastChar === '"' && body.slice(-4) !== '\\"""'; if (hasTrailingQuote || lastChar === '\\') { body += '\n'; } return '"""' + body + '"""'; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeComparators.js": /*!********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeComparators.js ***! \********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export doTypesOverlap [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isEqualType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isTypeSubTypeOf [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isEqualType = isEqualType; exports.isTypeSubTypeOf = isTypeSubTypeOf; exports.doTypesOverlap = doTypesOverlap; var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); /** * Provided two types, return true if the types are equal (invariant). */ function isEqualType(typeA, typeB) { // Equivalent types are equal. if (typeA === typeB) { return true; } // If either type is non-null, the other must also be non-null. if ((0, _definition.isNonNullType)(typeA) && (0, _definition.isNonNullType)(typeB)) { return isEqualType(typeA.ofType, typeB.ofType); } // If either type is a list, the other must also be a list. if ((0, _definition.isListType)(typeA) && (0, _definition.isListType)(typeB)) { return isEqualType(typeA.ofType, typeB.ofType); } // Otherwise the types are not equal. return false; } /** * Provided a type and a super type, return true if the first type is either * equal or a subset of the second super type (covariant). */ function isTypeSubTypeOf(schema, maybeSubType, superType) { // Equivalent type is a valid subtype if (maybeSubType === superType) { return true; } // If superType is non-null, maybeSubType must also be non-null. if ((0, _definition.isNonNullType)(superType)) { if ((0, _definition.isNonNullType)(maybeSubType)) { return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); } return false; } if ((0, _definition.isNonNullType)(maybeSubType)) { // If superType is nullable, maybeSubType may be non-null or nullable. return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); } // If superType type is a list, maybeSubType type must also be a list. if ((0, _definition.isListType)(superType)) { if ((0, _definition.isListType)(maybeSubType)) { return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); } return false; } if ((0, _definition.isListType)(maybeSubType)) { // If superType is not a list, maybeSubType must also be not a list. return false; } // If superType type is an abstract type, maybeSubType type may be a currently // possible object type. if ((0, _definition.isAbstractType)(superType) && (0, _definition.isObjectType)(maybeSubType) && schema.isPossibleType(superType, maybeSubType)) { return true; } // Otherwise, the child type is not a valid subtype of the parent type. return false; } /** * Provided two composite types, determine if they "overlap". Two composite * types overlap when the Sets of possible concrete types for each intersect. * * This is often used to determine if a fragment of a given type could possibly * be visited in a context of another type. * * This function is commutative. */ function doTypesOverlap(schema, typeA, typeB) { // Equivalent types overlap if (typeA === typeB) { return true; } if ((0, _definition.isAbstractType)(typeA)) { if ((0, _definition.isAbstractType)(typeB)) { // If both types are abstract, then determine if there is any intersection // between possible concrete types of each. return schema.getPossibleTypes(typeA).some(function (type) { return schema.isPossibleType(typeB, type); }); } // Determine if the latter type is a possible concrete type of the former. return schema.isPossibleType(typeA, typeB); } if ((0, _definition.isAbstractType)(typeB)) { // Determine if the former type is a possible concrete type of the latter. return schema.isPossibleType(typeB, typeA); } // Otherwise the types do not overlap. return false; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js": /*!****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js ***! \****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export typeFromAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.typeFromAST = typeFromAST; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function typeFromAST(schema, typeNode) { /* eslint-enable no-redeclare */ var innerType; if (typeNode.kind === _kinds.Kind.LIST_TYPE) { innerType = typeFromAST(schema, typeNode.type); return innerType && (0, _definition.GraphQLList)(innerType); } if (typeNode.kind === _kinds.Kind.NON_NULL_TYPE) { innerType = typeFromAST(schema, typeNode.type); return innerType && (0, _definition.GraphQLNonNull)(innerType); } /* istanbul ignore else */ if (typeNode.kind === _kinds.Kind.NAMED_TYPE) { return schema.getType(typeNode.name.value); } // Not reachable. All possible type nodes have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected type node: ' + (0, _inspect.default)(typeNode)); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromAST.js": /*!*****************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromAST.js ***! \*****************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export valueFromAST [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.valueFromAST = valueFromAST; var _objectValues3 = _interopRequireDefault(__webpack_require__(/*! ../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _keyMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _isInvalid = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isInvalid */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isInvalid.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _definition = __webpack_require__(/*! ../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Produces a JavaScript value given a GraphQL Value AST. * * A GraphQL type must be provided, which will be used to interpret different * GraphQL Value literals. * * Returns `undefined` when the value could not be validly coerced according to * the provided type. * * | GraphQL Value | JSON Value | * | -------------------- | ------------- | * | Input Object | Object | * | List | Array | * | Boolean | Boolean | * | String | String | * | Int / Float | Number | * | Enum Value | Mixed | * | NullValue | null | * */ function valueFromAST(valueNode, type, variables) { if (!valueNode) { // When there is no node, then there is also no value. // Importantly, this is different from returning the value null. return; } if ((0, _definition.isNonNullType)(type)) { if (valueNode.kind === _kinds.Kind.NULL) { return; // Invalid: intentionally return no value. } return valueFromAST(valueNode, type.ofType, variables); } if (valueNode.kind === _kinds.Kind.NULL) { // This is explicitly returning the value null. return null; } if (valueNode.kind === _kinds.Kind.VARIABLE) { var variableName = valueNode.name.value; if (!variables || (0, _isInvalid.default)(variables[variableName])) { // No valid return value. return; } var variableValue = variables[variableName]; if (variableValue === null && (0, _definition.isNonNullType)(type)) { return; // Invalid: intentionally return no value. } // Note: This does no further checking that this variable is correct. // This assumes that this query has been validated and the variable // usage here is of the correct type. return variableValue; } if ((0, _definition.isListType)(type)) { var itemType = type.ofType; if (valueNode.kind === _kinds.Kind.LIST) { var coercedValues = []; for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) { var itemNode = _valueNode$values2[_i2]; if (isMissingVariable(itemNode, variables)) { // If an array contains a missing variable, it is either coerced to // null or if the item type is non-null, it considered invalid. if ((0, _definition.isNonNullType)(itemType)) { return; // Invalid: intentionally return no value. } coercedValues.push(null); } else { var itemValue = valueFromAST(itemNode, itemType, variables); if ((0, _isInvalid.default)(itemValue)) { return; // Invalid: intentionally return no value. } coercedValues.push(itemValue); } } return coercedValues; } var coercedValue = valueFromAST(valueNode, itemType, variables); if ((0, _isInvalid.default)(coercedValue)) { return; // Invalid: intentionally return no value. } return [coercedValue]; } if ((0, _definition.isInputObjectType)(type)) { if (valueNode.kind !== _kinds.Kind.OBJECT) { return; // Invalid: intentionally return no value. } var coercedObj = Object.create(null); var fieldNodes = (0, _keyMap.default)(valueNode.fields, function (field) { return field.name.value; }); for (var _i4 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) { var field = _objectValues2[_i4]; var fieldNode = fieldNodes[field.name]; if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { if (field.defaultValue !== undefined) { coercedObj[field.name] = field.defaultValue; } else if ((0, _definition.isNonNullType)(field.type)) { return; // Invalid: intentionally return no value. } continue; } var fieldValue = valueFromAST(fieldNode.value, field.type, variables); if ((0, _isInvalid.default)(fieldValue)) { return; // Invalid: intentionally return no value. } coercedObj[field.name] = fieldValue; } return coercedObj; } if ((0, _definition.isEnumType)(type)) { if (valueNode.kind !== _kinds.Kind.ENUM) { return; // Invalid: intentionally return no value. } var enumValue = type.getValue(valueNode.value); if (!enumValue) { return; // Invalid: intentionally return no value. } return enumValue.value; } /* istanbul ignore else */ if ((0, _definition.isScalarType)(type)) { // Scalars fulfill parsing a literal value via parseLiteral(). // Invalid values represent a failure to parse correctly, in which case // no value is returned. var result; try { result = type.parseLiteral(valueNode, variables); } catch (_error) { return; // Invalid: intentionally return no value. } if ((0, _isInvalid.default)(result)) { return; // Invalid: intentionally return no value. } return result; } // Not reachable. All possible input types have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected input type: ' + (0, _inspect.default)(type)); } // Returns true if the provided valueNode is a variable which is not defined // in the set of variables. function isMissingVariable(valueNode, variables) { return valueNode.kind === _kinds.Kind.VARIABLE && (!variables || (0, _isInvalid.default)(variables[valueNode.name.value])); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromASTUntyped.js": /*!************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/utilities/valueFromASTUntyped.js ***! \************************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export valueFromASTUntyped [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.valueFromASTUntyped = valueFromASTUntyped; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _invariant = _interopRequireDefault(__webpack_require__(/*! ../jsutils/invariant */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/invariant.js")); var _keyValMap = _interopRequireDefault(__webpack_require__(/*! ../jsutils/keyValMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyValMap.js")); var _isInvalid = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isInvalid */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isInvalid.js")); var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Produces a JavaScript value given a GraphQL Value AST. * * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value * will reflect the provided GraphQL value AST. * * | GraphQL Value | JavaScript Value | * | -------------------- | ---------------- | * | Input Object | Object | * | List | Array | * | Boolean | Boolean | * | String / Enum | String | * | Int / Float | Number | * | Null | null | * */ function valueFromASTUntyped(valueNode, variables) { switch (valueNode.kind) { case _kinds.Kind.NULL: return null; case _kinds.Kind.INT: return parseInt(valueNode.value, 10); case _kinds.Kind.FLOAT: return parseFloat(valueNode.value); case _kinds.Kind.STRING: case _kinds.Kind.ENUM: case _kinds.Kind.BOOLEAN: return valueNode.value; case _kinds.Kind.LIST: return valueNode.values.map(function (node) { return valueFromASTUntyped(node, variables); }); case _kinds.Kind.OBJECT: return (0, _keyValMap.default)(valueNode.fields, function (field) { return field.name.value; }, function (field) { return valueFromASTUntyped(field.value, variables); }); case _kinds.Kind.VARIABLE: { var variableName = valueNode.name.value; return variables && !(0, _isInvalid.default)(variables[variableName]) ? variables[variableName] : undefined; } } // Not reachable. All possible value nodes have been considered. /* istanbul ignore next */ (0, _invariant.default)(false, 'Unexpected value node: ' + (0, _inspect.default)(valueNode)); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/ValidationContext.js": /*!***********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/ValidationContext.js ***! \***********************************************************************************************/ /*! flagged exports */ /*! export ASTValidationContext [provided] [no usage info] [missing usage info prevents renaming] */ /*! export SDLValidationContext [provided] [no usage info] [missing usage info prevents renaming] */ /*! export ValidationContext [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ValidationContext = exports.SDLValidationContext = exports.ASTValidationContext = void 0; var _kinds = __webpack_require__(/*! ../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _visitor = __webpack_require__(/*! ../language/visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); var _TypeInfo = __webpack_require__(/*! ../utilities/TypeInfo */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/TypeInfo.js"); function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * An instance of this class is passed as the "this" context to all validators, * allowing access to commonly useful contextual information from within a * validation rule. */ var ASTValidationContext = /*#__PURE__*/ function () { function ASTValidationContext(ast, onError) { this._ast = ast; this._errors = []; this._fragments = undefined; this._fragmentSpreads = new Map(); this._recursivelyReferencedFragments = new Map(); this._onError = onError; } var _proto = ASTValidationContext.prototype; _proto.reportError = function reportError(error) { this._errors.push(error); if (this._onError) { this._onError(error); } } // @deprecated: use onError callback instead - will be removed in v15. ; _proto.getErrors = function getErrors() { return this._errors; }; _proto.getDocument = function getDocument() { return this._ast; }; _proto.getFragment = function getFragment(name) { var fragments = this._fragments; if (!fragments) { this._fragments = fragments = this.getDocument().definitions.reduce(function (frags, statement) { if (statement.kind === _kinds.Kind.FRAGMENT_DEFINITION) { frags[statement.name.value] = statement; } return frags; }, Object.create(null)); } return fragments[name]; }; _proto.getFragmentSpreads = function getFragmentSpreads(node) { var spreads = this._fragmentSpreads.get(node); if (!spreads) { spreads = []; var setsToVisit = [node]; while (setsToVisit.length !== 0) { var set = setsToVisit.pop(); for (var _i2 = 0, _set$selections2 = set.selections; _i2 < _set$selections2.length; _i2++) { var selection = _set$selections2[_i2]; if (selection.kind === _kinds.Kind.FRAGMENT_SPREAD) { spreads.push(selection); } else if (selection.selectionSet) { setsToVisit.push(selection.selectionSet); } } } this._fragmentSpreads.set(node, spreads); } return spreads; }; _proto.getRecursivelyReferencedFragments = function getRecursivelyReferencedFragments(operation) { var fragments = this._recursivelyReferencedFragments.get(operation); if (!fragments) { fragments = []; var collectedNames = Object.create(null); var nodesToVisit = [operation.selectionSet]; while (nodesToVisit.length !== 0) { var node = nodesToVisit.pop(); for (var _i4 = 0, _this$getFragmentSpre2 = this.getFragmentSpreads(node); _i4 < _this$getFragmentSpre2.length; _i4++) { var spread = _this$getFragmentSpre2[_i4]; var fragName = spread.name.value; if (collectedNames[fragName] !== true) { collectedNames[fragName] = true; var fragment = this.getFragment(fragName); if (fragment) { fragments.push(fragment); nodesToVisit.push(fragment.selectionSet); } } } } this._recursivelyReferencedFragments.set(operation, fragments); } return fragments; }; return ASTValidationContext; }(); exports.ASTValidationContext = ASTValidationContext; var SDLValidationContext = /*#__PURE__*/ function (_ASTValidationContext) { _inheritsLoose(SDLValidationContext, _ASTValidationContext); function SDLValidationContext(ast, schema, onError) { var _this; _this = _ASTValidationContext.call(this, ast, onError) || this; _this._schema = schema; return _this; } var _proto2 = SDLValidationContext.prototype; _proto2.getSchema = function getSchema() { return this._schema; }; return SDLValidationContext; }(ASTValidationContext); exports.SDLValidationContext = SDLValidationContext; var ValidationContext = /*#__PURE__*/ function (_ASTValidationContext2) { _inheritsLoose(ValidationContext, _ASTValidationContext2); function ValidationContext(schema, ast, typeInfo, onError) { var _this2; _this2 = _ASTValidationContext2.call(this, ast, onError) || this; _this2._schema = schema; _this2._typeInfo = typeInfo; _this2._variableUsages = new Map(); _this2._recursiveVariableUsages = new Map(); return _this2; } var _proto3 = ValidationContext.prototype; _proto3.getSchema = function getSchema() { return this._schema; }; _proto3.getVariableUsages = function getVariableUsages(node) { var usages = this._variableUsages.get(node); if (!usages) { var newUsages = []; var typeInfo = new _TypeInfo.TypeInfo(this._schema); (0, _visitor.visit)(node, (0, _visitor.visitWithTypeInfo)(typeInfo, { VariableDefinition: function VariableDefinition() { return false; }, Variable: function Variable(variable) { newUsages.push({ node: variable, type: typeInfo.getInputType(), defaultValue: typeInfo.getDefaultValue() }); } })); usages = newUsages; this._variableUsages.set(node, usages); } return usages; }; _proto3.getRecursiveVariableUsages = function getRecursiveVariableUsages(operation) { var usages = this._recursiveVariableUsages.get(operation); if (!usages) { usages = this.getVariableUsages(operation); for (var _i6 = 0, _this$getRecursivelyR2 = this.getRecursivelyReferencedFragments(operation); _i6 < _this$getRecursivelyR2.length; _i6++) { var frag = _this$getRecursivelyR2[_i6]; usages = usages.concat(this.getVariableUsages(frag)); } this._recursiveVariableUsages.set(operation, usages); } return usages; }; _proto3.getType = function getType() { return this._typeInfo.getType(); }; _proto3.getParentType = function getParentType() { return this._typeInfo.getParentType(); }; _proto3.getInputType = function getInputType() { return this._typeInfo.getInputType(); }; _proto3.getParentInputType = function getParentInputType() { return this._typeInfo.getParentInputType(); }; _proto3.getFieldDef = function getFieldDef() { return this._typeInfo.getFieldDef(); }; _proto3.getDirective = function getDirective() { return this._typeInfo.getDirective(); }; _proto3.getArgument = function getArgument() { return this._typeInfo.getArgument(); }; return ValidationContext; }(ASTValidationContext); exports.ValidationContext = ValidationContext; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js": /*!***********************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/index.js ***! \***********************************************************************************/ /*! flagged exports */ /*! export ExecutableDefinitionsRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export FieldsOnCorrectTypeRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export FragmentsOnCompositeTypesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export KnownArgumentNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export KnownDirectivesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export KnownFragmentNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export KnownTypeNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export LoneAnonymousOperationRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export LoneSchemaDefinitionRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export NoFragmentCyclesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export NoUndefinedVariablesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export NoUnusedFragmentsRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export NoUnusedVariablesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export OverlappingFieldsCanBeMergedRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export PossibleFragmentSpreadsRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export PossibleTypeExtensionsRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export ProvidedRequiredArgumentsRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export ScalarLeafsRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export SingleFieldSubscriptionsRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueArgumentNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueDirectiveNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueDirectivesPerLocationRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueEnumValueNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueFieldDefinitionNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueFragmentNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueInputFieldNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueOperationNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueOperationTypesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueTypeNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export UniqueVariableNamesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export ValidationContext [provided] [no usage info] [missing usage info prevents renaming] */ /*! export ValuesOfCorrectTypeRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export VariablesAreInputTypesRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export VariablesInAllowedPositionRule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export specifiedRules [provided] [no usage info] [missing usage info prevents renaming] */ /*! export validate [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "validate", ({ enumerable: true, get: function get() { return _validate.validate; } })); Object.defineProperty(exports, "ValidationContext", ({ enumerable: true, get: function get() { return _ValidationContext.ValidationContext; } })); Object.defineProperty(exports, "specifiedRules", ({ enumerable: true, get: function get() { return _specifiedRules.specifiedRules; } })); Object.defineProperty(exports, "ExecutableDefinitionsRule", ({ enumerable: true, get: function get() { return _ExecutableDefinitions.ExecutableDefinitions; } })); Object.defineProperty(exports, "FieldsOnCorrectTypeRule", ({ enumerable: true, get: function get() { return _FieldsOnCorrectType.FieldsOnCorrectType; } })); Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", ({ enumerable: true, get: function get() { return _FragmentsOnCompositeTypes.FragmentsOnCompositeTypes; } })); Object.defineProperty(exports, "KnownArgumentNamesRule", ({ enumerable: true, get: function get() { return _KnownArgumentNames.KnownArgumentNames; } })); Object.defineProperty(exports, "KnownDirectivesRule", ({ enumerable: true, get: function get() { return _KnownDirectives.KnownDirectives; } })); Object.defineProperty(exports, "KnownFragmentNamesRule", ({ enumerable: true, get: function get() { return _KnownFragmentNames.KnownFragmentNames; } })); Object.defineProperty(exports, "KnownTypeNamesRule", ({ enumerable: true, get: function get() { return _KnownTypeNames.KnownTypeNames; } })); Object.defineProperty(exports, "LoneAnonymousOperationRule", ({ enumerable: true, get: function get() { return _LoneAnonymousOperation.LoneAnonymousOperation; } })); Object.defineProperty(exports, "NoFragmentCyclesRule", ({ enumerable: true, get: function get() { return _NoFragmentCycles.NoFragmentCycles; } })); Object.defineProperty(exports, "NoUndefinedVariablesRule", ({ enumerable: true, get: function get() { return _NoUndefinedVariables.NoUndefinedVariables; } })); Object.defineProperty(exports, "NoUnusedFragmentsRule", ({ enumerable: true, get: function get() { return _NoUnusedFragments.NoUnusedFragments; } })); Object.defineProperty(exports, "NoUnusedVariablesRule", ({ enumerable: true, get: function get() { return _NoUnusedVariables.NoUnusedVariables; } })); Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", ({ enumerable: true, get: function get() { return _OverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged; } })); Object.defineProperty(exports, "PossibleFragmentSpreadsRule", ({ enumerable: true, get: function get() { return _PossibleFragmentSpreads.PossibleFragmentSpreads; } })); Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", ({ enumerable: true, get: function get() { return _ProvidedRequiredArguments.ProvidedRequiredArguments; } })); Object.defineProperty(exports, "ScalarLeafsRule", ({ enumerable: true, get: function get() { return _ScalarLeafs.ScalarLeafs; } })); Object.defineProperty(exports, "SingleFieldSubscriptionsRule", ({ enumerable: true, get: function get() { return _SingleFieldSubscriptions.SingleFieldSubscriptions; } })); Object.defineProperty(exports, "UniqueArgumentNamesRule", ({ enumerable: true, get: function get() { return _UniqueArgumentNames.UniqueArgumentNames; } })); Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", ({ enumerable: true, get: function get() { return _UniqueDirectivesPerLocation.UniqueDirectivesPerLocation; } })); Object.defineProperty(exports, "UniqueFragmentNamesRule", ({ enumerable: true, get: function get() { return _UniqueFragmentNames.UniqueFragmentNames; } })); Object.defineProperty(exports, "UniqueInputFieldNamesRule", ({ enumerable: true, get: function get() { return _UniqueInputFieldNames.UniqueInputFieldNames; } })); Object.defineProperty(exports, "UniqueOperationNamesRule", ({ enumerable: true, get: function get() { return _UniqueOperationNames.UniqueOperationNames; } })); Object.defineProperty(exports, "UniqueVariableNamesRule", ({ enumerable: true, get: function get() { return _UniqueVariableNames.UniqueVariableNames; } })); Object.defineProperty(exports, "ValuesOfCorrectTypeRule", ({ enumerable: true, get: function get() { return _ValuesOfCorrectType.ValuesOfCorrectType; } })); Object.defineProperty(exports, "VariablesAreInputTypesRule", ({ enumerable: true, get: function get() { return _VariablesAreInputTypes.VariablesAreInputTypes; } })); Object.defineProperty(exports, "VariablesInAllowedPositionRule", ({ enumerable: true, get: function get() { return _VariablesInAllowedPosition.VariablesInAllowedPosition; } })); Object.defineProperty(exports, "LoneSchemaDefinitionRule", ({ enumerable: true, get: function get() { return _LoneSchemaDefinition.LoneSchemaDefinition; } })); Object.defineProperty(exports, "UniqueOperationTypesRule", ({ enumerable: true, get: function get() { return _UniqueOperationTypes.UniqueOperationTypes; } })); Object.defineProperty(exports, "UniqueTypeNamesRule", ({ enumerable: true, get: function get() { return _UniqueTypeNames.UniqueTypeNames; } })); Object.defineProperty(exports, "UniqueEnumValueNamesRule", ({ enumerable: true, get: function get() { return _UniqueEnumValueNames.UniqueEnumValueNames; } })); Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", ({ enumerable: true, get: function get() { return _UniqueFieldDefinitionNames.UniqueFieldDefinitionNames; } })); Object.defineProperty(exports, "UniqueDirectiveNamesRule", ({ enumerable: true, get: function get() { return _UniqueDirectiveNames.UniqueDirectiveNames; } })); Object.defineProperty(exports, "PossibleTypeExtensionsRule", ({ enumerable: true, get: function get() { return _PossibleTypeExtensions.PossibleTypeExtensions; } })); var _validate = __webpack_require__(/*! ./validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/validate.js"); var _ValidationContext = __webpack_require__(/*! ./ValidationContext */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/ValidationContext.js"); var _specifiedRules = __webpack_require__(/*! ./specifiedRules */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/specifiedRules.js"); var _ExecutableDefinitions = __webpack_require__(/*! ./rules/ExecutableDefinitions */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ExecutableDefinitions.js"); var _FieldsOnCorrectType = __webpack_require__(/*! ./rules/FieldsOnCorrectType */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FieldsOnCorrectType.js"); var _FragmentsOnCompositeTypes = __webpack_require__(/*! ./rules/FragmentsOnCompositeTypes */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js"); var _KnownArgumentNames = __webpack_require__(/*! ./rules/KnownArgumentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownArgumentNames.js"); var _KnownDirectives = __webpack_require__(/*! ./rules/KnownDirectives */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownDirectives.js"); var _KnownFragmentNames = __webpack_require__(/*! ./rules/KnownFragmentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownFragmentNames.js"); var _KnownTypeNames = __webpack_require__(/*! ./rules/KnownTypeNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownTypeNames.js"); var _LoneAnonymousOperation = __webpack_require__(/*! ./rules/LoneAnonymousOperation */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneAnonymousOperation.js"); var _NoFragmentCycles = __webpack_require__(/*! ./rules/NoFragmentCycles */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoFragmentCycles.js"); var _NoUndefinedVariables = __webpack_require__(/*! ./rules/NoUndefinedVariables */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUndefinedVariables.js"); var _NoUnusedFragments = __webpack_require__(/*! ./rules/NoUnusedFragments */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedFragments.js"); var _NoUnusedVariables = __webpack_require__(/*! ./rules/NoUnusedVariables */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedVariables.js"); var _OverlappingFieldsCanBeMerged = __webpack_require__(/*! ./rules/OverlappingFieldsCanBeMerged */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js"); var _PossibleFragmentSpreads = __webpack_require__(/*! ./rules/PossibleFragmentSpreads */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js"); var _ProvidedRequiredArguments = __webpack_require__(/*! ./rules/ProvidedRequiredArguments */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js"); var _ScalarLeafs = __webpack_require__(/*! ./rules/ScalarLeafs */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ScalarLeafs.js"); var _SingleFieldSubscriptions = __webpack_require__(/*! ./rules/SingleFieldSubscriptions */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js"); var _UniqueArgumentNames = __webpack_require__(/*! ./rules/UniqueArgumentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueArgumentNames.js"); var _UniqueDirectivesPerLocation = __webpack_require__(/*! ./rules/UniqueDirectivesPerLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js"); var _UniqueFragmentNames = __webpack_require__(/*! ./rules/UniqueFragmentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFragmentNames.js"); var _UniqueInputFieldNames = __webpack_require__(/*! ./rules/UniqueInputFieldNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueInputFieldNames.js"); var _UniqueOperationNames = __webpack_require__(/*! ./rules/UniqueOperationNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationNames.js"); var _UniqueVariableNames = __webpack_require__(/*! ./rules/UniqueVariableNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueVariableNames.js"); var _ValuesOfCorrectType = __webpack_require__(/*! ./rules/ValuesOfCorrectType */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ValuesOfCorrectType.js"); var _VariablesAreInputTypes = __webpack_require__(/*! ./rules/VariablesAreInputTypes */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesAreInputTypes.js"); var _VariablesInAllowedPosition = __webpack_require__(/*! ./rules/VariablesInAllowedPosition */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js"); var _LoneSchemaDefinition = __webpack_require__(/*! ./rules/LoneSchemaDefinition */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneSchemaDefinition.js"); var _UniqueOperationTypes = __webpack_require__(/*! ./rules/UniqueOperationTypes */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationTypes.js"); var _UniqueTypeNames = __webpack_require__(/*! ./rules/UniqueTypeNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueTypeNames.js"); var _UniqueEnumValueNames = __webpack_require__(/*! ./rules/UniqueEnumValueNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueEnumValueNames.js"); var _UniqueFieldDefinitionNames = __webpack_require__(/*! ./rules/UniqueFieldDefinitionNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js"); var _UniqueDirectiveNames = __webpack_require__(/*! ./rules/UniqueDirectiveNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectiveNames.js"); var _PossibleTypeExtensions = __webpack_require__(/*! ./rules/PossibleTypeExtensions */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleTypeExtensions.js"); /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ExecutableDefinitions.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ExecutableDefinitions.js ***! \*********************************************************************************************************/ /*! flagged exports */ /*! export ExecutableDefinitions [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export nonExecutableDefinitionMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.nonExecutableDefinitionMessage = nonExecutableDefinitionMessage; exports.ExecutableDefinitions = ExecutableDefinitions; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _predicates = __webpack_require__(/*! ../../language/predicates */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js"); function nonExecutableDefinitionMessage(defName) { return "The ".concat(defName, " definition is not executable."); } /** * Executable definitions * * A GraphQL document is only valid for execution if all definitions are either * operation or fragment definitions. */ function ExecutableDefinitions(context) { return { Document: function Document(node) { for (var _i2 = 0, _node$definitions2 = node.definitions; _i2 < _node$definitions2.length; _i2++) { var definition = _node$definitions2[_i2]; if (!(0, _predicates.isExecutableDefinitionNode)(definition)) { context.reportError(new _GraphQLError.GraphQLError(nonExecutableDefinitionMessage(definition.kind === _kinds.Kind.SCHEMA_DEFINITION || definition.kind === _kinds.Kind.SCHEMA_EXTENSION ? 'schema' : definition.name.value), definition)); } } return false; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FieldsOnCorrectType.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FieldsOnCorrectType.js ***! \*******************************************************************************************************/ /*! flagged exports */ /*! export FieldsOnCorrectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export undefinedFieldMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.undefinedFieldMessage = undefinedFieldMessage; exports.FieldsOnCorrectType = FieldsOnCorrectType; var _didYouMean = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/didYouMean */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js")); var _suggestionList = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/suggestionList */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function undefinedFieldMessage(fieldName, type, suggestedTypeNames, suggestedFieldNames) { var quotedTypeNames = suggestedTypeNames.map(function (x) { return "\"".concat(x, "\""); }); var quotedFieldNames = suggestedFieldNames.map(function (x) { return "\"".concat(x, "\""); }); return "Cannot query field \"".concat(fieldName, "\" on type \"").concat(type, "\".") + ((0, _didYouMean.default)('to use an inline fragment on', quotedTypeNames) || (0, _didYouMean.default)(quotedFieldNames)); } /** * Fields on correct type * * A GraphQL document is only valid if all fields selected are defined by the * parent type, or are an allowed meta field such as __typename. */ function FieldsOnCorrectType(context) { return { Field: function Field(node) { var type = context.getParentType(); if (type) { var fieldDef = context.getFieldDef(); if (!fieldDef) { // This field doesn't exist, lets look for suggestions. var schema = context.getSchema(); var fieldName = node.name.value; // First determine if there are any suggested types to condition on. var suggestedTypeNames = getSuggestedTypeNames(schema, type, fieldName); // If there are no suggested types, then perhaps this was a typo? var suggestedFieldNames = suggestedTypeNames.length !== 0 ? [] : getSuggestedFieldNames(schema, type, fieldName); // Report an error, including helpful suggestions. context.reportError(new _GraphQLError.GraphQLError(undefinedFieldMessage(fieldName, type.name, suggestedTypeNames, suggestedFieldNames), node)); } } } }; } /** * Go through all of the implementations of type, as well as the interfaces that * they implement. If any of those types include the provided field, suggest * them, sorted by how often the type is referenced, starting with Interfaces. */ function getSuggestedTypeNames(schema, type, fieldName) { if ((0, _definition.isAbstractType)(type)) { var suggestedObjectTypes = []; var interfaceUsageCount = Object.create(null); for (var _i2 = 0, _schema$getPossibleTy2 = schema.getPossibleTypes(type); _i2 < _schema$getPossibleTy2.length; _i2++) { var possibleType = _schema$getPossibleTy2[_i2]; if (!possibleType.getFields()[fieldName]) { continue; } // This object type defines this field. suggestedObjectTypes.push(possibleType.name); for (var _i4 = 0, _possibleType$getInte2 = possibleType.getInterfaces(); _i4 < _possibleType$getInte2.length; _i4++) { var possibleInterface = _possibleType$getInte2[_i4]; if (!possibleInterface.getFields()[fieldName]) { continue; } // This interface type defines this field. interfaceUsageCount[possibleInterface.name] = (interfaceUsageCount[possibleInterface.name] || 0) + 1; } } // Suggest interface types based on how common they are. var suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort(function (a, b) { return interfaceUsageCount[b] - interfaceUsageCount[a]; }); // Suggest both interface and object types. return suggestedInterfaceTypes.concat(suggestedObjectTypes); } // Otherwise, must be an Object type, which does not have possible fields. return []; } /** * For the field name provided, determine if there are any similar field names * that may be the result of a typo. */ function getSuggestedFieldNames(schema, type, fieldName) { if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { var possibleFieldNames = Object.keys(type.getFields()); return (0, _suggestionList.default)(fieldName, possibleFieldNames); } // Otherwise, must be a Union type, which does not define fields. return []; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js": /*!*************************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js ***! \*************************************************************************************************************/ /*! flagged exports */ /*! export FragmentsOnCompositeTypes [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export fragmentOnNonCompositeErrorMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export inlineFragmentOnNonCompositeErrorMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.inlineFragmentOnNonCompositeErrorMessage = inlineFragmentOnNonCompositeErrorMessage; exports.fragmentOnNonCompositeErrorMessage = fragmentOnNonCompositeErrorMessage; exports.FragmentsOnCompositeTypes = FragmentsOnCompositeTypes; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _printer = __webpack_require__(/*! ../../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); function inlineFragmentOnNonCompositeErrorMessage(type) { return "Fragment cannot condition on non composite type \"".concat(type, "\"."); } function fragmentOnNonCompositeErrorMessage(fragName, type) { return "Fragment \"".concat(fragName, "\" cannot condition on non composite type \"").concat(type, "\"."); } /** * Fragments on composite type * * Fragments use a type condition to determine if they apply, since fragments * can only be spread into a composite type (object, interface, or union), the * type condition must also be a composite type. */ function FragmentsOnCompositeTypes(context) { return { InlineFragment: function InlineFragment(node) { var typeCondition = node.typeCondition; if (typeCondition) { var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition); if (type && !(0, _definition.isCompositeType)(type)) { context.reportError(new _GraphQLError.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0, _printer.print)(typeCondition)), typeCondition)); } } }, FragmentDefinition: function FragmentDefinition(node) { var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.typeCondition); if (type && !(0, _definition.isCompositeType)(type)) { context.reportError(new _GraphQLError.GraphQLError(fragmentOnNonCompositeErrorMessage(node.name.value, (0, _printer.print)(node.typeCondition)), node.typeCondition)); } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownArgumentNames.js": /*!******************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownArgumentNames.js ***! \******************************************************************************************************/ /*! flagged exports */ /*! export KnownArgumentNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export KnownArgumentNamesOnDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unknownArgMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unknownDirectiveArgMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unknownArgMessage = unknownArgMessage; exports.unknownDirectiveArgMessage = unknownDirectiveArgMessage; exports.KnownArgumentNames = KnownArgumentNames; exports.KnownArgumentNamesOnDirectives = KnownArgumentNamesOnDirectives; var _didYouMean = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/didYouMean */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js")); var _suggestionList = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/suggestionList */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _directives = __webpack_require__(/*! ../../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function unknownArgMessage(argName, fieldName, typeName, suggestedArgs) { return "Unknown argument \"".concat(argName, "\" on field \"").concat(fieldName, "\" of type \"").concat(typeName, "\".") + (0, _didYouMean.default)(suggestedArgs.map(function (x) { return "\"".concat(x, "\""); })); } function unknownDirectiveArgMessage(argName, directiveName, suggestedArgs) { return "Unknown argument \"".concat(argName, "\" on directive \"@").concat(directiveName, "\".") + (0, _didYouMean.default)(suggestedArgs.map(function (x) { return "\"".concat(x, "\""); })); } /** * Known argument names * * A GraphQL field is only valid if all supplied arguments are defined by * that field. */ function KnownArgumentNames(context) { return _objectSpread({}, KnownArgumentNamesOnDirectives(context), { Argument: function Argument(argNode) { var argDef = context.getArgument(); var fieldDef = context.getFieldDef(); var parentType = context.getParentType(); if (!argDef && fieldDef && parentType) { var argName = argNode.name.value; var knownArgsNames = fieldDef.args.map(function (arg) { return arg.name; }); context.reportError(new _GraphQLError.GraphQLError(unknownArgMessage(argName, fieldDef.name, parentType.name, (0, _suggestionList.default)(argName, knownArgsNames)), argNode)); } } }); } // @internal function KnownArgumentNamesOnDirectives(context) { var directiveArgs = Object.create(null); var schema = context.getSchema(); var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { var directive = definedDirectives[_i2]; directiveArgs[directive.name] = directive.args.map(function (arg) { return arg.name; }); } var astDefinitions = context.getDocument().definitions; for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { var def = astDefinitions[_i4]; if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { directiveArgs[def.name.value] = def.arguments ? def.arguments.map(function (arg) { return arg.name.value; }) : []; } } return { Directive: function Directive(directiveNode) { var directiveName = directiveNode.name.value; var knownArgs = directiveArgs[directiveName]; if (directiveNode.arguments && knownArgs) { for (var _i6 = 0, _directiveNode$argume2 = directiveNode.arguments; _i6 < _directiveNode$argume2.length; _i6++) { var argNode = _directiveNode$argume2[_i6]; var argName = argNode.name.value; if (knownArgs.indexOf(argName) === -1) { var suggestions = (0, _suggestionList.default)(argName, knownArgs); context.reportError(new _GraphQLError.GraphQLError(unknownDirectiveArgMessage(argName, directiveName, suggestions), argNode)); } } } return false; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownDirectives.js": /*!***************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownDirectives.js ***! \***************************************************************************************************/ /*! flagged exports */ /*! export KnownDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export misplacedDirectiveMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unknownDirectiveMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unknownDirectiveMessage = unknownDirectiveMessage; exports.misplacedDirectiveMessage = misplacedDirectiveMessage; exports.KnownDirectives = KnownDirectives; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _directiveLocation = __webpack_require__(/*! ../../language/directiveLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/directiveLocation.js"); var _directives = __webpack_require__(/*! ../../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); function unknownDirectiveMessage(directiveName) { return "Unknown directive \"".concat(directiveName, "\"."); } function misplacedDirectiveMessage(directiveName, location) { return "Directive \"".concat(directiveName, "\" may not be used on ").concat(location, "."); } /** * Known directives * * A GraphQL document is only valid if all `@directives` are known by the * schema and legally positioned. */ function KnownDirectives(context) { var locationsMap = Object.create(null); var schema = context.getSchema(); var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { var directive = definedDirectives[_i2]; locationsMap[directive.name] = directive.locations; } var astDefinitions = context.getDocument().definitions; for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { var def = astDefinitions[_i4]; if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { locationsMap[def.name.value] = def.locations.map(function (name) { return name.value; }); } } return { Directive: function Directive(node, key, parent, path, ancestors) { var name = node.name.value; var locations = locationsMap[name]; if (!locations) { context.reportError(new _GraphQLError.GraphQLError(unknownDirectiveMessage(name), node)); return; } var candidateLocation = getDirectiveLocationForASTPath(ancestors); if (candidateLocation && locations.indexOf(candidateLocation) === -1) { context.reportError(new _GraphQLError.GraphQLError(misplacedDirectiveMessage(name, candidateLocation), node)); } } }; } function getDirectiveLocationForASTPath(ancestors) { var appliedTo = ancestors[ancestors.length - 1]; if (!Array.isArray(appliedTo)) { switch (appliedTo.kind) { case _kinds.Kind.OPERATION_DEFINITION: switch (appliedTo.operation) { case 'query': return _directiveLocation.DirectiveLocation.QUERY; case 'mutation': return _directiveLocation.DirectiveLocation.MUTATION; case 'subscription': return _directiveLocation.DirectiveLocation.SUBSCRIPTION; } break; case _kinds.Kind.FIELD: return _directiveLocation.DirectiveLocation.FIELD; case _kinds.Kind.FRAGMENT_SPREAD: return _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD; case _kinds.Kind.INLINE_FRAGMENT: return _directiveLocation.DirectiveLocation.INLINE_FRAGMENT; case _kinds.Kind.FRAGMENT_DEFINITION: return _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION; case _kinds.Kind.VARIABLE_DEFINITION: return _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION; case _kinds.Kind.SCHEMA_DEFINITION: case _kinds.Kind.SCHEMA_EXTENSION: return _directiveLocation.DirectiveLocation.SCHEMA; case _kinds.Kind.SCALAR_TYPE_DEFINITION: case _kinds.Kind.SCALAR_TYPE_EXTENSION: return _directiveLocation.DirectiveLocation.SCALAR; case _kinds.Kind.OBJECT_TYPE_DEFINITION: case _kinds.Kind.OBJECT_TYPE_EXTENSION: return _directiveLocation.DirectiveLocation.OBJECT; case _kinds.Kind.FIELD_DEFINITION: return _directiveLocation.DirectiveLocation.FIELD_DEFINITION; case _kinds.Kind.INTERFACE_TYPE_DEFINITION: case _kinds.Kind.INTERFACE_TYPE_EXTENSION: return _directiveLocation.DirectiveLocation.INTERFACE; case _kinds.Kind.UNION_TYPE_DEFINITION: case _kinds.Kind.UNION_TYPE_EXTENSION: return _directiveLocation.DirectiveLocation.UNION; case _kinds.Kind.ENUM_TYPE_DEFINITION: case _kinds.Kind.ENUM_TYPE_EXTENSION: return _directiveLocation.DirectiveLocation.ENUM; case _kinds.Kind.ENUM_VALUE_DEFINITION: return _directiveLocation.DirectiveLocation.ENUM_VALUE; case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: return _directiveLocation.DirectiveLocation.INPUT_OBJECT; case _kinds.Kind.INPUT_VALUE_DEFINITION: { var parentNode = ancestors[ancestors.length - 3]; return parentNode.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION ? _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION : _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION; } } } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownFragmentNames.js": /*!******************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownFragmentNames.js ***! \******************************************************************************************************/ /*! flagged exports */ /*! export KnownFragmentNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unknownFragmentMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unknownFragmentMessage = unknownFragmentMessage; exports.KnownFragmentNames = KnownFragmentNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function unknownFragmentMessage(fragName) { return "Unknown fragment \"".concat(fragName, "\"."); } /** * Known fragment names * * A GraphQL document is only valid if all `...Fragment` fragment spreads refer * to fragments defined in the same document. */ function KnownFragmentNames(context) { return { FragmentSpread: function FragmentSpread(node) { var fragmentName = node.name.value; var fragment = context.getFragment(fragmentName); if (!fragment) { context.reportError(new _GraphQLError.GraphQLError(unknownFragmentMessage(fragmentName), node.name)); } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownTypeNames.js": /*!**************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownTypeNames.js ***! \**************************************************************************************************/ /*! flagged exports */ /*! export KnownTypeNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unknownTypeMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unknownTypeMessage = unknownTypeMessage; exports.KnownTypeNames = KnownTypeNames; var _didYouMean = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/didYouMean */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js")); var _suggestionList = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/suggestionList */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _predicates = __webpack_require__(/*! ../../language/predicates */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js"); var _scalars = __webpack_require__(/*! ../../type/scalars */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/scalars.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function unknownTypeMessage(typeName, suggestedTypes) { return "Unknown type \"".concat(typeName, "\".") + (0, _didYouMean.default)(suggestedTypes.map(function (x) { return "\"".concat(x, "\""); })); } /** * Known type names * * A GraphQL document is only valid if referenced types (specifically * variable definitions and fragment conditions) are defined by the type schema. */ function KnownTypeNames(context) { var schema = context.getSchema(); var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); var definedTypes = Object.create(null); for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) { var def = _context$getDocument$2[_i2]; if ((0, _predicates.isTypeDefinitionNode)(def)) { definedTypes[def.name.value] = true; } } var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes)); return { NamedType: function NamedType(node, _1, parent, _2, ancestors) { var typeName = node.name.value; if (!existingTypesMap[typeName] && !definedTypes[typeName]) { var definitionNode = ancestors[2] || parent; var isSDL = isSDLNode(definitionNode); if (isSDL && isSpecifiedScalarName(typeName)) { return; } var suggestedTypes = (0, _suggestionList.default)(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames); context.reportError(new _GraphQLError.GraphQLError(unknownTypeMessage(typeName, suggestedTypes), node)); } } }; } var specifiedScalarsNames = _scalars.specifiedScalarTypes.map(function (type) { return type.name; }); function isSpecifiedScalarName(typeName) { return specifiedScalarsNames.indexOf(typeName) !== -1; } function isSDLNode(value) { return Boolean(value && !Array.isArray(value) && ((0, _predicates.isTypeSystemDefinitionNode)(value) || (0, _predicates.isTypeSystemExtensionNode)(value))); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneAnonymousOperation.js": /*!**********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneAnonymousOperation.js ***! \**********************************************************************************************************/ /*! flagged exports */ /*! export LoneAnonymousOperation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export anonOperationNotAloneMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.anonOperationNotAloneMessage = anonOperationNotAloneMessage; exports.LoneAnonymousOperation = LoneAnonymousOperation; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); function anonOperationNotAloneMessage() { return 'This anonymous operation must be the only defined operation.'; } /** * Lone anonymous operation * * A GraphQL document is only valid if when it contains an anonymous operation * (the query short-hand) that it contains only that one operation definition. */ function LoneAnonymousOperation(context) { var operationCount = 0; return { Document: function Document(node) { operationCount = node.definitions.filter(function (definition) { return definition.kind === _kinds.Kind.OPERATION_DEFINITION; }).length; }, OperationDefinition: function OperationDefinition(node) { if (!node.name && operationCount > 1) { context.reportError(new _GraphQLError.GraphQLError(anonOperationNotAloneMessage(), node)); } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneSchemaDefinition.js": /*!********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneSchemaDefinition.js ***! \********************************************************************************************************/ /*! flagged exports */ /*! export LoneSchemaDefinition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export canNotDefineSchemaWithinExtensionMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export schemaDefinitionNotAloneMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.schemaDefinitionNotAloneMessage = schemaDefinitionNotAloneMessage; exports.canNotDefineSchemaWithinExtensionMessage = canNotDefineSchemaWithinExtensionMessage; exports.LoneSchemaDefinition = LoneSchemaDefinition; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function schemaDefinitionNotAloneMessage() { return 'Must provide only one schema definition.'; } function canNotDefineSchemaWithinExtensionMessage() { return 'Cannot define a new schema within a schema extension.'; } /** * Lone Schema definition * * A GraphQL document is only valid if it contains only one schema definition. */ function LoneSchemaDefinition(context) { var oldSchema = context.getSchema(); var alreadyDefined = oldSchema && (oldSchema.astNode || oldSchema.getQueryType() || oldSchema.getMutationType() || oldSchema.getSubscriptionType()); var schemaDefinitionsCount = 0; return { SchemaDefinition: function SchemaDefinition(node) { if (alreadyDefined) { context.reportError(new _GraphQLError.GraphQLError(canNotDefineSchemaWithinExtensionMessage(), node)); return; } if (schemaDefinitionsCount > 0) { context.reportError(new _GraphQLError.GraphQLError(schemaDefinitionNotAloneMessage(), node)); } ++schemaDefinitionsCount; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoFragmentCycles.js": /*!****************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoFragmentCycles.js ***! \****************************************************************************************************/ /*! flagged exports */ /*! export NoFragmentCycles [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export cycleErrorMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.cycleErrorMessage = cycleErrorMessage; exports.NoFragmentCycles = NoFragmentCycles; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function cycleErrorMessage(fragName, spreadNames) { var via = spreadNames.length ? ' via ' + spreadNames.join(', ') : ''; return "Cannot spread fragment \"".concat(fragName, "\" within itself").concat(via, "."); } function NoFragmentCycles(context) { // Tracks already visited fragments to maintain O(N) and to ensure that cycles // are not redundantly reported. var visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors var spreadPath = []; // Position in the spread path var spreadPathIndexByName = Object.create(null); return { OperationDefinition: function OperationDefinition() { return false; }, FragmentDefinition: function FragmentDefinition(node) { detectCycleRecursive(node); return false; } }; // This does a straight-forward DFS to find cycles. // It does not terminate when a cycle was found but continues to explore // the graph to find all possible cycles. function detectCycleRecursive(fragment) { if (visitedFrags[fragment.name.value]) { return; } var fragmentName = fragment.name.value; visitedFrags[fragmentName] = true; var spreadNodes = context.getFragmentSpreads(fragment.selectionSet); if (spreadNodes.length === 0) { return; } spreadPathIndexByName[fragmentName] = spreadPath.length; for (var _i2 = 0; _i2 < spreadNodes.length; _i2++) { var spreadNode = spreadNodes[_i2]; var spreadName = spreadNode.name.value; var cycleIndex = spreadPathIndexByName[spreadName]; spreadPath.push(spreadNode); if (cycleIndex === undefined) { var spreadFragment = context.getFragment(spreadName); if (spreadFragment) { detectCycleRecursive(spreadFragment); } } else { var cyclePath = spreadPath.slice(cycleIndex); var fragmentNames = cyclePath.slice(0, -1).map(function (s) { return s.name.value; }); context.reportError(new _GraphQLError.GraphQLError(cycleErrorMessage(spreadName, fragmentNames), cyclePath)); } spreadPath.pop(); } spreadPathIndexByName[fragmentName] = undefined; } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUndefinedVariables.js": /*!********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUndefinedVariables.js ***! \********************************************************************************************************/ /*! flagged exports */ /*! export NoUndefinedVariables [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export undefinedVarMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.undefinedVarMessage = undefinedVarMessage; exports.NoUndefinedVariables = NoUndefinedVariables; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function undefinedVarMessage(varName, opName) { return opName ? "Variable \"$".concat(varName, "\" is not defined by operation \"").concat(opName, "\".") : "Variable \"$".concat(varName, "\" is not defined."); } /** * No undefined variables * * A GraphQL operation is only valid if all variables encountered, both directly * and via fragment spreads, are defined by that operation. */ function NoUndefinedVariables(context) { var variableNameDefined = Object.create(null); return { OperationDefinition: { enter: function enter() { variableNameDefined = Object.create(null); }, leave: function leave(operation) { var usages = context.getRecursiveVariableUsages(operation); for (var _i2 = 0; _i2 < usages.length; _i2++) { var _ref2 = usages[_i2]; var node = _ref2.node; var varName = node.name.value; if (variableNameDefined[varName] !== true) { context.reportError(new _GraphQLError.GraphQLError(undefinedVarMessage(varName, operation.name && operation.name.value), [node, operation])); } } } }, VariableDefinition: function VariableDefinition(node) { variableNameDefined[node.variable.name.value] = true; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedFragments.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedFragments.js ***! \*****************************************************************************************************/ /*! flagged exports */ /*! export NoUnusedFragments [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unusedFragMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unusedFragMessage = unusedFragMessage; exports.NoUnusedFragments = NoUnusedFragments; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function unusedFragMessage(fragName) { return "Fragment \"".concat(fragName, "\" is never used."); } /** * No unused fragments * * A GraphQL document is only valid if all fragment definitions are spread * within operations, or spread within other fragments spread within operations. */ function NoUnusedFragments(context) { var operationDefs = []; var fragmentDefs = []; return { OperationDefinition: function OperationDefinition(node) { operationDefs.push(node); return false; }, FragmentDefinition: function FragmentDefinition(node) { fragmentDefs.push(node); return false; }, Document: { leave: function leave() { var fragmentNameUsed = Object.create(null); for (var _i2 = 0; _i2 < operationDefs.length; _i2++) { var operation = operationDefs[_i2]; for (var _i4 = 0, _context$getRecursive2 = context.getRecursivelyReferencedFragments(operation); _i4 < _context$getRecursive2.length; _i4++) { var fragment = _context$getRecursive2[_i4]; fragmentNameUsed[fragment.name.value] = true; } } for (var _i6 = 0; _i6 < fragmentDefs.length; _i6++) { var fragmentDef = fragmentDefs[_i6]; var fragName = fragmentDef.name.value; if (fragmentNameUsed[fragName] !== true) { context.reportError(new _GraphQLError.GraphQLError(unusedFragMessage(fragName), fragmentDef)); } } } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedVariables.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedVariables.js ***! \*****************************************************************************************************/ /*! flagged exports */ /*! export NoUnusedVariables [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unusedVariableMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unusedVariableMessage = unusedVariableMessage; exports.NoUnusedVariables = NoUnusedVariables; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function unusedVariableMessage(varName, opName) { return opName ? "Variable \"$".concat(varName, "\" is never used in operation \"").concat(opName, "\".") : "Variable \"$".concat(varName, "\" is never used."); } /** * No unused variables * * A GraphQL operation is only valid if all variables defined by an operation * are used, either directly or within a spread fragment. */ function NoUnusedVariables(context) { var variableDefs = []; return { OperationDefinition: { enter: function enter() { variableDefs = []; }, leave: function leave(operation) { var variableNameUsed = Object.create(null); var usages = context.getRecursiveVariableUsages(operation); var opName = operation.name ? operation.name.value : null; for (var _i2 = 0; _i2 < usages.length; _i2++) { var _ref2 = usages[_i2]; var node = _ref2.node; variableNameUsed[node.name.value] = true; } for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) { var variableDef = _variableDefs2[_i4]; var variableName = variableDef.variable.name.value; if (variableNameUsed[variableName] !== true) { context.reportError(new _GraphQLError.GraphQLError(unusedVariableMessage(variableName, opName), variableDef)); } } } }, VariableDefinition: function VariableDefinition(def) { variableDefs.push(def); } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js": /*!****************************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js ***! \****************************************************************************************************************/ /*! flagged exports */ /*! export OverlappingFieldsCanBeMerged [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export fieldsConflictMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fieldsConflictMessage = fieldsConflictMessage; exports.OverlappingFieldsCanBeMerged = OverlappingFieldsCanBeMerged; var _find = _interopRequireDefault(__webpack_require__(/*! ../../polyfills/find */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/find.js")); var _objectEntries3 = _interopRequireDefault(__webpack_require__(/*! ../../polyfills/objectEntries */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectEntries.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _printer = __webpack_require__(/*! ../../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function fieldsConflictMessage(responseName, reason) { return "Fields \"".concat(responseName, "\" conflict because ").concat(reasonMessage(reason), ". ") + 'Use different aliases on the fields to fetch both if this was intentional.'; } function reasonMessage(reason) { if (Array.isArray(reason)) { return reason.map(function (_ref) { var responseName = _ref[0], subreason = _ref[1]; return "subfields \"".concat(responseName, "\" conflict because ").concat(reasonMessage(subreason)); }).join(' and '); } return reason; } /** * Overlapping fields can be merged * * A selection set is only valid if all fields (including spreading any * fragments) either correspond to distinct response names or can be merged * without ambiguity. */ function OverlappingFieldsCanBeMerged(context) { // A memoization for when two fragments are compared "between" each other for // conflicts. Two fragments may be compared many times, so memoizing this can // dramatically improve the performance of this validator. var comparedFragmentPairs = new PairSet(); // A cache for the "field map" and list of fragment names found in any given // selection set. Selection sets may be asked for this information multiple // times, so this improves the performance of this validator. var cachedFieldsAndFragmentNames = new Map(); return { SelectionSet: function SelectionSet(selectionSet) { var conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, context.getParentType(), selectionSet); for (var _i2 = 0; _i2 < conflicts.length; _i2++) { var _ref3 = conflicts[_i2]; var _ref2$ = _ref3[0]; var responseName = _ref2$[0]; var reason = _ref2$[1]; var fields1 = _ref3[1]; var fields2 = _ref3[2]; context.reportError(new _GraphQLError.GraphQLError(fieldsConflictMessage(responseName, reason), fields1.concat(fields2))); } } }; } /** * Algorithm: * * Conflicts occur when two fields exist in a query which will produce the same * response name, but represent differing values, thus creating a conflict. * The algorithm below finds all conflicts via making a series of comparisons * between fields. In order to compare as few fields as possible, this makes * a series of comparisons "within" sets of fields and "between" sets of fields. * * Given any selection set, a collection produces both a set of fields by * also including all inline fragments, as well as a list of fragments * referenced by fragment spreads. * * A) Each selection set represented in the document first compares "within" its * collected set of fields, finding any conflicts between every pair of * overlapping fields. * Note: This is the *only time* that a the fields "within" a set are compared * to each other. After this only fields "between" sets are compared. * * B) Also, if any fragment is referenced in a selection set, then a * comparison is made "between" the original set of fields and the * referenced fragment. * * C) Also, if multiple fragments are referenced, then comparisons * are made "between" each referenced fragment. * * D) When comparing "between" a set of fields and a referenced fragment, first * a comparison is made between each field in the original set of fields and * each field in the the referenced set of fields. * * E) Also, if any fragment is referenced in the referenced selection set, * then a comparison is made "between" the original set of fields and the * referenced fragment (recursively referring to step D). * * F) When comparing "between" two fragments, first a comparison is made between * each field in the first referenced set of fields and each field in the the * second referenced set of fields. * * G) Also, any fragments referenced by the first must be compared to the * second, and any fragments referenced by the second must be compared to the * first (recursively referring to step F). * * H) When comparing two fields, if both have selection sets, then a comparison * is made "between" both selection sets, first comparing the set of fields in * the first selection set with the set of fields in the second. * * I) Also, if any fragment is referenced in either selection set, then a * comparison is made "between" the other set of fields and the * referenced fragment. * * J) Also, if two fragments are referenced in both selection sets, then a * comparison is made "between" the two fragments. * */ // Find all conflicts found "within" a selection set, including those found // via spreading in fragments. Called when visiting each SelectionSet in the // GraphQL Document. function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentType, selectionSet) { var conflicts = []; var _getFieldsAndFragment = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet), fieldMap = _getFieldsAndFragment[0], fragmentNames = _getFieldsAndFragment[1]; // (A) Find find all conflicts "within" the fields of this selection set. // Note: this is the *only place* `collectConflictsWithin` is called. collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap); if (fragmentNames.length !== 0) { // (B) Then collect conflicts between these fields and those represented by // each spread fragment name found. var comparedFragments = Object.create(null); for (var i = 0; i < fragmentNames.length; i++) { collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, false, fieldMap, fragmentNames[i]); // (C) Then compare this fragment with all other fragments found in this // selection set to collect conflicts between fragments spread together. // This compares each item in the list of fragment names to every other // item in that same list (except for itself). for (var j = i + 1; j < fragmentNames.length; j++) { collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fragmentNames[i], fragmentNames[j]); } } } return conflicts; } // Collect all conflicts found between a set of fields and a fragment reference // including via spreading in any nested fragments. function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { // Memoize so a fragment is not compared for conflicts more than once. if (comparedFragments[fragmentName]) { return; } comparedFragments[fragmentName] = true; var fragment = context.getFragment(fragmentName); if (!fragment) { return; } var _getReferencedFieldsA = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment), fieldMap2 = _getReferencedFieldsA[0], fragmentNames2 = _getReferencedFieldsA[1]; // Do not compare a fragment's fieldMap to itself. if (fieldMap === fieldMap2) { return; } // (D) First collect any conflicts between the provided collection of fields // and the collection of fields represented by the given fragment. collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fieldMap2); // (E) Then collect any conflicts between the provided collection of fields // and any fragment names found in the given fragment. for (var i = 0; i < fragmentNames2.length; i++) { collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentNames2[i]); } } // Collect all conflicts found between two fragments, including via spreading in // any nested fragments. function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2) { // No need to compare a fragment to itself. if (fragmentName1 === fragmentName2) { return; } // Memoize so two fragments are not compared for conflicts more than once. if (comparedFragmentPairs.has(fragmentName1, fragmentName2, areMutuallyExclusive)) { return; } comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); var fragment1 = context.getFragment(fragmentName1); var fragment2 = context.getFragment(fragmentName2); if (!fragment1 || !fragment2) { return; } var _getReferencedFieldsA2 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment1), fieldMap1 = _getReferencedFieldsA2[0], fragmentNames1 = _getReferencedFieldsA2[1]; var _getReferencedFieldsA3 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment2), fieldMap2 = _getReferencedFieldsA3[0], fragmentNames2 = _getReferencedFieldsA3[1]; // (F) First, collect all conflicts between these two collections of fields // (not including any nested fragments). collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (G) Then collect conflicts between the first fragment and any nested // fragments spread in the second fragment. for (var j = 0; j < fragmentNames2.length; j++) { collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentNames2[j]); } // (G) Then collect conflicts between the second fragment and any nested // fragments spread in the first fragment. for (var i = 0; i < fragmentNames1.length; i++) { collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[i], fragmentName2); } } // Find all conflicts found between two selection sets, including those found // via spreading in fragments. Called when determining if conflicts exist // between the sub-fields of two overlapping fields. function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, parentType2, selectionSet2) { var conflicts = []; var _getFieldsAndFragment2 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType1, selectionSet1), fieldMap1 = _getFieldsAndFragment2[0], fragmentNames1 = _getFieldsAndFragment2[1]; var _getFieldsAndFragment3 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType2, selectionSet2), fieldMap2 = _getFieldsAndFragment3[0], fragmentNames2 = _getFieldsAndFragment3[1]; // (H) First, collect all conflicts between these two collections of field. collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (I) Then collect conflicts between the first collection of fields and // those referenced by each fragment name associated with the second. if (fragmentNames2.length !== 0) { var comparedFragments = Object.create(null); for (var j = 0; j < fragmentNames2.length; j++) { collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentNames2[j]); } } // (I) Then collect conflicts between the second collection of fields and // those referenced by each fragment name associated with the first. if (fragmentNames1.length !== 0) { var _comparedFragments = Object.create(null); for (var i = 0; i < fragmentNames1.length; i++) { collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, _comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentNames1[i]); } } // (J) Also collect conflicts between any fragment names by the first and // fragment names by the second. This compares each item in the first set of // names to each item in the second set of names. for (var _i3 = 0; _i3 < fragmentNames1.length; _i3++) { for (var _j = 0; _j < fragmentNames2.length; _j++) { collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[_i3], fragmentNames2[_j]); } } return conflicts; } // Collect all Conflicts "within" one collection of fields. function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap) { // A field map is a keyed collection, where each key represents a response // name and the value at that key is a list of all fields which provide that // response name. For every response name, if there are multiple fields, they // must be compared to find a potential conflict. for (var _i5 = 0, _objectEntries2 = (0, _objectEntries3.default)(fieldMap); _i5 < _objectEntries2.length; _i5++) { var _ref5 = _objectEntries2[_i5]; var responseName = _ref5[0]; var fields = _ref5[1]; // This compares every field in the list to every other field in this list // (except to itself). If the list only has one item, nothing needs to // be compared. if (fields.length > 1) { for (var i = 0; i < fields.length; i++) { for (var j = i + 1; j < fields.length; j++) { var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, // within one collection is never mutually exclusive responseName, fields[i], fields[j]); if (conflict) { conflicts.push(conflict); } } } } } } // Collect all Conflicts between two collections of fields. This is similar to, // but different from the `collectConflictsWithin` function above. This check // assumes that `collectConflictsWithin` has already been called on each // provided collection of fields. This is true because this validator traverses // each individual selection set. function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, fieldMap2) { // A field map is a keyed collection, where each key represents a response // name and the value at that key is a list of all fields which provide that // response name. For any response name which appears in both provided field // maps, each field from the first field map must be compared to every field // in the second field map to find potential conflicts. for (var _i7 = 0, _Object$keys2 = Object.keys(fieldMap1); _i7 < _Object$keys2.length; _i7++) { var responseName = _Object$keys2[_i7]; var fields2 = fieldMap2[responseName]; if (fields2) { var fields1 = fieldMap1[responseName]; for (var i = 0; i < fields1.length; i++) { for (var j = 0; j < fields2.length; j++) { var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, fields1[i], fields2[j]); if (conflict) { conflicts.push(conflict); } } } } } } // Determines if there is a conflict between two particular fields, including // comparing their sub-fields. function findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2) { var parentType1 = field1[0], node1 = field1[1], def1 = field1[2]; var parentType2 = field2[0], node2 = field2[1], def2 = field2[2]; // If it is known that two fields could not possibly apply at the same // time, due to the parent types, then it is safe to permit them to diverge // in aliased field or arguments used as they will not present any ambiguity // by differing. // It is known that two parent types could never overlap if they are // different Object types. Interface or Union types might overlap - if not // in the current state of the schema, then perhaps in some future version, // thus may not safely diverge. var areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && (0, _definition.isObjectType)(parentType1) && (0, _definition.isObjectType)(parentType2); // The return type for each field. var type1 = def1 && def1.type; var type2 = def2 && def2.type; if (!areMutuallyExclusive) { // Two aliases must refer to the same field. var name1 = node1.name.value; var name2 = node2.name.value; if (name1 !== name2) { return [[responseName, "".concat(name1, " and ").concat(name2, " are different fields")], [node1], [node2]]; } // Two field calls must have the same arguments. if (!sameArguments(node1.arguments || [], node2.arguments || [])) { return [[responseName, 'they have differing arguments'], [node1], [node2]]; } } if (type1 && type2 && doTypesConflict(type1, type2)) { return [[responseName, "they return conflicting types ".concat((0, _inspect.default)(type1), " and ").concat((0, _inspect.default)(type2))], [node1], [node2]]; } // Collect and compare sub-fields. Use the same "visited fragment names" list // for both collections so fields in a fragment reference are never // compared to themselves. var selectionSet1 = node1.selectionSet; var selectionSet2 = node2.selectionSet; if (selectionSet1 && selectionSet2) { var conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, (0, _definition.getNamedType)(type1), selectionSet1, (0, _definition.getNamedType)(type2), selectionSet2); return subfieldConflicts(conflicts, responseName, node1, node2); } } function sameArguments(arguments1, arguments2) { if (arguments1.length !== arguments2.length) { return false; } return arguments1.every(function (argument1) { var argument2 = (0, _find.default)(arguments2, function (argument) { return argument.name.value === argument1.name.value; }); if (!argument2) { return false; } return sameValue(argument1.value, argument2.value); }); } function sameValue(value1, value2) { return !value1 && !value2 || (0, _printer.print)(value1) === (0, _printer.print)(value2); } // Two types conflict if both types could not apply to a value simultaneously. // Composite types are ignored as their individual field types will be compared // later recursively. However List and Non-Null types must match. function doTypesConflict(type1, type2) { if ((0, _definition.isListType)(type1)) { return (0, _definition.isListType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; } if ((0, _definition.isListType)(type2)) { return true; } if ((0, _definition.isNonNullType)(type1)) { return (0, _definition.isNonNullType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; } if ((0, _definition.isNonNullType)(type2)) { return true; } if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(type2)) { return type1 !== type2; } return false; } // Given a selection set, return the collection of fields (a mapping of response // name to field nodes and definitions) as well as a list of fragment names // referenced via fragment spreads. function getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) { var cached = cachedFieldsAndFragmentNames.get(selectionSet); if (!cached) { var nodeAndDefs = Object.create(null); var fragmentNames = Object.create(null); _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames); cached = [nodeAndDefs, Object.keys(fragmentNames)]; cachedFieldsAndFragmentNames.set(selectionSet, cached); } return cached; } // Given a reference to a fragment, return the represented collection of fields // as well as a list of nested fragment names referenced via fragment spreads. function getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment) { // Short-circuit building a type from the node if possible. var cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); if (cached) { return cached; } var fragmentType = (0, _typeFromAST.typeFromAST)(context.getSchema(), fragment.typeCondition); return getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragmentType, fragment.selectionSet); } function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames) { for (var _i9 = 0, _selectionSet$selecti2 = selectionSet.selections; _i9 < _selectionSet$selecti2.length; _i9++) { var selection = _selectionSet$selecti2[_i9]; switch (selection.kind) { case _kinds.Kind.FIELD: { var fieldName = selection.name.value; var fieldDef = void 0; if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { fieldDef = parentType.getFields()[fieldName]; } var responseName = selection.alias ? selection.alias.value : fieldName; if (!nodeAndDefs[responseName]) { nodeAndDefs[responseName] = []; } nodeAndDefs[responseName].push([parentType, selection, fieldDef]); break; } case _kinds.Kind.FRAGMENT_SPREAD: fragmentNames[selection.name.value] = true; break; case _kinds.Kind.INLINE_FRAGMENT: { var typeCondition = selection.typeCondition; var inlineFragmentType = typeCondition ? (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition) : parentType; _collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames); break; } } } } // Given a series of Conflicts which occurred between two sub-fields, generate // a single Conflict. function subfieldConflicts(conflicts, responseName, node1, node2) { if (conflicts.length > 0) { return [[responseName, conflicts.map(function (_ref6) { var reason = _ref6[0]; return reason; })], conflicts.reduce(function (allFields, _ref7) { var fields1 = _ref7[1]; return allFields.concat(fields1); }, [node1]), conflicts.reduce(function (allFields, _ref8) { var fields2 = _ref8[2]; return allFields.concat(fields2); }, [node2])]; } } /** * A way to keep track of pairs of things when the ordering of the pair does * not matter. We do this by maintaining a sort of double adjacency sets. */ var PairSet = /*#__PURE__*/ function () { function PairSet() { this._data = Object.create(null); } var _proto = PairSet.prototype; _proto.has = function has(a, b, areMutuallyExclusive) { var first = this._data[a]; var result = first && first[b]; if (result === undefined) { return false; } // areMutuallyExclusive being false is a superset of being true, // hence if we want to know if this PairSet "has" these two with no // exclusivity, we have to ensure it was added as such. if (areMutuallyExclusive === false) { return result === false; } return true; }; _proto.add = function add(a, b, areMutuallyExclusive) { _pairSetAdd(this._data, a, b, areMutuallyExclusive); _pairSetAdd(this._data, b, a, areMutuallyExclusive); }; return PairSet; }(); function _pairSetAdd(data, a, b, areMutuallyExclusive) { var map = data[a]; if (!map) { map = Object.create(null); data[a] = map; } map[b] = areMutuallyExclusive; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js": /*!***********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js ***! \***********************************************************************************************************/ /*! flagged exports */ /*! export PossibleFragmentSpreads [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export typeIncompatibleAnonSpreadMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export typeIncompatibleSpreadMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.typeIncompatibleSpreadMessage = typeIncompatibleSpreadMessage; exports.typeIncompatibleAnonSpreadMessage = typeIncompatibleAnonSpreadMessage; exports.PossibleFragmentSpreads = PossibleFragmentSpreads; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); var _typeComparators = __webpack_require__(/*! ../../utilities/typeComparators */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeComparators.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function typeIncompatibleSpreadMessage(fragName, parentType, fragType) { return "Fragment \"".concat(fragName, "\" cannot be spread here as objects of type \"").concat(parentType, "\" can never be of type \"").concat(fragType, "\"."); } function typeIncompatibleAnonSpreadMessage(parentType, fragType) { return "Fragment cannot be spread here as objects of type \"".concat(parentType, "\" can never be of type \"").concat(fragType, "\"."); } /** * Possible fragment spread * * A fragment spread is only valid if the type condition could ever possibly * be true: if there is a non-empty intersection of the possible parent types, * and possible types which pass the type condition. */ function PossibleFragmentSpreads(context) { return { InlineFragment: function InlineFragment(node) { var fragType = context.getType(); var parentType = context.getParentType(); if ((0, _definition.isCompositeType)(fragType) && (0, _definition.isCompositeType)(parentType) && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { context.reportError(new _GraphQLError.GraphQLError(typeIncompatibleAnonSpreadMessage((0, _inspect.default)(parentType), (0, _inspect.default)(fragType)), node)); } }, FragmentSpread: function FragmentSpread(node) { var fragName = node.name.value; var fragType = getFragmentType(context, fragName); var parentType = context.getParentType(); if (fragType && parentType && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { context.reportError(new _GraphQLError.GraphQLError(typeIncompatibleSpreadMessage(fragName, (0, _inspect.default)(parentType), (0, _inspect.default)(fragType)), node)); } } }; } function getFragmentType(context, name) { var frag = context.getFragment(name); if (frag) { var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition); if ((0, _definition.isCompositeType)(type)) { return type; } } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleTypeExtensions.js": /*!**********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleTypeExtensions.js ***! \**********************************************************************************************************/ /*! flagged exports */ /*! export PossibleTypeExtensions [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export extendingDifferentTypeKindMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export extendingUnknownTypeMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extendingUnknownTypeMessage = extendingUnknownTypeMessage; exports.extendingDifferentTypeKindMessage = extendingDifferentTypeKindMessage; exports.PossibleTypeExtensions = PossibleTypeExtensions; var _didYouMean = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/didYouMean */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js")); var _suggestionList = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/suggestionList */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _predicates = __webpack_require__(/*! ../../language/predicates */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/predicates.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _defKindToExtKind; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function extendingUnknownTypeMessage(typeName, suggestedTypes) { return "Cannot extend type \"".concat(typeName, "\" because it is not defined.") + (0, _didYouMean.default)(suggestedTypes.map(function (x) { return "\"".concat(x, "\""); })); } function extendingDifferentTypeKindMessage(typeName, kind) { return "Cannot extend non-".concat(kind, " type \"").concat(typeName, "\"."); } /** * Possible type extension * * A type extension is only valid if the type is defined and has the same kind. */ function PossibleTypeExtensions(context) { var schema = context.getSchema(); var definedTypes = Object.create(null); for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) { var def = _context$getDocument$2[_i2]; if ((0, _predicates.isTypeDefinitionNode)(def)) { definedTypes[def.name.value] = def; } } return { ScalarTypeExtension: checkExtension, ObjectTypeExtension: checkExtension, InterfaceTypeExtension: checkExtension, UnionTypeExtension: checkExtension, EnumTypeExtension: checkExtension, InputObjectTypeExtension: checkExtension }; function checkExtension(node) { var typeName = node.name.value; var defNode = definedTypes[typeName]; var existingType = schema && schema.getType(typeName); if (defNode) { var expectedKind = defKindToExtKind[defNode.kind]; if (expectedKind !== node.kind) { context.reportError(new _GraphQLError.GraphQLError(extendingDifferentTypeKindMessage(typeName, extensionKindToTypeName(expectedKind)), [defNode, node])); } } else if (existingType) { var _expectedKind = typeToExtKind(existingType); if (_expectedKind !== node.kind) { context.reportError(new _GraphQLError.GraphQLError(extendingDifferentTypeKindMessage(typeName, extensionKindToTypeName(_expectedKind)), node)); } } else { var allTypeNames = Object.keys(definedTypes); if (schema) { allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap())); } var suggestedTypes = (0, _suggestionList.default)(typeName, allTypeNames); context.reportError(new _GraphQLError.GraphQLError(extendingUnknownTypeMessage(typeName, suggestedTypes), node.name)); } } } var defKindToExtKind = (_defKindToExtKind = {}, _defineProperty(_defKindToExtKind, _kinds.Kind.SCALAR_TYPE_DEFINITION, _kinds.Kind.SCALAR_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.OBJECT_TYPE_DEFINITION, _kinds.Kind.OBJECT_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.INTERFACE_TYPE_DEFINITION, _kinds.Kind.INTERFACE_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.UNION_TYPE_DEFINITION, _kinds.Kind.UNION_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.ENUM_TYPE_DEFINITION, _kinds.Kind.ENUM_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION), _defKindToExtKind); function typeToExtKind(type) { if ((0, _definition.isScalarType)(type)) { return _kinds.Kind.SCALAR_TYPE_EXTENSION; } else if ((0, _definition.isObjectType)(type)) { return _kinds.Kind.OBJECT_TYPE_EXTENSION; } else if ((0, _definition.isInterfaceType)(type)) { return _kinds.Kind.INTERFACE_TYPE_EXTENSION; } else if ((0, _definition.isUnionType)(type)) { return _kinds.Kind.UNION_TYPE_EXTENSION; } else if ((0, _definition.isEnumType)(type)) { return _kinds.Kind.ENUM_TYPE_EXTENSION; } else if ((0, _definition.isInputObjectType)(type)) { return _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; } } function extensionKindToTypeName(kind) { switch (kind) { case _kinds.Kind.SCALAR_TYPE_EXTENSION: return 'scalar'; case _kinds.Kind.OBJECT_TYPE_EXTENSION: return 'object'; case _kinds.Kind.INTERFACE_TYPE_EXTENSION: return 'interface'; case _kinds.Kind.UNION_TYPE_EXTENSION: return 'union'; case _kinds.Kind.ENUM_TYPE_EXTENSION: return 'enum'; case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: return 'input object'; default: return 'unknown type'; } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js": /*!*************************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js ***! \*************************************************************************************************************/ /*! flagged exports */ /*! export ProvidedRequiredArguments [provided] [no usage info] [missing usage info prevents renaming] */ /*! export ProvidedRequiredArgumentsOnDirectives [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export missingDirectiveArgMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export missingFieldArgMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.missingFieldArgMessage = missingFieldArgMessage; exports.missingDirectiveArgMessage = missingDirectiveArgMessage; exports.ProvidedRequiredArguments = ProvidedRequiredArguments; exports.ProvidedRequiredArgumentsOnDirectives = ProvidedRequiredArgumentsOnDirectives; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _keyMap = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/keyMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _printer = __webpack_require__(/*! ../../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _directives = __webpack_require__(/*! ../../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function missingFieldArgMessage(fieldName, argName, type) { return "Field \"".concat(fieldName, "\" argument \"").concat(argName, "\" of type \"").concat(type, "\" is required, but it was not provided."); } function missingDirectiveArgMessage(directiveName, argName, type) { return "Directive \"@".concat(directiveName, "\" argument \"").concat(argName, "\" of type \"").concat(type, "\" is required, but it was not provided."); } /** * Provided required arguments * * A field or directive is only valid if all required (non-null without a * default value) field arguments have been provided. */ function ProvidedRequiredArguments(context) { return _objectSpread({}, ProvidedRequiredArgumentsOnDirectives(context), { Field: { // Validate on leave to allow for deeper errors to appear first. leave: function leave(fieldNode) { var fieldDef = context.getFieldDef(); if (!fieldDef) { return false; } var argNodes = fieldNode.arguments || []; var argNodeMap = (0, _keyMap.default)(argNodes, function (arg) { return arg.name.value; }); for (var _i2 = 0, _fieldDef$args2 = fieldDef.args; _i2 < _fieldDef$args2.length; _i2++) { var argDef = _fieldDef$args2[_i2]; var argNode = argNodeMap[argDef.name]; if (!argNode && (0, _definition.isRequiredArgument)(argDef)) { context.reportError(new _GraphQLError.GraphQLError(missingFieldArgMessage(fieldDef.name, argDef.name, (0, _inspect.default)(argDef.type)), fieldNode)); } } } } }); } // @internal function ProvidedRequiredArgumentsOnDirectives(context) { var requiredArgsMap = Object.create(null); var schema = context.getSchema(); var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; for (var _i4 = 0; _i4 < definedDirectives.length; _i4++) { var directive = definedDirectives[_i4]; requiredArgsMap[directive.name] = (0, _keyMap.default)(directive.args.filter(_definition.isRequiredArgument), function (arg) { return arg.name; }); } var astDefinitions = context.getDocument().definitions; for (var _i6 = 0; _i6 < astDefinitions.length; _i6++) { var def = astDefinitions[_i6]; if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { requiredArgsMap[def.name.value] = (0, _keyMap.default)(def.arguments ? def.arguments.filter(isRequiredArgumentNode) : [], function (arg) { return arg.name.value; }); } } return { Directive: { // Validate on leave to allow for deeper errors to appear first. leave: function leave(directiveNode) { var directiveName = directiveNode.name.value; var requiredArgs = requiredArgsMap[directiveName]; if (requiredArgs) { var argNodes = directiveNode.arguments || []; var argNodeMap = (0, _keyMap.default)(argNodes, function (arg) { return arg.name.value; }); for (var _i8 = 0, _Object$keys2 = Object.keys(requiredArgs); _i8 < _Object$keys2.length; _i8++) { var argName = _Object$keys2[_i8]; if (!argNodeMap[argName]) { var argType = requiredArgs[argName].type; context.reportError(new _GraphQLError.GraphQLError(missingDirectiveArgMessage(directiveName, argName, (0, _definition.isType)(argType) ? (0, _inspect.default)(argType) : (0, _printer.print)(argType)), directiveNode)); } } } } } }; } function isRequiredArgumentNode(arg) { return arg.type.kind === _kinds.Kind.NON_NULL_TYPE && arg.defaultValue == null; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ScalarLeafs.js": /*!***********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ScalarLeafs.js ***! \***********************************************************************************************/ /*! flagged exports */ /*! export ScalarLeafs [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export noSubselectionAllowedMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export requiredSubselectionMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.noSubselectionAllowedMessage = noSubselectionAllowedMessage; exports.requiredSubselectionMessage = requiredSubselectionMessage; exports.ScalarLeafs = ScalarLeafs; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function noSubselectionAllowedMessage(fieldName, type) { return "Field \"".concat(fieldName, "\" must not have a selection since type \"").concat(type, "\" has no subfields."); } function requiredSubselectionMessage(fieldName, type) { return "Field \"".concat(fieldName, "\" of type \"").concat(type, "\" must have a selection of subfields. Did you mean \"").concat(fieldName, " { ... }\"?"); } /** * Scalar leafs * * A GraphQL document is valid only if all leaf fields (fields without * sub selections) are of scalar or enum types. */ function ScalarLeafs(context) { return { Field: function Field(node) { var type = context.getType(); var selectionSet = node.selectionSet; if (type) { if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) { if (selectionSet) { context.reportError(new _GraphQLError.GraphQLError(noSubselectionAllowedMessage(node.name.value, (0, _inspect.default)(type)), selectionSet)); } } else if (!selectionSet) { context.reportError(new _GraphQLError.GraphQLError(requiredSubselectionMessage(node.name.value, (0, _inspect.default)(type)), node)); } } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js": /*!************************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js ***! \************************************************************************************************************/ /*! flagged exports */ /*! export SingleFieldSubscriptions [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export singleFieldOnlyMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.singleFieldOnlyMessage = singleFieldOnlyMessage; exports.SingleFieldSubscriptions = SingleFieldSubscriptions; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function singleFieldOnlyMessage(name) { return name ? "Subscription \"".concat(name, "\" must select only one top level field.") : 'Anonymous Subscription must select only one top level field.'; } /** * Subscriptions must only include one field. * * A GraphQL subscription is valid only if it contains a single root field. */ function SingleFieldSubscriptions(context) { return { OperationDefinition: function OperationDefinition(node) { if (node.operation === 'subscription') { if (node.selectionSet.selections.length !== 1) { context.reportError(new _GraphQLError.GraphQLError(singleFieldOnlyMessage(node.name && node.name.value), node.selectionSet.selections.slice(1))); } } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueArgumentNames.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueArgumentNames.js ***! \*******************************************************************************************************/ /*! flagged exports */ /*! export UniqueArgumentNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateArgMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateArgMessage = duplicateArgMessage; exports.UniqueArgumentNames = UniqueArgumentNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateArgMessage(argName) { return "There can be only one argument named \"".concat(argName, "\"."); } /** * Unique argument names * * A GraphQL field or directive is only valid if all supplied arguments are * uniquely named. */ function UniqueArgumentNames(context) { var knownArgNames = Object.create(null); return { Field: function Field() { knownArgNames = Object.create(null); }, Directive: function Directive() { knownArgNames = Object.create(null); }, Argument: function Argument(node) { var argName = node.name.value; if (knownArgNames[argName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateArgMessage(argName), [knownArgNames[argName], node.name])); } else { knownArgNames[argName] = node.name; } return false; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectiveNames.js": /*!********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectiveNames.js ***! \********************************************************************************************************/ /*! flagged exports */ /*! export UniqueDirectiveNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateDirectiveNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export existedDirectiveNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateDirectiveNameMessage = duplicateDirectiveNameMessage; exports.existedDirectiveNameMessage = existedDirectiveNameMessage; exports.UniqueDirectiveNames = UniqueDirectiveNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateDirectiveNameMessage(directiveName) { return "There can be only one directive named \"".concat(directiveName, "\"."); } function existedDirectiveNameMessage(directiveName) { return "Directive \"".concat(directiveName, "\" already exists in the schema. It cannot be redefined."); } /** * Unique directive names * * A GraphQL document is only valid if all defined directives have unique names. */ function UniqueDirectiveNames(context) { var knownDirectiveNames = Object.create(null); var schema = context.getSchema(); return { DirectiveDefinition: function DirectiveDefinition(node) { var directiveName = node.name.value; if (schema && schema.getDirective(directiveName)) { context.reportError(new _GraphQLError.GraphQLError(existedDirectiveNameMessage(directiveName), node.name)); return; } if (knownDirectiveNames[directiveName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateDirectiveNameMessage(directiveName), [knownDirectiveNames[directiveName], node.name])); } else { knownDirectiveNames[directiveName] = node.name; } return false; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js": /*!***************************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js ***! \***************************************************************************************************************/ /*! flagged exports */ /*! export UniqueDirectivesPerLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateDirectiveMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateDirectiveMessage = duplicateDirectiveMessage; exports.UniqueDirectivesPerLocation = UniqueDirectivesPerLocation; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _directives = __webpack_require__(/*! ../../type/directives */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/directives.js"); function duplicateDirectiveMessage(directiveName) { return "The directive \"".concat(directiveName, "\" can only be used once at this location."); } /** * Unique directive names per location * * A GraphQL document is only valid if all non-repeatable directives at * a given location are uniquely named. */ function UniqueDirectivesPerLocation(context) { var uniqueDirectiveMap = Object.create(null); var schema = context.getSchema(); var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { var directive = definedDirectives[_i2]; uniqueDirectiveMap[directive.name] = !directive.isRepeatable; } var astDefinitions = context.getDocument().definitions; for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { var def = astDefinitions[_i4]; if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { uniqueDirectiveMap[def.name.value] = !def.repeatable; } } return { // Many different AST nodes may contain directives. Rather than listing // them all, just listen for entering any node, and check to see if it // defines any directives. enter: function enter(node) { // Flow can't refine that node.directives will only contain directives, // so we cast so the rest of the code is well typed. var directives = node.directives; if (directives) { var knownDirectives = Object.create(null); for (var _i6 = 0; _i6 < directives.length; _i6++) { var _directive = directives[_i6]; var directiveName = _directive.name.value; if (uniqueDirectiveMap[directiveName]) { if (knownDirectives[directiveName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], _directive])); } else { knownDirectives[directiveName] = _directive; } } } } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueEnumValueNames.js": /*!********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueEnumValueNames.js ***! \********************************************************************************************************/ /*! flagged exports */ /*! export UniqueEnumValueNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateEnumValueNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export existedEnumValueNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateEnumValueNameMessage = duplicateEnumValueNameMessage; exports.existedEnumValueNameMessage = existedEnumValueNameMessage; exports.UniqueEnumValueNames = UniqueEnumValueNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function duplicateEnumValueNameMessage(typeName, valueName) { return "Enum value \"".concat(typeName, ".").concat(valueName, "\" can only be defined once."); } function existedEnumValueNameMessage(typeName, valueName) { return "Enum value \"".concat(typeName, ".").concat(valueName, "\" already exists in the schema. It cannot also be defined in this type extension."); } /** * Unique enum value names * * A GraphQL enum type is only valid if all its values are uniquely named. */ function UniqueEnumValueNames(context) { var schema = context.getSchema(); var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); var knownValueNames = Object.create(null); return { EnumTypeDefinition: checkValueUniqueness, EnumTypeExtension: checkValueUniqueness }; function checkValueUniqueness(node) { var typeName = node.name.value; if (!knownValueNames[typeName]) { knownValueNames[typeName] = Object.create(null); } if (node.values) { var valueNames = knownValueNames[typeName]; for (var _i2 = 0, _node$values2 = node.values; _i2 < _node$values2.length; _i2++) { var valueDef = _node$values2[_i2]; var valueName = valueDef.name.value; var existingType = existingTypeMap[typeName]; if ((0, _definition.isEnumType)(existingType) && existingType.getValue(valueName)) { context.reportError(new _GraphQLError.GraphQLError(existedEnumValueNameMessage(typeName, valueName), valueDef.name)); } else if (valueNames[valueName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateEnumValueNameMessage(typeName, valueName), [valueNames[valueName], valueDef.name])); } else { valueNames[valueName] = valueDef.name; } } } return false; } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js": /*!**************************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js ***! \**************************************************************************************************************/ /*! flagged exports */ /*! export UniqueFieldDefinitionNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateFieldDefinitionNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export existedFieldDefinitionNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateFieldDefinitionNameMessage = duplicateFieldDefinitionNameMessage; exports.existedFieldDefinitionNameMessage = existedFieldDefinitionNameMessage; exports.UniqueFieldDefinitionNames = UniqueFieldDefinitionNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function duplicateFieldDefinitionNameMessage(typeName, fieldName) { return "Field \"".concat(typeName, ".").concat(fieldName, "\" can only be defined once."); } function existedFieldDefinitionNameMessage(typeName, fieldName) { return "Field \"".concat(typeName, ".").concat(fieldName, "\" already exists in the schema. It cannot also be defined in this type extension."); } /** * Unique field definition names * * A GraphQL complex type is only valid if all its fields are uniquely named. */ function UniqueFieldDefinitionNames(context) { var schema = context.getSchema(); var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); var knownFieldNames = Object.create(null); return { InputObjectTypeDefinition: checkFieldUniqueness, InputObjectTypeExtension: checkFieldUniqueness, InterfaceTypeDefinition: checkFieldUniqueness, InterfaceTypeExtension: checkFieldUniqueness, ObjectTypeDefinition: checkFieldUniqueness, ObjectTypeExtension: checkFieldUniqueness }; function checkFieldUniqueness(node) { var typeName = node.name.value; if (!knownFieldNames[typeName]) { knownFieldNames[typeName] = Object.create(null); } if (node.fields) { var fieldNames = knownFieldNames[typeName]; for (var _i2 = 0, _node$fields2 = node.fields; _i2 < _node$fields2.length; _i2++) { var fieldDef = _node$fields2[_i2]; var fieldName = fieldDef.name.value; if (hasField(existingTypeMap[typeName], fieldName)) { context.reportError(new _GraphQLError.GraphQLError(existedFieldDefinitionNameMessage(typeName, fieldName), fieldDef.name)); } else if (fieldNames[fieldName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateFieldDefinitionNameMessage(typeName, fieldName), [fieldNames[fieldName], fieldDef.name])); } else { fieldNames[fieldName] = fieldDef.name; } } } return false; } } function hasField(type, fieldName) { if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type) || (0, _definition.isInputObjectType)(type)) { return type.getFields()[fieldName]; } return false; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFragmentNames.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFragmentNames.js ***! \*******************************************************************************************************/ /*! flagged exports */ /*! export UniqueFragmentNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateFragmentNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateFragmentNameMessage = duplicateFragmentNameMessage; exports.UniqueFragmentNames = UniqueFragmentNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateFragmentNameMessage(fragName) { return "There can be only one fragment named \"".concat(fragName, "\"."); } /** * Unique fragment names * * A GraphQL document is only valid if all defined fragments have unique names. */ function UniqueFragmentNames(context) { var knownFragmentNames = Object.create(null); return { OperationDefinition: function OperationDefinition() { return false; }, FragmentDefinition: function FragmentDefinition(node) { var fragmentName = node.name.value; if (knownFragmentNames[fragmentName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateFragmentNameMessage(fragmentName), [knownFragmentNames[fragmentName], node.name])); } else { knownFragmentNames[fragmentName] = node.name; } return false; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueInputFieldNames.js": /*!*********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueInputFieldNames.js ***! \*********************************************************************************************************/ /*! flagged exports */ /*! export UniqueInputFieldNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateInputFieldMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateInputFieldMessage = duplicateInputFieldMessage; exports.UniqueInputFieldNames = UniqueInputFieldNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateInputFieldMessage(fieldName) { return "There can be only one input field named \"".concat(fieldName, "\"."); } /** * Unique input field names * * A GraphQL input object value is only valid if all supplied fields are * uniquely named. */ function UniqueInputFieldNames(context) { var knownNameStack = []; var knownNames = Object.create(null); return { ObjectValue: { enter: function enter() { knownNameStack.push(knownNames); knownNames = Object.create(null); }, leave: function leave() { knownNames = knownNameStack.pop(); } }, ObjectField: function ObjectField(node) { var fieldName = node.name.value; if (knownNames[fieldName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateInputFieldMessage(fieldName), [knownNames[fieldName], node.name])); } else { knownNames[fieldName] = node.name; } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationNames.js": /*!********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationNames.js ***! \********************************************************************************************************/ /*! flagged exports */ /*! export UniqueOperationNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateOperationNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateOperationNameMessage = duplicateOperationNameMessage; exports.UniqueOperationNames = UniqueOperationNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateOperationNameMessage(operationName) { return "There can be only one operation named \"".concat(operationName, "\"."); } /** * Unique operation names * * A GraphQL document is only valid if all defined operations have unique names. */ function UniqueOperationNames(context) { var knownOperationNames = Object.create(null); return { OperationDefinition: function OperationDefinition(node) { var operationName = node.name; if (operationName) { if (knownOperationNames[operationName.value]) { context.reportError(new _GraphQLError.GraphQLError(duplicateOperationNameMessage(operationName.value), [knownOperationNames[operationName.value], operationName])); } else { knownOperationNames[operationName.value] = operationName; } } return false; }, FragmentDefinition: function FragmentDefinition() { return false; } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationTypes.js": /*!********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationTypes.js ***! \********************************************************************************************************/ /*! flagged exports */ /*! export UniqueOperationTypes [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateOperationTypeMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export existedOperationTypeMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateOperationTypeMessage = duplicateOperationTypeMessage; exports.existedOperationTypeMessage = existedOperationTypeMessage; exports.UniqueOperationTypes = UniqueOperationTypes; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateOperationTypeMessage(operation) { return "There can be only one ".concat(operation, " type in schema."); } function existedOperationTypeMessage(operation) { return "Type for ".concat(operation, " already defined in the schema. It cannot be redefined."); } /** * Unique operation types * * A GraphQL document is only valid if it has only one type per operation. */ function UniqueOperationTypes(context) { var schema = context.getSchema(); var definedOperationTypes = Object.create(null); var existingOperationTypes = schema ? { query: schema.getQueryType(), mutation: schema.getMutationType(), subscription: schema.getSubscriptionType() } : {}; return { SchemaDefinition: checkOperationTypes, SchemaExtension: checkOperationTypes }; function checkOperationTypes(node) { if (node.operationTypes) { for (var _i2 = 0, _ref2 = node.operationTypes || []; _i2 < _ref2.length; _i2++) { var operationType = _ref2[_i2]; var operation = operationType.operation; var alreadyDefinedOperationType = definedOperationTypes[operation]; if (existingOperationTypes[operation]) { context.reportError(new _GraphQLError.GraphQLError(existedOperationTypeMessage(operation), operationType)); } else if (alreadyDefinedOperationType) { context.reportError(new _GraphQLError.GraphQLError(duplicateOperationTypeMessage(operation), [alreadyDefinedOperationType, operationType])); } else { definedOperationTypes[operation] = operationType; } } } return false; } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueTypeNames.js": /*!***************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueTypeNames.js ***! \***************************************************************************************************/ /*! flagged exports */ /*! export UniqueTypeNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateTypeNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export existedTypeNameMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateTypeNameMessage = duplicateTypeNameMessage; exports.existedTypeNameMessage = existedTypeNameMessage; exports.UniqueTypeNames = UniqueTypeNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateTypeNameMessage(typeName) { return "There can be only one type named \"".concat(typeName, "\"."); } function existedTypeNameMessage(typeName) { return "Type \"".concat(typeName, "\" already exists in the schema. It cannot also be defined in this type definition."); } /** * Unique type names * * A GraphQL document is only valid if all defined types have unique names. */ function UniqueTypeNames(context) { var knownTypeNames = Object.create(null); var schema = context.getSchema(); return { ScalarTypeDefinition: checkTypeName, ObjectTypeDefinition: checkTypeName, InterfaceTypeDefinition: checkTypeName, UnionTypeDefinition: checkTypeName, EnumTypeDefinition: checkTypeName, InputObjectTypeDefinition: checkTypeName }; function checkTypeName(node) { var typeName = node.name.value; if (schema && schema.getType(typeName)) { context.reportError(new _GraphQLError.GraphQLError(existedTypeNameMessage(typeName), node.name)); return; } if (knownTypeNames[typeName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateTypeNameMessage(typeName), [knownTypeNames[typeName], node.name])); } else { knownTypeNames[typeName] = node.name; } return false; } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueVariableNames.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueVariableNames.js ***! \*******************************************************************************************************/ /*! flagged exports */ /*! export UniqueVariableNames [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export duplicateVariableMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.duplicateVariableMessage = duplicateVariableMessage; exports.UniqueVariableNames = UniqueVariableNames; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); function duplicateVariableMessage(variableName) { return "There can be only one variable named \"".concat(variableName, "\"."); } /** * Unique variable names * * A GraphQL operation is only valid if all its variables are uniquely named. */ function UniqueVariableNames(context) { var knownVariableNames = Object.create(null); return { OperationDefinition: function OperationDefinition() { knownVariableNames = Object.create(null); }, VariableDefinition: function VariableDefinition(node) { var variableName = node.variable.name.value; if (knownVariableNames[variableName]) { context.reportError(new _GraphQLError.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name])); } else { knownVariableNames[variableName] = node.variable.name; } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ValuesOfCorrectType.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ValuesOfCorrectType.js ***! \*******************************************************************************************************/ /*! flagged exports */ /*! export ValuesOfCorrectType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export badEnumValueMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export badValueMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export requiredFieldMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! export unknownFieldMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.badValueMessage = badValueMessage; exports.badEnumValueMessage = badEnumValueMessage; exports.requiredFieldMessage = requiredFieldMessage; exports.unknownFieldMessage = unknownFieldMessage; exports.ValuesOfCorrectType = ValuesOfCorrectType; var _objectValues3 = _interopRequireDefault(__webpack_require__(/*! ../../polyfills/objectValues */ "./node_modules/graphql-ruby-client/node_modules/graphql/polyfills/objectValues.js")); var _keyMap = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/keyMap */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/keyMap.js")); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _isInvalid = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/isInvalid */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/isInvalid.js")); var _didYouMean = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/didYouMean */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/didYouMean.js")); var _suggestionList = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/suggestionList */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/suggestionList.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _printer = __webpack_require__(/*! ../../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function badValueMessage(typeName, valueName, message) { return "Expected type ".concat(typeName, ", found ").concat(valueName) + (message ? "; ".concat(message) : '.'); } function badEnumValueMessage(typeName, valueName, suggestedValues) { return "Expected type ".concat(typeName, ", found ").concat(valueName, ".") + (0, _didYouMean.default)('the enum value', suggestedValues); } function requiredFieldMessage(typeName, fieldName, fieldTypeName) { return "Field ".concat(typeName, ".").concat(fieldName, " of required type ").concat(fieldTypeName, " was not provided."); } function unknownFieldMessage(typeName, fieldName, suggestedFields) { return "Field \"".concat(fieldName, "\" is not defined by type ").concat(typeName, ".") + (0, _didYouMean.default)(suggestedFields); } /** * Value literals of correct type * * A GraphQL document is only valid if all value literals are of the type * expected at their position. */ function ValuesOfCorrectType(context) { return { NullValue: function NullValue(node) { var type = context.getInputType(); if ((0, _definition.isNonNullType)(type)) { context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(type), (0, _printer.print)(node)), node)); } }, ListValue: function ListValue(node) { // Note: TypeInfo will traverse into a list's item type, so look to the // parent input type to check if it is a list. var type = (0, _definition.getNullableType)(context.getParentInputType()); if (!(0, _definition.isListType)(type)) { isValidScalar(context, node); return false; // Don't traverse further. } }, ObjectValue: function ObjectValue(node) { var type = (0, _definition.getNamedType)(context.getInputType()); if (!(0, _definition.isInputObjectType)(type)) { isValidScalar(context, node); return false; // Don't traverse further. } // Ensure every required field exists. var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) { return field.name.value; }); for (var _i2 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i2 < _objectValues2.length; _i2++) { var fieldDef = _objectValues2[_i2]; var fieldNode = fieldNodeMap[fieldDef.name]; if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) { var typeStr = (0, _inspect.default)(fieldDef.type); context.reportError(new _GraphQLError.GraphQLError(requiredFieldMessage(type.name, fieldDef.name, typeStr), node)); } } }, ObjectField: function ObjectField(node) { var parentType = (0, _definition.getNamedType)(context.getParentInputType()); var fieldType = context.getInputType(); if (!fieldType && (0, _definition.isInputObjectType)(parentType)) { var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields())); context.reportError(new _GraphQLError.GraphQLError(unknownFieldMessage(parentType.name, node.name.value, suggestions), node)); } }, EnumValue: function EnumValue(node) { var type = (0, _definition.getNamedType)(context.getInputType()); if (!(0, _definition.isEnumType)(type)) { isValidScalar(context, node); } else if (!type.getValue(node.value)) { context.reportError(new _GraphQLError.GraphQLError(badEnumValueMessage(type.name, (0, _printer.print)(node), enumTypeSuggestion(type, node)), node)); } }, IntValue: function IntValue(node) { return isValidScalar(context, node); }, FloatValue: function FloatValue(node) { return isValidScalar(context, node); }, StringValue: function StringValue(node) { return isValidScalar(context, node); }, BooleanValue: function BooleanValue(node) { return isValidScalar(context, node); } }; } /** * Any value literal may be a valid representation of a Scalar, depending on * that scalar type. */ function isValidScalar(context, node) { // Report any error at the full type expected by the location. var locationType = context.getInputType(); if (!locationType) { return; } var type = (0, _definition.getNamedType)(locationType); if (!(0, _definition.isScalarType)(type)) { var message = (0, _definition.isEnumType)(type) ? badEnumValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node), enumTypeSuggestion(type, node)) : badValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node)); context.reportError(new _GraphQLError.GraphQLError(message, node)); return; } // Scalars determine if a literal value is valid via parseLiteral() which // may throw or return an invalid value to indicate failure. try { var parseResult = type.parseLiteral(node, undefined /* variables */ ); if ((0, _isInvalid.default)(parseResult)) { context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node)), node)); } } catch (error) { // Ensure a reference to the original error is maintained. context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node), error.message), node, undefined, undefined, undefined, error)); } } function enumTypeSuggestion(type, node) { var allNames = type.getValues().map(function (value) { return value.name; }); return (0, _suggestionList.default)((0, _printer.print)(node), allNames); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesAreInputTypes.js": /*!**********************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesAreInputTypes.js ***! \**********************************************************************************************************/ /*! flagged exports */ /*! export VariablesAreInputTypes [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export nonInputTypeOnVarMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.nonInputTypeOnVarMessage = nonInputTypeOnVarMessage; exports.VariablesAreInputTypes = VariablesAreInputTypes; var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _printer = __webpack_require__(/*! ../../language/printer */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/printer.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); function nonInputTypeOnVarMessage(variableName, typeName) { return "Variable \"$".concat(variableName, "\" cannot be non-input type \"").concat(typeName, "\"."); } /** * Variables are input types * * A GraphQL operation is only valid if all the variables it defines are of * input types (scalar, enum, or input object). */ function VariablesAreInputTypes(context) { return { VariableDefinition: function VariableDefinition(node) { var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type); // If the variable type is not an input type, return an error. if (type && !(0, _definition.isInputType)(type)) { var variableName = node.variable.name.value; context.reportError(new _GraphQLError.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _printer.print)(node.type)), node.type)); } } }; } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js": /*!**************************************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js ***! \**************************************************************************************************************/ /*! flagged exports */ /*! export VariablesInAllowedPosition [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export badVarPosMessage [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.badVarPosMessage = badVarPosMessage; exports.VariablesInAllowedPosition = VariablesInAllowedPosition; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../../jsutils/inspect */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/inspect.js")); var _GraphQLError = __webpack_require__(/*! ../../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _kinds = __webpack_require__(/*! ../../language/kinds */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/kinds.js"); var _definition = __webpack_require__(/*! ../../type/definition */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/definition.js"); var _typeFromAST = __webpack_require__(/*! ../../utilities/typeFromAST */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeFromAST.js"); var _typeComparators = __webpack_require__(/*! ../../utilities/typeComparators */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/typeComparators.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function badVarPosMessage(varName, varType, expectedType) { return "Variable \"$".concat(varName, "\" of type \"").concat(varType, "\" used in position expecting type \"").concat(expectedType, "\"."); } /** * Variables passed to field arguments conform to type */ function VariablesInAllowedPosition(context) { var varDefMap = Object.create(null); return { OperationDefinition: { enter: function enter() { varDefMap = Object.create(null); }, leave: function leave(operation) { var usages = context.getRecursiveVariableUsages(operation); for (var _i2 = 0; _i2 < usages.length; _i2++) { var _ref2 = usages[_i2]; var node = _ref2.node; var type = _ref2.type; var defaultValue = _ref2.defaultValue; var varName = node.name.value; var varDef = varDefMap[varName]; if (varDef && type) { // A var type is allowed if it is the same or more strict (e.g. is // a subtype of) than the expected type. It can be more strict if // the variable type is non-null when the expected type is nullable. // If both are list types, the variable item type can be more strict // than the expected item type (contravariant). var schema = context.getSchema(); var varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type); if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) { context.reportError(new _GraphQLError.GraphQLError(badVarPosMessage(varName, (0, _inspect.default)(varType), (0, _inspect.default)(type)), [varDef, node])); } } } } }, VariableDefinition: function VariableDefinition(node) { varDefMap[node.variable.name.value] = node; } }; } /** * Returns true if the variable is allowed in the location it was found, * which includes considering if default values exist for either the variable * or the location at which it is located. */ function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { if ((0, _definition.isNonNullType)(locationType) && !(0, _definition.isNonNullType)(varType)) { var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _kinds.Kind.NULL; var hasLocationDefaultValue = locationDefaultValue !== undefined; if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { return false; } var nullableLocationType = locationType.ofType; return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, nullableLocationType); } return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, locationType); } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/specifiedRules.js": /*!********************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/specifiedRules.js ***! \********************************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export specifiedRules [provided] [no usage info] [missing usage info prevents renaming] */ /*! export specifiedSDLRules [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.specifiedSDLRules = exports.specifiedRules = void 0; var _ExecutableDefinitions = __webpack_require__(/*! ./rules/ExecutableDefinitions */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ExecutableDefinitions.js"); var _UniqueOperationNames = __webpack_require__(/*! ./rules/UniqueOperationNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationNames.js"); var _LoneAnonymousOperation = __webpack_require__(/*! ./rules/LoneAnonymousOperation */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneAnonymousOperation.js"); var _SingleFieldSubscriptions = __webpack_require__(/*! ./rules/SingleFieldSubscriptions */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js"); var _KnownTypeNames = __webpack_require__(/*! ./rules/KnownTypeNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownTypeNames.js"); var _FragmentsOnCompositeTypes = __webpack_require__(/*! ./rules/FragmentsOnCompositeTypes */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js"); var _VariablesAreInputTypes = __webpack_require__(/*! ./rules/VariablesAreInputTypes */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesAreInputTypes.js"); var _ScalarLeafs = __webpack_require__(/*! ./rules/ScalarLeafs */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ScalarLeafs.js"); var _FieldsOnCorrectType = __webpack_require__(/*! ./rules/FieldsOnCorrectType */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/FieldsOnCorrectType.js"); var _UniqueFragmentNames = __webpack_require__(/*! ./rules/UniqueFragmentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFragmentNames.js"); var _KnownFragmentNames = __webpack_require__(/*! ./rules/KnownFragmentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownFragmentNames.js"); var _NoUnusedFragments = __webpack_require__(/*! ./rules/NoUnusedFragments */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedFragments.js"); var _PossibleFragmentSpreads = __webpack_require__(/*! ./rules/PossibleFragmentSpreads */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js"); var _NoFragmentCycles = __webpack_require__(/*! ./rules/NoFragmentCycles */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoFragmentCycles.js"); var _UniqueVariableNames = __webpack_require__(/*! ./rules/UniqueVariableNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueVariableNames.js"); var _NoUndefinedVariables = __webpack_require__(/*! ./rules/NoUndefinedVariables */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUndefinedVariables.js"); var _NoUnusedVariables = __webpack_require__(/*! ./rules/NoUnusedVariables */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/NoUnusedVariables.js"); var _KnownDirectives = __webpack_require__(/*! ./rules/KnownDirectives */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownDirectives.js"); var _UniqueDirectivesPerLocation = __webpack_require__(/*! ./rules/UniqueDirectivesPerLocation */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js"); var _KnownArgumentNames = __webpack_require__(/*! ./rules/KnownArgumentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/KnownArgumentNames.js"); var _UniqueArgumentNames = __webpack_require__(/*! ./rules/UniqueArgumentNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueArgumentNames.js"); var _ValuesOfCorrectType = __webpack_require__(/*! ./rules/ValuesOfCorrectType */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ValuesOfCorrectType.js"); var _ProvidedRequiredArguments = __webpack_require__(/*! ./rules/ProvidedRequiredArguments */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js"); var _VariablesInAllowedPosition = __webpack_require__(/*! ./rules/VariablesInAllowedPosition */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js"); var _OverlappingFieldsCanBeMerged = __webpack_require__(/*! ./rules/OverlappingFieldsCanBeMerged */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js"); var _UniqueInputFieldNames = __webpack_require__(/*! ./rules/UniqueInputFieldNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueInputFieldNames.js"); var _LoneSchemaDefinition = __webpack_require__(/*! ./rules/LoneSchemaDefinition */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/LoneSchemaDefinition.js"); var _UniqueOperationTypes = __webpack_require__(/*! ./rules/UniqueOperationTypes */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueOperationTypes.js"); var _UniqueTypeNames = __webpack_require__(/*! ./rules/UniqueTypeNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueTypeNames.js"); var _UniqueEnumValueNames = __webpack_require__(/*! ./rules/UniqueEnumValueNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueEnumValueNames.js"); var _UniqueFieldDefinitionNames = __webpack_require__(/*! ./rules/UniqueFieldDefinitionNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js"); var _UniqueDirectiveNames = __webpack_require__(/*! ./rules/UniqueDirectiveNames */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/UniqueDirectiveNames.js"); var _PossibleTypeExtensions = __webpack_require__(/*! ./rules/PossibleTypeExtensions */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/rules/PossibleTypeExtensions.js"); // Spec Section: "Executable Definitions" // Spec Section: "Operation Name Uniqueness" // Spec Section: "Lone Anonymous Operation" // Spec Section: "Subscriptions with Single Root Field" // Spec Section: "Fragment Spread Type Existence" // Spec Section: "Fragments on Composite Types" // Spec Section: "Variables are Input Types" // Spec Section: "Leaf Field Selections" // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" // Spec Section: "Fragment Name Uniqueness" // Spec Section: "Fragment spread target defined" // Spec Section: "Fragments must be used" // Spec Section: "Fragment spread is possible" // Spec Section: "Fragments must not form cycles" // Spec Section: "Variable Uniqueness" // Spec Section: "All Variable Used Defined" // Spec Section: "All Variables Used" // Spec Section: "Directives Are Defined" // Spec Section: "Directives Are Unique Per Location" // Spec Section: "Argument Names" // Spec Section: "Argument Uniqueness" // Spec Section: "Value Type Correctness" // Spec Section: "Argument Optionality" // Spec Section: "All Variable Usages Are Allowed" // Spec Section: "Field Selection Merging" // Spec Section: "Input Object Field Uniqueness" /** * This set includes all validation rules defined by the GraphQL spec. * * The order of the rules in this list has been adjusted to lead to the * most clear output when encountering multiple validation errors. */ var specifiedRules = Object.freeze([_ExecutableDefinitions.ExecutableDefinitions, _UniqueOperationNames.UniqueOperationNames, _LoneAnonymousOperation.LoneAnonymousOperation, _SingleFieldSubscriptions.SingleFieldSubscriptions, _KnownTypeNames.KnownTypeNames, _FragmentsOnCompositeTypes.FragmentsOnCompositeTypes, _VariablesAreInputTypes.VariablesAreInputTypes, _ScalarLeafs.ScalarLeafs, _FieldsOnCorrectType.FieldsOnCorrectType, _UniqueFragmentNames.UniqueFragmentNames, _KnownFragmentNames.KnownFragmentNames, _NoUnusedFragments.NoUnusedFragments, _PossibleFragmentSpreads.PossibleFragmentSpreads, _NoFragmentCycles.NoFragmentCycles, _UniqueVariableNames.UniqueVariableNames, _NoUndefinedVariables.NoUndefinedVariables, _NoUnusedVariables.NoUnusedVariables, _KnownDirectives.KnownDirectives, _UniqueDirectivesPerLocation.UniqueDirectivesPerLocation, _KnownArgumentNames.KnownArgumentNames, _UniqueArgumentNames.UniqueArgumentNames, _ValuesOfCorrectType.ValuesOfCorrectType, _ProvidedRequiredArguments.ProvidedRequiredArguments, _VariablesInAllowedPosition.VariablesInAllowedPosition, _OverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged, _UniqueInputFieldNames.UniqueInputFieldNames]); exports.specifiedRules = specifiedRules; // @internal var specifiedSDLRules = Object.freeze([_LoneSchemaDefinition.LoneSchemaDefinition, _UniqueOperationTypes.UniqueOperationTypes, _UniqueTypeNames.UniqueTypeNames, _UniqueEnumValueNames.UniqueEnumValueNames, _UniqueFieldDefinitionNames.UniqueFieldDefinitionNames, _UniqueDirectiveNames.UniqueDirectiveNames, _KnownTypeNames.KnownTypeNames, _KnownDirectives.KnownDirectives, _UniqueDirectivesPerLocation.UniqueDirectivesPerLocation, _PossibleTypeExtensions.PossibleTypeExtensions, _KnownArgumentNames.KnownArgumentNamesOnDirectives, _UniqueArgumentNames.UniqueArgumentNames, _UniqueInputFieldNames.UniqueInputFieldNames, _ProvidedRequiredArguments.ProvidedRequiredArgumentsOnDirectives]); exports.specifiedSDLRules = specifiedSDLRules; /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/validate.js": /*!**************************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/validation/validate.js ***! \**************************************************************************************/ /*! flagged exports */ /*! export ABORT_VALIDATION [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertValidSDL [provided] [no usage info] [missing usage info prevents renaming] */ /*! export assertValidSDLExtension [provided] [no usage info] [missing usage info prevents renaming] */ /*! export validate [provided] [no usage info] [missing usage info prevents renaming] */ /*! export validateSDL [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validate = validate; exports.validateSDL = validateSDL; exports.assertValidSDL = assertValidSDL; exports.assertValidSDLExtension = assertValidSDLExtension; exports.ABORT_VALIDATION = void 0; var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert */ "./node_modules/graphql-ruby-client/node_modules/graphql/jsutils/devAssert.js")); var _GraphQLError = __webpack_require__(/*! ../error/GraphQLError */ "./node_modules/graphql-ruby-client/node_modules/graphql/error/GraphQLError.js"); var _visitor = __webpack_require__(/*! ../language/visitor */ "./node_modules/graphql-ruby-client/node_modules/graphql/language/visitor.js"); var _validate = __webpack_require__(/*! ../type/validate */ "./node_modules/graphql-ruby-client/node_modules/graphql/type/validate.js"); var _TypeInfo = __webpack_require__(/*! ../utilities/TypeInfo */ "./node_modules/graphql-ruby-client/node_modules/graphql/utilities/TypeInfo.js"); var _specifiedRules = __webpack_require__(/*! ./specifiedRules */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/specifiedRules.js"); var _ValidationContext = __webpack_require__(/*! ./ValidationContext */ "./node_modules/graphql-ruby-client/node_modules/graphql/validation/ValidationContext.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ABORT_VALIDATION = Object.freeze({}); /** * Implements the "Validation" section of the spec. * * Validation runs synchronously, returning an array of encountered errors, or * an empty array if no errors were encountered and the document is valid. * * A list of specific validation rules may be provided. If not provided, the * default list of rules defined by the GraphQL specification will be used. * * Each validation rules is a function which returns a visitor * (see the language/visitor API). Visitor methods are expected to return * GraphQLErrors, or Arrays of GraphQLErrors when invalid. * * Optionally a custom TypeInfo instance may be provided. If not provided, one * will be created from the provided schema. */ exports.ABORT_VALIDATION = ABORT_VALIDATION; function validate(schema, documentAST) { var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _specifiedRules.specifiedRules; var typeInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new _TypeInfo.TypeInfo(schema); var options = arguments.length > 4 ? arguments[4] : undefined; documentAST || (0, _devAssert.default)(0, 'Must provide document'); // If the schema used for validation is invalid, throw an error. (0, _validate.assertValidSchema)(schema); var abortObj = Object.freeze({}); var errors = []; var maxErrors = options && options.maxErrors; var context = new _ValidationContext.ValidationContext(schema, documentAST, typeInfo, function (error) { if (maxErrors != null && errors.length >= maxErrors) { errors.push(new _GraphQLError.GraphQLError('Too many validation errors, error limit reached. Validation aborted.')); throw abortObj; } errors.push(error); }); // This uses a specialized visitor which runs multiple visitors in parallel, // while maintaining the visitor skip and break API. var visitor = (0, _visitor.visitInParallel)(rules.map(function (rule) { return rule(context); })); // Visit the whole document with each instance of all provided rules. try { (0, _visitor.visit)(documentAST, (0, _visitor.visitWithTypeInfo)(typeInfo, visitor)); } catch (e) { if (e !== abortObj) { throw e; } } return errors; } // @internal function validateSDL(documentAST, schemaToExtend) { var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _specifiedRules.specifiedSDLRules; var errors = []; var context = new _ValidationContext.SDLValidationContext(documentAST, schemaToExtend, function (error) { errors.push(error); }); var visitors = rules.map(function (rule) { return rule(context); }); (0, _visitor.visit)(documentAST, (0, _visitor.visitInParallel)(visitors)); return errors; } /** * Utility function which asserts a SDL document is valid by throwing an error * if it is invalid. * * @internal */ function assertValidSDL(documentAST) { var errors = validateSDL(documentAST); if (errors.length !== 0) { throw new Error(errors.map(function (error) { return error.message; }).join('\n\n')); } } /** * Utility function which asserts a SDL document is valid by throwing an error * if it is invalid. * * @internal */ function assertValidSDLExtension(documentAST, schema) { var errors = validateSDL(documentAST, schema); if (errors.length !== 0) { throw new Error(errors.map(function (error) { return error.message; }).join('\n\n')); } } /***/ }), /***/ "./node_modules/graphql-ruby-client/node_modules/graphql/version.js": /*!**************************************************************************!*\ !*** ./node_modules/graphql-ruby-client/node_modules/graphql/version.js ***! \**************************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export version [provided] [no usage info] [missing usage info prevents renaming] */ /*! export versionInfo [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.versionInfo = exports.version = void 0; /** * Note: This file is autogenerated using "resources/gen-version.js" script and * automatically updated by "yarn version" command. */ /** * A string containing the version of the GraphQL.js library */ var version = '14.7.0'; /** * An object containing the components of the GraphQL.js version string */ exports.version = version; var versionInfo = Object.freeze({ major: 14, minor: 7, patch: 0, preReleaseTag: null }); exports.versionInfo = versionInfo; /***/ }), /***/ "./src/client/operations/get_election_log_entries.gql": /*!************************************************************!*\ !*** ./src/client/operations/get_election_log_entries.gql ***! \************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module */ /*! CommonJS bailout: module.exports is used directly at 119:4-18 */ /***/ ((module) => { var doc = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetElectionLogEntries"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"electionUniqueId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"election"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"uniqueId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"electionUniqueId"}}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"logEntries"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"messageId"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"signedData"},"arguments":[],"directives":[]}]}}]}}]}}],"loc":{"start":0,"end":187}}; doc.loc.source = {"body":"query GetElectionLogEntries($electionUniqueId: String!, $after: String) {\n election(uniqueId: $electionUniqueId) {\n logEntries {\n id\n messageId\n signedData\n }\n }\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}}; var names = {}; function unique(defs) { return defs.filter( function(def) { if (def.kind !== 'FragmentDefinition') return true; var name = def.name.value if (names[name]) { return false; } else { names[name] = true; return true; } } ) } // Collect any fragment/type references from a node, adding them to the refs Set function collectFragmentReferences(node, refs) { if (node.kind === "FragmentSpread") { refs.add(node.name.value); } else if (node.kind === "VariableDefinition") { var type = node.type; if (type.kind === "NamedType") { refs.add(type.name.value); } } if (node.selectionSet) { node.selectionSet.selections.forEach(function(selection) { collectFragmentReferences(selection, refs); }); } if (node.variableDefinitions) { node.variableDefinitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } if (node.definitions) { node.definitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } } var definitionRefs = {}; (function extractReferences() { doc.definitions.forEach(function(def) { if (def.name) { var refs = new Set(); collectFragmentReferences(def, refs); definitionRefs[def.name.value] = refs; } }); })(); function findOperation(doc, name) { for (var i = 0; i < doc.definitions.length; i++) { var element = doc.definitions[i]; if (element.name && element.name.value == name) { return element; } } } function oneQuery(doc, operationName) { // Copy the DocumentNode, but clear out the definitions var newDoc = { kind: doc.kind, definitions: [findOperation(doc, operationName)] }; if (doc.hasOwnProperty("loc")) { newDoc.loc = doc.loc; } // Now, for the operation we're running, find any fragments referenced by // it or the fragments it references var opRefs = definitionRefs[operationName] || new Set(); var allRefs = new Set(); var newRefs = new Set(); // IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one opRefs.forEach(function(refName) { newRefs.add(refName); }); while (newRefs.size > 0) { var prevRefs = newRefs; newRefs = new Set(); prevRefs.forEach(function(refName) { if (!allRefs.has(refName)) { allRefs.add(refName); var childRefs = definitionRefs[refName] || new Set(); childRefs.forEach(function(childRef) { newRefs.add(childRef); }); } }); } allRefs.forEach(function(refName) { var op = findOperation(doc, refName); if (op) { newDoc.definitions.push(op); } }); return newDoc; } module.exports = doc; module.exports.GetElectionLogEntries = oneQuery(doc, "GetElectionLogEntries"); /***/ }), /***/ "./src/client/operations/get_log_entry.gql": /*!*************************************************!*\ !*** ./src/client/operations/get_log_entry.gql ***! \*************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module */ /*! CommonJS bailout: module.exports is used directly at 119:4-18 */ /***/ ((module) => { var doc = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLogEntry"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"electionUniqueId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"contentHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"logEntry"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"electionUniqueId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"electionUniqueId"}}},{"kind":"Argument","name":{"kind":"Name","value":"contentHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"contentHash"}}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"signedData"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"contentHash"},"arguments":[],"directives":[]}]}}]}}],"loc":{"start":0,"end":199}}; doc.loc.source = {"body":"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}}; var names = {}; function unique(defs) { return defs.filter( function(def) { if (def.kind !== 'FragmentDefinition') return true; var name = def.name.value if (names[name]) { return false; } else { names[name] = true; return true; } } ) } // Collect any fragment/type references from a node, adding them to the refs Set function collectFragmentReferences(node, refs) { if (node.kind === "FragmentSpread") { refs.add(node.name.value); } else if (node.kind === "VariableDefinition") { var type = node.type; if (type.kind === "NamedType") { refs.add(type.name.value); } } if (node.selectionSet) { node.selectionSet.selections.forEach(function(selection) { collectFragmentReferences(selection, refs); }); } if (node.variableDefinitions) { node.variableDefinitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } if (node.definitions) { node.definitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } } var definitionRefs = {}; (function extractReferences() { doc.definitions.forEach(function(def) { if (def.name) { var refs = new Set(); collectFragmentReferences(def, refs); definitionRefs[def.name.value] = refs; } }); })(); function findOperation(doc, name) { for (var i = 0; i < doc.definitions.length; i++) { var element = doc.definitions[i]; if (element.name && element.name.value == name) { return element; } } } function oneQuery(doc, operationName) { // Copy the DocumentNode, but clear out the definitions var newDoc = { kind: doc.kind, definitions: [findOperation(doc, operationName)] }; if (doc.hasOwnProperty("loc")) { newDoc.loc = doc.loc; } // Now, for the operation we're running, find any fragments referenced by // it or the fragments it references var opRefs = definitionRefs[operationName] || new Set(); var allRefs = new Set(); var newRefs = new Set(); // IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one opRefs.forEach(function(refName) { newRefs.add(refName); }); while (newRefs.size > 0) { var prevRefs = newRefs; newRefs = new Set(); prevRefs.forEach(function(refName) { if (!allRefs.has(refName)) { allRefs.add(refName); var childRefs = definitionRefs[refName] || new Set(); childRefs.forEach(function(childRef) { newRefs.add(childRef); }); } }); } allRefs.forEach(function(refName) { var op = findOperation(doc, refName); if (op) { newDoc.definitions.push(op); } }); return newDoc; } module.exports = doc; module.exports.GetLogEntry = oneQuery(doc, "GetLogEntry"); /***/ }), /***/ "./src/client/operations/process_key_ceremony_step.gql": /*!*************************************************************!*\ !*** ./src/client/operations/process_key_ceremony_step.gql ***! \*************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module */ /*! CommonJS bailout: module.exports is used directly at 119:4-18 */ /***/ ((module) => { var doc = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ProcessKeyCeremonyStep"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"messageId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"signedData"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"processKeyCeremonyStep"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"messageId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"messageId"}}},{"kind":"Argument","name":{"kind":"Name","value":"signedData"},"value":{"kind":"Variable","name":{"kind":"Name","value":"signedData"}}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pendingMessage"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"signedData"},"arguments":[],"directives":[]}]}},{"kind":"Field","name":{"kind":"Name","value":"error"},"arguments":[],"directives":[]}]}}]}}],"loc":{"start":0,"end":212}}; doc.loc.source = {"body":"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}}; var names = {}; function unique(defs) { return defs.filter( function(def) { if (def.kind !== 'FragmentDefinition') return true; var name = def.name.value if (names[name]) { return false; } else { names[name] = true; return true; } } ) } // Collect any fragment/type references from a node, adding them to the refs Set function collectFragmentReferences(node, refs) { if (node.kind === "FragmentSpread") { refs.add(node.name.value); } else if (node.kind === "VariableDefinition") { var type = node.type; if (type.kind === "NamedType") { refs.add(type.name.value); } } if (node.selectionSet) { node.selectionSet.selections.forEach(function(selection) { collectFragmentReferences(selection, refs); }); } if (node.variableDefinitions) { node.variableDefinitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } if (node.definitions) { node.definitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } } var definitionRefs = {}; (function extractReferences() { doc.definitions.forEach(function(def) { if (def.name) { var refs = new Set(); collectFragmentReferences(def, refs); definitionRefs[def.name.value] = refs; } }); })(); function findOperation(doc, name) { for (var i = 0; i < doc.definitions.length; i++) { var element = doc.definitions[i]; if (element.name && element.name.value == name) { return element; } } } function oneQuery(doc, operationName) { // Copy the DocumentNode, but clear out the definitions var newDoc = { kind: doc.kind, definitions: [findOperation(doc, operationName)] }; if (doc.hasOwnProperty("loc")) { newDoc.loc = doc.loc; } // Now, for the operation we're running, find any fragments referenced by // it or the fragments it references var opRefs = definitionRefs[operationName] || new Set(); var allRefs = new Set(); var newRefs = new Set(); // IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one opRefs.forEach(function(refName) { newRefs.add(refName); }); while (newRefs.size > 0) { var prevRefs = newRefs; newRefs = new Set(); prevRefs.forEach(function(refName) { if (!allRefs.has(refName)) { allRefs.add(refName); var childRefs = definitionRefs[refName] || new Set(); childRefs.forEach(function(childRef) { newRefs.add(childRef); }); } }); } allRefs.forEach(function(refName) { var op = findOperation(doc, refName); if (op) { newDoc.definitions.push(op); } }); return newDoc; } module.exports = doc; module.exports.ProcessKeyCeremonyStep = oneQuery(doc, "ProcessKeyCeremonyStep"); /***/ }), /***/ "./src/client/operations/subscribe_to_election_log.gql": /*!*************************************************************!*\ !*** ./src/client/operations/subscribe_to_election_log.gql ***! \*************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module */ /*! CommonJS bailout: module.exports is used directly at 119:4-18 */ /***/ ((module) => { var doc = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"SubscribeToElectionLog"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"electionUniqueId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"electionLogEntryAdded"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"electionUniqueId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"electionUniqueId"}}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"logEntry"},"arguments":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"signedData"},"arguments":[],"directives":[]}]}}]}}]}}],"loc":{"start":0,"end":189}}; doc.loc.source = {"body":"subscription SubscribeToElectionLog($electionUniqueId: String!) {\n electionLogEntryAdded(electionUniqueId: $electionUniqueId) {\n logEntry {\n messageId\n signedData\n }\n }\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}}; var names = {}; function unique(defs) { return defs.filter( function(def) { if (def.kind !== 'FragmentDefinition') return true; var name = def.name.value if (names[name]) { return false; } else { names[name] = true; return true; } } ) } // Collect any fragment/type references from a node, adding them to the refs Set function collectFragmentReferences(node, refs) { if (node.kind === "FragmentSpread") { refs.add(node.name.value); } else if (node.kind === "VariableDefinition") { var type = node.type; if (type.kind === "NamedType") { refs.add(type.name.value); } } if (node.selectionSet) { node.selectionSet.selections.forEach(function(selection) { collectFragmentReferences(selection, refs); }); } if (node.variableDefinitions) { node.variableDefinitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } if (node.definitions) { node.definitions.forEach(function(def) { collectFragmentReferences(def, refs); }); } } var definitionRefs = {}; (function extractReferences() { doc.definitions.forEach(function(def) { if (def.name) { var refs = new Set(); collectFragmentReferences(def, refs); definitionRefs[def.name.value] = refs; } }); })(); function findOperation(doc, name) { for (var i = 0; i < doc.definitions.length; i++) { var element = doc.definitions[i]; if (element.name && element.name.value == name) { return element; } } } function oneQuery(doc, operationName) { // Copy the DocumentNode, but clear out the definitions var newDoc = { kind: doc.kind, definitions: [findOperation(doc, operationName)] }; if (doc.hasOwnProperty("loc")) { newDoc.loc = doc.loc; } // Now, for the operation we're running, find any fragments referenced by // it or the fragments it references var opRefs = definitionRefs[operationName] || new Set(); var allRefs = new Set(); var newRefs = new Set(); // IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one opRefs.forEach(function(refName) { newRefs.add(refName); }); while (newRefs.size > 0) { var prevRefs = newRefs; newRefs = new Set(); prevRefs.forEach(function(refName) { if (!allRefs.has(refName)) { allRefs.add(refName); var childRefs = definitionRefs[refName] || new Set(); childRefs.forEach(function(childRef) { newRefs.add(childRef); }); } }); } allRefs.forEach(function(refName) { var op = findOperation(doc, refName); if (op) { newDoc.definitions.push(op); } }); return newDoc; } module.exports = doc; module.exports.SubscribeToElectionLog = oneQuery(doc, "SubscribeToElectionLog"); /***/ }), /***/ "./node_modules/graphql-tag/src/index.js": /*!***********************************************!*\ !*** ./node_modules/graphql-tag/src/index.js ***! \***********************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: module, __webpack_require__ */ /*! CommonJS bailout: module.exports is used directly at 180:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var parser = __webpack_require__(/*! graphql/language/parser */ "./node_modules/graphql/language/parser.js"); var parse = parser.parse; // Strip insignificant whitespace // Note that this could do a lot more, such as reorder fields etc. function normalize(string) { return string.replace(/[\s,]+/g, ' ').trim(); } // A map docString -> graphql document var docCache = {}; // A map fragmentName -> [normalized source] var fragmentSourceMap = {}; function cacheKeyFromLoc(loc) { return normalize(loc.source.body.substring(loc.start, loc.end)); } // For testing. function resetCaches() { docCache = {}; fragmentSourceMap = {}; } // Take a unstripped parsed document (query/mutation or even fragment), and // check all fragment definitions, checking for name->source uniqueness. // We also want to make sure only unique fragments exist in the document. var printFragmentWarnings = true; function processFragments(ast) { var astFragmentMap = {}; var definitions = []; for (var i = 0; i < ast.definitions.length; i++) { var fragmentDefinition = ast.definitions[i]; if (fragmentDefinition.kind === 'FragmentDefinition') { var fragmentName = fragmentDefinition.name.value; var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); // We know something about this fragment if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) { // this is a problem because the app developer is trying to register another fragment with // the same name as one previously registered. So, we tell them about it. if (printFragmentWarnings) { console.warn("Warning: fragment with name " + fragmentName + " already exists.\n" + "graphql-tag enforces all fragment names across your application to be unique; read more about\n" + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"); } fragmentSourceMap[fragmentName][sourceKey] = true; } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) { fragmentSourceMap[fragmentName] = {}; fragmentSourceMap[fragmentName][sourceKey] = true; } if (!astFragmentMap[sourceKey]) { astFragmentMap[sourceKey] = true; definitions.push(fragmentDefinition); } } else { definitions.push(fragmentDefinition); } } ast.definitions = definitions; return ast; } function disableFragmentWarnings() { printFragmentWarnings = false; } function stripLoc(doc, removeLocAtThisLevel) { var docType = Object.prototype.toString.call(doc); if (docType === '[object Array]') { return doc.map(function (d) { return stripLoc(d, removeLocAtThisLevel); }); } if (docType !== '[object Object]') { throw new Error('Unexpected input.'); } // We don't want to remove the root loc field so we can use it // for fragment substitution (see below) if (removeLocAtThisLevel && doc.loc) { delete doc.loc; } // https://github.com/apollographql/graphql-tag/issues/40 if (doc.loc) { delete doc.loc.startToken; delete doc.loc.endToken; } var keys = Object.keys(doc); var key; var value; var valueType; for (key in keys) { if (keys.hasOwnProperty(key)) { value = doc[keys[key]]; valueType = Object.prototype.toString.call(value); if (valueType === '[object Object]' || valueType === '[object Array]') { doc[keys[key]] = stripLoc(value, true); } } } return doc; } var experimentalFragmentVariables = false; function parseDocument(doc) { var cacheKey = normalize(doc); if (docCache[cacheKey]) { return docCache[cacheKey]; } var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables }); if (!parsed || parsed.kind !== 'Document') { throw new Error('Not a valid GraphQL document.'); } // check that all "new" fragments inside the documents are consistent with // existing fragments of the same name parsed = processFragments(parsed); parsed = stripLoc(parsed, false); docCache[cacheKey] = parsed; return parsed; } function enableExperimentalFragmentVariables() { experimentalFragmentVariables = true; } function disableExperimentalFragmentVariables() { experimentalFragmentVariables = false; } // XXX This should eventually disallow arbitrary string interpolation, like Relay does function gql(/* arguments */) { var args = Array.prototype.slice.call(arguments); var literals = args[0]; // We always get literals[0] and then matching post literals for each arg given var result = (typeof(literals) === "string") ? literals : literals[0]; for (var i = 1; i < args.length; i++) { if (args[i] && args[i].kind && args[i].kind === 'Document') { result += args[i].loc.source.body; } else { result += args[i]; } result += literals[i]; } return parseDocument(result); } // Support typescript, which isn't as nice as Babel about default exports gql.default = gql; gql.resetCaches = resetCaches; gql.disableFragmentWarnings = disableFragmentWarnings; gql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables; gql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables; module.exports = gql; /***/ }), /***/ "./node_modules/graphql/error/GraphQLError.js": /*!****************************************************!*\ !*** ./node_modules/graphql/error/GraphQLError.js ***! \****************************************************/ /*! flagged exports */ /*! export GraphQLError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.printError = printError; exports.GraphQLError = void 0; var _isObjectLike = _interopRequireDefault(__webpack_require__(/*! ../jsutils/isObjectLike.js */ "./node_modules/graphql/jsutils/isObjectLike.js")); var _symbols = __webpack_require__(/*! ../polyfills/symbols.js */ "./node_modules/graphql/polyfills/symbols.js"); var _location = __webpack_require__(/*! ../language/location.js */ "./node_modules/graphql/language/location.js"); var _printLocation = __webpack_require__(/*! ../language/printLocation.js */ "./node_modules/graphql/language/printLocation.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /** * A GraphQLError describes an Error found during the parse, validate, or * execute phases of performing a GraphQL operation. In addition to a message * and stack trace, it also includes information about the locations in a * GraphQL document and/or execution result that correspond to the Error. */ var GraphQLError = /*#__PURE__*/function (_Error) { _inherits(GraphQLError, _Error); var _super = _createSuper(GraphQLError); /** * A message describing the Error for debugging purposes. * * Enumerable, and appears in the result of JSON.stringify(). * * Note: should be treated as readonly, despite invariant usage. */ /** * An array of { line, column } locations within the source GraphQL document * which correspond to this error. * * Errors during validation often contain multiple locations, for example to * point out two things with the same name. Errors during execution include a * single location, the field which produced the error. * * Enumerable, and appears in the result of JSON.stringify(). */ /** * An array describing the JSON-path into the execution response which * corresponds to this error. Only included for errors during execution. * * Enumerable, and appears in the result of JSON.stringify(). */ /** * An array of GraphQL AST Nodes corresponding to this error. */ /** * The source GraphQL document for the first location of this error. * * Note that if this Error represents more than one node, the source may not * represent nodes after the first node. */ /** * An array of character offsets within the source GraphQL document * which correspond to this error. */ /** * The original error thrown from a field resolver during execution. */ /** * Extension fields to add to the formatted error. */ function GraphQLError(message, nodes, source, positions, path, originalError, extensions) { var _locations2, _source2, _positions2, _extensions2; var _this; _classCallCheck(this, GraphQLError); _this = _super.call(this, message); // Compute list of blame nodes. var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions. var _source = source; if (!_source && _nodes) { var _nodes$0$loc; _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$loc.source; } var _positions = positions; if (!_positions && _nodes) { _positions = _nodes.reduce(function (list, node) { if (node.loc) { list.push(node.loc.start); } return list; }, []); } if (_positions && _positions.length === 0) { _positions = undefined; } var _locations; if (positions && source) { _locations = positions.map(function (pos) { return (0, _location.getLocation)(source, pos); }); } else if (_nodes) { _locations = _nodes.reduce(function (list, node) { if (node.loc) { list.push((0, _location.getLocation)(node.loc.source, node.loc.start)); } return list; }, []); } var _extensions = extensions; if (_extensions == null && originalError != null) { var originalExtensions = originalError.extensions; if ((0, _isObjectLike.default)(originalExtensions)) { _extensions = originalExtensions; } } Object.defineProperties(_assertThisInitialized(_this), { name: { value: 'GraphQLError' }, message: { value: message, // By being enumerable, JSON.stringify will include `message` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: true, writable: true }, locations: { // Coercing falsy values to undefined ensures they will not be included // in JSON.stringify() when not provided. value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : undefined, // By being enumerable, JSON.stringify will include `locations` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: _locations != null }, path: { // Coercing falsy values to undefined ensures they will not be included // in JSON.stringify() when not provided. value: path !== null && path !== void 0 ? path : undefined, // By being enumerable, JSON.stringify will include `path` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: path != null }, nodes: { value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined }, source: { value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined }, positions: { value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined }, originalError: { value: originalError }, extensions: { // Coercing falsy values to undefined ensures they will not be included // in JSON.stringify() when not provided. value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : undefined, // By being enumerable, JSON.stringify will include `path` in the // resulting output. This ensures that the simplest possible GraphQL // service adheres to the spec. enumerable: _extensions != null } }); // Include (non-enumerable) stack trace. if (originalError === null || originalError === void 0 ? void 0 : originalError.stack) { Object.defineProperty(_assertThisInitialized(_this), 'stack', { value: originalError.stack, writable: true, configurable: true }); return _possibleConstructorReturn(_this); } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') if (Error.captureStackTrace) { Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError); } else { Object.defineProperty(_assertThisInitialized(_this), 'stack', { value: Error().stack, writable: true, configurable: true }); } return _this; } _createClass(GraphQLError, [{ key: "toString", value: function toString() { return printError(this); } // FIXME: workaround to not break chai comparisons, should be remove in v16 // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet }, { key: _symbols.SYMBOL_TO_STRING_TAG, get: function get() { return 'Object'; } }]); return GraphQLError; }( /*#__PURE__*/_wrapNativeSuper(Error)); /** * Prints a GraphQLError to a string, representing useful location information * about the error's position in the source. */ exports.GraphQLError = GraphQLError; function printError(error) { var output = error.message; if (error.nodes) { for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) { var node = _error$nodes2[_i2]; if (node.loc) { output += '\n\n' + (0, _printLocation.printLocation)(node.loc); } } } else if (error.source && error.locations) { for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) { var location = _error$locations2[_i4]; output += '\n\n' + (0, _printLocation.printSourceLocation)(error.source, location); } } return output; } /***/ }), /***/ "./node_modules/graphql/error/syntaxError.js": /*!***************************************************!*\ !*** ./node_modules/graphql/error/syntaxError.js ***! \***************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export syntaxError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.syntaxError = syntaxError; var _GraphQLError = __webpack_require__(/*! ./GraphQLError.js */ "./node_modules/graphql/error/GraphQLError.js"); /** * Produces a GraphQLError representing a syntax error, containing useful * descriptive information about the syntax error's position in the source. */ function syntaxError(source, position, description) { return new _GraphQLError.GraphQLError("Syntax Error: ".concat(description), undefined, source, [position]); } /***/ }), /***/ "./node_modules/graphql/jsutils/defineInspect.js": /*!*******************************************************!*\ !*** ./node_modules/graphql/jsutils/defineInspect.js ***! \*******************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = defineInspect; var _invariant = _interopRequireDefault(__webpack_require__(/*! ./invariant.js */ "./node_modules/graphql/jsutils/invariant.js")); var _nodejsCustomInspectSymbol = _interopRequireDefault(__webpack_require__(/*! ./nodejsCustomInspectSymbol.js */ "./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` */ function defineInspect(classObject) { var fn = classObject.prototype.toJSON; typeof fn === 'function' || (0, _invariant.default)(0); classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') if (_nodejsCustomInspectSymbol.default) { classObject.prototype[_nodejsCustomInspectSymbol.default] = fn; } } /***/ }), /***/ "./node_modules/graphql/jsutils/defineInspect.mjs": /*!********************************************************!*\ !*** ./node_modules/graphql/jsutils/defineInspect.mjs ***! \********************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => /* binding */ defineInspect /* harmony export */ }); /* harmony import */ var _invariant_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./invariant.mjs */ "./node_modules/graphql/jsutils/invariant.mjs"); /* harmony import */ var _nodejsCustomInspectSymbol_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodejsCustomInspectSymbol.mjs */ "./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs"); ; /** * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` */ function defineInspect(classObject) { var fn = classObject.prototype.toJSON; typeof fn === 'function' || (0,_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__.default)(0); classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') if (_nodejsCustomInspectSymbol_mjs__WEBPACK_IMPORTED_MODULE_1__.default) { classObject.prototype[_nodejsCustomInspectSymbol_mjs__WEBPACK_IMPORTED_MODULE_1__.default] = fn; } } /***/ }), /***/ "./node_modules/graphql/jsutils/devAssert.js": /*!***************************************************!*\ !*** ./node_modules/graphql/jsutils/devAssert.js ***! \***************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = devAssert; function devAssert(condition, message) { var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') if (!booleanCondition) { throw new Error(message); } } /***/ }), /***/ "./node_modules/graphql/jsutils/inspect.js": /*!*************************************************!*\ !*** ./node_modules/graphql/jsutils/inspect.js ***! \*************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = inspect; var _nodejsCustomInspectSymbol = _interopRequireDefault(__webpack_require__(/*! ./nodejsCustomInspectSymbol.js */ "./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var MAX_ARRAY_LENGTH = 10; var MAX_RECURSIVE_DEPTH = 2; /** * Used to print values in error messages. */ function inspect(value) { return formatValue(value, []); } function formatValue(value, seenValues) { switch (_typeof(value)) { case 'string': return JSON.stringify(value); case 'function': return value.name ? "[function ".concat(value.name, "]") : '[function]'; case 'object': if (value === null) { return 'null'; } return formatObjectValue(value, seenValues); default: return String(value); } } function formatObjectValue(value, previouslySeenValues) { if (previouslySeenValues.indexOf(value) !== -1) { return '[Circular]'; } var seenValues = [].concat(previouslySeenValues, [value]); var customInspectFn = getCustomFn(value); if (customInspectFn !== undefined) { var customValue = customInspectFn.call(value); // check for infinite recursion if (customValue !== value) { return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues); } } else if (Array.isArray(value)) { return formatArray(value, seenValues); } return formatObject(value, seenValues); } function formatObject(object, seenValues) { var keys = Object.keys(object); if (keys.length === 0) { return '{}'; } if (seenValues.length > MAX_RECURSIVE_DEPTH) { return '[' + getObjectTag(object) + ']'; } var properties = keys.map(function (key) { var value = formatValue(object[key], seenValues); return key + ': ' + value; }); return '{ ' + properties.join(', ') + ' }'; } function formatArray(array, seenValues) { if (array.length === 0) { return '[]'; } if (seenValues.length > MAX_RECURSIVE_DEPTH) { return '[Array]'; } var len = Math.min(MAX_ARRAY_LENGTH, array.length); var remaining = array.length - len; var items = []; for (var i = 0; i < len; ++i) { items.push(formatValue(array[i], seenValues)); } if (remaining === 1) { items.push('... 1 more item'); } else if (remaining > 1) { items.push("... ".concat(remaining, " more items")); } return '[' + items.join(', ') + ']'; } function getCustomFn(object) { var customInspectFn = object[String(_nodejsCustomInspectSymbol.default)]; if (typeof customInspectFn === 'function') { return customInspectFn; } if (typeof object.inspect === 'function') { return object.inspect; } } function getObjectTag(object) { var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); if (tag === 'Object' && typeof object.constructor === 'function') { var name = object.constructor.name; if (typeof name === 'string' && name !== '') { return name; } } return tag; } /***/ }), /***/ "./node_modules/graphql/jsutils/inspect.mjs": /*!**************************************************!*\ !*** ./node_modules/graphql/jsutils/inspect.mjs ***! \**************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => /* binding */ inspect /* harmony export */ }); /* harmony import */ var _nodejsCustomInspectSymbol_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nodejsCustomInspectSymbol.mjs */ "./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /* eslint-disable flowtype/no-weak-types */ var MAX_ARRAY_LENGTH = 10; var MAX_RECURSIVE_DEPTH = 2; /** * Used to print values in error messages. */ function inspect(value) { return formatValue(value, []); } function formatValue(value, seenValues) { switch (_typeof(value)) { case 'string': return JSON.stringify(value); case 'function': return value.name ? "[function ".concat(value.name, "]") : '[function]'; case 'object': if (value === null) { return 'null'; } return formatObjectValue(value, seenValues); default: return String(value); } } function formatObjectValue(value, previouslySeenValues) { if (previouslySeenValues.indexOf(value) !== -1) { return '[Circular]'; } var seenValues = [].concat(previouslySeenValues, [value]); var customInspectFn = getCustomFn(value); if (customInspectFn !== undefined) { var customValue = customInspectFn.call(value); // check for infinite recursion if (customValue !== value) { return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues); } } else if (Array.isArray(value)) { return formatArray(value, seenValues); } return formatObject(value, seenValues); } function formatObject(object, seenValues) { var keys = Object.keys(object); if (keys.length === 0) { return '{}'; } if (seenValues.length > MAX_RECURSIVE_DEPTH) { return '[' + getObjectTag(object) + ']'; } var properties = keys.map(function (key) { var value = formatValue(object[key], seenValues); return key + ': ' + value; }); return '{ ' + properties.join(', ') + ' }'; } function formatArray(array, seenValues) { if (array.length === 0) { return '[]'; } if (seenValues.length > MAX_RECURSIVE_DEPTH) { return '[Array]'; } var len = Math.min(MAX_ARRAY_LENGTH, array.length); var remaining = array.length - len; var items = []; for (var i = 0; i < len; ++i) { items.push(formatValue(array[i], seenValues)); } if (remaining === 1) { items.push('... 1 more item'); } else if (remaining > 1) { items.push("... ".concat(remaining, " more items")); } return '[' + items.join(', ') + ']'; } function getCustomFn(object) { var customInspectFn = object[String(_nodejsCustomInspectSymbol_mjs__WEBPACK_IMPORTED_MODULE_0__.default)]; if (typeof customInspectFn === 'function') { return customInspectFn; } if (typeof object.inspect === 'function') { return object.inspect; } } function getObjectTag(object) { var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); if (tag === 'Object' && typeof object.constructor === 'function') { var name = object.constructor.name; if (typeof name === 'string' && name !== '') { return name; } } return tag; } /***/ }), /***/ "./node_modules/graphql/jsutils/instanceOf.js": /*!****************************************************!*\ !*** ./node_modules/graphql/jsutils/instanceOf.js ***! \****************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; /** * A replacement for instanceof which includes an error warning when multi-realm * constructors are detected. */ // See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production // See: https://webpack.js.org/guides/production/ var _default = false ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') // eslint-disable-next-line no-shadow 0 : // eslint-disable-next-line no-shadow function instanceOf(value, constructor) { if (value instanceof constructor) { return true; } if (value) { var valueClass = value.constructor; var className = constructor.name; if (className && valueClass && valueClass.name === className) { throw new Error("Cannot use ".concat(className, " \"").concat(value, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); } } return false; }; exports.default = _default; /***/ }), /***/ "./node_modules/graphql/jsutils/invariant.js": /*!***************************************************!*\ !*** ./node_modules/graphql/jsutils/invariant.js ***! \***************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = invariant; function invariant(condition, message) { var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') if (!booleanCondition) { throw new Error(message != null ? message : 'Unexpected invariant triggered.'); } } /***/ }), /***/ "./node_modules/graphql/jsutils/invariant.mjs": /*!****************************************************!*\ !*** ./node_modules/graphql/jsutils/invariant.mjs ***! \****************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => /* binding */ invariant /* harmony export */ }); function invariant(condition, message) { var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') if (!booleanCondition) { throw new Error(message != null ? message : 'Unexpected invariant triggered.'); } } /***/ }), /***/ "./node_modules/graphql/jsutils/isObjectLike.js": /*!******************************************************!*\ !*** ./node_modules/graphql/jsutils/isObjectLike.js ***! \******************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = isObjectLike; function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** * Return true if `value` is object-like. A value is object-like if it's not * `null` and has a `typeof` result of "object". */ function isObjectLike(value) { return _typeof(value) == 'object' && value !== null; } /***/ }), /***/ "./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js": /*!*******************************************************************!*\ !*** ./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js ***! \*******************************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = void 0; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; var _default = nodejsCustomInspectSymbol; exports.default = _default; /***/ }), /***/ "./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs": /*!********************************************************************!*\ !*** ./node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs ***! \********************************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___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 */ }); // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nodejsCustomInspectSymbol); /***/ }), /***/ "./node_modules/graphql/language/ast.js": /*!**********************************************!*\ !*** ./node_modules/graphql/language/ast.js ***! \**********************************************/ /*! flagged exports */ /*! export Location [provided] [no usage info] [missing usage info prevents renaming] */ /*! export Token [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isNode = isNode; exports.Token = exports.Location = void 0; var _defineInspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/defineInspect.js */ "./node_modules/graphql/jsutils/defineInspect.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Contains a range of UTF-8 character offsets and token references that * identify the region of the source from which the AST derived. */ var Location = /*#__PURE__*/function () { /** * The character offset at which this Node begins. */ /** * The character offset at which this Node ends. */ /** * The Token at which this Node begins. */ /** * The Token at which this Node ends. */ /** * The Source document the AST represents. */ function Location(startToken, endToken, source) { this.start = startToken.start; this.end = endToken.end; this.startToken = startToken; this.endToken = endToken; this.source = source; } var _proto = Location.prototype; _proto.toJSON = function toJSON() { return { start: this.start, end: this.end }; }; return Location; }(); // Print a simplified form when appearing in `inspect` and `util.inspect`. exports.Location = Location; (0, _defineInspect.default)(Location); /** * Represents a range of characters represented by a lexical token * within a Source. */ var Token = /*#__PURE__*/function () { /** * The kind of Token. */ /** * The character offset at which this Node begins. */ /** * The character offset at which this Node ends. */ /** * The 1-indexed line number on which this Token appears. */ /** * The 1-indexed column number at which this Token begins. */ /** * For non-punctuation tokens, represents the interpreted value of the token. */ /** * Tokens exist as nodes in a double-linked-list amongst all tokens * including ignored tokens. is always the first node and * the last. */ function Token(kind, start, end, line, column, prev, value) { this.kind = kind; this.start = start; this.end = end; this.line = line; this.column = column; this.value = value; this.prev = prev; this.next = null; } var _proto2 = Token.prototype; _proto2.toJSON = function toJSON() { return { kind: this.kind, value: this.value, line: this.line, column: this.column }; }; return Token; }(); // Print a simplified form when appearing in `inspect` and `util.inspect`. exports.Token = Token; (0, _defineInspect.default)(Token); /** * @internal */ function isNode(maybeNode) { return maybeNode != null && typeof maybeNode.kind === 'string'; } /** * The list of all possible AST node types. */ /***/ }), /***/ "./node_modules/graphql/language/ast.mjs": /*!***********************************************!*\ !*** ./node_modules/graphql/language/ast.mjs ***! \***********************************************/ /*! namespace exports */ /*! export Location [provided] [no usage info] [missing usage info prevents renaming] */ /*! export Token [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isNode [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Location": () => /* binding */ Location, /* harmony export */ "Token": () => /* binding */ Token, /* harmony export */ "isNode": () => /* binding */ isNode /* harmony export */ }); /* harmony import */ var _jsutils_defineInspect_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/defineInspect.mjs */ "./node_modules/graphql/jsutils/defineInspect.mjs"); ; /** * Contains a range of UTF-8 character offsets and token references that * identify the region of the source from which the AST derived. */ var Location = /*#__PURE__*/function () { /** * The character offset at which this Node begins. */ /** * The character offset at which this Node ends. */ /** * The Token at which this Node begins. */ /** * The Token at which this Node ends. */ /** * The Source document the AST represents. */ function Location(startToken, endToken, source) { this.start = startToken.start; this.end = endToken.end; this.startToken = startToken; this.endToken = endToken; this.source = source; } var _proto = Location.prototype; _proto.toJSON = function toJSON() { return { start: this.start, end: this.end }; }; return Location; }(); // Print a simplified form when appearing in `inspect` and `util.inspect`. (0,_jsutils_defineInspect_mjs__WEBPACK_IMPORTED_MODULE_0__.default)(Location); /** * Represents a range of characters represented by a lexical token * within a Source. */ var Token = /*#__PURE__*/function () { /** * The kind of Token. */ /** * The character offset at which this Node begins. */ /** * The character offset at which this Node ends. */ /** * The 1-indexed line number on which this Token appears. */ /** * The 1-indexed column number at which this Token begins. */ /** * For non-punctuation tokens, represents the interpreted value of the token. */ /** * Tokens exist as nodes in a double-linked-list amongst all tokens * including ignored tokens. is always the first node and * the last. */ function Token(kind, start, end, line, column, prev, value) { this.kind = kind; this.start = start; this.end = end; this.line = line; this.column = column; this.value = value; this.prev = prev; this.next = null; } var _proto2 = Token.prototype; _proto2.toJSON = function toJSON() { return { kind: this.kind, value: this.value, line: this.line, column: this.column }; }; return Token; }(); // Print a simplified form when appearing in `inspect` and `util.inspect`. (0,_jsutils_defineInspect_mjs__WEBPACK_IMPORTED_MODULE_0__.default)(Token); /** * @internal */ function isNode(maybeNode) { return maybeNode != null && typeof maybeNode.kind === 'string'; } /** * The list of all possible AST node types. */ /***/ }), /***/ "./node_modules/graphql/language/blockString.js": /*!******************************************************!*\ !*** ./node_modules/graphql/language/blockString.js ***! \******************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export dedentBlockStringValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getBlockStringIndentation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printBlockString [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.dedentBlockStringValue = dedentBlockStringValue; exports.getBlockStringIndentation = getBlockStringIndentation; exports.printBlockString = printBlockString; /** * Produces the value of a block string from its parsed raw value, similar to * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. * * This implements the GraphQL spec's BlockStringValue() static algorithm. * * @internal */ function dedentBlockStringValue(rawString) { // Expand a block string's raw value into independent lines. var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first. var commonIndent = getBlockStringIndentation(rawString); if (commonIndent !== 0) { for (var i = 1; i < lines.length; i++) { lines[i] = lines[i].slice(commonIndent); } } // Remove leading and trailing blank lines. var startLine = 0; while (startLine < lines.length && isBlank(lines[startLine])) { ++startLine; } var endLine = lines.length; while (endLine > startLine && isBlank(lines[endLine - 1])) { --endLine; } // Return a string of the lines joined with U+000A. return lines.slice(startLine, endLine).join('\n'); } function isBlank(str) { for (var i = 0; i < str.length; ++i) { if (str[i] !== ' ' && str[i] !== '\t') { return false; } } return true; } /** * @internal */ function getBlockStringIndentation(value) { var _commonIndent; var isFirstLine = true; var isEmptyLine = true; var indent = 0; var commonIndent = null; for (var i = 0; i < value.length; ++i) { switch (value.charCodeAt(i)) { case 13: // \r if (value.charCodeAt(i + 1) === 10) { ++i; // skip \r\n as one symbol } // falls through case 10: // \n isFirstLine = false; isEmptyLine = true; indent = 0; break; case 9: // \t case 32: // ++indent; break; default: if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) { commonIndent = indent; } isEmptyLine = false; } } return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0; } /** * Print a block string in the indented block form by adding a leading and * trailing blank line. However, if a block string starts with whitespace and is * a single-line, adding a leading blank line would strip that whitespace. * * @internal */ function printBlockString(value) { var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isSingleLine = value.indexOf('\n') === -1; var hasLeadingSpace = value[0] === ' ' || value[0] === '\t'; var hasTrailingQuote = value[value.length - 1] === '"'; var hasTrailingSlash = value[value.length - 1] === '\\'; var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines; var result = ''; // Format a multi-line block quote to account for leading space. if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) { result += '\n' + indentation; } result += indentation ? value.replace(/\n/g, '\n' + indentation) : value; if (printAsMultipleLines) { result += '\n'; } return '"""' + result.replace(/"""/g, '\\"""') + '"""'; } /***/ }), /***/ "./node_modules/graphql/language/blockString.mjs": /*!*******************************************************!*\ !*** ./node_modules/graphql/language/blockString.mjs ***! \*******************************************************/ /*! namespace exports */ /*! export dedentBlockStringValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getBlockStringIndentation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printBlockString [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "dedentBlockStringValue": () => /* binding */ dedentBlockStringValue, /* harmony export */ "getBlockStringIndentation": () => /* binding */ getBlockStringIndentation, /* harmony export */ "printBlockString": () => /* binding */ printBlockString /* harmony export */ }); /** * Produces the value of a block string from its parsed raw value, similar to * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. * * This implements the GraphQL spec's BlockStringValue() static algorithm. * * @internal */ function dedentBlockStringValue(rawString) { // Expand a block string's raw value into independent lines. var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first. var commonIndent = getBlockStringIndentation(rawString); if (commonIndent !== 0) { for (var i = 1; i < lines.length; i++) { lines[i] = lines[i].slice(commonIndent); } } // Remove leading and trailing blank lines. var startLine = 0; while (startLine < lines.length && isBlank(lines[startLine])) { ++startLine; } var endLine = lines.length; while (endLine > startLine && isBlank(lines[endLine - 1])) { --endLine; } // Return a string of the lines joined with U+000A. return lines.slice(startLine, endLine).join('\n'); } function isBlank(str) { for (var i = 0; i < str.length; ++i) { if (str[i] !== ' ' && str[i] !== '\t') { return false; } } return true; } /** * @internal */ function getBlockStringIndentation(value) { var _commonIndent; var isFirstLine = true; var isEmptyLine = true; var indent = 0; var commonIndent = null; for (var i = 0; i < value.length; ++i) { switch (value.charCodeAt(i)) { case 13: // \r if (value.charCodeAt(i + 1) === 10) { ++i; // skip \r\n as one symbol } // falls through case 10: // \n isFirstLine = false; isEmptyLine = true; indent = 0; break; case 9: // \t case 32: // ++indent; break; default: if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) { commonIndent = indent; } isEmptyLine = false; } } return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0; } /** * Print a block string in the indented block form by adding a leading and * trailing blank line. However, if a block string starts with whitespace and is * a single-line, adding a leading blank line would strip that whitespace. * * @internal */ function printBlockString(value) { var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isSingleLine = value.indexOf('\n') === -1; var hasLeadingSpace = value[0] === ' ' || value[0] === '\t'; var hasTrailingQuote = value[value.length - 1] === '"'; var hasTrailingSlash = value[value.length - 1] === '\\'; var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines; var result = ''; // Format a multi-line block quote to account for leading space. if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) { result += '\n' + indentation; } result += indentation ? value.replace(/\n/g, '\n' + indentation) : value; if (printAsMultipleLines) { result += '\n'; } return '"""' + result.replace(/"""/g, '\\"""') + '"""'; } /***/ }), /***/ "./node_modules/graphql/language/directiveLocation.js": /*!************************************************************!*\ !*** ./node_modules/graphql/language/directiveLocation.js ***! \************************************************************/ /*! flagged exports */ /*! export DirectiveLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DirectiveLocation = void 0; /** * The set of allowed directive location values. */ var DirectiveLocation = Object.freeze({ // Request Definitions QUERY: 'QUERY', MUTATION: 'MUTATION', SUBSCRIPTION: 'SUBSCRIPTION', FIELD: 'FIELD', FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', INLINE_FRAGMENT: 'INLINE_FRAGMENT', VARIABLE_DEFINITION: 'VARIABLE_DEFINITION', // Type System Definitions SCHEMA: 'SCHEMA', SCALAR: 'SCALAR', OBJECT: 'OBJECT', FIELD_DEFINITION: 'FIELD_DEFINITION', ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', INTERFACE: 'INTERFACE', UNION: 'UNION', ENUM: 'ENUM', ENUM_VALUE: 'ENUM_VALUE', INPUT_OBJECT: 'INPUT_OBJECT', INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION' }); /** * The enum type representing the directive location values. */ exports.DirectiveLocation = DirectiveLocation; /***/ }), /***/ "./node_modules/graphql/language/kinds.js": /*!************************************************!*\ !*** ./node_modules/graphql/language/kinds.js ***! \************************************************/ /*! flagged exports */ /*! export Kind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Kind = void 0; /** * The set of allowed kind values for AST nodes. */ var Kind = Object.freeze({ // Name NAME: 'Name', // Document DOCUMENT: 'Document', OPERATION_DEFINITION: 'OperationDefinition', VARIABLE_DEFINITION: 'VariableDefinition', SELECTION_SET: 'SelectionSet', FIELD: 'Field', ARGUMENT: 'Argument', // Fragments FRAGMENT_SPREAD: 'FragmentSpread', INLINE_FRAGMENT: 'InlineFragment', FRAGMENT_DEFINITION: 'FragmentDefinition', // Values VARIABLE: 'Variable', INT: 'IntValue', FLOAT: 'FloatValue', STRING: 'StringValue', BOOLEAN: 'BooleanValue', NULL: 'NullValue', ENUM: 'EnumValue', LIST: 'ListValue', OBJECT: 'ObjectValue', OBJECT_FIELD: 'ObjectField', // Directives DIRECTIVE: 'Directive', // Types NAMED_TYPE: 'NamedType', LIST_TYPE: 'ListType', NON_NULL_TYPE: 'NonNullType', // Type System Definitions SCHEMA_DEFINITION: 'SchemaDefinition', OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition', // Type Definitions SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition', OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition', FIELD_DEFINITION: 'FieldDefinition', INPUT_VALUE_DEFINITION: 'InputValueDefinition', INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition', UNION_TYPE_DEFINITION: 'UnionTypeDefinition', ENUM_TYPE_DEFINITION: 'EnumTypeDefinition', ENUM_VALUE_DEFINITION: 'EnumValueDefinition', INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition', // Directive Definitions DIRECTIVE_DEFINITION: 'DirectiveDefinition', // Type System Extensions SCHEMA_EXTENSION: 'SchemaExtension', // Type Extensions SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension', OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension', INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension', UNION_TYPE_EXTENSION: 'UnionTypeExtension', ENUM_TYPE_EXTENSION: 'EnumTypeExtension', INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension' }); /** * The enum type representing the possible kind values of AST nodes. */ exports.Kind = Kind; /***/ }), /***/ "./node_modules/graphql/language/lexer.js": /*!************************************************!*\ !*** ./node_modules/graphql/language/lexer.js ***! \************************************************/ /*! flagged exports */ /*! export Lexer [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isPunctuatorTokenKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isPunctuatorTokenKind = isPunctuatorTokenKind; exports.Lexer = void 0; var _syntaxError = __webpack_require__(/*! ../error/syntaxError.js */ "./node_modules/graphql/error/syntaxError.js"); var _ast = __webpack_require__(/*! ./ast.js */ "./node_modules/graphql/language/ast.js"); var _tokenKind = __webpack_require__(/*! ./tokenKind.js */ "./node_modules/graphql/language/tokenKind.js"); var _blockString = __webpack_require__(/*! ./blockString.js */ "./node_modules/graphql/language/blockString.js"); /** * Given a Source object, creates a Lexer for that source. * A Lexer is a stateful stream generator in that every time * it is advanced, it returns the next token in the Source. Assuming the * source lexes, the final Token emitted by the lexer will be of kind * EOF, after which the lexer will repeatedly return the same EOF token * whenever called. */ var Lexer = /*#__PURE__*/function () { /** * The previously focused non-ignored token. */ /** * The currently focused non-ignored token. */ /** * The (1-indexed) line containing the current token. */ /** * The character offset at which the current line begins. */ function Lexer(source) { var startOfFileToken = new _ast.Token(_tokenKind.TokenKind.SOF, 0, 0, 0, 0, null); this.source = source; this.lastToken = startOfFileToken; this.token = startOfFileToken; this.line = 1; this.lineStart = 0; } /** * Advances the token stream to the next non-ignored token. */ var _proto = Lexer.prototype; _proto.advance = function advance() { this.lastToken = this.token; var token = this.token = this.lookahead(); return token; } /** * Looks ahead and returns the next non-ignored token, but does not change * the state of Lexer. */ ; _proto.lookahead = function lookahead() { var token = this.token; if (token.kind !== _tokenKind.TokenKind.EOF) { do { var _token$next; // Note: next is only mutable during parsing, so we cast to allow this. token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token); } while (token.kind === _tokenKind.TokenKind.COMMENT); } return token; }; return Lexer; }(); /** * @internal */ exports.Lexer = Lexer; function isPunctuatorTokenKind(kind) { return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKind.AMP || kind === _tokenKind.TokenKind.PAREN_L || kind === _tokenKind.TokenKind.PAREN_R || kind === _tokenKind.TokenKind.SPREAD || kind === _tokenKind.TokenKind.COLON || kind === _tokenKind.TokenKind.EQUALS || kind === _tokenKind.TokenKind.AT || kind === _tokenKind.TokenKind.BRACKET_L || kind === _tokenKind.TokenKind.BRACKET_R || kind === _tokenKind.TokenKind.BRACE_L || kind === _tokenKind.TokenKind.PIPE || kind === _tokenKind.TokenKind.BRACE_R; } function printCharCode(code) { return (// NaN/undefined represents access beyond the end of the file. isNaN(code) ? _tokenKind.TokenKind.EOF : // Trust JSON for ASCII. code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form. "\"\\u".concat(('00' + code.toString(16).toUpperCase()).slice(-4), "\"") ); } /** * Gets the next token from the source starting at the given position. * * This skips over whitespace until it finds the next lexable token, then lexes * punctuators immediately or calls the appropriate helper function for more * complicated tokens. */ function readToken(lexer, prev) { var source = lexer.source; var body = source.body; var bodyLength = body.length; var pos = prev.end; while (pos < bodyLength) { var code = body.charCodeAt(pos); var _line = lexer.line; var _col = 1 + pos - lexer.lineStart; // SourceCharacter switch (code) { case 0xfeff: // case 9: // \t case 32: // case 44: // , ++pos; continue; case 10: // \n ++pos; ++lexer.line; lexer.lineStart = pos; continue; case 13: // \r if (body.charCodeAt(pos + 1) === 10) { pos += 2; } else { ++pos; } ++lexer.line; lexer.lineStart = pos; continue; case 33: // ! return new _ast.Token(_tokenKind.TokenKind.BANG, pos, pos + 1, _line, _col, prev); case 35: // # return readComment(source, pos, _line, _col, prev); case 36: // $ return new _ast.Token(_tokenKind.TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev); case 38: // & return new _ast.Token(_tokenKind.TokenKind.AMP, pos, pos + 1, _line, _col, prev); case 40: // ( return new _ast.Token(_tokenKind.TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev); case 41: // ) return new _ast.Token(_tokenKind.TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev); case 46: // . if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) { return new _ast.Token(_tokenKind.TokenKind.SPREAD, pos, pos + 3, _line, _col, prev); } break; case 58: // : return new _ast.Token(_tokenKind.TokenKind.COLON, pos, pos + 1, _line, _col, prev); case 61: // = return new _ast.Token(_tokenKind.TokenKind.EQUALS, pos, pos + 1, _line, _col, prev); case 64: // @ return new _ast.Token(_tokenKind.TokenKind.AT, pos, pos + 1, _line, _col, prev); case 91: // [ return new _ast.Token(_tokenKind.TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev); case 93: // ] return new _ast.Token(_tokenKind.TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev); case 123: // { return new _ast.Token(_tokenKind.TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev); case 124: // | return new _ast.Token(_tokenKind.TokenKind.PIPE, pos, pos + 1, _line, _col, prev); case 125: // } return new _ast.Token(_tokenKind.TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev); case 34: // " if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) { return readBlockString(source, pos, _line, _col, prev, lexer); } return readString(source, pos, _line, _col, prev); case 45: // - case 48: // 0 case 49: // 1 case 50: // 2 case 51: // 3 case 52: // 4 case 53: // 5 case 54: // 6 case 55: // 7 case 56: // 8 case 57: // 9 return readNumber(source, pos, code, _line, _col, prev); case 65: // A case 66: // B case 67: // C case 68: // D case 69: // E case 70: // F case 71: // G case 72: // H case 73: // I case 74: // J case 75: // K case 76: // L case 77: // M case 78: // N case 79: // O case 80: // P case 81: // Q case 82: // R case 83: // S case 84: // T case 85: // U case 86: // V case 87: // W case 88: // X case 89: // Y case 90: // Z case 95: // _ case 97: // a case 98: // b case 99: // c case 100: // d case 101: // e case 102: // f case 103: // g case 104: // h case 105: // i case 106: // j case 107: // k case 108: // l case 109: // m case 110: // n case 111: // o case 112: // p case 113: // q case 114: // r case 115: // s case 116: // t case 117: // u case 118: // v case 119: // w case 120: // x case 121: // y case 122: // z return readName(source, pos, _line, _col, prev); } throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code)); } var line = lexer.line; var col = 1 + pos - lexer.lineStart; return new _ast.Token(_tokenKind.TokenKind.EOF, bodyLength, bodyLength, line, col, prev); } /** * Report a message that an unexpected character was encountered. */ function unexpectedCharacterMessage(code) { if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { return "Cannot contain the invalid character ".concat(printCharCode(code), "."); } if (code === 39) { // ' return 'Unexpected single quote character (\'), did you mean to use a double quote (")?'; } return "Cannot parse the unexpected character ".concat(printCharCode(code), "."); } /** * Reads a comment token from the source file. * * #[\u0009\u0020-\uFFFF]* */ function readComment(source, start, line, col, prev) { var body = source.body; var code; var position = start; do { code = body.charCodeAt(++position); } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator code > 0x001f || code === 0x0009)); return new _ast.Token(_tokenKind.TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position)); } /** * Reads a number token from the source file, either a float * or an int depending on whether a decimal point appears. * * Int: -?(0|[1-9][0-9]*) * Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? */ function readNumber(source, start, firstCode, line, col, prev) { var body = source.body; var code = firstCode; var position = start; var isFloat = false; if (code === 45) { // - code = body.charCodeAt(++position); } if (code === 48) { // 0 code = body.charCodeAt(++position); if (code >= 48 && code <= 57) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), ".")); } } else { position = readDigits(source, position, code); code = body.charCodeAt(position); } if (code === 46) { // . isFloat = true; code = body.charCodeAt(++position); position = readDigits(source, position, code); code = body.charCodeAt(position); } if (code === 69 || code === 101) { // E e isFloat = true; code = body.charCodeAt(++position); if (code === 43 || code === 45) { // + - code = body.charCodeAt(++position); } position = readDigits(source, position, code); code = body.charCodeAt(position); } // Numbers cannot be followed by . or NameStart if (code === 46 || isNameStart(code)) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); } return new _ast.Token(isFloat ? _tokenKind.TokenKind.FLOAT : _tokenKind.TokenKind.INT, start, position, line, col, prev, body.slice(start, position)); } /** * Returns the new position in the source after reading digits. */ function readDigits(source, start, firstCode) { var body = source.body; var position = start; var code = firstCode; if (code >= 48 && code <= 57) { // 0 - 9 do { code = body.charCodeAt(++position); } while (code >= 48 && code <= 57); // 0 - 9 return position; } throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); } /** * Reads a string token from the source file. * * "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*" */ function readString(source, start, line, col, prev) { var body = source.body; var position = start + 1; var chunkStart = position; var code = 0; var value = ''; while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator code !== 0x000a && code !== 0x000d) { // Closing Quote (") if (code === 34) { value += body.slice(chunkStart, position); return new _ast.Token(_tokenKind.TokenKind.STRING, start, position + 1, line, col, prev, value); } // SourceCharacter if (code < 0x0020 && code !== 0x0009) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); } ++position; if (code === 92) { // \ value += body.slice(chunkStart, position - 1); code = body.charCodeAt(position); switch (code) { case 34: value += '"'; break; case 47: value += '/'; break; case 92: value += '\\'; break; case 98: value += '\b'; break; case 102: value += '\f'; break; case 110: value += '\n'; break; case 114: value += '\r'; break; case 116: value += '\t'; break; case 117: { // uXXXX var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4)); if (charCode < 0) { var invalidSequence = body.slice(position + 1, position + 5); throw (0, _syntaxError.syntaxError)(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, ".")); } value += String.fromCharCode(charCode); position += 4; break; } default: throw (0, _syntaxError.syntaxError)(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), ".")); } ++position; chunkStart = position; } } throw (0, _syntaxError.syntaxError)(source, position, 'Unterminated string.'); } /** * Reads a block string token from the source file. * * """("?"?(\\"""|\\(?!=""")|[^"\\]))*""" */ function readBlockString(source, start, line, col, prev, lexer) { var body = source.body; var position = start + 3; var chunkStart = position; var code = 0; var rawValue = ''; while (position < body.length && !isNaN(code = body.charCodeAt(position))) { // Closing Triple-Quote (""") if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) { rawValue += body.slice(chunkStart, position); return new _ast.Token(_tokenKind.TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, (0, _blockString.dedentBlockStringValue)(rawValue)); } // SourceCharacter if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { throw (0, _syntaxError.syntaxError)(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); } if (code === 10) { // new line ++position; ++lexer.line; lexer.lineStart = position; } else if (code === 13) { // carriage return if (body.charCodeAt(position + 1) === 10) { position += 2; } else { ++position; } ++lexer.line; lexer.lineStart = position; } else if ( // Escape Triple-Quote (\""") code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) { rawValue += body.slice(chunkStart, position) + '"""'; position += 4; chunkStart = position; } else { ++position; } } throw (0, _syntaxError.syntaxError)(source, position, 'Unterminated string.'); } /** * Converts four hexadecimal chars to the integer that the * string represents. For example, uniCharCode('0','0','0','f') * will return 15, and uniCharCode('0','0','f','f') returns 255. * * Returns a negative number on error, if a char was invalid. * * This is implemented by noting that char2hex() returns -1 on error, * which means the result of ORing the char2hex() will also be negative. */ function uniCharCode(a, b, c, d) { return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d); } /** * Converts a hex character to its integer value. * '0' becomes 0, '9' becomes 9 * 'A' becomes 10, 'F' becomes 15 * 'a' becomes 10, 'f' becomes 15 * * Returns -1 on error. */ function char2hex(a) { return a >= 48 && a <= 57 ? a - 48 // 0-9 : a >= 65 && a <= 70 ? a - 55 // A-F : a >= 97 && a <= 102 ? a - 87 // a-f : -1; } /** * Reads an alphanumeric + underscore name from the source. * * [_A-Za-z][_0-9A-Za-z]* */ function readName(source, start, line, col, prev) { var body = source.body; var bodyLength = body.length; var position = start + 1; var code = 0; while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _ code >= 48 && code <= 57 || // 0-9 code >= 65 && code <= 90 || // A-Z code >= 97 && code <= 122) // a-z ) { ++position; } return new _ast.Token(_tokenKind.TokenKind.NAME, start, position, line, col, prev, body.slice(start, position)); } // _ A-Z a-z function isNameStart(code) { return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122; } /***/ }), /***/ "./node_modules/graphql/language/location.js": /*!***************************************************!*\ !*** ./node_modules/graphql/language/location.js ***! \***************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getLocation = getLocation; /** * Represents a location in a Source. */ /** * Takes a Source and a UTF-8 character offset, and returns the corresponding * line and column as a SourceLocation. */ function getLocation(source, position) { var lineRegexp = /\r\n|[\n\r]/g; var line = 1; var column = position + 1; var match; while ((match = lineRegexp.exec(source.body)) && match.index < position) { line += 1; column = position + 1 - (match.index + match[0].length); } return { line: line, column: column }; } /***/ }), /***/ "./node_modules/graphql/language/parser.js": /*!*************************************************!*\ !*** ./node_modules/graphql/language/parser.js ***! \*************************************************/ /*! flagged exports */ /*! export Parser [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parse [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parseType [provided] [no usage info] [missing usage info prevents renaming] */ /*! export parseValue [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.parse = parse; exports.parseValue = parseValue; exports.parseType = parseType; exports.Parser = void 0; var _syntaxError = __webpack_require__(/*! ../error/syntaxError.js */ "./node_modules/graphql/error/syntaxError.js"); var _kinds = __webpack_require__(/*! ./kinds.js */ "./node_modules/graphql/language/kinds.js"); var _ast = __webpack_require__(/*! ./ast.js */ "./node_modules/graphql/language/ast.js"); var _tokenKind = __webpack_require__(/*! ./tokenKind.js */ "./node_modules/graphql/language/tokenKind.js"); var _source = __webpack_require__(/*! ./source.js */ "./node_modules/graphql/language/source.js"); var _directiveLocation = __webpack_require__(/*! ./directiveLocation.js */ "./node_modules/graphql/language/directiveLocation.js"); var _lexer = __webpack_require__(/*! ./lexer.js */ "./node_modules/graphql/language/lexer.js"); /** * Given a GraphQL source, parses it into a Document. * Throws GraphQLError if a syntax error is encountered. */ function parse(source, options) { var parser = new Parser(source, options); return parser.parseDocument(); } /** * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for * that value. * Throws GraphQLError if a syntax error is encountered. * * This is useful within tools that operate upon GraphQL Values directly and * in isolation of complete GraphQL documents. * * Consider providing the results to the utility function: valueFromAST(). */ function parseValue(source, options) { var parser = new Parser(source, options); parser.expectToken(_tokenKind.TokenKind.SOF); var value = parser.parseValueLiteral(false); parser.expectToken(_tokenKind.TokenKind.EOF); return value; } /** * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for * that type. * Throws GraphQLError if a syntax error is encountered. * * This is useful within tools that operate upon GraphQL Types directly and * in isolation of complete GraphQL documents. * * Consider providing the results to the utility function: typeFromAST(). */ function parseType(source, options) { var parser = new Parser(source, options); parser.expectToken(_tokenKind.TokenKind.SOF); var type = parser.parseTypeReference(); parser.expectToken(_tokenKind.TokenKind.EOF); return type; } /** * This class is exported only to assist people in implementing their own parsers * without duplicating too much code and should be used only as last resort for cases * such as experimental syntax or if certain features could not be contributed upstream. * * It is still part of the internal API and is versioned, so any changes to it are never * considered breaking changes. If you still need to support multiple versions of the * library, please use the `versionInfo` variable for version detection. * * @internal */ var Parser = /*#__PURE__*/function () { function Parser(source, options) { var sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source); this._lexer = new _lexer.Lexer(sourceObj); this._options = options; } /** * Converts a name lex token into a name parse node. */ var _proto = Parser.prototype; _proto.parseName = function parseName() { var token = this.expectToken(_tokenKind.TokenKind.NAME); return { kind: _kinds.Kind.NAME, value: token.value, loc: this.loc(token) }; } // Implements the parsing rules in the Document section. /** * Document : Definition+ */ ; _proto.parseDocument = function parseDocument() { var start = this._lexer.token; return { kind: _kinds.Kind.DOCUMENT, definitions: this.many(_tokenKind.TokenKind.SOF, this.parseDefinition, _tokenKind.TokenKind.EOF), loc: this.loc(start) }; } /** * Definition : * - ExecutableDefinition * - TypeSystemDefinition * - TypeSystemExtension * * ExecutableDefinition : * - OperationDefinition * - FragmentDefinition */ ; _proto.parseDefinition = function parseDefinition() { if (this.peek(_tokenKind.TokenKind.NAME)) { switch (this._lexer.token.value) { case 'query': case 'mutation': case 'subscription': return this.parseOperationDefinition(); case 'fragment': return this.parseFragmentDefinition(); case 'schema': case 'scalar': case 'type': case 'interface': case 'union': case 'enum': case 'input': case 'directive': return this.parseTypeSystemDefinition(); case 'extend': return this.parseTypeSystemExtension(); } } else if (this.peek(_tokenKind.TokenKind.BRACE_L)) { return this.parseOperationDefinition(); } else if (this.peekDescription()) { return this.parseTypeSystemDefinition(); } throw this.unexpected(); } // Implements the parsing rules in the Operations section. /** * OperationDefinition : * - SelectionSet * - OperationType Name? VariableDefinitions? Directives? SelectionSet */ ; _proto.parseOperationDefinition = function parseOperationDefinition() { var start = this._lexer.token; if (this.peek(_tokenKind.TokenKind.BRACE_L)) { return { kind: _kinds.Kind.OPERATION_DEFINITION, operation: 'query', name: undefined, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } var operation = this.parseOperationType(); var name; if (this.peek(_tokenKind.TokenKind.NAME)) { name = this.parseName(); } return { kind: _kinds.Kind.OPERATION_DEFINITION, operation: operation, name: name, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } /** * OperationType : one of query mutation subscription */ ; _proto.parseOperationType = function parseOperationType() { var operationToken = this.expectToken(_tokenKind.TokenKind.NAME); switch (operationToken.value) { case 'query': return 'query'; case 'mutation': return 'mutation'; case 'subscription': return 'subscription'; } throw this.unexpected(operationToken); } /** * VariableDefinitions : ( VariableDefinition+ ) */ ; _proto.parseVariableDefinitions = function parseVariableDefinitions() { return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseVariableDefinition, _tokenKind.TokenKind.PAREN_R); } /** * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? */ ; _proto.parseVariableDefinition = function parseVariableDefinition() { var start = this._lexer.token; return { kind: _kinds.Kind.VARIABLE_DEFINITION, variable: this.parseVariable(), type: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined, directives: this.parseDirectives(true), loc: this.loc(start) }; } /** * Variable : $ Name */ ; _proto.parseVariable = function parseVariable() { var start = this._lexer.token; this.expectToken(_tokenKind.TokenKind.DOLLAR); return { kind: _kinds.Kind.VARIABLE, name: this.parseName(), loc: this.loc(start) }; } /** * SelectionSet : { Selection+ } */ ; _proto.parseSelectionSet = function parseSelectionSet() { var start = this._lexer.token; return { kind: _kinds.Kind.SELECTION_SET, selections: this.many(_tokenKind.TokenKind.BRACE_L, this.parseSelection, _tokenKind.TokenKind.BRACE_R), loc: this.loc(start) }; } /** * Selection : * - Field * - FragmentSpread * - InlineFragment */ ; _proto.parseSelection = function parseSelection() { return this.peek(_tokenKind.TokenKind.SPREAD) ? this.parseFragment() : this.parseField(); } /** * Field : Alias? Name Arguments? Directives? SelectionSet? * * Alias : Name : */ ; _proto.parseField = function parseField() { var start = this._lexer.token; var nameOrAlias = this.parseName(); var alias; var name; if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) { alias = nameOrAlias; name = this.parseName(); } else { name = nameOrAlias; } return { kind: _kinds.Kind.FIELD, alias: alias, name: name, arguments: this.parseArguments(false), directives: this.parseDirectives(false), selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined, loc: this.loc(start) }; } /** * Arguments[Const] : ( Argument[?Const]+ ) */ ; _proto.parseArguments = function parseArguments(isConst) { var item = isConst ? this.parseConstArgument : this.parseArgument; return this.optionalMany(_tokenKind.TokenKind.PAREN_L, item, _tokenKind.TokenKind.PAREN_R); } /** * Argument[Const] : Name : Value[?Const] */ ; _proto.parseArgument = function parseArgument() { var start = this._lexer.token; var name = this.parseName(); this.expectToken(_tokenKind.TokenKind.COLON); return { kind: _kinds.Kind.ARGUMENT, name: name, value: this.parseValueLiteral(false), loc: this.loc(start) }; }; _proto.parseConstArgument = function parseConstArgument() { var start = this._lexer.token; return { kind: _kinds.Kind.ARGUMENT, name: this.parseName(), value: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseValueLiteral(true)), loc: this.loc(start) }; } // Implements the parsing rules in the Fragments section. /** * Corresponds to both FragmentSpread and InlineFragment in the spec. * * FragmentSpread : ... FragmentName Directives? * * InlineFragment : ... TypeCondition? Directives? SelectionSet */ ; _proto.parseFragment = function parseFragment() { var start = this._lexer.token; this.expectToken(_tokenKind.TokenKind.SPREAD); var hasTypeCondition = this.expectOptionalKeyword('on'); if (!hasTypeCondition && this.peek(_tokenKind.TokenKind.NAME)) { return { kind: _kinds.Kind.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(false), loc: this.loc(start) }; } return { kind: _kinds.Kind.INLINE_FRAGMENT, typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } /** * FragmentDefinition : * - fragment FragmentName on TypeCondition Directives? SelectionSet * * TypeCondition : NamedType */ ; _proto.parseFragmentDefinition = function parseFragmentDefinition() { var _this$_options; var start = this._lexer.token; this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes // the grammar of FragmentDefinition: // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) { return { kind: _kinds.Kind.FRAGMENT_DEFINITION, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword('on'), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } return { kind: _kinds.Kind.FRAGMENT_DEFINITION, name: this.parseFragmentName(), typeCondition: (this.expectKeyword('on'), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet(), loc: this.loc(start) }; } /** * FragmentName : Name but not `on` */ ; _proto.parseFragmentName = function parseFragmentName() { if (this._lexer.token.value === 'on') { throw this.unexpected(); } return this.parseName(); } // Implements the parsing rules in the Values section. /** * Value[Const] : * - [~Const] Variable * - IntValue * - FloatValue * - StringValue * - BooleanValue * - NullValue * - EnumValue * - ListValue[?Const] * - ObjectValue[?Const] * * BooleanValue : one of `true` `false` * * NullValue : `null` * * EnumValue : Name but not `true`, `false` or `null` */ ; _proto.parseValueLiteral = function parseValueLiteral(isConst) { var token = this._lexer.token; switch (token.kind) { case _tokenKind.TokenKind.BRACKET_L: return this.parseList(isConst); case _tokenKind.TokenKind.BRACE_L: return this.parseObject(isConst); case _tokenKind.TokenKind.INT: this._lexer.advance(); return { kind: _kinds.Kind.INT, value: token.value, loc: this.loc(token) }; case _tokenKind.TokenKind.FLOAT: this._lexer.advance(); return { kind: _kinds.Kind.FLOAT, value: token.value, loc: this.loc(token) }; case _tokenKind.TokenKind.STRING: case _tokenKind.TokenKind.BLOCK_STRING: return this.parseStringLiteral(); case _tokenKind.TokenKind.NAME: this._lexer.advance(); switch (token.value) { case 'true': return { kind: _kinds.Kind.BOOLEAN, value: true, loc: this.loc(token) }; case 'false': return { kind: _kinds.Kind.BOOLEAN, value: false, loc: this.loc(token) }; case 'null': return { kind: _kinds.Kind.NULL, loc: this.loc(token) }; default: return { kind: _kinds.Kind.ENUM, value: token.value, loc: this.loc(token) }; } case _tokenKind.TokenKind.DOLLAR: if (!isConst) { return this.parseVariable(); } break; } throw this.unexpected(); }; _proto.parseStringLiteral = function parseStringLiteral() { var token = this._lexer.token; this._lexer.advance(); return { kind: _kinds.Kind.STRING, value: token.value, block: token.kind === _tokenKind.TokenKind.BLOCK_STRING, loc: this.loc(token) }; } /** * ListValue[Const] : * - [ ] * - [ Value[?Const]+ ] */ ; _proto.parseList = function parseList(isConst) { var _this = this; var start = this._lexer.token; var item = function item() { return _this.parseValueLiteral(isConst); }; return { kind: _kinds.Kind.LIST, values: this.any(_tokenKind.TokenKind.BRACKET_L, item, _tokenKind.TokenKind.BRACKET_R), loc: this.loc(start) }; } /** * ObjectValue[Const] : * - { } * - { ObjectField[?Const]+ } */ ; _proto.parseObject = function parseObject(isConst) { var _this2 = this; var start = this._lexer.token; var item = function item() { return _this2.parseObjectField(isConst); }; return { kind: _kinds.Kind.OBJECT, fields: this.any(_tokenKind.TokenKind.BRACE_L, item, _tokenKind.TokenKind.BRACE_R), loc: this.loc(start) }; } /** * ObjectField[Const] : Name : Value[?Const] */ ; _proto.parseObjectField = function parseObjectField(isConst) { var start = this._lexer.token; var name = this.parseName(); this.expectToken(_tokenKind.TokenKind.COLON); return { kind: _kinds.Kind.OBJECT_FIELD, name: name, value: this.parseValueLiteral(isConst), loc: this.loc(start) }; } // Implements the parsing rules in the Directives section. /** * Directives[Const] : Directive[?Const]+ */ ; _proto.parseDirectives = function parseDirectives(isConst) { var directives = []; while (this.peek(_tokenKind.TokenKind.AT)) { directives.push(this.parseDirective(isConst)); } return directives; } /** * Directive[Const] : @ Name Arguments[?Const]? */ ; _proto.parseDirective = function parseDirective(isConst) { var start = this._lexer.token; this.expectToken(_tokenKind.TokenKind.AT); return { kind: _kinds.Kind.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(isConst), loc: this.loc(start) }; } // Implements the parsing rules in the Types section. /** * Type : * - NamedType * - ListType * - NonNullType */ ; _proto.parseTypeReference = function parseTypeReference() { var start = this._lexer.token; var type; if (this.expectOptionalToken(_tokenKind.TokenKind.BRACKET_L)) { type = this.parseTypeReference(); this.expectToken(_tokenKind.TokenKind.BRACKET_R); type = { kind: _kinds.Kind.LIST_TYPE, type: type, loc: this.loc(start) }; } else { type = this.parseNamedType(); } if (this.expectOptionalToken(_tokenKind.TokenKind.BANG)) { return { kind: _kinds.Kind.NON_NULL_TYPE, type: type, loc: this.loc(start) }; } return type; } /** * NamedType : Name */ ; _proto.parseNamedType = function parseNamedType() { var start = this._lexer.token; return { kind: _kinds.Kind.NAMED_TYPE, name: this.parseName(), loc: this.loc(start) }; } // Implements the parsing rules in the Type Definition section. /** * TypeSystemDefinition : * - SchemaDefinition * - TypeDefinition * - DirectiveDefinition * * TypeDefinition : * - ScalarTypeDefinition * - ObjectTypeDefinition * - InterfaceTypeDefinition * - UnionTypeDefinition * - EnumTypeDefinition * - InputObjectTypeDefinition */ ; _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() { // Many definitions begin with a description and require a lookahead. var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token; if (keywordToken.kind === _tokenKind.TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return this.parseSchemaDefinition(); case 'scalar': return this.parseScalarTypeDefinition(); case 'type': return this.parseObjectTypeDefinition(); case 'interface': return this.parseInterfaceTypeDefinition(); case 'union': return this.parseUnionTypeDefinition(); case 'enum': return this.parseEnumTypeDefinition(); case 'input': return this.parseInputObjectTypeDefinition(); case 'directive': return this.parseDirectiveDefinition(); } } throw this.unexpected(keywordToken); }; _proto.peekDescription = function peekDescription() { return this.peek(_tokenKind.TokenKind.STRING) || this.peek(_tokenKind.TokenKind.BLOCK_STRING); } /** * Description : StringValue */ ; _proto.parseDescription = function parseDescription() { if (this.peekDescription()) { return this.parseStringLiteral(); } } /** * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } */ ; _proto.parseSchemaDefinition = function parseSchemaDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('schema'); var directives = this.parseDirectives(true); var operationTypes = this.many(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); return { kind: _kinds.Kind.SCHEMA_DEFINITION, description: description, directives: directives, operationTypes: operationTypes, loc: this.loc(start) }; } /** * OperationTypeDefinition : OperationType : NamedType */ ; _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() { var start = this._lexer.token; var operation = this.parseOperationType(); this.expectToken(_tokenKind.TokenKind.COLON); var type = this.parseNamedType(); return { kind: _kinds.Kind.OPERATION_TYPE_DEFINITION, operation: operation, type: type, loc: this.loc(start) }; } /** * ScalarTypeDefinition : Description? scalar Name Directives[Const]? */ ; _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('scalar'); var name = this.parseName(); var directives = this.parseDirectives(true); return { kind: _kinds.Kind.SCALAR_TYPE_DEFINITION, description: description, name: name, directives: directives, loc: this.loc(start) }; } /** * ObjectTypeDefinition : * Description? * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? */ ; _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('type'); var name = this.parseName(); var interfaces = this.parseImplementsInterfaces(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); return { kind: _kinds.Kind.OBJECT_TYPE_DEFINITION, description: description, name: name, interfaces: interfaces, directives: directives, fields: fields, loc: this.loc(start) }; } /** * ImplementsInterfaces : * - implements `&`? NamedType * - ImplementsInterfaces & NamedType */ ; _proto.parseImplementsInterfaces = function parseImplementsInterfaces() { var _this$_options2; if (!this.expectOptionalKeyword('implements')) { return []; } if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) { var types = []; // Optional leading ampersand this.expectOptionalToken(_tokenKind.TokenKind.AMP); do { types.push(this.parseNamedType()); } while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME)); return types; } return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType); } /** * FieldsDefinition : { FieldDefinition+ } */ ; _proto.parseFieldsDefinition = function parseFieldsDefinition() { var _this$_options3; // Legacy support for the SDL? if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(_tokenKind.TokenKind.BRACE_L) && this._lexer.lookahead().kind === _tokenKind.TokenKind.BRACE_R) { this._lexer.advance(); this._lexer.advance(); return []; } return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseFieldDefinition, _tokenKind.TokenKind.BRACE_R); } /** * FieldDefinition : * - Description? Name ArgumentsDefinition? : Type Directives[Const]? */ ; _proto.parseFieldDefinition = function parseFieldDefinition() { var start = this._lexer.token; var description = this.parseDescription(); var name = this.parseName(); var args = this.parseArgumentDefs(); this.expectToken(_tokenKind.TokenKind.COLON); var type = this.parseTypeReference(); var directives = this.parseDirectives(true); return { kind: _kinds.Kind.FIELD_DEFINITION, description: description, name: name, arguments: args, type: type, directives: directives, loc: this.loc(start) }; } /** * ArgumentsDefinition : ( InputValueDefinition+ ) */ ; _proto.parseArgumentDefs = function parseArgumentDefs() { return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseInputValueDef, _tokenKind.TokenKind.PAREN_R); } /** * InputValueDefinition : * - Description? Name : Type DefaultValue? Directives[Const]? */ ; _proto.parseInputValueDef = function parseInputValueDef() { var start = this._lexer.token; var description = this.parseDescription(); var name = this.parseName(); this.expectToken(_tokenKind.TokenKind.COLON); var type = this.parseTypeReference(); var defaultValue; if (this.expectOptionalToken(_tokenKind.TokenKind.EQUALS)) { defaultValue = this.parseValueLiteral(true); } var directives = this.parseDirectives(true); return { kind: _kinds.Kind.INPUT_VALUE_DEFINITION, description: description, name: name, type: type, defaultValue: defaultValue, directives: directives, loc: this.loc(start) }; } /** * InterfaceTypeDefinition : * - Description? interface Name Directives[Const]? FieldsDefinition? */ ; _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('interface'); var name = this.parseName(); var interfaces = this.parseImplementsInterfaces(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); return { kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION, description: description, name: name, interfaces: interfaces, directives: directives, fields: fields, loc: this.loc(start) }; } /** * UnionTypeDefinition : * - Description? union Name Directives[Const]? UnionMemberTypes? */ ; _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('union'); var name = this.parseName(); var directives = this.parseDirectives(true); var types = this.parseUnionMemberTypes(); return { kind: _kinds.Kind.UNION_TYPE_DEFINITION, description: description, name: name, directives: directives, types: types, loc: this.loc(start) }; } /** * UnionMemberTypes : * - = `|`? NamedType * - UnionMemberTypes | NamedType */ ; _proto.parseUnionMemberTypes = function parseUnionMemberTypes() { return this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseNamedType) : []; } /** * EnumTypeDefinition : * - Description? enum Name Directives[Const]? EnumValuesDefinition? */ ; _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('enum'); var name = this.parseName(); var directives = this.parseDirectives(true); var values = this.parseEnumValuesDefinition(); return { kind: _kinds.Kind.ENUM_TYPE_DEFINITION, description: description, name: name, directives: directives, values: values, loc: this.loc(start) }; } /** * EnumValuesDefinition : { EnumValueDefinition+ } */ ; _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() { return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseEnumValueDefinition, _tokenKind.TokenKind.BRACE_R); } /** * EnumValueDefinition : Description? EnumValue Directives[Const]? * * EnumValue : Name */ ; _proto.parseEnumValueDefinition = function parseEnumValueDefinition() { var start = this._lexer.token; var description = this.parseDescription(); var name = this.parseName(); var directives = this.parseDirectives(true); return { kind: _kinds.Kind.ENUM_VALUE_DEFINITION, description: description, name: name, directives: directives, loc: this.loc(start) }; } /** * InputObjectTypeDefinition : * - Description? input Name Directives[Const]? InputFieldsDefinition? */ ; _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('input'); var name = this.parseName(); var directives = this.parseDirectives(true); var fields = this.parseInputFieldsDefinition(); return { kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, description: description, name: name, directives: directives, fields: fields, loc: this.loc(start) }; } /** * InputFieldsDefinition : { InputValueDefinition+ } */ ; _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() { return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseInputValueDef, _tokenKind.TokenKind.BRACE_R); } /** * TypeSystemExtension : * - SchemaExtension * - TypeExtension * * TypeExtension : * - ScalarTypeExtension * - ObjectTypeExtension * - InterfaceTypeExtension * - UnionTypeExtension * - EnumTypeExtension * - InputObjectTypeDefinition */ ; _proto.parseTypeSystemExtension = function parseTypeSystemExtension() { var keywordToken = this._lexer.lookahead(); if (keywordToken.kind === _tokenKind.TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return this.parseSchemaExtension(); case 'scalar': return this.parseScalarTypeExtension(); case 'type': return this.parseObjectTypeExtension(); case 'interface': return this.parseInterfaceTypeExtension(); case 'union': return this.parseUnionTypeExtension(); case 'enum': return this.parseEnumTypeExtension(); case 'input': return this.parseInputObjectTypeExtension(); } } throw this.unexpected(keywordToken); } /** * SchemaExtension : * - extend schema Directives[Const]? { OperationTypeDefinition+ } * - extend schema Directives[Const] */ ; _proto.parseSchemaExtension = function parseSchemaExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('schema'); var directives = this.parseDirectives(true); var operationTypes = this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); if (directives.length === 0 && operationTypes.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.SCHEMA_EXTENSION, directives: directives, operationTypes: operationTypes, loc: this.loc(start) }; } /** * ScalarTypeExtension : * - extend scalar Name Directives[Const] */ ; _proto.parseScalarTypeExtension = function parseScalarTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('scalar'); var name = this.parseName(); var directives = this.parseDirectives(true); if (directives.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.SCALAR_TYPE_EXTENSION, name: name, directives: directives, loc: this.loc(start) }; } /** * ObjectTypeExtension : * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition * - extend type Name ImplementsInterfaces? Directives[Const] * - extend type Name ImplementsInterfaces */ ; _proto.parseObjectTypeExtension = function parseObjectTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('type'); var name = this.parseName(); var interfaces = this.parseImplementsInterfaces(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.OBJECT_TYPE_EXTENSION, name: name, interfaces: interfaces, directives: directives, fields: fields, loc: this.loc(start) }; } /** * InterfaceTypeExtension : * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition * - extend interface Name ImplementsInterfaces? Directives[Const] * - extend interface Name ImplementsInterfaces */ ; _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('interface'); var name = this.parseName(); var interfaces = this.parseImplementsInterfaces(); var directives = this.parseDirectives(true); var fields = this.parseFieldsDefinition(); if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION, name: name, interfaces: interfaces, directives: directives, fields: fields, loc: this.loc(start) }; } /** * UnionTypeExtension : * - extend union Name Directives[Const]? UnionMemberTypes * - extend union Name Directives[Const] */ ; _proto.parseUnionTypeExtension = function parseUnionTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('union'); var name = this.parseName(); var directives = this.parseDirectives(true); var types = this.parseUnionMemberTypes(); if (directives.length === 0 && types.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.UNION_TYPE_EXTENSION, name: name, directives: directives, types: types, loc: this.loc(start) }; } /** * EnumTypeExtension : * - extend enum Name Directives[Const]? EnumValuesDefinition * - extend enum Name Directives[Const] */ ; _proto.parseEnumTypeExtension = function parseEnumTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('enum'); var name = this.parseName(); var directives = this.parseDirectives(true); var values = this.parseEnumValuesDefinition(); if (directives.length === 0 && values.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.ENUM_TYPE_EXTENSION, name: name, directives: directives, values: values, loc: this.loc(start) }; } /** * InputObjectTypeExtension : * - extend input Name Directives[Const]? InputFieldsDefinition * - extend input Name Directives[Const] */ ; _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() { var start = this._lexer.token; this.expectKeyword('extend'); this.expectKeyword('input'); var name = this.parseName(); var directives = this.parseDirectives(true); var fields = this.parseInputFieldsDefinition(); if (directives.length === 0 && fields.length === 0) { throw this.unexpected(); } return { kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION, name: name, directives: directives, fields: fields, loc: this.loc(start) }; } /** * DirectiveDefinition : * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations */ ; _proto.parseDirectiveDefinition = function parseDirectiveDefinition() { var start = this._lexer.token; var description = this.parseDescription(); this.expectKeyword('directive'); this.expectToken(_tokenKind.TokenKind.AT); var name = this.parseName(); var args = this.parseArgumentDefs(); var repeatable = this.expectOptionalKeyword('repeatable'); this.expectKeyword('on'); var locations = this.parseDirectiveLocations(); return { kind: _kinds.Kind.DIRECTIVE_DEFINITION, description: description, name: name, arguments: args, repeatable: repeatable, locations: locations, loc: this.loc(start) }; } /** * DirectiveLocations : * - `|`? DirectiveLocation * - DirectiveLocations | DirectiveLocation */ ; _proto.parseDirectiveLocations = function parseDirectiveLocations() { return this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseDirectiveLocation); } /* * DirectiveLocation : * - ExecutableDirectiveLocation * - TypeSystemDirectiveLocation * * ExecutableDirectiveLocation : one of * `QUERY` * `MUTATION` * `SUBSCRIPTION` * `FIELD` * `FRAGMENT_DEFINITION` * `FRAGMENT_SPREAD` * `INLINE_FRAGMENT` * * TypeSystemDirectiveLocation : one of * `SCHEMA` * `SCALAR` * `OBJECT` * `FIELD_DEFINITION` * `ARGUMENT_DEFINITION` * `INTERFACE` * `UNION` * `ENUM` * `ENUM_VALUE` * `INPUT_OBJECT` * `INPUT_FIELD_DEFINITION` */ ; _proto.parseDirectiveLocation = function parseDirectiveLocation() { var start = this._lexer.token; var name = this.parseName(); if (_directiveLocation.DirectiveLocation[name.value] !== undefined) { return name; } throw this.unexpected(start); } // Core parsing utility functions /** * Returns a location object, used to identify the place in the source that created a given parsed object. */ ; _proto.loc = function loc(startToken) { var _this$_options4; if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) { return new _ast.Location(startToken, this._lexer.lastToken, this._lexer.source); } } /** * Determines if the next token is of a given kind */ ; _proto.peek = function peek(kind) { return this._lexer.token.kind === kind; } /** * If the next token is of the given kind, return that token after advancing the lexer. * Otherwise, do not change the parser state and throw an error. */ ; _proto.expectToken = function expectToken(kind) { var token = this._lexer.token; if (token.kind === kind) { this._lexer.advance(); return token; } throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, "Expected ".concat(getTokenKindDesc(kind), ", found ").concat(getTokenDesc(token), ".")); } /** * If the next token is of the given kind, return that token after advancing the lexer. * Otherwise, do not change the parser state and return undefined. */ ; _proto.expectOptionalToken = function expectOptionalToken(kind) { var token = this._lexer.token; if (token.kind === kind) { this._lexer.advance(); return token; } return undefined; } /** * If the next token is a given keyword, advance the lexer. * Otherwise, do not change the parser state and throw an error. */ ; _proto.expectKeyword = function expectKeyword(value) { var token = this._lexer.token; if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { this._lexer.advance(); } else { throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat(getTokenDesc(token), ".")); } } /** * If the next token is a given keyword, return "true" after advancing the lexer. * Otherwise, do not change the parser state and return "false". */ ; _proto.expectOptionalKeyword = function expectOptionalKeyword(value) { var token = this._lexer.token; if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { this._lexer.advance(); return true; } return false; } /** * Helper function for creating an error when an unexpected lexed token is encountered. */ ; _proto.unexpected = function unexpected(atToken) { var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token; return (0, _syntaxError.syntaxError)(this._lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token), ".")); } /** * Returns a possibly empty list of parse nodes, determined by the parseFn. * This list begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex token after the closing token. */ ; _proto.any = function any(openKind, parseFn, closeKind) { this.expectToken(openKind); var nodes = []; while (!this.expectOptionalToken(closeKind)) { nodes.push(parseFn.call(this)); } return nodes; } /** * Returns a list of parse nodes, determined by the parseFn. * It can be empty only if open token is missing otherwise it will always return non-empty list * that begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex token after the closing token. */ ; _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) { if (this.expectOptionalToken(openKind)) { var nodes = []; do { nodes.push(parseFn.call(this)); } while (!this.expectOptionalToken(closeKind)); return nodes; } return []; } /** * Returns a non-empty list of parse nodes, determined by the parseFn. * This list begins with a lex token of openKind and ends with a lex token of closeKind. * Advances the parser to the next lex token after the closing token. */ ; _proto.many = function many(openKind, parseFn, closeKind) { this.expectToken(openKind); var nodes = []; do { nodes.push(parseFn.call(this)); } while (!this.expectOptionalToken(closeKind)); return nodes; } /** * Returns a non-empty list of parse nodes, determined by the parseFn. * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. * Advances the parser to the next lex token after last item in the list. */ ; _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) { this.expectOptionalToken(delimiterKind); var nodes = []; do { nodes.push(parseFn.call(this)); } while (this.expectOptionalToken(delimiterKind)); return nodes; }; return Parser; }(); /** * A helper function to describe a token as a string for debugging. */ exports.Parser = Parser; function getTokenDesc(token) { var value = token.value; return getTokenKindDesc(token.kind) + (value != null ? " \"".concat(value, "\"") : ''); } /** * A helper function to describe a token kind as a string for debugging. */ function getTokenKindDesc(kind) { return (0, _lexer.isPunctuatorTokenKind)(kind) ? "\"".concat(kind, "\"") : kind; } /***/ }), /***/ "./node_modules/graphql/language/printLocation.js": /*!********************************************************!*\ !*** ./node_modules/graphql/language/printLocation.js ***! \********************************************************/ /*! flagged exports */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! export printSourceLocation [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.printLocation = printLocation; exports.printSourceLocation = printSourceLocation; var _location = __webpack_require__(/*! ./location.js */ "./node_modules/graphql/language/location.js"); /** * Render a helpful description of the location in the GraphQL Source document. */ function printLocation(location) { return printSourceLocation(location.source, (0, _location.getLocation)(location.source, location.start)); } /** * Render a helpful description of the location in the GraphQL Source document. */ function printSourceLocation(source, sourceLocation) { var firstLineColumnOffset = source.locationOffset.column - 1; var body = whitespace(firstLineColumnOffset) + source.body; var lineIndex = sourceLocation.line - 1; var lineOffset = source.locationOffset.line - 1; var lineNum = sourceLocation.line + lineOffset; var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; var columnNum = sourceLocation.column + columnOffset; var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n"); var lines = body.split(/\r\n|[\n\r]/g); var locationLine = lines[lineIndex]; // Special case for minified documents if (locationLine.length > 120) { var subLineIndex = Math.floor(columnNum / 80); var subLineColumnNum = columnNum % 80; var subLines = []; for (var i = 0; i < locationLine.length; i += 80) { subLines.push(locationLine.slice(i, i + 80)); } return locationStr + printPrefixedLines([["".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) { return ['', subLine]; }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]])); } return locationStr + printPrefixedLines([// Lines specified like this: ["prefix", "string"], ["".concat(lineNum - 1), lines[lineIndex - 1]], ["".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], ["".concat(lineNum + 1), lines[lineIndex + 1]]]); } function printPrefixedLines(lines) { var existingLines = lines.filter(function (_ref) { var _ = _ref[0], line = _ref[1]; return line !== undefined; }); var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) { var prefix = _ref2[0]; return prefix.length; })); return existingLines.map(function (_ref3) { var prefix = _ref3[0], line = _ref3[1]; return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |'); }).join('\n'); } function whitespace(len) { return Array(len + 1).join(' '); } function leftPad(len, str) { return whitespace(len - str.length) + str; } /***/ }), /***/ "./node_modules/graphql/language/printer.mjs": /*!***************************************************!*\ !*** ./node_modules/graphql/language/printer.mjs ***! \***************************************************/ /*! namespace exports */ /*! export print [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "print": () => /* binding */ print /* harmony export */ }); /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./visitor.mjs */ "./node_modules/graphql/language/visitor.mjs"); /* harmony import */ var _blockString_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockString.mjs */ "./node_modules/graphql/language/blockString.mjs"); ; /** * Converts an AST into a string, using one set of reasonable * formatting rules. */ function print(ast) { return (0,_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.visit)(ast, { leave: printDocASTReducer }); } var MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future var printDocASTReducer = { Name: function Name(node) { return node.value; }, Variable: function Variable(node) { return '$' + node.name; }, // Document Document: function Document(node) { return join(node.definitions, '\n\n') + '\n'; }, OperationDefinition: function OperationDefinition(node) { var op = node.operation; var name = node.name; var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); var directives = join(node.directives, ' '); var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use // the query short form. return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' '); }, VariableDefinition: function VariableDefinition(_ref) { var variable = _ref.variable, type = _ref.type, defaultValue = _ref.defaultValue, directives = _ref.directives; return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')); }, SelectionSet: function SelectionSet(_ref2) { var selections = _ref2.selections; return block(selections); }, Field: function Field(_ref3) { var alias = _ref3.alias, name = _ref3.name, args = _ref3.arguments, directives = _ref3.directives, selectionSet = _ref3.selectionSet; var prefix = wrap('', alias, ': ') + name; var argsLine = prefix + wrap('(', join(args, ', '), ')'); if (argsLine.length > MAX_LINE_LENGTH) { argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); } return join([argsLine, join(directives, ' '), selectionSet], ' '); }, Argument: function Argument(_ref4) { var name = _ref4.name, value = _ref4.value; return name + ': ' + value; }, // Fragments FragmentSpread: function FragmentSpread(_ref5) { var name = _ref5.name, directives = _ref5.directives; return '...' + name + wrap(' ', join(directives, ' ')); }, InlineFragment: function InlineFragment(_ref6) { var typeCondition = _ref6.typeCondition, directives = _ref6.directives, selectionSet = _ref6.selectionSet; return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' '); }, FragmentDefinition: function FragmentDefinition(_ref7) { var name = _ref7.name, typeCondition = _ref7.typeCondition, variableDefinitions = _ref7.variableDefinitions, directives = _ref7.directives, selectionSet = _ref7.selectionSet; return (// Note: fragment variable definitions are experimental and may be changed // or removed in the future. "fragment ".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), " ") + "on ".concat(typeCondition, " ").concat(wrap('', join(directives, ' '), ' ')) + selectionSet ); }, // Value IntValue: function IntValue(_ref8) { var value = _ref8.value; return value; }, FloatValue: function FloatValue(_ref9) { var value = _ref9.value; return value; }, StringValue: function StringValue(_ref10, key) { var value = _ref10.value, isBlockString = _ref10.block; return isBlockString ? (0,_blockString_mjs__WEBPACK_IMPORTED_MODULE_1__.printBlockString)(value, key === 'description' ? '' : ' ') : JSON.stringify(value); }, BooleanValue: function BooleanValue(_ref11) { var value = _ref11.value; return value ? 'true' : 'false'; }, NullValue: function NullValue() { return 'null'; }, EnumValue: function EnumValue(_ref12) { var value = _ref12.value; return value; }, ListValue: function ListValue(_ref13) { var values = _ref13.values; return '[' + join(values, ', ') + ']'; }, ObjectValue: function ObjectValue(_ref14) { var fields = _ref14.fields; return '{' + join(fields, ', ') + '}'; }, ObjectField: function ObjectField(_ref15) { var name = _ref15.name, value = _ref15.value; return name + ': ' + value; }, // Directive Directive: function Directive(_ref16) { var name = _ref16.name, args = _ref16.arguments; return '@' + name + wrap('(', join(args, ', '), ')'); }, // Type NamedType: function NamedType(_ref17) { var name = _ref17.name; return name; }, ListType: function ListType(_ref18) { var type = _ref18.type; return '[' + type + ']'; }, NonNullType: function NonNullType(_ref19) { var type = _ref19.type; return type + '!'; }, // Type System Definitions SchemaDefinition: addDescription(function (_ref20) { var directives = _ref20.directives, operationTypes = _ref20.operationTypes; return join(['schema', join(directives, ' '), block(operationTypes)], ' '); }), OperationTypeDefinition: function OperationTypeDefinition(_ref21) { var operation = _ref21.operation, type = _ref21.type; return operation + ': ' + type; }, ScalarTypeDefinition: addDescription(function (_ref22) { var name = _ref22.name, directives = _ref22.directives; return join(['scalar', name, join(directives, ' ')], ' '); }), ObjectTypeDefinition: addDescription(function (_ref23) { var name = _ref23.name, interfaces = _ref23.interfaces, directives = _ref23.directives, fields = _ref23.fields; return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); }), FieldDefinition: addDescription(function (_ref24) { var name = _ref24.name, args = _ref24.arguments, type = _ref24.type, directives = _ref24.directives; return name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' ')); }), InputValueDefinition: addDescription(function (_ref25) { var name = _ref25.name, type = _ref25.type, defaultValue = _ref25.defaultValue, directives = _ref25.directives; return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '); }), InterfaceTypeDefinition: addDescription(function (_ref26) { var name = _ref26.name, interfaces = _ref26.interfaces, directives = _ref26.directives, fields = _ref26.fields; return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); }), UnionTypeDefinition: addDescription(function (_ref27) { var name = _ref27.name, directives = _ref27.directives, types = _ref27.types; return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); }), EnumTypeDefinition: addDescription(function (_ref28) { var name = _ref28.name, directives = _ref28.directives, values = _ref28.values; return join(['enum', name, join(directives, ' '), block(values)], ' '); }), EnumValueDefinition: addDescription(function (_ref29) { var name = _ref29.name, directives = _ref29.directives; return join([name, join(directives, ' ')], ' '); }), InputObjectTypeDefinition: addDescription(function (_ref30) { var name = _ref30.name, directives = _ref30.directives, fields = _ref30.fields; return join(['input', name, join(directives, ' '), block(fields)], ' '); }), DirectiveDefinition: addDescription(function (_ref31) { var name = _ref31.name, args = _ref31.arguments, repeatable = _ref31.repeatable, locations = _ref31.locations; return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | '); }), SchemaExtension: function SchemaExtension(_ref32) { var directives = _ref32.directives, operationTypes = _ref32.operationTypes; return join(['extend schema', join(directives, ' '), block(operationTypes)], ' '); }, ScalarTypeExtension: function ScalarTypeExtension(_ref33) { var name = _ref33.name, directives = _ref33.directives; return join(['extend scalar', name, join(directives, ' ')], ' '); }, ObjectTypeExtension: function ObjectTypeExtension(_ref34) { var name = _ref34.name, interfaces = _ref34.interfaces, directives = _ref34.directives, fields = _ref34.fields; return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); }, InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) { var name = _ref35.name, interfaces = _ref35.interfaces, directives = _ref35.directives, fields = _ref35.fields; return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); }, UnionTypeExtension: function UnionTypeExtension(_ref36) { var name = _ref36.name, directives = _ref36.directives, types = _ref36.types; return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); }, EnumTypeExtension: function EnumTypeExtension(_ref37) { var name = _ref37.name, directives = _ref37.directives, values = _ref37.values; return join(['extend enum', name, join(directives, ' '), block(values)], ' '); }, InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) { var name = _ref38.name, directives = _ref38.directives, fields = _ref38.fields; return join(['extend input', name, join(directives, ' '), block(fields)], ' '); } }; function addDescription(cb) { return function (node) { return join([node.description, cb(node)], '\n'); }; } /** * Given maybeArray, print an empty string if it is null or empty, otherwise * print all items together separated by separator if provided */ function join(maybeArray) { var _maybeArray$filter$jo; var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) { return x; }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : ''; } /** * Given array, print each item on its own line, wrapped in an * indented "{ }" block. */ function block(array) { return wrap('{\n', indent(join(array, '\n')), '\n}'); } /** * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string. */ function wrap(start, maybeString) { var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; return maybeString != null && maybeString !== '' ? start + maybeString + end : ''; } function indent(str) { return wrap(' ', str.replace(/\n/g, '\n ')); } function isMultiline(str) { return str.indexOf('\n') !== -1; } function hasMultilineItems(maybeArray) { return maybeArray != null && maybeArray.some(isMultiline); } /***/ }), /***/ "./node_modules/graphql/language/source.js": /*!*************************************************!*\ !*** ./node_modules/graphql/language/source.js ***! \*************************************************/ /*! flagged exports */ /*! export Source [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isSource [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isSource = isSource; exports.Source = void 0; var _symbols = __webpack_require__(/*! ../polyfills/symbols.js */ "./node_modules/graphql/polyfills/symbols.js"); var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect.js */ "./node_modules/graphql/jsutils/inspect.js")); var _devAssert = _interopRequireDefault(__webpack_require__(/*! ../jsutils/devAssert.js */ "./node_modules/graphql/jsutils/devAssert.js")); var _instanceOf = _interopRequireDefault(__webpack_require__(/*! ../jsutils/instanceOf.js */ "./node_modules/graphql/jsutils/instanceOf.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /** * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are * optional, but they are useful for clients who store GraphQL documents in source files. * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. * The `line` and `column` properties in `locationOffset` are 1-indexed. */ var Source = /*#__PURE__*/function () { function Source(body) { var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request'; var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { line: 1, column: 1 }; typeof body === 'string' || (0, _devAssert.default)(0, "Body must be a string. Received: ".concat((0, _inspect.default)(body), ".")); this.body = body; this.name = name; this.locationOffset = locationOffset; this.locationOffset.line > 0 || (0, _devAssert.default)(0, 'line in locationOffset is 1-indexed and must be positive.'); this.locationOffset.column > 0 || (0, _devAssert.default)(0, 'column in locationOffset is 1-indexed and must be positive.'); } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet _createClass(Source, [{ key: _symbols.SYMBOL_TO_STRING_TAG, get: function get() { return 'Source'; } }]); return Source; }(); /** * Test if the given value is a Source object. * * @internal */ exports.Source = Source; // eslint-disable-next-line no-redeclare function isSource(source) { return (0, _instanceOf.default)(source, Source); } /***/ }), /***/ "./node_modules/graphql/language/tokenKind.js": /*!****************************************************!*\ !*** ./node_modules/graphql/language/tokenKind.js ***! \****************************************************/ /*! flagged exports */ /*! export TokenKind [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TokenKind = void 0; /** * An exported enum describing the different kinds of tokens that the * lexer emits. */ var TokenKind = Object.freeze({ SOF: '', EOF: '', BANG: '!', DOLLAR: '$', AMP: '&', PAREN_L: '(', PAREN_R: ')', SPREAD: '...', COLON: ':', EQUALS: '=', AT: '@', BRACKET_L: '[', BRACKET_R: ']', BRACE_L: '{', PIPE: '|', BRACE_R: '}', NAME: 'Name', INT: 'Int', FLOAT: 'Float', STRING: 'String', BLOCK_STRING: 'BlockString', COMMENT: 'Comment' }); /** * The enum type representing the token kinds values. */ exports.TokenKind = TokenKind; /***/ }), /***/ "./node_modules/graphql/language/visitor.js": /*!**************************************************!*\ !*** ./node_modules/graphql/language/visitor.js ***! \**************************************************/ /*! flagged exports */ /*! export BREAK [provided] [no usage info] [missing usage info prevents renaming] */ /*! export QueryDocumentKeys [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getVisitFn [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visit [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visitInParallel [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__, __webpack_require__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.visit = visit; exports.visitInParallel = visitInParallel; exports.getVisitFn = getVisitFn; exports.BREAK = exports.QueryDocumentKeys = void 0; var _inspect = _interopRequireDefault(__webpack_require__(/*! ../jsutils/inspect.js */ "./node_modules/graphql/jsutils/inspect.js")); var _ast = __webpack_require__(/*! ./ast.js */ "./node_modules/graphql/language/ast.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var QueryDocumentKeys = { Name: [], Document: ['definitions'], OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'], VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], Variable: ['name'], SelectionSet: ['selections'], Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], Argument: ['name', 'value'], FragmentSpread: ['name', 'directives'], InlineFragment: ['typeCondition', 'directives', 'selectionSet'], FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed // or removed in the future. 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ['values'], ObjectValue: ['fields'], ObjectField: ['name', 'value'], Directive: ['name', 'arguments'], NamedType: ['name'], ListType: ['type'], NonNullType: ['type'], SchemaDefinition: ['description', 'directives', 'operationTypes'], OperationTypeDefinition: ['type'], ScalarTypeDefinition: ['description', 'name', 'directives'], ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'], InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], UnionTypeDefinition: ['description', 'name', 'directives', 'types'], EnumTypeDefinition: ['description', 'name', 'directives', 'values'], EnumValueDefinition: ['description', 'name', 'directives'], InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], SchemaExtension: ['directives', 'operationTypes'], ScalarTypeExtension: ['name', 'directives'], ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], UnionTypeExtension: ['name', 'directives', 'types'], EnumTypeExtension: ['name', 'directives', 'values'], InputObjectTypeExtension: ['name', 'directives', 'fields'] }; exports.QueryDocumentKeys = QueryDocumentKeys; var BREAK = Object.freeze({}); /** * visit() will walk through an AST using a depth-first traversal, calling * the visitor's enter function at each node in the traversal, and calling the * leave function after visiting that node and all of its child nodes. * * By returning different values from the enter and leave functions, the * behavior of the visitor can be altered, including skipping over a sub-tree of * the AST (by returning false), editing the AST by returning a value or null * to remove the value, or to stop the whole traversal by returning BREAK. * * When using visit() to edit an AST, the original AST will not be modified, and * a new version of the AST with the changes applied will be returned from the * visit function. * * const editedAST = visit(ast, { * enter(node, key, parent, path, ancestors) { * // @return * // undefined: no action * // false: skip visiting this node * // visitor.BREAK: stop visiting altogether * // null: delete this node * // any value: replace this node with the returned value * }, * leave(node, key, parent, path, ancestors) { * // @return * // undefined: no action * // false: no action * // visitor.BREAK: stop visiting altogether * // null: delete this node * // any value: replace this node with the returned value * } * }); * * Alternatively to providing enter() and leave() functions, a visitor can * instead provide functions named the same as the kinds of AST nodes, or * enter/leave visitors at a named key, leading to four permutations of the * visitor API: * * 1) Named visitors triggered when entering a node of a specific kind. * * visit(ast, { * Kind(node) { * // enter the "Kind" node * } * }) * * 2) Named visitors that trigger upon entering and leaving a node of * a specific kind. * * visit(ast, { * Kind: { * enter(node) { * // enter the "Kind" node * } * leave(node) { * // leave the "Kind" node * } * } * }) * * 3) Generic visitors that trigger upon entering and leaving any node. * * visit(ast, { * enter(node) { * // enter any node * }, * leave(node) { * // leave any node * } * }) * * 4) Parallel visitors for entering and leaving nodes of a specific kind. * * visit(ast, { * enter: { * Kind(node) { * // enter the "Kind" node * } * }, * leave: { * Kind(node) { * // leave the "Kind" node * } * } * }) */ exports.BREAK = BREAK; function visit(root, visitor) { var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys; /* eslint-disable no-undef-init */ var stack = undefined; var inArray = Array.isArray(root); var keys = [root]; var index = -1; var edits = []; var node = undefined; var key = undefined; var parent = undefined; var path = []; var ancestors = []; var newRoot = root; /* eslint-enable no-undef-init */ do { index++; var isLeaving = index === keys.length; var isEdited = isLeaving && edits.length !== 0; if (isLeaving) { key = ancestors.length === 0 ? undefined : path[path.length - 1]; node = parent; parent = ancestors.pop(); if (isEdited) { if (inArray) { node = node.slice(); } else { var clone = {}; for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) { var k = _Object$keys2[_i2]; clone[k] = node[k]; } node = clone; } var editOffset = 0; for (var ii = 0; ii < edits.length; ii++) { var editKey = edits[ii][0]; var editValue = edits[ii][1]; if (inArray) { editKey -= editOffset; } if (inArray && editValue === null) { node.splice(editKey, 1); editOffset++; } else { node[editKey] = editValue; } } } index = stack.index; keys = stack.keys; edits = stack.edits; inArray = stack.inArray; stack = stack.prev; } else { key = parent ? inArray ? index : keys[index] : undefined; node = parent ? parent[key] : newRoot; if (node === null || node === undefined) { continue; } if (parent) { path.push(key); } } var result = void 0; if (!Array.isArray(node)) { if (!(0, _ast.isNode)(node)) { throw new Error("Invalid AST Node: ".concat((0, _inspect.default)(node), ".")); } var visitFn = getVisitFn(visitor, node.kind, isLeaving); if (visitFn) { result = visitFn.call(visitor, node, key, parent, path, ancestors); if (result === BREAK) { break; } if (result === false) { if (!isLeaving) { path.pop(); continue; } } else if (result !== undefined) { edits.push([key, result]); if (!isLeaving) { if ((0, _ast.isNode)(result)) { node = result; } else { path.pop(); continue; } } } } } if (result === undefined && isEdited) { edits.push([key, node]); } if (isLeaving) { path.pop(); } else { var _visitorKeys$node$kin; stack = { inArray: inArray, index: index, keys: keys, edits: edits, prev: stack }; inArray = Array.isArray(node); keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : []; index = -1; edits = []; if (parent) { ancestors.push(parent); } parent = node; } } while (stack !== undefined); if (edits.length !== 0) { newRoot = edits[edits.length - 1][1]; } return newRoot; } /** * Creates a new visitor instance which delegates to many visitors to run in * parallel. Each visitor will be visited for each node before moving on. * * If a prior visitor edits a node, no following visitors will see that node. */ function visitInParallel(visitors) { var skipping = new Array(visitors.length); return { enter: function enter(node) { for (var i = 0; i < visitors.length; i++) { if (skipping[i] == null) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ false); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === false) { skipping[i] = node; } else if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined) { return result; } } } } }, leave: function leave(node) { for (var i = 0; i < visitors.length; i++) { if (skipping[i] == null) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ true); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined && result !== false) { return result; } } } else if (skipping[i] === node) { skipping[i] = null; } } } }; } /** * Given a visitor instance, if it is leaving or not, and a node kind, return * the function the visitor runtime should call. */ function getVisitFn(visitor, kind, isLeaving) { var kindVisitor = visitor[kind]; if (kindVisitor) { if (!isLeaving && typeof kindVisitor === 'function') { // { Kind() {} } return kindVisitor; } var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter; if (typeof kindSpecificVisitor === 'function') { // { Kind: { enter() {}, leave() {} } } return kindSpecificVisitor; } } else { var specificVisitor = isLeaving ? visitor.leave : visitor.enter; if (specificVisitor) { if (typeof specificVisitor === 'function') { // { enter() {}, leave() {} } return specificVisitor; } var specificKindVisitor = specificVisitor[kind]; if (typeof specificKindVisitor === 'function') { // { enter: { Kind() {} }, leave: { Kind() {} } } return specificKindVisitor; } } } } /***/ }), /***/ "./node_modules/graphql/language/visitor.mjs": /*!***************************************************!*\ !*** ./node_modules/graphql/language/visitor.mjs ***! \***************************************************/ /*! namespace exports */ /*! export BREAK [provided] [no usage info] [missing usage info prevents renaming] */ /*! export QueryDocumentKeys [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getVisitFn [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visit [provided] [no usage info] [missing usage info prevents renaming] */ /*! export visitInParallel [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "QueryDocumentKeys": () => /* binding */ QueryDocumentKeys, /* harmony export */ "BREAK": () => /* binding */ BREAK, /* harmony export */ "visit": () => /* binding */ visit, /* harmony export */ "visitInParallel": () => /* binding */ visitInParallel, /* harmony export */ "getVisitFn": () => /* binding */ getVisitFn /* harmony export */ }); /* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "./node_modules/graphql/jsutils/inspect.mjs"); /* harmony import */ var _ast_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast.mjs */ "./node_modules/graphql/language/ast.mjs"); ; /** * A visitor is provided to visit, it contains the collection of * relevant functions to be called during the visitor's traversal. */ var QueryDocumentKeys = { Name: [], Document: ['definitions'], OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'], VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], Variable: ['name'], SelectionSet: ['selections'], Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], Argument: ['name', 'value'], FragmentSpread: ['name', 'directives'], InlineFragment: ['typeCondition', 'directives', 'selectionSet'], FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed // or removed in the future. 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ['values'], ObjectValue: ['fields'], ObjectField: ['name', 'value'], Directive: ['name', 'arguments'], NamedType: ['name'], ListType: ['type'], NonNullType: ['type'], SchemaDefinition: ['description', 'directives', 'operationTypes'], OperationTypeDefinition: ['type'], ScalarTypeDefinition: ['description', 'name', 'directives'], ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'], InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], UnionTypeDefinition: ['description', 'name', 'directives', 'types'], EnumTypeDefinition: ['description', 'name', 'directives', 'values'], EnumValueDefinition: ['description', 'name', 'directives'], InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], SchemaExtension: ['directives', 'operationTypes'], ScalarTypeExtension: ['name', 'directives'], ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], UnionTypeExtension: ['name', 'directives', 'types'], EnumTypeExtension: ['name', 'directives', 'values'], InputObjectTypeExtension: ['name', 'directives', 'fields'] }; var BREAK = Object.freeze({}); /** * visit() will walk through an AST using a depth-first traversal, calling * the visitor's enter function at each node in the traversal, and calling the * leave function after visiting that node and all of its child nodes. * * By returning different values from the enter and leave functions, the * behavior of the visitor can be altered, including skipping over a sub-tree of * the AST (by returning false), editing the AST by returning a value or null * to remove the value, or to stop the whole traversal by returning BREAK. * * When using visit() to edit an AST, the original AST will not be modified, and * a new version of the AST with the changes applied will be returned from the * visit function. * * const editedAST = visit(ast, { * enter(node, key, parent, path, ancestors) { * // @return * // undefined: no action * // false: skip visiting this node * // visitor.BREAK: stop visiting altogether * // null: delete this node * // any value: replace this node with the returned value * }, * leave(node, key, parent, path, ancestors) { * // @return * // undefined: no action * // false: no action * // visitor.BREAK: stop visiting altogether * // null: delete this node * // any value: replace this node with the returned value * } * }); * * Alternatively to providing enter() and leave() functions, a visitor can * instead provide functions named the same as the kinds of AST nodes, or * enter/leave visitors at a named key, leading to four permutations of the * visitor API: * * 1) Named visitors triggered when entering a node of a specific kind. * * visit(ast, { * Kind(node) { * // enter the "Kind" node * } * }) * * 2) Named visitors that trigger upon entering and leaving a node of * a specific kind. * * visit(ast, { * Kind: { * enter(node) { * // enter the "Kind" node * } * leave(node) { * // leave the "Kind" node * } * } * }) * * 3) Generic visitors that trigger upon entering and leaving any node. * * visit(ast, { * enter(node) { * // enter any node * }, * leave(node) { * // leave any node * } * }) * * 4) Parallel visitors for entering and leaving nodes of a specific kind. * * visit(ast, { * enter: { * Kind(node) { * // enter the "Kind" node * } * }, * leave: { * Kind(node) { * // leave the "Kind" node * } * } * }) */ function visit(root, visitor) { var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys; /* eslint-disable no-undef-init */ var stack = undefined; var inArray = Array.isArray(root); var keys = [root]; var index = -1; var edits = []; var node = undefined; var key = undefined; var parent = undefined; var path = []; var ancestors = []; var newRoot = root; /* eslint-enable no-undef-init */ do { index++; var isLeaving = index === keys.length; var isEdited = isLeaving && edits.length !== 0; if (isLeaving) { key = ancestors.length === 0 ? undefined : path[path.length - 1]; node = parent; parent = ancestors.pop(); if (isEdited) { if (inArray) { node = node.slice(); } else { var clone = {}; for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) { var k = _Object$keys2[_i2]; clone[k] = node[k]; } node = clone; } var editOffset = 0; for (var ii = 0; ii < edits.length; ii++) { var editKey = edits[ii][0]; var editValue = edits[ii][1]; if (inArray) { editKey -= editOffset; } if (inArray && editValue === null) { node.splice(editKey, 1); editOffset++; } else { node[editKey] = editValue; } } } index = stack.index; keys = stack.keys; edits = stack.edits; inArray = stack.inArray; stack = stack.prev; } else { key = parent ? inArray ? index : keys[index] : undefined; node = parent ? parent[key] : newRoot; if (node === null || node === undefined) { continue; } if (parent) { path.push(key); } } var result = void 0; if (!Array.isArray(node)) { if (!(0,_ast_mjs__WEBPACK_IMPORTED_MODULE_0__.isNode)(node)) { throw new Error("Invalid AST Node: ".concat((0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.default)(node), ".")); } var visitFn = getVisitFn(visitor, node.kind, isLeaving); if (visitFn) { result = visitFn.call(visitor, node, key, parent, path, ancestors); if (result === BREAK) { break; } if (result === false) { if (!isLeaving) { path.pop(); continue; } } else if (result !== undefined) { edits.push([key, result]); if (!isLeaving) { if ((0,_ast_mjs__WEBPACK_IMPORTED_MODULE_0__.isNode)(result)) { node = result; } else { path.pop(); continue; } } } } } if (result === undefined && isEdited) { edits.push([key, node]); } if (isLeaving) { path.pop(); } else { var _visitorKeys$node$kin; stack = { inArray: inArray, index: index, keys: keys, edits: edits, prev: stack }; inArray = Array.isArray(node); keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : []; index = -1; edits = []; if (parent) { ancestors.push(parent); } parent = node; } } while (stack !== undefined); if (edits.length !== 0) { newRoot = edits[edits.length - 1][1]; } return newRoot; } /** * Creates a new visitor instance which delegates to many visitors to run in * parallel. Each visitor will be visited for each node before moving on. * * If a prior visitor edits a node, no following visitors will see that node. */ function visitInParallel(visitors) { var skipping = new Array(visitors.length); return { enter: function enter(node) { for (var i = 0; i < visitors.length; i++) { if (skipping[i] == null) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ false); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === false) { skipping[i] = node; } else if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined) { return result; } } } } }, leave: function leave(node) { for (var i = 0; i < visitors.length; i++) { if (skipping[i] == null) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ true); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined && result !== false) { return result; } } } else if (skipping[i] === node) { skipping[i] = null; } } } }; } /** * Given a visitor instance, if it is leaving or not, and a node kind, return * the function the visitor runtime should call. */ function getVisitFn(visitor, kind, isLeaving) { var kindVisitor = visitor[kind]; if (kindVisitor) { if (!isLeaving && typeof kindVisitor === 'function') { // { Kind() {} } return kindVisitor; } var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter; if (typeof kindSpecificVisitor === 'function') { // { Kind: { enter() {}, leave() {} } } return kindSpecificVisitor; } } else { var specificVisitor = isLeaving ? visitor.leave : visitor.enter; if (specificVisitor) { if (typeof specificVisitor === 'function') { // { enter() {}, leave() {} } return specificVisitor; } var specificKindVisitor = specificVisitor[kind]; if (typeof specificKindVisitor === 'function') { // { enter: { Kind() {} }, leave: { Kind() {} } } return specificKindVisitor; } } } } /***/ }), /***/ "./node_modules/graphql/polyfills/symbols.js": /*!***************************************************!*\ !*** ./node_modules/graphql/polyfills/symbols.js ***! \***************************************************/ /*! flagged exports */ /*! export SYMBOL_ASYNC_ITERATOR [provided] [no usage info] [missing usage info prevents renaming] */ /*! export SYMBOL_ITERATOR [provided] [no usage info] [missing usage info prevents renaming] */ /*! export SYMBOL_TO_STRING_TAG [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SYMBOL_TO_STRING_TAG = exports.SYMBOL_ASYNC_ITERATOR = exports.SYMBOL_ITERATOR = void 0; // In ES2015 (or a polyfilled) environment, this will be Symbol.iterator // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') exports.SYMBOL_ITERATOR = SYMBOL_ITERATOR; var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') exports.SYMBOL_ASYNC_ITERATOR = SYMBOL_ASYNC_ITERATOR; var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag'; exports.SYMBOL_TO_STRING_TAG = SYMBOL_TO_STRING_TAG; /***/ }), /***/ "./node_modules/iterall/index.mjs": /*!****************************************!*\ !*** ./node_modules/iterall/index.mjs ***! \****************************************/ /*! namespace exports */ /*! export $$asyncIterator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export $$iterator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createAsyncIterator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export createIterator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export forAwaitEach [provided] [no usage info] [missing usage info prevents renaming] */ /*! export forEach [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getAsyncIterator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getAsyncIteratorMethod [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getIterator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export getIteratorMethod [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isArrayLike [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isAsyncIterable [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isCollection [provided] [no usage info] [missing usage info prevents renaming] */ /*! export isIterable [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$$iterator": () => /* binding */ $$iterator, /* harmony export */ "isIterable": () => /* binding */ isIterable, /* harmony export */ "isArrayLike": () => /* binding */ isArrayLike, /* harmony export */ "isCollection": () => /* binding */ isCollection, /* harmony export */ "getIterator": () => /* binding */ getIterator, /* harmony export */ "getIteratorMethod": () => /* binding */ getIteratorMethod, /* harmony export */ "createIterator": () => /* binding */ createIterator, /* harmony export */ "forEach": () => /* binding */ forEach, /* harmony export */ "$$asyncIterator": () => /* binding */ $$asyncIterator, /* harmony export */ "isAsyncIterable": () => /* binding */ isAsyncIterable, /* harmony export */ "getAsyncIterator": () => /* binding */ getAsyncIterator, /* harmony export */ "getAsyncIteratorMethod": () => /* binding */ getAsyncIteratorMethod, /* harmony export */ "createAsyncIterator": () => /* binding */ createAsyncIterator, /* harmony export */ "forAwaitEach": () => /* binding */ forAwaitEach /* harmony export */ }); /** * Copyright (c) 2016, Lee Byron * All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @ignore */ /** * [Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator) * is a *protocol* which describes a standard way to produce a sequence of * values, typically the values of the Iterable represented by this Iterator. * * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface) * it can be utilized by any version of JavaScript. * * @external Iterator * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator|MDN Iteration protocols} */ /** * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable) * is a *protocol* which when implemented allows a JavaScript object to define * their iteration behavior, such as what values are looped over in a * [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) * loop or `iterall`'s `forEach` function. Many [built-in types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Builtin_iterables) * implement the Iterable protocol, including `Array` and `Map`. * * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterable-interface) * it can be utilized by any version of JavaScript. * * @external Iterable * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable|MDN Iteration protocols} */ // In ES2015 environments, Symbol exists var SYMBOL /*: any */ = typeof Symbol === 'function' ? Symbol : void 0 // In ES2015 (or a polyfilled) environment, this will be Symbol.iterator var SYMBOL_ITERATOR = SYMBOL && SYMBOL.iterator /** * A property name to be used as the name of an Iterable's method responsible * for producing an Iterator, referred to as `@@iterator`. Typically represents * the value `Symbol.iterator` but falls back to the string `"@@iterator"` when * `Symbol.iterator` is not defined. * * Use `$$iterator` for defining new Iterables instead of `Symbol.iterator`, * but do not use it for accessing existing Iterables, instead use * {@link getIterator} or {@link isIterable}. * * @example * * var $$iterator = require('iterall').$$iterator * * function Counter (to) { * this.to = to * } * * Counter.prototype[$$iterator] = function () { * return { * to: this.to, * num: 0, * next () { * if (this.num >= this.to) { * return { value: undefined, done: true } * } * return { value: this.num++, done: false } * } * } * } * * var counter = new Counter(3) * for (var number of counter) { * console.log(number) // 0 ... 1 ... 2 * } * * @type {Symbol|string} */ /*:: declare export var $$iterator: '@@iterator'; */ var $$iterator = SYMBOL_ITERATOR || '@@iterator' /** * Returns true if the provided object implements the Iterator protocol via * either implementing a `Symbol.iterator` or `"@@iterator"` method. * * @example * * var isIterable = require('iterall').isIterable * isIterable([ 1, 2, 3 ]) // true * isIterable('ABC') // true * isIterable({ length: 1, 0: 'Alpha' }) // false * isIterable({ key: 'value' }) // false * isIterable(new Map()) // true * * @param obj * A value which might implement the Iterable protocol. * @return {boolean} true if Iterable. */ /*:: declare export function isIterable(obj: any): boolean; */ function isIterable(obj) { return !!getIteratorMethod(obj) } /** * Returns true if the provided object implements the Array-like protocol via * defining a positive-integer `length` property. * * @example * * var isArrayLike = require('iterall').isArrayLike * isArrayLike([ 1, 2, 3 ]) // true * isArrayLike('ABC') // true * isArrayLike({ length: 1, 0: 'Alpha' }) // true * isArrayLike({ key: 'value' }) // false * isArrayLike(new Map()) // false * * @param obj * A value which might implement the Array-like protocol. * @return {boolean} true if Array-like. */ /*:: declare export function isArrayLike(obj: any): boolean; */ function isArrayLike(obj) { var length = obj != null && obj.length return typeof length === 'number' && length >= 0 && length % 1 === 0 } /** * Returns true if the provided object is an Object (i.e. not a string literal) * and is either Iterable or Array-like. * * This may be used in place of [Array.isArray()][isArray] to determine if an * object should be iterated-over. It always excludes string literals and * includes Arrays (regardless of if it is Iterable). It also includes other * Array-like objects such as NodeList, TypedArray, and Buffer. * * @example * * var isCollection = require('iterall').isCollection * isCollection([ 1, 2, 3 ]) // true * isCollection('ABC') // false * isCollection({ length: 1, 0: 'Alpha' }) // true * isCollection({ key: 'value' }) // false * isCollection(new Map()) // true * * @example * * var forEach = require('iterall').forEach * if (isCollection(obj)) { * forEach(obj, function (value) { * console.log(value) * }) * } * * @param obj * An Object value which might implement the Iterable or Array-like protocols. * @return {boolean} true if Iterable or Array-like Object. */ /*:: declare export function isCollection(obj: any): boolean; */ function isCollection(obj) { return Object(obj) === obj && (isArrayLike(obj) || isIterable(obj)) } /** * If the provided object implements the Iterator protocol, its Iterator object * is returned. Otherwise returns undefined. * * @example * * var getIterator = require('iterall').getIterator * var iterator = getIterator([ 1, 2, 3 ]) * iterator.next() // { value: 1, done: false } * iterator.next() // { value: 2, done: false } * iterator.next() // { value: 3, done: false } * iterator.next() // { value: undefined, done: true } * * @template T the type of each iterated value * @param {Iterable} iterable * An Iterable object which is the source of an Iterator. * @return {Iterator} new Iterator instance. */ /*:: declare export var getIterator: & (<+TValue>(iterable: Iterable) => Iterator) & ((iterable: mixed) => void | Iterator); */ function getIterator(iterable) { var method = getIteratorMethod(iterable) if (method) { return method.call(iterable) } } /** * If the provided object implements the Iterator protocol, the method * responsible for producing its Iterator object is returned. * * This is used in rare cases for performance tuning. This method must be called * with obj as the contextual this-argument. * * @example * * var getIteratorMethod = require('iterall').getIteratorMethod * var myArray = [ 1, 2, 3 ] * var method = getIteratorMethod(myArray) * if (method) { * var iterator = method.call(myArray) * } * * @template T the type of each iterated value * @param {Iterable} iterable * An Iterable object which defines an `@@iterator` method. * @return {function(): Iterator} `@@iterator` method. */ /*:: declare export var getIteratorMethod: & (<+TValue>(iterable: Iterable) => (() => Iterator)) & ((iterable: mixed) => (void | (() => Iterator))); */ function getIteratorMethod(iterable) { if (iterable != null) { var method = (SYMBOL_ITERATOR && iterable[SYMBOL_ITERATOR]) || iterable['@@iterator'] if (typeof method === 'function') { return method } } } /** * Similar to {@link getIterator}, this method returns a new Iterator given an * Iterable. However it will also create an Iterator for a non-Iterable * Array-like collection, such as Array in a non-ES2015 environment. * * `createIterator` is complimentary to `forEach`, but allows a "pull"-based * iteration as opposed to `forEach`'s "push"-based iteration. * * `createIterator` produces an Iterator for Array-likes with the same behavior * as ArrayIteratorPrototype described in the ECMAScript specification, and * does *not* skip over "holes". * * @example * * var createIterator = require('iterall').createIterator * * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } * var iterator = createIterator(myArraylike) * iterator.next() // { value: 'Alpha', done: false } * iterator.next() // { value: 'Bravo', done: false } * iterator.next() // { value: 'Charlie', done: false } * iterator.next() // { value: undefined, done: true } * * @template T the type of each iterated value * @param {Iterable|{ length: number }} collection * An Iterable or Array-like object to produce an Iterator. * @return {Iterator} new Iterator instance. */ /*:: declare export var createIterator: & (<+TValue>(collection: Iterable) => Iterator) & ((collection: {length: number}) => Iterator) & ((collection: mixed) => (void | Iterator)); */ function createIterator(collection) { if (collection != null) { var iterator = getIterator(collection) if (iterator) { return iterator } if (isArrayLike(collection)) { return new ArrayLikeIterator(collection) } } } // When the object provided to `createIterator` is not Iterable but is // Array-like, this simple Iterator is created. function ArrayLikeIterator(obj) { this._o = obj this._i = 0 } // Note: all Iterators are themselves Iterable. ArrayLikeIterator.prototype[$$iterator] = function() { return this } // A simple state-machine determines the IteratorResult returned, yielding // each value in the Array-like object in order of their indicies. ArrayLikeIterator.prototype.next = function() { if (this._o === void 0 || this._i >= this._o.length) { this._o = void 0 return { value: void 0, done: true } } return { value: this._o[this._i++], done: false } } /** * Given an object which either implements the Iterable protocol or is * Array-like, iterate over it, calling the `callback` at each iteration. * * Use `forEach` where you would expect to use a `for ... of` loop in ES6. * However `forEach` adheres to the behavior of [Array#forEach][] described in * the ECMAScript specification, skipping over "holes" in Array-likes. It will * also delegate to a `forEach` method on `collection` if one is defined, * ensuring native performance for `Arrays`. * * Similar to [Array#forEach][], the `callback` function accepts three * arguments, and is provided with `thisArg` as the calling context. * * Note: providing an infinite Iterator to forEach will produce an error. * * [Array#forEach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach * * @example * * var forEach = require('iterall').forEach * * forEach(myIterable, function (value, index, iterable) { * console.log(value, index, iterable === myIterable) * }) * * @example * * // ES6: * for (let value of myIterable) { * console.log(value) * } * * // Any JavaScript environment: * forEach(myIterable, function (value) { * console.log(value) * }) * * @template T the type of each iterated value * @param {Iterable|{ length: number }} collection * The Iterable or array to iterate over. * @param {function(T, number, object)} callback * Function to execute for each iteration, taking up to three arguments * @param [thisArg] * Optional. Value to use as `this` when executing `callback`. */ /*:: declare export var forEach: & (<+TValue, TCollection: Iterable>( collection: TCollection, callbackFn: (value: TValue, index: number, collection: TCollection) => any, thisArg?: any ) => void) & (( collection: TCollection, callbackFn: (value: mixed, index: number, collection: TCollection) => any, thisArg?: any ) => void); */ function forEach(collection, callback, thisArg) { if (collection != null) { if (typeof collection.forEach === 'function') { return collection.forEach(callback, thisArg) } var i = 0 var iterator = getIterator(collection) if (iterator) { var step while (!(step = iterator.next()).done) { callback.call(thisArg, step.value, i++, collection) // Infinite Iterators could cause forEach to run forever. // After a very large number of iterations, produce an error. /* istanbul ignore if */ if (i > 9999999) { throw new TypeError('Near-infinite iteration.') } } } else if (isArrayLike(collection)) { for (; i < collection.length; i++) { if (collection.hasOwnProperty(i)) { callback.call(thisArg, collection[i], i, collection) } } } } } ///////////////////////////////////////////////////// // // // ASYNC ITERATORS // // // ///////////////////////////////////////////////////// /** * [AsyncIterable](https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface) * is a *protocol* which when implemented allows a JavaScript object to define * an asynchronous iteration behavior, such as what values are looped over in * a [`for-await-of`](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) * loop or `iterall`'s {@link forAwaitEach} function. * * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) * it can be utilized by any version of JavaScript. * * @external AsyncIterable * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface|Async Iteration Proposal} * @template T The type of each iterated value * @property {function (): AsyncIterator} Symbol.asyncIterator * A method which produces an AsyncIterator for this AsyncIterable. */ /** * [AsyncIterator](https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface) * is a *protocol* which describes a standard way to produce and consume an * asynchronous sequence of values, typically the values of the * {@link AsyncIterable} represented by this {@link AsyncIterator}. * * AsyncIterator is similar to Observable or Stream. Like an {@link Iterator} it * also as a `next()` method, however instead of an IteratorResult, * calling this method returns a {@link Promise} for a IteratorResult. * * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) * it can be utilized by any version of JavaScript. * * @external AsyncIterator * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface|Async Iteration Proposal} */ // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator var SYMBOL_ASYNC_ITERATOR = SYMBOL && SYMBOL.asyncIterator /** * A property name to be used as the name of an AsyncIterable's method * responsible for producing an Iterator, referred to as `@@asyncIterator`. * Typically represents the value `Symbol.asyncIterator` but falls back to the * string `"@@asyncIterator"` when `Symbol.asyncIterator` is not defined. * * Use `$$asyncIterator` for defining new AsyncIterables instead of * `Symbol.asyncIterator`, but do not use it for accessing existing Iterables, * instead use {@link getAsyncIterator} or {@link isAsyncIterable}. * * @example * * var $$asyncIterator = require('iterall').$$asyncIterator * * function Chirper (to) { * this.to = to * } * * Chirper.prototype[$$asyncIterator] = function () { * return { * to: this.to, * num: 0, * next () { * return new Promise(resolve => { * if (this.num >= this.to) { * resolve({ value: undefined, done: true }) * } else { * setTimeout(() => { * resolve({ value: this.num++, done: false }) * }, 1000) * } * }) * } * } * } * * var chirper = new Chirper(3) * for await (var number of chirper) { * console.log(number) // 0 ...wait... 1 ...wait... 2 * } * * @type {Symbol|string} */ /*:: declare export var $$asyncIterator: '@@asyncIterator'; */ var $$asyncIterator = SYMBOL_ASYNC_ITERATOR || '@@asyncIterator' /** * Returns true if the provided object implements the AsyncIterator protocol via * either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. * * @example * * var isAsyncIterable = require('iterall').isAsyncIterable * isAsyncIterable(myStream) // true * isAsyncIterable('ABC') // false * * @param obj * A value which might implement the AsyncIterable protocol. * @return {boolean} true if AsyncIterable. */ /*:: declare export function isAsyncIterable(obj: any): boolean; */ function isAsyncIterable(obj) { return !!getAsyncIteratorMethod(obj) } /** * If the provided object implements the AsyncIterator protocol, its * AsyncIterator object is returned. Otherwise returns undefined. * * @example * * var getAsyncIterator = require('iterall').getAsyncIterator * var asyncIterator = getAsyncIterator(myStream) * asyncIterator.next().then(console.log) // { value: 1, done: false } * asyncIterator.next().then(console.log) // { value: 2, done: false } * asyncIterator.next().then(console.log) // { value: 3, done: false } * asyncIterator.next().then(console.log) // { value: undefined, done: true } * * @template T the type of each iterated value * @param {AsyncIterable} asyncIterable * An AsyncIterable object which is the source of an AsyncIterator. * @return {AsyncIterator} new AsyncIterator instance. */ /*:: declare export var getAsyncIterator: & (<+TValue>(asyncIterable: AsyncIterable) => AsyncIterator) & ((asyncIterable: mixed) => (void | AsyncIterator)); */ function getAsyncIterator(asyncIterable) { var method = getAsyncIteratorMethod(asyncIterable) if (method) { return method.call(asyncIterable) } } /** * If the provided object implements the AsyncIterator protocol, the method * responsible for producing its AsyncIterator object is returned. * * This is used in rare cases for performance tuning. This method must be called * with obj as the contextual this-argument. * * @example * * var getAsyncIteratorMethod = require('iterall').getAsyncIteratorMethod * var method = getAsyncIteratorMethod(myStream) * if (method) { * var asyncIterator = method.call(myStream) * } * * @template T the type of each iterated value * @param {AsyncIterable} asyncIterable * An AsyncIterable object which defines an `@@asyncIterator` method. * @return {function(): AsyncIterator} `@@asyncIterator` method. */ /*:: declare export var getAsyncIteratorMethod: & (<+TValue>(asyncIterable: AsyncIterable) => (() => AsyncIterator)) & ((asyncIterable: mixed) => (void | (() => AsyncIterator))); */ function getAsyncIteratorMethod(asyncIterable) { if (asyncIterable != null) { var method = (SYMBOL_ASYNC_ITERATOR && asyncIterable[SYMBOL_ASYNC_ITERATOR]) || asyncIterable['@@asyncIterator'] if (typeof method === 'function') { return method } } } /** * Similar to {@link getAsyncIterator}, this method returns a new AsyncIterator * given an AsyncIterable. However it will also create an AsyncIterator for a * non-async Iterable as well as non-Iterable Array-like collection, such as * Array in a pre-ES2015 environment. * * `createAsyncIterator` is complimentary to `forAwaitEach`, but allows a * buffering "pull"-based iteration as opposed to `forAwaitEach`'s * "push"-based iteration. * * `createAsyncIterator` produces an AsyncIterator for non-async Iterables as * described in the ECMAScript proposal [Async-from-Sync Iterator Objects](https://tc39.github.io/proposal-async-iteration/#sec-async-from-sync-iterator-objects). * * > Note: Creating `AsyncIterator`s requires the existence of `Promise`. * > While `Promise` has been available in modern browsers for a number of * > years, legacy browsers (like IE 11) may require a polyfill. * * @example * * var createAsyncIterator = require('iterall').createAsyncIterator * * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } * var iterator = createAsyncIterator(myArraylike) * iterator.next().then(console.log) // { value: 'Alpha', done: false } * iterator.next().then(console.log) // { value: 'Bravo', done: false } * iterator.next().then(console.log) // { value: 'Charlie', done: false } * iterator.next().then(console.log) // { value: undefined, done: true } * * @template T the type of each iterated value * @param {AsyncIterable|Iterable|{ length: number }} source * An AsyncIterable, Iterable, or Array-like object to produce an Iterator. * @return {AsyncIterator} new AsyncIterator instance. */ /*:: declare export var createAsyncIterator: & (<+TValue>( collection: Iterable | TValue> | AsyncIterable ) => AsyncIterator) & ((collection: {length: number}) => AsyncIterator) & ((collection: mixed) => (void | AsyncIterator)); */ function createAsyncIterator(source) { if (source != null) { var asyncIterator = getAsyncIterator(source) if (asyncIterator) { return asyncIterator } var iterator = createIterator(source) if (iterator) { return new AsyncFromSyncIterator(iterator) } } } // When the object provided to `createAsyncIterator` is not AsyncIterable but is // sync Iterable, this simple wrapper is created. function AsyncFromSyncIterator(iterator) { this._i = iterator } // Note: all AsyncIterators are themselves AsyncIterable. AsyncFromSyncIterator.prototype[$$asyncIterator] = function() { return this } // A simple state-machine determines the IteratorResult returned, yielding // each value in the Array-like object in order of their indicies. AsyncFromSyncIterator.prototype.next = function(value) { return unwrapAsyncFromSync(this._i, 'next', value) } AsyncFromSyncIterator.prototype.return = function(value) { return this._i.return ? unwrapAsyncFromSync(this._i, 'return', value) : Promise.resolve({ value: value, done: true }) } AsyncFromSyncIterator.prototype.throw = function(value) { return this._i.throw ? unwrapAsyncFromSync(this._i, 'throw', value) : Promise.reject(value) } function unwrapAsyncFromSync(iterator, fn, value) { var step return new Promise(function(resolve) { step = iterator[fn](value) resolve(step.value) }).then(function(value) { return { value: value, done: step.done } }) } /** * Given an object which either implements the AsyncIterable protocol or is * Array-like, iterate over it, calling the `callback` at each iteration. * * Use `forAwaitEach` where you would expect to use a [for-await-of](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) loop. * * Similar to [Array#forEach][], the `callback` function accepts three * arguments, and is provided with `thisArg` as the calling context. * * > Note: Using `forAwaitEach` requires the existence of `Promise`. * > While `Promise` has been available in modern browsers for a number of * > years, legacy browsers (like IE 11) may require a polyfill. * * @example * * var forAwaitEach = require('iterall').forAwaitEach * * forAwaitEach(myIterable, function (value, index, iterable) { * console.log(value, index, iterable === myIterable) * }) * * @example * * // ES2017: * for await (let value of myAsyncIterable) { * console.log(await doSomethingAsync(value)) * } * console.log('done') * * // Any JavaScript environment: * forAwaitEach(myAsyncIterable, function (value) { * return doSomethingAsync(value).then(console.log) * }).then(function () { * console.log('done') * }) * * @template T the type of each iterated value * @param {AsyncIterable|Iterable | T>|{ length: number }} source * The AsyncIterable or array to iterate over. * @param {function(T, number, object)} callback * Function to execute for each iteration, taking up to three arguments * @param [thisArg] * Optional. Value to use as `this` when executing `callback`. */ /*:: declare export var forAwaitEach: & (<+TValue, TCollection: Iterable | TValue> | AsyncIterable>( collection: TCollection, callbackFn: (value: TValue, index: number, collection: TCollection) => any, thisArg?: any ) => Promise) & (( collection: TCollection, callbackFn: (value: mixed, index: number, collection: TCollection) => any, thisArg?: any ) => Promise); */ function forAwaitEach(source, callback, thisArg) { var asyncIterator = createAsyncIterator(source) if (asyncIterator) { var i = 0 return new Promise(function(resolve, reject) { function next() { asyncIterator .next() .then(function(step) { if (!step.done) { Promise.resolve(callback.call(thisArg, step.value, i++, source)) .then(next) .catch(reject) } else { resolve() } // Explicitly return null, silencing bluebird-style warnings. return null }) .catch(reject) // Explicitly return null, silencing bluebird-style warnings. return null } next() }) } } /***/ }), /***/ "./node_modules/optimism/lib/bundle.esm.js": /*!*************************************************!*\ !*** ./node_modules/optimism/lib/bundle.esm.js ***! \*************************************************/ /*! namespace exports */ /*! export KeyTrie [provided] [no usage info] [missing usage info prevents renaming] */ /*! export asyncFromGen [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@wry/context/lib/context.esm.js .asyncFromGen */ /*! export bindContext [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@wry/context/lib/context.esm.js .bind */ /*! export defaultMakeCacheKey [provided] [no usage info] [missing usage info prevents renaming] */ /*! export dep [provided] [no usage info] [missing usage info prevents renaming] */ /*! export noContext [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@wry/context/lib/context.esm.js .noContext */ /*! export setTimeout [provided] [no usage info] [missing usage info prevents renaming] -> ./node_modules/@wry/context/lib/context.esm.js .setTimeout */ /*! export wrap [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "asyncFromGen": () => /* reexport safe */ _wry_context__WEBPACK_IMPORTED_MODULE_0__.asyncFromGen, /* harmony export */ "bindContext": () => /* reexport safe */ _wry_context__WEBPACK_IMPORTED_MODULE_0__.bind, /* harmony export */ "noContext": () => /* reexport safe */ _wry_context__WEBPACK_IMPORTED_MODULE_0__.noContext, /* harmony export */ "setTimeout": () => /* reexport safe */ _wry_context__WEBPACK_IMPORTED_MODULE_0__.setTimeout, /* harmony export */ "KeyTrie": () => /* binding */ KeyTrie, /* harmony export */ "defaultMakeCacheKey": () => /* binding */ defaultMakeCacheKey, /* harmony export */ "dep": () => /* binding */ dep, /* harmony export */ "wrap": () => /* binding */ wrap /* harmony export */ }); /* harmony import */ var _wry_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wry/context */ "./node_modules/@wry/context/lib/context.esm.js"); ; function defaultDispose() { } var Cache = /** @class */ (function () { function Cache(max, dispose) { if (max === void 0) { max = Infinity; } if (dispose === void 0) { dispose = defaultDispose; } this.max = max; this.dispose = dispose; this.map = new Map(); this.newest = null; this.oldest = null; } Cache.prototype.has = function (key) { return this.map.has(key); }; Cache.prototype.get = function (key) { var entry = this.getEntry(key); return entry && entry.value; }; Cache.prototype.getEntry = function (key) { var entry = this.map.get(key); if (entry && entry !== this.newest) { var older = entry.older, newer = entry.newer; if (newer) { newer.older = older; } if (older) { older.newer = newer; } entry.older = this.newest; entry.older.newer = entry; entry.newer = null; this.newest = entry; if (entry === this.oldest) { this.oldest = newer; } } return entry; }; Cache.prototype.set = function (key, value) { var entry = this.getEntry(key); if (entry) { return entry.value = value; } entry = { key: key, value: value, newer: null, older: this.newest }; if (this.newest) { this.newest.newer = entry; } this.newest = entry; this.oldest = this.oldest || entry; this.map.set(key, entry); return entry.value; }; Cache.prototype.clean = function () { while (this.oldest && this.map.size > this.max) { this.delete(this.oldest.key); } }; Cache.prototype.delete = function (key) { var entry = this.map.get(key); if (entry) { if (entry === this.newest) { this.newest = entry.older; } if (entry === this.oldest) { this.oldest = entry.newer; } if (entry.newer) { entry.newer.older = entry.older; } if (entry.older) { entry.older.newer = entry.newer; } this.map.delete(key); this.dispose(entry.value, key); return true; } return false; }; return Cache; }()); var parentEntrySlot = new _wry_context__WEBPACK_IMPORTED_MODULE_0__.Slot(); function maybeUnsubscribe(entryOrDep) { var unsubscribe = entryOrDep.unsubscribe; if (typeof unsubscribe === "function") { entryOrDep.unsubscribe = void 0; unsubscribe(); } } var emptySetPool = []; var POOL_TARGET_SIZE = 100; // Since this package might be used browsers, we should avoid using the // Node built-in assert module. function assert(condition, optionalMessage) { if (!condition) { throw new Error(optionalMessage || "assertion failure"); } } function valueIs(a, b) { var len = a.length; return ( // Unknown values are not equal to each other. len > 0 && // Both values must be ordinary (or both exceptional) to be equal. len === b.length && // The underlying value or exception must be the same. a[len - 1] === b[len - 1]); } function valueGet(value) { switch (value.length) { case 0: throw new Error("unknown value"); case 1: return value[0]; case 2: throw value[1]; } } function valueCopy(value) { return value.slice(0); } var Entry = /** @class */ (function () { function Entry(fn, args) { this.fn = fn; this.args = args; this.parents = new Set(); this.childValues = new Map(); // When this Entry has children that are dirty, this property becomes // a Set containing other Entry objects, borrowed from emptySetPool. // When the set becomes empty, it gets recycled back to emptySetPool. this.dirtyChildren = null; this.dirty = true; this.recomputing = false; this.value = []; this.deps = null; ++Entry.count; } Entry.prototype.peek = function () { if (this.value.length === 1 && !mightBeDirty(this)) { return this.value[0]; } }; // This is the most important method of the Entry API, because it // determines whether the cached this.value can be returned immediately, // or must be recomputed. The overall performance of the caching system // depends on the truth of the following observations: (1) this.dirty is // usually false, (2) this.dirtyChildren is usually null/empty, and thus // (3) valueGet(this.value) is usually returned without recomputation. Entry.prototype.recompute = function () { assert(!this.recomputing, "already recomputing"); rememberParent(this); return mightBeDirty(this) ? reallyRecompute(this) : valueGet(this.value); }; Entry.prototype.setDirty = function () { if (this.dirty) return; this.dirty = true; this.value.length = 0; reportDirty(this); forgetChildren(this); // We can go ahead and unsubscribe here, since any further dirty // notifications we receive will be redundant, and unsubscribing may // free up some resources, e.g. file watchers. maybeUnsubscribe(this); }; Entry.prototype.dispose = function () { var _this = this; forgetChildren(this); maybeUnsubscribe(this); // Because this entry has been kicked out of the cache (in index.js), // we've lost the ability to find out if/when this entry becomes dirty, // whether that happens through a subscription, because of a direct call // to entry.setDirty(), or because one of its children becomes dirty. // Because of this loss of future information, we have to assume the // worst (that this entry might have become dirty very soon), so we must // immediately mark this entry's parents as dirty. Normally we could // just call entry.setDirty() rather than calling parent.setDirty() for // each parent, but that would leave this entry in parent.childValues // and parent.dirtyChildren, which would prevent the child from being // truly forgotten. this.parents.forEach(function (parent) { parent.setDirty(); forgetChild(parent, _this); }); }; Entry.prototype.dependOn = function (dep) { dep.add(this); if (!this.deps) { this.deps = emptySetPool.pop() || new Set(); } this.deps.add(dep); }; Entry.prototype.forgetDeps = function () { var _this = this; if (this.deps) { this.deps.forEach(function (dep) { return dep.delete(_this); }); this.deps.clear(); emptySetPool.push(this.deps); this.deps = null; } }; Entry.count = 0; return Entry; }()); function rememberParent(child) { var parent = parentEntrySlot.getValue(); if (parent) { child.parents.add(parent); if (!parent.childValues.has(child)) { parent.childValues.set(child, []); } if (mightBeDirty(child)) { reportDirtyChild(parent, child); } else { reportCleanChild(parent, child); } return parent; } } function reallyRecompute(entry) { forgetChildren(entry); // Set entry as the parent entry while calling recomputeNewValue(entry). parentEntrySlot.withValue(entry, recomputeNewValue, [entry]); if (maybeSubscribe(entry)) { // If we successfully recomputed entry.value and did not fail to // (re)subscribe, then this Entry is no longer explicitly dirty. setClean(entry); } return valueGet(entry.value); } function recomputeNewValue(entry) { entry.recomputing = true; // Set entry.value as unknown. entry.value.length = 0; try { // If entry.fn succeeds, entry.value will become a normal Value. entry.value[0] = entry.fn.apply(null, entry.args); } catch (e) { // If entry.fn throws, entry.value will become exceptional. entry.value[1] = e; } // Either way, this line is always reached. entry.recomputing = false; } function mightBeDirty(entry) { return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size); } function setClean(entry) { entry.dirty = false; if (mightBeDirty(entry)) { // This Entry may still have dirty children, in which case we can't // let our parents know we're clean just yet. return; } reportClean(entry); } function reportDirty(child) { child.parents.forEach(function (parent) { return reportDirtyChild(parent, child); }); } function reportClean(child) { child.parents.forEach(function (parent) { return reportCleanChild(parent, child); }); } // Let a parent Entry know that one of its children may be dirty. function reportDirtyChild(parent, child) { // Must have called rememberParent(child) before calling // reportDirtyChild(parent, child). assert(parent.childValues.has(child)); assert(mightBeDirty(child)); if (!parent.dirtyChildren) { parent.dirtyChildren = emptySetPool.pop() || new Set; } else if (parent.dirtyChildren.has(child)) { // If we already know this child is dirty, then we must have already // informed our own parents that we are dirty, so we can terminate // the recursion early. return; } parent.dirtyChildren.add(child); reportDirty(parent); } // Let a parent Entry know that one of its children is no longer dirty. function reportCleanChild(parent, child) { // Must have called rememberChild(child) before calling // reportCleanChild(parent, child). assert(parent.childValues.has(child)); assert(!mightBeDirty(child)); var childValue = parent.childValues.get(child); if (childValue.length === 0) { parent.childValues.set(child, valueCopy(child.value)); } else if (!valueIs(childValue, child.value)) { parent.setDirty(); } removeDirtyChild(parent, child); if (mightBeDirty(parent)) { return; } reportClean(parent); } function removeDirtyChild(parent, child) { var dc = parent.dirtyChildren; if (dc) { dc.delete(child); if (dc.size === 0) { if (emptySetPool.length < POOL_TARGET_SIZE) { emptySetPool.push(dc); } parent.dirtyChildren = null; } } } // Removes all children from this entry and returns an array of the // removed children. function forgetChildren(parent) { if (parent.childValues.size > 0) { parent.childValues.forEach(function (_value, child) { forgetChild(parent, child); }); } // Remove this parent Entry from any sets to which it was added by the // addToSet method. parent.forgetDeps(); // After we forget all our children, this.dirtyChildren must be empty // and therefore must have been reset to null. assert(parent.dirtyChildren === null); } function forgetChild(parent, child) { child.parents.delete(parent); parent.childValues.delete(child); removeDirtyChild(parent, child); } function maybeSubscribe(entry) { if (typeof entry.subscribe === "function") { try { maybeUnsubscribe(entry); // Prevent double subscriptions. entry.unsubscribe = entry.subscribe.apply(null, entry.args); } catch (e) { // If this Entry has a subscribe function and it threw an exception // (or an unsubscribe function it previously returned now throws), // return false to indicate that we were not able to subscribe (or // unsubscribe), and this Entry should remain dirty. entry.setDirty(); return false; } } // Returning true indicates either that there was no entry.subscribe // function or that it succeeded. return true; } // A trie data structure that holds object keys weakly, yet can also hold // non-object keys, unlike the native `WeakMap`. // If no makeData function is supplied, the looked-up data will be an empty, // no-prototype Object. var defaultMakeData = function () { return Object.create(null); }; // Useful for processing arguments objects as well as arrays. var _a = Array.prototype, forEach = _a.forEach, slice = _a.slice; var KeyTrie = /** @class */ (function () { function KeyTrie(weakness, makeData) { if (makeData === void 0) { makeData = defaultMakeData; } this.weakness = weakness; this.makeData = makeData; } KeyTrie.prototype.lookup = function () { var array = []; for (var _i = 0; _i < arguments.length; _i++) { array[_i] = arguments[_i]; } return this.lookupArray(array); }; KeyTrie.prototype.lookupArray = function (array) { var node = this; forEach.call(array, function (key) { return node = node.getChildTrie(key); }); return node.data || (node.data = this.makeData(slice.call(array))); }; KeyTrie.prototype.getChildTrie = function (key) { var map = this.weakness && isObjRef(key) ? this.weak || (this.weak = new WeakMap()) : this.strong || (this.strong = new Map()); var child = map.get(key); if (!child) map.set(key, child = new KeyTrie(this.weakness, this.makeData)); return child; }; return KeyTrie; }()); function isObjRef(value) { switch (typeof value) { case "object": if (value === null) break; // Fall through to return true... case "function": return true; } return false; } function dep(options) { var depsByKey = new Map(); var subscribe = options && options.subscribe; function depend(key) { var parent = parentEntrySlot.getValue(); if (parent) { var dep_1 = depsByKey.get(key); if (!dep_1) { depsByKey.set(key, dep_1 = new Set); } parent.dependOn(dep_1); if (typeof subscribe === "function") { maybeUnsubscribe(dep_1); dep_1.unsubscribe = subscribe(key); } } } depend.dirty = function dirty(key) { var dep = depsByKey.get(key); if (dep) { dep.forEach(function (entry) { return entry.setDirty(); }); depsByKey.delete(key); maybeUnsubscribe(dep); } }; return depend; } // The defaultMakeCacheKey function is remarkably powerful, because it gives // a unique object for any shallow-identical list of arguments. If you need // to implement a custom makeCacheKey function, you may find it helpful to // delegate the final work to defaultMakeCacheKey, which is why we export it // here. However, you may want to avoid defaultMakeCacheKey if your runtime // does not support WeakMap, or you have the ability to return a string key. // In those cases, just write your own custom makeCacheKey functions. var keyTrie = new KeyTrie(typeof WeakMap === "function"); function defaultMakeCacheKey() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return keyTrie.lookupArray(args); } var caches = new Set(); function wrap(originalFunction, options) { if (options === void 0) { options = Object.create(null); } var cache = new Cache(options.max || Math.pow(2, 16), function (entry) { return entry.dispose(); }); var keyArgs = options.keyArgs || (function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return args; }); var makeCacheKey = options.makeCacheKey || defaultMakeCacheKey; function optimistic() { var key = makeCacheKey.apply(null, keyArgs.apply(null, arguments)); if (key === void 0) { return originalFunction.apply(null, arguments); } var args = Array.prototype.slice.call(arguments); var entry = cache.get(key); if (entry) { entry.args = args; } else { entry = new Entry(originalFunction, args); cache.set(key, entry); entry.subscribe = options.subscribe; } var value = entry.recompute(); // Move this entry to the front of the least-recently used queue, // since we just finished computing its value. cache.set(key, entry); caches.add(cache); // Clean up any excess entries in the cache, but only if there is no // active parent entry, meaning we're not in the middle of a larger // computation that might be flummoxed by the cleaning. if (!parentEntrySlot.hasValue()) { caches.forEach(function (cache) { return cache.clean(); }); caches.clear(); } return value; } function lookup() { var key = makeCacheKey.apply(null, arguments); if (key !== void 0) { return cache.get(key); } } optimistic.dirty = function () { var entry = lookup.apply(null, arguments); if (entry) { entry.setDirty(); } }; optimistic.peek = function () { var entry = lookup.apply(null, arguments); if (entry) { return entry.peek(); } }; optimistic.forget = function () { var key = makeCacheKey.apply(null, arguments); return key !== void 0 && cache.delete(key); }; return optimistic; } //# sourceMappingURL=bundle.esm.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/Observable.js": /*!********************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/Observable.js ***! \********************************************************/ /*! namespace exports */ /*! export Observable [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Observable": () => /* binding */ Observable /* harmony export */ }); /* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/canReportError */ "./node_modules/rxjs/_esm5/internal/util/canReportError.js"); /* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/toSubscriber */ "./node_modules/rxjs/_esm5/internal/util/toSubscriber.js"); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./symbol/observable */ "./node_modules/rxjs/_esm5/internal/symbol/observable.js"); /* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/pipe */ "./node_modules/rxjs/_esm5/internal/util/pipe.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm5/internal/config.js"); /** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ ; var Observable = /*@__PURE__*/ (function () { function Observable(subscribe) { this._isScalar = false; if (subscribe) { this._subscribe = subscribe; } } Observable.prototype.lift = function (operator) { var observable = new Observable(); observable.source = this; observable.operator = operator; return observable; }; Observable.prototype.subscribe = function (observerOrNext, error, complete) { var operator = this.operator; var sink = (0,_util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__.toSubscriber)(observerOrNext, error, complete); if (operator) { sink.add(operator.call(sink, this.source)); } else { sink.add(this.source || (_config__WEBPACK_IMPORTED_MODULE_1__.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? this._subscribe(sink) : this._trySubscribe(sink)); } if (_config__WEBPACK_IMPORTED_MODULE_1__.config.useDeprecatedSynchronousErrorHandling) { if (sink.syncErrorThrowable) { sink.syncErrorThrowable = false; if (sink.syncErrorThrown) { throw sink.syncErrorValue; } } } return sink; }; Observable.prototype._trySubscribe = function (sink) { try { return this._subscribe(sink); } catch (err) { if (_config__WEBPACK_IMPORTED_MODULE_1__.config.useDeprecatedSynchronousErrorHandling) { sink.syncErrorThrown = true; sink.syncErrorValue = err; } if ((0,_util_canReportError__WEBPACK_IMPORTED_MODULE_2__.canReportError)(sink)) { sink.error(err); } else { console.warn(err); } } }; Observable.prototype.forEach = function (next, promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var subscription; subscription = _this.subscribe(function (value) { try { next(value); } catch (err) { reject(err); if (subscription) { subscription.unsubscribe(); } } }, reject, resolve); }); }; Observable.prototype._subscribe = function (subscriber) { var source = this.source; return source && source.subscribe(subscriber); }; Observable.prototype[_symbol_observable__WEBPACK_IMPORTED_MODULE_3__.observable] = function () { return this; }; Observable.prototype.pipe = function () { var operations = []; for (var _i = 0; _i < arguments.length; _i++) { operations[_i] = arguments[_i]; } if (operations.length === 0) { return this; } return (0,_util_pipe__WEBPACK_IMPORTED_MODULE_4__.pipeFromArray)(operations)(this); }; Observable.prototype.toPromise = function (promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var value; _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); }); }); }; Observable.create = function (subscribe) { return new Observable(subscribe); }; return Observable; }()); function getPromiseCtor(promiseCtor) { if (!promiseCtor) { promiseCtor = _config__WEBPACK_IMPORTED_MODULE_1__.config.Promise || Promise; } if (!promiseCtor) { throw new Error('no Promise impl found'); } return promiseCtor; } //# sourceMappingURL=Observable.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/Observer.js": /*!******************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/Observer.js ***! \******************************************************/ /*! namespace exports */ /*! export empty [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "empty": () => /* binding */ empty /* harmony export */ }); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm5/internal/config.js"); /* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/hostReportError */ "./node_modules/rxjs/_esm5/internal/util/hostReportError.js"); /** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */ ; var empty = { closed: true, next: function (value) { }, error: function (err) { if (_config__WEBPACK_IMPORTED_MODULE_0__.config.useDeprecatedSynchronousErrorHandling) { throw err; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__.hostReportError)(err); } }, complete: function () { } }; //# sourceMappingURL=Observer.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/Subject.js": /*!*****************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/Subject.js ***! \*****************************************************/ /*! namespace exports */ /*! export AnonymousSubject [provided] [no usage info] [missing usage info prevents renaming] */ /*! export Subject [provided] [no usage info] [missing usage info prevents renaming] */ /*! export SubjectSubscriber [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "SubjectSubscriber": () => /* binding */ SubjectSubscriber, /* harmony export */ "Subject": () => /* binding */ Subject, /* harmony export */ "AnonymousSubject": () => /* binding */ AnonymousSubject /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Observable */ "./node_modules/rxjs/_esm5/internal/Observable.js"); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js"); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js"); /* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js"); /* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SubjectSubscription */ "./node_modules/rxjs/_esm5/internal/SubjectSubscription.js"); /* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js"); /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ ; var SubjectSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__.__extends(SubjectSubscriber, _super); function SubjectSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.destination = destination; return _this; } return SubjectSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__.Subscriber)); var Subject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__.__extends(Subject, _super); function Subject() { var _this = _super.call(this) || this; _this.observers = []; _this.closed = false; _this.isStopped = false; _this.hasError = false; _this.thrownError = null; return _this; } Subject.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__.rxSubscriber] = function () { return new SubjectSubscriber(this); }; Subject.prototype.lift = function (operator) { var subject = new AnonymousSubject(this, this); subject.operator = operator; return subject; }; Subject.prototype.next = function (value) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } if (!this.isStopped) { var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].next(value); } } }; Subject.prototype.error = function (err) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } this.hasError = true; this.thrownError = err; this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].error(err); } this.observers.length = 0; }; Subject.prototype.complete = function () { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].complete(); } this.observers.length = 0; }; Subject.prototype.unsubscribe = function () { this.isStopped = true; this.closed = true; this.observers = null; }; Subject.prototype._trySubscribe = function (subscriber) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } else { return _super.prototype._trySubscribe.call(this, subscriber); } }; Subject.prototype._subscribe = function (subscriber) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } else if (this.hasError) { subscriber.error(this.thrownError); return _Subscription__WEBPACK_IMPORTED_MODULE_4__.Subscription.EMPTY; } else if (this.isStopped) { subscriber.complete(); return _Subscription__WEBPACK_IMPORTED_MODULE_4__.Subscription.EMPTY; } else { this.observers.push(subscriber); return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__.SubjectSubscription(this, subscriber); } }; Subject.prototype.asObservable = function () { var observable = new _Observable__WEBPACK_IMPORTED_MODULE_6__.Observable(); observable.source = this; return observable; }; Subject.create = function (destination, source) { return new AnonymousSubject(destination, source); }; return Subject; }(_Observable__WEBPACK_IMPORTED_MODULE_6__.Observable)); var AnonymousSubject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__.__extends(AnonymousSubject, _super); function AnonymousSubject(destination, source) { var _this = _super.call(this) || this; _this.destination = destination; _this.source = source; return _this; } AnonymousSubject.prototype.next = function (value) { var destination = this.destination; if (destination && destination.next) { destination.next(value); } }; AnonymousSubject.prototype.error = function (err) { var destination = this.destination; if (destination && destination.error) { this.destination.error(err); } }; AnonymousSubject.prototype.complete = function () { var destination = this.destination; if (destination && destination.complete) { this.destination.complete(); } }; AnonymousSubject.prototype._subscribe = function (subscriber) { var source = this.source; if (source) { return this.source.subscribe(subscriber); } else { return _Subscription__WEBPACK_IMPORTED_MODULE_4__.Subscription.EMPTY; } }; return AnonymousSubject; }(Subject)); //# sourceMappingURL=Subject.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/SubjectSubscription.js": /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/SubjectSubscription.js ***! \*****************************************************************/ /*! namespace exports */ /*! export SubjectSubscription [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "SubjectSubscription": () => /* binding */ SubjectSubscription /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js"); /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */ ; var SubjectSubscription = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__.__extends(SubjectSubscription, _super); function SubjectSubscription(subject, subscriber) { var _this = _super.call(this) || this; _this.subject = subject; _this.subscriber = subscriber; _this.closed = false; return _this; } SubjectSubscription.prototype.unsubscribe = function () { if (this.closed) { return; } this.closed = true; var subject = this.subject; var observers = subject.observers; this.subject = null; if (!observers || observers.length === 0 || subject.isStopped || subject.closed) { return; } var subscriberIndex = observers.indexOf(this.subscriber); if (subscriberIndex !== -1) { observers.splice(subscriberIndex, 1); } }; return SubjectSubscription; }(_Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription)); //# sourceMappingURL=SubjectSubscription.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/Subscriber.js": /*!********************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/Subscriber.js ***! \********************************************************/ /*! namespace exports */ /*! export SafeSubscriber [provided] [no usage info] [missing usage info prevents renaming] */ /*! export Subscriber [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Subscriber": () => /* binding */ Subscriber, /* harmony export */ "SafeSubscriber": () => /* binding */ SafeSubscriber /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/isFunction */ "./node_modules/rxjs/_esm5/internal/util/isFunction.js"); /* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observer */ "./node_modules/rxjs/_esm5/internal/Observer.js"); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Subscription */ "./node_modules/rxjs/_esm5/internal/Subscription.js"); /* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ "./node_modules/rxjs/_esm5/internal/config.js"); /* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/hostReportError */ "./node_modules/rxjs/_esm5/internal/util/hostReportError.js"); /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ ; var Subscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__.__extends(Subscriber, _super); function Subscriber(destinationOrNext, error, complete) { var _this = _super.call(this) || this; _this.syncErrorValue = null; _this.syncErrorThrown = false; _this.syncErrorThrowable = false; _this.isStopped = false; switch (arguments.length) { case 0: _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__.empty; break; case 1: if (!destinationOrNext) { _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__.empty; break; } if (typeof destinationOrNext === 'object') { if (destinationOrNext instanceof Subscriber) { _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable; _this.destination = destinationOrNext; destinationOrNext.add(_this); } else { _this.syncErrorThrowable = true; _this.destination = new SafeSubscriber(_this, destinationOrNext); } break; } default: _this.syncErrorThrowable = true; _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete); break; } return _this; } Subscriber.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__.rxSubscriber] = function () { return this; }; Subscriber.create = function (next, error, complete) { var subscriber = new Subscriber(next, error, complete); subscriber.syncErrorThrowable = false; return subscriber; }; Subscriber.prototype.next = function (value) { if (!this.isStopped) { this._next(value); } }; Subscriber.prototype.error = function (err) { if (!this.isStopped) { this.isStopped = true; this._error(err); } }; Subscriber.prototype.complete = function () { if (!this.isStopped) { this.isStopped = true; this._complete(); } }; Subscriber.prototype.unsubscribe = function () { if (this.closed) { return; } this.isStopped = true; _super.prototype.unsubscribe.call(this); }; Subscriber.prototype._next = function (value) { this.destination.next(value); }; Subscriber.prototype._error = function (err) { this.destination.error(err); this.unsubscribe(); }; Subscriber.prototype._complete = function () { this.destination.complete(); this.unsubscribe(); }; Subscriber.prototype._unsubscribeAndRecycle = function () { var _parentOrParents = this._parentOrParents; this._parentOrParents = null; this.unsubscribe(); this.closed = false; this.isStopped = false; this._parentOrParents = _parentOrParents; return this; }; return Subscriber; }(_Subscription__WEBPACK_IMPORTED_MODULE_3__.Subscription)); var SafeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__.__extends(SafeSubscriber, _super); function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) { var _this = _super.call(this) || this; _this._parentSubscriber = _parentSubscriber; var next; var context = _this; if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(observerOrNext)) { next = observerOrNext; } else if (observerOrNext) { next = observerOrNext.next; error = observerOrNext.error; complete = observerOrNext.complete; if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_1__.empty) { context = Object.create(observerOrNext); if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(context.unsubscribe)) { _this.add(context.unsubscribe.bind(context)); } context.unsubscribe = _this.unsubscribe.bind(_this); } } _this._context = context; _this._next = next; _this._error = error; _this._complete = complete; return _this; } SafeSubscriber.prototype.next = function (value) { if (!this.isStopped && this._next) { var _parentSubscriber = this._parentSubscriber; if (!_config__WEBPACK_IMPORTED_MODULE_5__.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._next, value); } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { this.unsubscribe(); } } }; SafeSubscriber.prototype.error = function (err) { if (!this.isStopped) { var _parentSubscriber = this._parentSubscriber; var useDeprecatedSynchronousErrorHandling = _config__WEBPACK_IMPORTED_MODULE_5__.config.useDeprecatedSynchronousErrorHandling; if (this._error) { if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._error, err); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, this._error, err); this.unsubscribe(); } } else if (!_parentSubscriber.syncErrorThrowable) { this.unsubscribe(); if (useDeprecatedSynchronousErrorHandling) { throw err; } (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__.hostReportError)(err); } else { if (useDeprecatedSynchronousErrorHandling) { _parentSubscriber.syncErrorValue = err; _parentSubscriber.syncErrorThrown = true; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__.hostReportError)(err); } this.unsubscribe(); } } }; SafeSubscriber.prototype.complete = function () { var _this = this; if (!this.isStopped) { var _parentSubscriber = this._parentSubscriber; if (this._complete) { var wrappedComplete = function () { return _this._complete.call(_this._context); }; if (!_config__WEBPACK_IMPORTED_MODULE_5__.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(wrappedComplete); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, wrappedComplete); this.unsubscribe(); } } else { this.unsubscribe(); } } }; SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) { try { fn.call(this._context, value); } catch (err) { this.unsubscribe(); if (_config__WEBPACK_IMPORTED_MODULE_5__.config.useDeprecatedSynchronousErrorHandling) { throw err; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__.hostReportError)(err); } } }; SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { if (!_config__WEBPACK_IMPORTED_MODULE_5__.config.useDeprecatedSynchronousErrorHandling) { throw new Error('bad call'); } try { fn.call(this._context, value); } catch (err) { if (_config__WEBPACK_IMPORTED_MODULE_5__.config.useDeprecatedSynchronousErrorHandling) { parent.syncErrorValue = err; parent.syncErrorThrown = true; return true; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__.hostReportError)(err); return true; } } return false; }; SafeSubscriber.prototype._unsubscribe = function () { var _parentSubscriber = this._parentSubscriber; this._context = null; this._parentSubscriber = null; _parentSubscriber.unsubscribe(); }; return SafeSubscriber; }(Subscriber)); //# sourceMappingURL=Subscriber.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/Subscription.js": /*!**********************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/Subscription.js ***! \**********************************************************/ /*! namespace exports */ /*! export Subscription [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Subscription": () => /* binding */ Subscription /* harmony export */ }); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/isArray */ "./node_modules/rxjs/_esm5/internal/util/isArray.js"); /* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/isObject */ "./node_modules/rxjs/_esm5/internal/util/isObject.js"); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isFunction */ "./node_modules/rxjs/_esm5/internal/util/isFunction.js"); /* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/UnsubscriptionError */ "./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js"); /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */ ; var Subscription = /*@__PURE__*/ (function () { function Subscription(unsubscribe) { this.closed = false; this._parentOrParents = null; this._subscriptions = null; if (unsubscribe) { this._ctorUnsubscribe = true; this._unsubscribe = unsubscribe; } } Subscription.prototype.unsubscribe = function () { var errors; if (this.closed) { return; } var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions; this.closed = true; this._parentOrParents = null; this._subscriptions = null; if (_parentOrParents instanceof Subscription) { _parentOrParents.remove(this); } else if (_parentOrParents !== null) { for (var index = 0; index < _parentOrParents.length; ++index) { var parent_1 = _parentOrParents[index]; parent_1.remove(this); } } if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(_unsubscribe)) { if (_ctorUnsubscribe) { this._unsubscribe = undefined; } try { _unsubscribe.call(this); } catch (e) { errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e]; } } if ((0,_util_isArray__WEBPACK_IMPORTED_MODULE_2__.isArray)(_subscriptions)) { var index = -1; var len = _subscriptions.length; while (++index < len) { var sub = _subscriptions[index]; if ((0,_util_isObject__WEBPACK_IMPORTED_MODULE_3__.isObject)(sub)) { try { sub.unsubscribe(); } catch (e) { errors = errors || []; if (e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError) { errors = errors.concat(flattenUnsubscriptionErrors(e.errors)); } else { errors.push(e); } } } } } if (errors) { throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError(errors); } }; Subscription.prototype.add = function (teardown) { var subscription = teardown; if (!teardown) { return Subscription.EMPTY; } switch (typeof teardown) { case 'function': subscription = new Subscription(teardown); case 'object': if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') { return subscription; } else if (this.closed) { subscription.unsubscribe(); return subscription; } else if (!(subscription instanceof Subscription)) { var tmp = subscription; subscription = new Subscription(); subscription._subscriptions = [tmp]; } break; default: { throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); } } var _parentOrParents = subscription._parentOrParents; if (_parentOrParents === null) { subscription._parentOrParents = this; } else if (_parentOrParents instanceof Subscription) { if (_parentOrParents === this) { return subscription; } subscription._parentOrParents = [_parentOrParents, this]; } else if (_parentOrParents.indexOf(this) === -1) { _parentOrParents.push(this); } else { return subscription; } var subscriptions = this._subscriptions; if (subscriptions === null) { this._subscriptions = [subscription]; } else { subscriptions.push(subscription); } return subscription; }; Subscription.prototype.remove = function (subscription) { var subscriptions = this._subscriptions; if (subscriptions) { var subscriptionIndex = subscriptions.indexOf(subscription); if (subscriptionIndex !== -1) { subscriptions.splice(subscriptionIndex, 1); } } }; Subscription.EMPTY = (function (empty) { empty.closed = true; return empty; }(new Subscription())); return Subscription; }()); function flattenUnsubscriptionErrors(errors) { return errors.reduce(function (errs, err) { return errs.concat((err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError) ? err.errors : err); }, []); } //# sourceMappingURL=Subscription.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/config.js": /*!****************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/config.js ***! \****************************************************/ /*! namespace exports */ /*! export config [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "config": () => /* binding */ config /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var _enable_super_gross_mode_that_will_cause_bad_things = false; var config = { Promise: undefined, set useDeprecatedSynchronousErrorHandling(value) { if (value) { var error = /*@__PURE__*/ new Error(); /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack); } else if (_enable_super_gross_mode_that_will_cause_bad_things) { /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3'); } _enable_super_gross_mode_that_will_cause_bad_things = value; }, get useDeprecatedSynchronousErrorHandling() { return _enable_super_gross_mode_that_will_cause_bad_things; }, }; //# sourceMappingURL=config.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/symbol/observable.js": /*!***************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/symbol/observable.js ***! \***************************************************************/ /*! namespace exports */ /*! export observable [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "observable": () => /* binding */ observable /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })(); //# sourceMappingURL=observable.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js": /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js ***! \*****************************************************************/ /*! namespace exports */ /*! export $$rxSubscriber [provided] [no usage info] [missing usage info prevents renaming] */ /*! export rxSubscriber [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "rxSubscriber": () => /* binding */ rxSubscriber, /* harmony export */ "$$rxSubscriber": () => /* binding */ $$rxSubscriber /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var rxSubscriber = /*@__PURE__*/ (function () { return typeof Symbol === 'function' ? /*@__PURE__*/ Symbol('rxSubscriber') : '@@rxSubscriber_' + /*@__PURE__*/ Math.random(); })(); var $$rxSubscriber = rxSubscriber; //# sourceMappingURL=rxSubscriber.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js": /*!**************************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js ***! \**************************************************************************/ /*! namespace exports */ /*! export ObjectUnsubscribedError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ObjectUnsubscribedError": () => /* binding */ ObjectUnsubscribedError /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () { function ObjectUnsubscribedErrorImpl() { Error.call(this); this.message = 'object unsubscribed'; this.name = 'ObjectUnsubscribedError'; return this; } ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); return ObjectUnsubscribedErrorImpl; })(); var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl; //# sourceMappingURL=ObjectUnsubscribedError.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js": /*!**********************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js ***! \**********************************************************************/ /*! namespace exports */ /*! export UnsubscriptionError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "UnsubscriptionError": () => /* binding */ UnsubscriptionError /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var UnsubscriptionErrorImpl = /*@__PURE__*/ (function () { function UnsubscriptionErrorImpl(errors) { Error.call(this); this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : ''; this.name = 'UnsubscriptionError'; this.errors = errors; return this; } UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); return UnsubscriptionErrorImpl; })(); var UnsubscriptionError = UnsubscriptionErrorImpl; //# sourceMappingURL=UnsubscriptionError.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/canReportError.js": /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/canReportError.js ***! \*****************************************************************/ /*! namespace exports */ /*! export canReportError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "canReportError": () => /* binding */ canReportError /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js"); /** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */ ; function canReportError(observer) { while (observer) { var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped; if (closed_1 || isStopped) { return false; } else if (destination && destination instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber) { observer = destination; } else { observer = null; } } return true; } //# sourceMappingURL=canReportError.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/hostReportError.js": /*!******************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/hostReportError.js ***! \******************************************************************/ /*! namespace exports */ /*! export hostReportError [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "hostReportError": () => /* binding */ hostReportError /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function hostReportError(err) { setTimeout(function () { throw err; }, 0); } //# sourceMappingURL=hostReportError.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/identity.js": /*!***********************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/identity.js ***! \***********************************************************/ /*! namespace exports */ /*! export identity [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "identity": () => /* binding */ identity /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function identity(x) { return x; } //# sourceMappingURL=identity.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/isArray.js": /*!**********************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/isArray.js ***! \**********************************************************/ /*! namespace exports */ /*! export isArray [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isArray": () => /* binding */ isArray /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })(); //# sourceMappingURL=isArray.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/isFunction.js": /*!*************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/isFunction.js ***! \*************************************************************/ /*! namespace exports */ /*! export isFunction [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isFunction": () => /* binding */ isFunction /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function isFunction(x) { return typeof x === 'function'; } //# sourceMappingURL=isFunction.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/isObject.js": /*!***********************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/isObject.js ***! \***********************************************************/ /*! namespace exports */ /*! export isObject [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isObject": () => /* binding */ isObject /* harmony export */ }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function isObject(x) { return x !== null && typeof x === 'object'; } //# sourceMappingURL=isObject.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/pipe.js": /*!*******************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/pipe.js ***! \*******************************************************/ /*! namespace exports */ /*! export pipe [provided] [no usage info] [missing usage info prevents renaming] */ /*! export pipeFromArray [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "pipe": () => /* binding */ pipe, /* harmony export */ "pipeFromArray": () => /* binding */ pipeFromArray /* harmony export */ }); /* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity */ "./node_modules/rxjs/_esm5/internal/util/identity.js"); /** PURE_IMPORTS_START _identity PURE_IMPORTS_END */ ; function pipe() { var fns = []; for (var _i = 0; _i < arguments.length; _i++) { fns[_i] = arguments[_i]; } return pipeFromArray(fns); } function pipeFromArray(fns) { if (fns.length === 0) { return _identity__WEBPACK_IMPORTED_MODULE_0__.identity; } if (fns.length === 1) { return fns[0]; } return function piped(input) { return fns.reduce(function (prev, fn) { return fn(prev); }, input); }; } //# sourceMappingURL=pipe.js.map /***/ }), /***/ "./node_modules/rxjs/_esm5/internal/util/toSubscriber.js": /*!***************************************************************!*\ !*** ./node_modules/rxjs/_esm5/internal/util/toSubscriber.js ***! \***************************************************************/ /*! namespace exports */ /*! export toSubscriber [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "toSubscriber": () => /* binding */ toSubscriber /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "./node_modules/rxjs/_esm5/internal/Subscriber.js"); /* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../symbol/rxSubscriber */ "./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js"); /* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observer */ "./node_modules/rxjs/_esm5/internal/Observer.js"); /** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */ ; function toSubscriber(nextOrObserver, error, complete) { if (nextOrObserver) { if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber) { return nextOrObserver; } if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__.rxSubscriber]) { return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__.rxSubscriber](); } } if (!nextOrObserver && !error && !complete) { return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber(_Observer__WEBPACK_IMPORTED_MODULE_2__.empty); } return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber(nextOrObserver, error, complete); } //# sourceMappingURL=toSubscriber.js.map /***/ }), /***/ "./node_modules/symbol-observable/es/index.js": /*!****************************************************!*\ !*** ./node_modules/symbol-observable/es/index.js ***! \****************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, module.loaded, module.id, module, __webpack_require__.hmd, __webpack_exports__, __webpack_require__.r, __webpack_require__.g, __webpack_require__.d, __webpack_require__.* */ /***/ ((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 _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ponyfill.js */ "./node_modules/symbol-observable/es/ponyfill.js"); /* module decorator */ module = __webpack_require__.hmd(module); /* global window */ ; var root; if (typeof self !== 'undefined') { root = self; } else if (typeof window !== 'undefined') { root = window; } else if (typeof __webpack_require__.g !== 'undefined') { root = __webpack_require__.g; } else if (true) { root = module; } else {} var result = (0,_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__.default)(root); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (result); /***/ }), /***/ "./node_modules/symbol-observable/es/ponyfill.js": /*!*******************************************************!*\ !*** ./node_modules/symbol-observable/es/ponyfill.js ***! \*******************************************************/ /*! namespace exports */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__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 */ symbolObservablePonyfill /* harmony export */ }); function symbolObservablePonyfill(root) { var result; var Symbol = root.Symbol; if (typeof Symbol === 'function') { if (Symbol.observable) { result = Symbol.observable; } else { // This just needs to be something that won't trample other user's Symbol.for use // It also will guide people to the source of their issues, if this is problematic. // META: It's a resource locator! result = Symbol.for('https://github.com/benlesh/symbol-observable'); try { Symbol.observable = result; } catch (err) { // Do nothing. In some environments, users have frozen `Symbol` for security reasons, // if it is frozen assigning to it will throw. In this case, we don't care, because // they will need to use the returned value from the ponyfill. } } } else { result = '@@observable'; } return result; }; /***/ }), /***/ "./node_modules/ts-invariant/lib/invariant.esm.js": /*!********************************************************!*\ !*** ./node_modules/ts-invariant/lib/invariant.esm.js ***! \********************************************************/ /*! namespace exports */ /*! export InvariantError [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! export invariant [provided] [no usage info] [missing usage info prevents renaming] */ /*! export process [provided] [no usage info] [missing usage info prevents renaming] */ /*! export setVerbosity [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ /***/ ((__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 */ "InvariantError": () => /* binding */ InvariantError, /* harmony export */ "invariant": () => /* binding */ invariant, /* harmony export */ "process": () => /* binding */ processStub, /* harmony export */ "setVerbosity": () => /* binding */ setVerbosity /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); ; var genericMessage = "Invariant Violation"; var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { obj.__proto__ = proto; return obj; } : _a; var InvariantError = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(InvariantError, _super); function InvariantError(message) { if (message === void 0) { message = genericMessage; } var _this = _super.call(this, typeof message === "number" ? genericMessage + ": " + message + " (see https://github.com/apollographql/invariant-packages)" : message) || this; _this.framesToPop = 1; _this.name = genericMessage; setPrototypeOf(_this, InvariantError.prototype); return _this; } return InvariantError; }(Error)); function invariant(condition, message) { if (!condition) { throw new InvariantError(message); } } var verbosityLevels = ["log", "warn", "error", "silent"]; var verbosityLevel = verbosityLevels.indexOf("log"); function wrapConsoleMethod(method) { return function () { if (verbosityLevels.indexOf(method) >= verbosityLevel) { return console[method].apply(console, arguments); } }; } (function (invariant) { invariant.log = wrapConsoleMethod("log"); invariant.warn = wrapConsoleMethod("warn"); invariant.error = wrapConsoleMethod("error"); })(invariant || (invariant = {})); function setVerbosity(level) { var old = verbosityLevels[verbosityLevel]; verbosityLevel = Math.max(0, verbosityLevels.indexOf(level)); return old; } // Code that uses ts-invariant with rollup-plugin-invariant may want to // import this process stub to avoid errors evaluating process.env.NODE_ENV. // However, because most ESM-to-CJS compilers will rewrite the process import // as tsInvariant.process, which prevents proper replacement by minifiers, we // also attempt to define the stub globally when it is not already defined. var processStub = { env: {} }; if (typeof process === "object") { processStub = process; } else try { // Using Function to evaluate this assignment in global scope also escapes // the strict mode of the current module, thereby allowing the assignment. // Inspired by https://github.com/facebook/regenerator/pull/369. Function("stub", "process = stub")(processStub); } catch (atLeastWeTried) { // The assignment can fail if a Content Security Policy heavy-handedly // forbids Function usage. In those environments, developers should take // extra care to replace process.env.NODE_ENV in their production builds, // or define an appropriate global.process polyfill. } var invariant$1 = invariant; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (invariant$1); //# sourceMappingURL=invariant.esm.js.map /***/ }), /***/ "./node_modules/tslib/tslib.es6.js": /*!*****************************************!*\ !*** ./node_modules/tslib/tslib.es6.js ***! \*****************************************/ /*! namespace exports */ /*! export __assign [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __asyncDelegator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __asyncGenerator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __asyncValues [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __await [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __awaiter [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __classPrivateFieldGet [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __classPrivateFieldSet [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __createBinding [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __decorate [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __exportStar [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __extends [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __generator [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __importDefault [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __importStar [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __makeTemplateObject [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __metadata [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __param [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __read [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __rest [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __spread [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __spreadArrays [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __values [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "__extends": () => /* binding */ __extends, /* harmony export */ "__assign": () => /* binding */ __assign, /* harmony export */ "__rest": () => /* binding */ __rest, /* harmony export */ "__decorate": () => /* binding */ __decorate, /* harmony export */ "__param": () => /* binding */ __param, /* harmony export */ "__metadata": () => /* binding */ __metadata, /* harmony export */ "__awaiter": () => /* binding */ __awaiter, /* harmony export */ "__generator": () => /* binding */ __generator, /* harmony export */ "__createBinding": () => /* binding */ __createBinding, /* harmony export */ "__exportStar": () => /* binding */ __exportStar, /* harmony export */ "__values": () => /* binding */ __values, /* harmony export */ "__read": () => /* binding */ __read, /* harmony export */ "__spread": () => /* binding */ __spread, /* harmony export */ "__spreadArrays": () => /* binding */ __spreadArrays, /* harmony export */ "__await": () => /* binding */ __await, /* harmony export */ "__asyncGenerator": () => /* binding */ __asyncGenerator, /* harmony export */ "__asyncDelegator": () => /* binding */ __asyncDelegator, /* harmony export */ "__asyncValues": () => /* binding */ __asyncValues, /* harmony export */ "__makeTemplateObject": () => /* binding */ __makeTemplateObject, /* harmony export */ "__importStar": () => /* binding */ __importStar, /* harmony export */ "__importDefault": () => /* binding */ __importDefault, /* harmony export */ "__classPrivateFieldGet": () => /* binding */ __classPrivateFieldGet, /* harmony export */ "__classPrivateFieldSet": () => /* binding */ __classPrivateFieldSet /* 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; } /***/ }), /***/ "./node_modules/zen-observable-ts/lib/bundle.esm.js": /*!**********************************************************!*\ !*** ./node_modules/zen-observable-ts/lib/bundle.esm.js ***! \**********************************************************/ /*! namespace exports */ /*! export Observable [provided] [no usage info] [missing usage info prevents renaming] */ /*! export default [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ /***/ ((__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 */ "Observable": () => /* binding */ Observable /* harmony export */ }); /* harmony import */ var zen_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zen-observable */ "./node_modules/zen-observable/index.js"); /* harmony import */ var zen_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(zen_observable__WEBPACK_IMPORTED_MODULE_0__); ; var Observable = (zen_observable__WEBPACK_IMPORTED_MODULE_0___default()); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Observable); //# sourceMappingURL=bundle.esm.js.map /***/ }), /***/ "./node_modules/zen-observable/index.js": /*!**********************************************!*\ !*** ./node_modules/zen-observable/index.js ***! \**********************************************/ /*! dynamic exports */ /*! export __esModule [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! export default [maybe provided (runtime-defined)] [no usage info] [provision prevents renaming (no use info)] */ /*! other exports [maybe provided (runtime-defined)] [no usage info] */ /*! runtime requirements: module, __webpack_require__ */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(/*! ./lib/Observable.js */ "./node_modules/zen-observable/lib/Observable.js").Observable; /***/ }), /***/ "./node_modules/zen-observable/lib/Observable.js": /*!*******************************************************!*\ !*** ./node_modules/zen-observable/lib/Observable.js ***! \*******************************************************/ /*! flagged exports */ /*! export Observable [provided] [no usage info] [missing usage info prevents renaming] */ /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Observable = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } // === Symbol Support === var hasSymbols = function () { return typeof Symbol === 'function'; }; var hasSymbol = function (name) { return hasSymbols() && Boolean(Symbol[name]); }; var getSymbol = function (name) { return hasSymbol(name) ? Symbol[name] : '@@' + name; }; if (hasSymbols() && !hasSymbol('observable')) { Symbol.observable = Symbol('observable'); } var SymbolIterator = getSymbol('iterator'); var SymbolObservable = getSymbol('observable'); var SymbolSpecies = getSymbol('species'); // === Abstract Operations === function getMethod(obj, key) { var value = obj[key]; if (value == null) return undefined; if (typeof value !== 'function') throw new TypeError(value + ' is not a function'); return value; } function getSpecies(obj) { var ctor = obj.constructor; if (ctor !== undefined) { ctor = ctor[SymbolSpecies]; if (ctor === null) { ctor = undefined; } } return ctor !== undefined ? ctor : Observable; } function isObservable(x) { return x instanceof Observable; // SPEC: Brand check } function hostReportError(e) { if (hostReportError.log) { hostReportError.log(e); } else { setTimeout(function () { throw e; }); } } function enqueue(fn) { Promise.resolve().then(function () { try { fn(); } catch (e) { hostReportError(e); } }); } function cleanupSubscription(subscription) { var cleanup = subscription._cleanup; if (cleanup === undefined) return; subscription._cleanup = undefined; if (!cleanup) { return; } try { if (typeof cleanup === 'function') { cleanup(); } else { var unsubscribe = getMethod(cleanup, 'unsubscribe'); if (unsubscribe) { unsubscribe.call(cleanup); } } } catch (e) { hostReportError(e); } } function closeSubscription(subscription) { subscription._observer = undefined; subscription._queue = undefined; subscription._state = 'closed'; } function flushSubscription(subscription) { var queue = subscription._queue; if (!queue) { return; } subscription._queue = undefined; subscription._state = 'ready'; for (var i = 0; i < queue.length; ++i) { notifySubscription(subscription, queue[i].type, queue[i].value); if (subscription._state === 'closed') break; } } function notifySubscription(subscription, type, value) { subscription._state = 'running'; var observer = subscription._observer; try { var m = getMethod(observer, type); switch (type) { case 'next': if (m) m.call(observer, value); break; case 'error': closeSubscription(subscription); if (m) m.call(observer, value);else throw value; break; case 'complete': closeSubscription(subscription); if (m) m.call(observer); break; } } catch (e) { hostReportError(e); } if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready'; } function onNotify(subscription, type, value) { if (subscription._state === 'closed') return; if (subscription._state === 'buffering') { subscription._queue.push({ type: type, value: value }); return; } if (subscription._state !== 'ready') { subscription._state = 'buffering'; subscription._queue = [{ type: type, value: value }]; enqueue(function () { return flushSubscription(subscription); }); return; } notifySubscription(subscription, type, value); } var Subscription = /*#__PURE__*/ function () { function Subscription(observer, subscriber) { _classCallCheck(this, Subscription); // ASSERT: observer is an object // ASSERT: subscriber is callable this._cleanup = undefined; this._observer = observer; this._queue = undefined; this._state = 'initializing'; var subscriptionObserver = new SubscriptionObserver(this); try { this._cleanup = subscriber.call(undefined, subscriptionObserver); } catch (e) { subscriptionObserver.error(e); } if (this._state === 'initializing') this._state = 'ready'; } _createClass(Subscription, [{ key: "unsubscribe", value: function unsubscribe() { if (this._state !== 'closed') { closeSubscription(this); cleanupSubscription(this); } } }, { key: "closed", get: function () { return this._state === 'closed'; } }]); return Subscription; }(); var SubscriptionObserver = /*#__PURE__*/ function () { function SubscriptionObserver(subscription) { _classCallCheck(this, SubscriptionObserver); this._subscription = subscription; } _createClass(SubscriptionObserver, [{ key: "next", value: function next(value) { onNotify(this._subscription, 'next', value); } }, { key: "error", value: function error(value) { onNotify(this._subscription, 'error', value); } }, { key: "complete", value: function complete() { onNotify(this._subscription, 'complete'); } }, { key: "closed", get: function () { return this._subscription._state === 'closed'; } }]); return SubscriptionObserver; }(); var Observable = /*#__PURE__*/ function () { function Observable(subscriber) { _classCallCheck(this, Observable); if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function'); if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function'); this._subscriber = subscriber; } _createClass(Observable, [{ key: "subscribe", value: function subscribe(observer) { if (typeof observer !== 'object' || observer === null) { observer = { next: observer, error: arguments[1], complete: arguments[2] }; } return new Subscription(observer, this._subscriber); } }, { key: "forEach", value: function forEach(fn) { var _this = this; return new Promise(function (resolve, reject) { if (typeof fn !== 'function') { reject(new TypeError(fn + ' is not a function')); return; } function done() { subscription.unsubscribe(); resolve(); } var subscription = _this.subscribe({ next: function (value) { try { fn(value, done); } catch (e) { reject(e); subscription.unsubscribe(); } }, error: reject, complete: resolve }); }); } }, { key: "map", value: function map(fn) { var _this2 = this; if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); var C = getSpecies(this); return new C(function (observer) { return _this2.subscribe({ next: function (value) { try { value = fn(value); } catch (e) { return observer.error(e); } observer.next(value); }, error: function (e) { observer.error(e); }, complete: function () { observer.complete(); } }); }); } }, { key: "filter", value: function filter(fn) { var _this3 = this; if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); var C = getSpecies(this); return new C(function (observer) { return _this3.subscribe({ next: function (value) { try { if (!fn(value)) return; } catch (e) { return observer.error(e); } observer.next(value); }, error: function (e) { observer.error(e); }, complete: function () { observer.complete(); } }); }); } }, { key: "reduce", value: function reduce(fn) { var _this4 = this; if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); var C = getSpecies(this); var hasSeed = arguments.length > 1; var hasValue = false; var seed = arguments[1]; var acc = seed; return new C(function (observer) { return _this4.subscribe({ next: function (value) { var first = !hasValue; hasValue = true; if (!first || hasSeed) { try { acc = fn(acc, value); } catch (e) { return observer.error(e); } } else { acc = value; } }, error: function (e) { observer.error(e); }, complete: function () { if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence')); observer.next(acc); observer.complete(); } }); }); } }, { key: "concat", value: function concat() { var _this5 = this; for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) { sources[_key] = arguments[_key]; } var C = getSpecies(this); return new C(function (observer) { var subscription; var index = 0; function startNext(next) { subscription = next.subscribe({ next: function (v) { observer.next(v); }, error: function (e) { observer.error(e); }, complete: function () { if (index === sources.length) { subscription = undefined; observer.complete(); } else { startNext(C.from(sources[index++])); } } }); } startNext(_this5); return function () { if (subscription) { subscription.unsubscribe(); subscription = undefined; } }; }); } }, { key: "flatMap", value: function flatMap(fn) { var _this6 = this; if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); var C = getSpecies(this); return new C(function (observer) { var subscriptions = []; var outer = _this6.subscribe({ next: function (value) { if (fn) { try { value = fn(value); } catch (e) { return observer.error(e); } } var inner = C.from(value).subscribe({ next: function (value) { observer.next(value); }, error: function (e) { observer.error(e); }, complete: function () { var i = subscriptions.indexOf(inner); if (i >= 0) subscriptions.splice(i, 1); completeIfDone(); } }); subscriptions.push(inner); }, error: function (e) { observer.error(e); }, complete: function () { completeIfDone(); } }); function completeIfDone() { if (outer.closed && subscriptions.length === 0) observer.complete(); } return function () { subscriptions.forEach(function (s) { return s.unsubscribe(); }); outer.unsubscribe(); }; }); } }, { key: SymbolObservable, value: function () { return this; } }], [{ key: "from", value: function from(x) { var C = typeof this === 'function' ? this : Observable; if (x == null) throw new TypeError(x + ' is not an object'); var method = getMethod(x, SymbolObservable); if (method) { var observable = method.call(x); if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object'); if (isObservable(observable) && observable.constructor === C) return observable; return new C(function (observer) { return observable.subscribe(observer); }); } if (hasSymbol('iterator')) { method = getMethod(x, SymbolIterator); if (method) { return new C(function (observer) { enqueue(function () { if (observer.closed) return; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _item = _step.value; observer.next(_item); if (observer.closed) return; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } observer.complete(); }); }); } } if (Array.isArray(x)) { return new C(function (observer) { enqueue(function () { if (observer.closed) return; for (var i = 0; i < x.length; ++i) { observer.next(x[i]); if (observer.closed) return; } observer.complete(); }); }); } throw new TypeError(x + ' is not observable'); } }, { key: "of", value: function of() { for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { items[_key2] = arguments[_key2]; } var C = typeof this === 'function' ? this : Observable; return new C(function (observer) { enqueue(function () { if (observer.closed) return; for (var i = 0; i < items.length; ++i) { observer.next(items[i]); if (observer.closed) return; } observer.complete(); }); }); } }, { key: SymbolSpecies, get: function () { return this; } }]); return Observable; }(); exports.Observable = Observable; if (hasSymbols()) { Object.defineProperty(Observable, Symbol('extensions'), { value: { symbol: SymbolObservable, hostReportError: hostReportError }, configurable: true }); } /***/ }), /***/ "./src/client/client.js": /*!******************************!*\ !*** ./src/client/client.js ***! \******************************/ /*! namespace exports */ /*! export Client [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Client": () => /* binding */ Client /* harmony export */ }); /* harmony import */ var _graphql_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graphql-client */ "./src/client/graphql-client.js"); ; /** * This is a facade over the API client specific implementation. */ class Client { /** * Initializes the API client using the same params. * * @constructor * @param {Object} params - An object that include the same params as the API client. */ constructor(params) { this.apiClient = new _graphql_client__WEBPACK_IMPORTED_MODULE_0__.GraphQLClient(params); } /** * Query a log entry for the given election unique id and the given content hash. * * @param {Object} params - An object that include the following options. * - {String} electionUniqueId - The election's unique id. * - {String} contentHash - The log entry content hash. * @returns {Promise>} - A log entry. * @throws Will throw an error if the request is rejected. */ getLogEntry({ electionUniqueId, contentHash }) { return this.apiClient.getLogEntry({ electionUniqueId, contentHash }); } /** * Query all log entries for the given election id. * * @param {Object} params - An object that include the following options. * - {String} electionUniqueId - The election's unique id. * @returns {Promise>} - A collection of log entries. * @throws Will throw an error if the request is rejected. */ getElectionLogEntries({ electionUniqueId, after }) { return this.apiClient.getElectionLogEntries({ electionUniqueId, after }); } /** * Subscribes to an Observable and executes a callback function with each log entry added. * * @param {Object} params - An object that include the following options. * - {String} electionUniqueId - The election's unique id. * @param {Function} onNextLogEntryUpdate - A callback function that will be called with each log entry added the election. * @returns {Subscription} - A subscription object that can be manually unsubscribed. */ subscribeToElectionLogEntriesUpdates( { electionUniqueId }, onNextLogEntryUpdate ) { const subscription = this.apiClient.subscribeToElectionLogEntriesUpdates({ electionUniqueId, }); return subscription.subscribe((logEntry) => { if (logEntry) { onNextLogEntryUpdate(logEntry); } }); } /** * Process a key ceremony step sending a signed message. * * @param {Object} params - An object that include the following options. * - {String} signedData - The signed data to be processed. * @returns {Promise} - A pending message created. * @throws Will throw an error if the request is rejected or the data contains an error. */ processKeyCeremonyStep({ messageId, signedData }) { return this.apiClient.processKeyCeremonyStep({ messageId, signedData }); } } /***/ }), /***/ "./src/client/graphql-client.js": /*!**************************************!*\ !*** ./src/client/graphql-client.js ***! \**************************************/ /*! namespace exports */ /*! export GraphQLClient [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "GraphQLClient": () => /* binding */ GraphQLClient /* harmony export */ }); /* harmony import */ var _apollo_client_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @apollo/client/core */ "./node_modules/@apollo/client/core/index.js"); /* harmony import */ var _apollo_client_utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @apollo/client/utilities */ "./node_modules/@apollo/client/utilities/index.js"); /* harmony import */ var graphql_ruby_client_dist_subscriptions_ActionCableLink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphql-ruby-client/dist/subscriptions/ActionCableLink */ "./node_modules/graphql-ruby-client/dist/subscriptions/ActionCableLink.js"); /* harmony import */ var graphql_ruby_client_dist_subscriptions_ActionCableLink__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphql_ruby_client_dist_subscriptions_ActionCableLink__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var actioncable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! actioncable */ "./node_modules/actioncable/lib/assets/compiled/action_cable.js"); /* harmony import */ var actioncable__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(actioncable__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _operations_get_election_log_entries__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operations/get_election_log_entries */ "./src/client/operations/get_election_log_entries.gql"); /* harmony import */ var _operations_get_election_log_entries__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_operations_get_election_log_entries__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _operations_subscribe_to_election_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./operations/subscribe_to_election_log */ "./src/client/operations/subscribe_to_election_log.gql"); /* harmony import */ var _operations_subscribe_to_election_log__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_operations_subscribe_to_election_log__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _operations_process_key_ceremony_step__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./operations/process_key_ceremony_step */ "./src/client/operations/process_key_ceremony_step.gql"); /* harmony import */ var _operations_process_key_ceremony_step__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_operations_process_key_ceremony_step__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _operations_get_log_entry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./operations/get_log_entry */ "./src/client/operations/get_log_entry.gql"); /* harmony import */ var _operations_get_log_entry__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_operations_get_log_entry__WEBPACK_IMPORTED_MODULE_7__); ; /** * This is the Bulletin Board API client that will use Apollo's client to * interact with our GraphQL schema using both http and websocket connections. */ class GraphQLClient { /** * Initializes the class given the correct params. Since we need to handle * both http and websocket connections we need to create two links and use either * of them depending on the GraphQL operation. * * @constructor * @param {Object} params - An object that include the following options. * - {String} apiEndpointUrl - The http endpoint used to perform queries and mutations. * - {String} wsEndpointUrl - The ws endpoint used to perform subscriptions. * - {Object?} headers - An optional object of headers to be included on http requests. */ constructor({ apiEndpointUrl, wsEndpointUrl, headers }) { const wsLink = new (graphql_ruby_client_dist_subscriptions_ActionCableLink__WEBPACK_IMPORTED_MODULE_2___default())({ cable: actioncable__WEBPACK_IMPORTED_MODULE_3___default().createConsumer(wsEndpointUrl), }); const httpLink = new _apollo_client_core__WEBPACK_IMPORTED_MODULE_0__.HttpLink({ uri: apiEndpointUrl, headers, }); const splitLink = (0,_apollo_client_core__WEBPACK_IMPORTED_MODULE_0__.split)( ({ query }) => { const definition = (0,_apollo_client_utilities__WEBPACK_IMPORTED_MODULE_1__.getMainDefinition)(query); return ( definition.kind === "OperationDefinition" && definition.operation === "subscription" ); }, wsLink, httpLink ); this.apolloClient = new _apollo_client_core__WEBPACK_IMPORTED_MODULE_0__.ApolloClient({ link: splitLink, cache: new _apollo_client_core__WEBPACK_IMPORTED_MODULE_0__.InMemoryCache(), }); } /** * Query a log entry for the given election unique id and the given content hash. * * @param {Object} params - An object that include the following options. * - {String} electionUniqueId - The election's unique id. * - {String} contentHash - The log entry content hash. * @returns {Promise>} - A log entry. * @throws Will throw an error if the request is rejected. */ async getLogEntry({ electionUniqueId, contentHash }) { const result = await this.apolloClient.query({ query: (_operations_get_log_entry__WEBPACK_IMPORTED_MODULE_7___default()), variables: { electionUniqueId, contentHash, }, }); return result.data.logEntry; } /** * Query all log entries for the given election unique id. * * @param {Object} params - An object that include the following options. * - {String} electionUniqueId - The election's unique id. * @returns {Promise>} - A collection of log entries. * @throws Will throw an error if the request is rejected. */ async getElectionLogEntries({ electionUniqueId, after }) { const result = await this.apolloClient.query({ query: (_operations_get_election_log_entries__WEBPACK_IMPORTED_MODULE_4___default()), variables: { electionUniqueId, after, }, fetchPolicy: "no-cache", }); return result.data.election.logEntries; } /** * Returns an observable that needs to be manually subscribed and unsubscribed. * When a new log entry is added it maps the GraphQL result to a log entry. * * @param {Object} params - An object that include the following options. * - {String} electionUniqueId - The election's unique id. * @returns {Observable} - An observable that returns every log entry added. */ subscribeToElectionLogEntriesUpdates({ electionUniqueId }) { return this.apolloClient .subscribe({ query: (_operations_subscribe_to_election_log__WEBPACK_IMPORTED_MODULE_5___default()), variables: { electionUniqueId, }, }) .map( ({ data }) => data && data.electionLogEntryAdded && data.electionLogEntryAdded.logEntry ); } /** * Process a key ceremony step sending a signed message. * * @param {Object} params - An object that include the following options. * - {String} signedData - The signed data to be processed. * @returns {Promise} - A pending message created. * @throws Will throw an error if the request is rejected or the data contains an error. */ async processKeyCeremonyStep({ messageId, signedData }) { const result = await this.apolloClient.mutate({ mutation: (_operations_process_key_ceremony_step__WEBPACK_IMPORTED_MODULE_6___default()), variables: { signedData, messageId, }, }); if (result.data.processKeyCeremonyStep.error) { throw new Error(result.data.processKeyCeremonyStep.error); } return result.data.processKeyCeremonyStep.pendingMessage; } } /***/ }), /***/ "./src/client/message-identifier.js": /*!******************************************!*\ !*** ./src/client/message-identifier.js ***! \******************************************/ /*! namespace exports */ /*! export AUTHORITY_TYPE [provided] [no usage info] [missing usage info prevents renaming] */ /*! export BULLETIN_BOARD_TYPE [provided] [no usage info] [missing usage info prevents renaming] */ /*! export MessageIdentifier [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TRUSTEE_TYPE [provided] [no usage info] [missing usage info prevents renaming] */ /*! export VALID_TYPES [provided] [no usage info] [missing usage info prevents renaming] */ /*! export VOTER_TYPE [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "AUTHORITY_TYPE": () => /* binding */ AUTHORITY_TYPE, /* harmony export */ "BULLETIN_BOARD_TYPE": () => /* binding */ BULLETIN_BOARD_TYPE, /* harmony export */ "VOTER_TYPE": () => /* binding */ VOTER_TYPE, /* harmony export */ "TRUSTEE_TYPE": () => /* binding */ TRUSTEE_TYPE, /* harmony export */ "VALID_TYPES": () => /* binding */ VALID_TYPES, /* harmony export */ "MessageIdentifier": () => /* binding */ MessageIdentifier /* harmony export */ }); const AUTHORITY_TYPE = "a"; const BULLETIN_BOARD_TYPE = "b"; const VOTER_TYPE = "v"; const TRUSTEE_TYPE = "t"; const VALID_TYPES = [ AUTHORITY_TYPE, BULLETIN_BOARD_TYPE, VOTER_TYPE, TRUSTEE_TYPE, ]; /** * This is a class that handles message id strings. */ class MessageIdentifier { /** * Parses a message id string into a JS object. * * @param {String} messageId - A string with a message id. * @returns {Object} - An object with the message id values. */ static parse(messageId) { const [elements, author] = messageId.split("+"); const [authority, electionId, type, subtype] = elements.split(".", 4); const [authorType, authorId] = author.split(".", 2); const dotSubtype = subtype ? `.${subtype}` : ""; if (!VALID_TYPES.includes(authorType)) { throw new Error("Invalid message identifier format"); } return { electionId: `${authority}.${electionId}`, type, subtype, typeSubtype: `${type}${dotSubtype}`, author: { type: authorType, id: authorId, }, }; } static format(electionId, typeSubtype, authorType, authorId) { return `${electionId}.${typeSubtype}+${authorType}.${authorId}`; } } /***/ }), /***/ "./src/index.js": /*!**********************!*\ !*** ./src/index.js ***! \**********************/ /*! namespace exports */ /*! export Client [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./src/client/client.js .Client */ /*! export KeyCeremony [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./src/key-ceremony/key-ceremony.js .KeyCeremony */ /*! export MessageIdentifier [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./src/client/message-identifier.js .MessageIdentifier */ /*! export Voter [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] -> ./src/voter/voter.js .Voter */ /*! other exports [not provided] [maybe used in main (runtime-defined)] */ /*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.d, __webpack_require__.r, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Client": () => /* reexport safe */ _client_client__WEBPACK_IMPORTED_MODULE_0__.Client, /* harmony export */ "KeyCeremony": () => /* reexport safe */ _key_ceremony_key_ceremony__WEBPACK_IMPORTED_MODULE_1__.KeyCeremony, /* harmony export */ "MessageIdentifier": () => /* reexport safe */ _client_message_identifier__WEBPACK_IMPORTED_MODULE_2__.MessageIdentifier, /* harmony export */ "Voter": () => /* reexport safe */ _voter_voter__WEBPACK_IMPORTED_MODULE_3__.Voter /* harmony export */ }); /* harmony import */ var _client_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./client/client */ "./src/client/client.js"); /* harmony import */ var _key_ceremony_key_ceremony__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./key-ceremony/key-ceremony */ "./src/key-ceremony/key-ceremony.js"); /* harmony import */ var _client_message_identifier__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./client/message-identifier */ "./src/client/message-identifier.js"); /* harmony import */ var _voter_voter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./voter/voter */ "./src/voter/voter.js"); ; /***/ }), /***/ "./src/key-ceremony/key-ceremony.js": /*!******************************************!*\ !*** ./src/key-ceremony/key-ceremony.js ***! \******************************************/ /*! namespace exports */ /*! export KeyCeremony [provided] [no usage info] [missing usage info prevents renaming] */ /*! export MESSAGE_PROCESSED [provided] [no usage info] [missing usage info prevents renaming] */ /*! export MESSAGE_RECEIVED [provided] [no usage info] [missing usage info prevents renaming] */ /*! export WAIT_TIME_MS [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "WAIT_TIME_MS": () => /* binding */ WAIT_TIME_MS, /* harmony export */ "MESSAGE_RECEIVED": () => /* binding */ MESSAGE_RECEIVED, /* harmony export */ "MESSAGE_PROCESSED": () => /* binding */ MESSAGE_PROCESSED, /* harmony export */ "KeyCeremony": () => /* binding */ KeyCeremony /* harmony export */ }); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/internal/Subject.js"); /* harmony import */ var _trustee_trustee__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../trustee/trustee */ "./src/trustee/trustee.js"); /* harmony import */ var _client_message_identifier__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client/message-identifier */ "./src/client/message-identifier.js"); ; const WAIT_TIME_MS = 1_000; // 1s const MESSAGE_RECEIVED = "[Message] Received"; const MESSAGE_PROCESSED = "[Message] Processed"; /** * Handles all the key ceremony steps for a specific election and trustee. */ class KeyCeremony { /** * Initializes the class with the given params. * * @constructor * @param {Object} params - An object that contains the initialization params. * - {Client} bulletinBoardClient - An instance of the Bulletin Board Client * - {Object} electionContext - An object that contains some necessary attributes * of the election to perform the key ceremony. * - {Object?} options - An optional object with some options to configure the key ceremony. */ constructor({ bulletinBoardClient, electionContext, options }) { this.bulletinBoardClient = bulletinBoardClient; this.electionContext = electionContext; this.currentTrustee = null; this.options = options || { bulletinBoardWaitTime: WAIT_TIME_MS }; this.pollingIntervalId = null; this.electionLogEntries = []; this.response = null; this.events = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); } /** * Performs some operations to setup the key ceremony. Initializes the trustee * object based on the given election context and subscribe to log entries updates. * * @returns {Promise} */ async setup() { const { currentTrusteeContext } = this.electionContext; this.currentTrustee = new _trustee_trustee__WEBPACK_IMPORTED_MODULE_0__.Trustee(currentTrusteeContext); await this.getLogEntries(); this.nextLogEntryIndexToProcess = 0; } /** * Retrieves all the new log entries for the elections and add them to the list with all the entries. */ async getLogEntries() { const { id: electionUniqueId } = this.electionContext; const lastLogEntry = this.electionLogEntries.slice(-1)[0]; const after = (lastLogEntry && lastLogEntry.id) || null; this.bulletinBoardClient .getElectionLogEntries({ electionUniqueId, after, }) .then((logEntries) => { if (logEntries.length) { this.electionLogEntries = [...this.electionLogEntries, ...logEntries]; } }); } /** * Checks if a restore state operation is needed before starting processing new messages. * * @returns {Promise} */ restoreNeeded() { const lastMessage = this.lastMessageSent(); return ( lastMessage && this.currentTrustee.checkRestoreNeeded(lastMessage.messageId) ); } /** * Get the last message sent to the election log by this trustee. * * @returns {string} */ lastMessageSent() { for (let i = this.electionLogEntries.length - 1; i >= 0; i--) { const logEntry = this.electionLogEntries[i]; const messageIdentifier = _client_message_identifier__WEBPACK_IMPORTED_MODULE_1__.MessageIdentifier.parse(logEntry.messageId); if ( messageIdentifier.author.type === _client_message_identifier__WEBPACK_IMPORTED_MODULE_1__.TRUSTEE_TYPE && messageIdentifier.author.id === this.currentTrustee.id ) { return logEntry; } } } /** * Returns the state of the wrapper to be able to perform future restores. * * @returns {string} */ backup() { return this.currentTrustee.backup(); } /** * Restores the state of the wrapper to continue from a state backup. * * @param {string} wrapperState - As string with the wrapper state retrieved from the backup method. * @returns {boolean} */ restore(wrapperState) { if (!this.restoreNeeded()) { return false; } const lastMessage = this.lastMessageSent(); return this.currentTrustee.restore( wrapperState, lastMessage && lastMessage.messageId ); } /** * Starts or continues with the key ceremony. * * @param {string} wrapperState - As string with the wrapper state retrieved from the backup method. * @returns {Promise} */ async run() { if (this.restoreNeeded()) { throw new Error("You need to restore the wrapper state to continue"); } if (!this.pollingIntervalId) { this.pollingIntervalId = setInterval(() => { this.getLogEntries(); }, this.options.bulletinBoardWaitTime); } if (this.response) { await this.sendMessageToBulletinBoard(this.response); } return this.waitForNextLogEntryResult().then( async ({ message, done, save }) => { this.response = message; if (done) { clearInterval(this.pollingIntervalId); } else if (!save) { return this.run(); } } ); } /** * Creates a interval that will check periodically if there are new log entries * to process. The interval is done when a new log entry is processed and it has * a result. * * @private * @returns {Promise} */ waitForNextLogEntryResult() { return new Promise((resolve) => { const intervalId = setInterval(async () => { let result; if (this.electionLogEntries.length > this.nextLogEntryIndexToProcess) { result = await this.processNextLogEntry(); } if (result) { clearInterval(intervalId); resolve(result); } }, this.options.bulletinBoardWaitTime); }); } /** * Uses the `Trustee` object to process the next log entry and outputs the result. * * @private * @returns {Promise} */ async processNextLogEntry() { const message = this.electionLogEntries[this.nextLogEntryIndexToProcess]; this.events.next({ type: MESSAGE_RECEIVED, message, }); const result = await this.currentTrustee.processLogEntry(message); this.events.next({ type: MESSAGE_PROCESSED, message, result, }); this.nextLogEntryIndexToProcess += 1; return result; } /** * Sign a message using the `Trustee` identification keys and send it to the Bulletin Board. * * @private * @param {Object} message - An object containing some data to be sent to the Bulletin Board. * @returns {Promise} * @throws An exception is raised if there is a problem with the client. */ async sendMessageToBulletinBoard(message) { if ( this.electionLogEntries.find( (logEntry) => logEntry.messageId === message.message_id ) ) { return; } const signedData = await this.currentTrustee.sign({ iat: (new Date() / 1000) | 0, ...message, }); return this.bulletinBoardClient.processKeyCeremonyStep({ messageId: message.message_id, signedData, }); } } /***/ }), /***/ "./src/trustee/jwt_parser.js": /*!***********************************!*\ !*** ./src/trustee/jwt_parser.js ***! \***********************************/ /*! namespace exports */ /*! export JWTParser [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "JWTParser": () => /* binding */ JWTParser /* harmony export */ }); /** * Verify and parses JWT tokens. */ class JWTParser { /** * Parses the given token only if it can be verified. * * @param {String} token - A JWT token. * @returns {Promise} - The payload included in the token. * @throws An error is thrown if the payload is not a valid JSON or the token * cannot be verified. */ async parse(token) { const verified = await this.verify(token); if (verified) { const base64Url = token.split(".")[1]; const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/"); const jsonPayload = decodeURIComponent( atob(base64) .split("") .map(function (c) { return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2); }) .join("") ); return JSON.parse(jsonPayload); } throw new Error(`${token} is not valid.`); } /** * Verifies the token signature. * * @todo Needs real implementation. * @param {String} token - A JWT token. * @returns {Promise} - Whether the signature is valid or not. */ verify(token) { return Promise.resolve(true); } } /***/ }), /***/ "./src/trustee/trustee.js": /*!********************************!*\ !*** ./src/trustee/trustee.js ***! \********************************/ /*! namespace exports */ /*! export Trustee [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Trustee": () => /* binding */ Trustee /* harmony export */ }); /* harmony import */ var _trustee_wrapper_dummy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./trustee_wrapper_dummy */ "./src/trustee/trustee_wrapper_dummy.js"); /* harmony import */ var _jwt_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jwt_parser */ "./src/trustee/jwt_parser.js"); ; /** * This is a facade class that will use the correspondig `TrusteeWrapper` to process * the log entries. */ class Trustee { /** * Initializes the class with the given params. * * @constructor * @param {Object} params - An object that contains the initialization params. * - {String} id - The trustee identifier. * - {Object} identificationKeys - A object that contains both the public and private key for * the corresponding trustee. */ constructor({ id, identificationKeys }) { this.id = id; this.wrapper = new _trustee_wrapper_dummy__WEBPACK_IMPORTED_MODULE_0__.TrusteeWrapper({ trusteeId: id }); this.parser = new _jwt_parser__WEBPACK_IMPORTED_MODULE_1__.JWTParser(); this.identificationKeys = identificationKeys; } /** * After parsing the `signedData` it processes the message using the wrapper. * * @param {Object} logEntry - The log entry to be processed. * @returns {Promise} - The result of the processing if any. */ async processLogEntry({ messageId, signedData }) { const payload = await this.parser.parse(signedData); return this.wrapper.processMessage(messageId, payload); } /** * Delegates the sign process to the `identificationKeys`. It signs the * message using the private key. * * @params {Object} message - The message to be signed. * @returns {Promise} - The signed message. */ sign(message) { return this.identificationKeys.sign(message); } /** * Returns the state of the wrapper to be able to perform future restores. * * @returns {string} */ backup() { return this.wrapper.backup(); } /** * Checks if the wrapper considers that a restore is needed based on the last messageId sent by the trustee. * * @params {Object} messageId - The message_id of the last message sent by the trustee. * @returns {boolean} - The answer from the wrapper. */ checkRestoreNeeded(messageId) { return this.wrapper.checkRestoreNeeded(messageId); } /** * Restore the wrapper from the given state string. It uses the last messageId sent to check that the state is valid. * * @params {string} wrapperState - The state of the wrapper to recover. * @params {Object} messageId - The message_id of the last message sent by the trustee. * @returns {boolean} - The result of the restore operation. */ restore(wrapperState, messageId) { return this.wrapper.restore(wrapperState, messageId); } } /***/ }), /***/ "./src/trustee/trustee_wrapper_dummy.js": /*!**********************************************!*\ !*** ./src/trustee/trustee_wrapper_dummy.js ***! \**********************************************/ /*! namespace exports */ /*! export CREATE_ELECTION [provided] [no usage info] [missing usage info prevents renaming] */ /*! export KEY_CEREMONY_JOINT_ELECTION_KEY [provided] [no usage info] [missing usage info prevents renaming] */ /*! export KEY_CEREMONY_STEP_1 [provided] [no usage info] [missing usage info prevents renaming] */ /*! export TrusteeWrapper [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "CREATE_ELECTION": () => /* binding */ CREATE_ELECTION, /* harmony export */ "KEY_CEREMONY_STEP_1": () => /* binding */ KEY_CEREMONY_STEP_1, /* harmony export */ "KEY_CEREMONY_JOINT_ELECTION_KEY": () => /* binding */ KEY_CEREMONY_JOINT_ELECTION_KEY, /* harmony export */ "TrusteeWrapper": () => /* binding */ TrusteeWrapper /* harmony export */ }); /* harmony import */ var _client_message_identifier__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client/message-identifier */ "./src/client/message-identifier.js"); ; const CREATE_ELECTION = "create_election"; const KEY_CEREMONY_STEP_1 = "key_ceremony.step_1"; const KEY_CEREMONY_JOINT_ELECTION_KEY = "key_ceremony.joint_election_key"; /** * This is just a dummy implementation of a possible `TrusteeWrapper`. * It is based on the dummy voting schema that we are using in the Bulletin Board. */ class TrusteeWrapper { constructor({ trusteeId }) { this.trusteeId = trusteeId; this.electionId = null; this.status = CREATE_ELECTION; this.electionTrusteesCount = 0; this.processedMessages = []; } backup() { return JSON.stringify(this); } checkRestoreNeeded(messageId) { return messageId && this.status === CREATE_ELECTION; } restore(state, messageId) { if (!this.checkRestoreNeeded(messageId)) { return false; } const result = JSON.parse(state); if ( result.trusteeId !== this.trusteeId || (messageId && result.status === CREATE_ELECTION) ) { return false; } try { Object.assign(this, result); } catch (error) { return false; } return true; } processMessage(messageId, message) { const messageIdentifier = _client_message_identifier__WEBPACK_IMPORTED_MODULE_0__.MessageIdentifier.parse(messageId); switch (this.status) { case CREATE_ELECTION: { if (messageIdentifier.type === CREATE_ELECTION) { this.status = KEY_CEREMONY_STEP_1; this.electionId = messageIdentifier.electionId; this.processedMessages = []; this.electionTrusteesCount = message.trustees.length; return { done: false, save: true, message: { message_id: _client_message_identifier__WEBPACK_IMPORTED_MODULE_0__.MessageIdentifier.format( this.electionId, KEY_CEREMONY_STEP_1, _client_message_identifier__WEBPACK_IMPORTED_MODULE_0__.TRUSTEE_TYPE, this.trusteeId ), content: JSON.stringify({ election_public_key: 7, owner_id: this.trusteeId, }), }, }; } break; } case KEY_CEREMONY_STEP_1: { if (messageIdentifier.typeSubtype === KEY_CEREMONY_STEP_1) { this.processedMessages = [...this.processedMessages, message]; if (this.processedMessages.length === this.electionTrusteesCount) { this.status = KEY_CEREMONY_JOINT_ELECTION_KEY; return { done: false, save: false, message: null, }; } } break; } case KEY_CEREMONY_JOINT_ELECTION_KEY: { if (messageIdentifier.typeSubtype === KEY_CEREMONY_JOINT_ELECTION_KEY) { return { done: true, save: false, message: null, }; } break; } } } } /***/ }), /***/ "./src/voter/voter.js": /*!****************************!*\ !*** ./src/voter/voter.js ***! \****************************/ /*! namespace exports */ /*! export Voter [provided] [no usage info] [missing usage info prevents renaming] */ /*! export WAIT_TIME_MS [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "WAIT_TIME_MS": () => /* binding */ WAIT_TIME_MS, /* harmony export */ "Voter": () => /* binding */ Voter /* harmony export */ }); /* harmony import */ var _voter_wrapper_dummy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./voter_wrapper_dummy */ "./src/voter/voter_wrapper_dummy.js"); ; const WAIT_TIME_MS = 1_000; // 1s /** * This is a facade class that will use the correspondig `VoterWrapper` to encrypt * the vote. */ class Voter { /** * Initializes the class with the given params. * * @constructor * @param {Object} params - An object that contains the initialization params. * - {String} id - The voter identifier. */ constructor({ id, bulletinBoardClient, electionContext, options }) { this.id = id; this.wrapper = new _voter_wrapper_dummy__WEBPACK_IMPORTED_MODULE_0__.VoterWrapper({ voterId: id }); this.bulletinBoardClient = bulletinBoardClient; this.electionContext = electionContext; this.options = options || { bulletinBoardWaitTime: WAIT_TIME_MS }; } /** * Encrypts the data using the wrapper. * * @param {Object} data - The data to be. * @returns {Object} - The data encrypted. */ async encrypt(data) { return this.wrapper.encrypt(data); } async verifyVote(voteHash) { const { id: electionUniqueId } = this.electionContext; return new Promise((resolve) => { const intervalId = setInterval(() => { this.bulletinBoardClient .getLogEntry({ electionUniqueId, contentHash: voteHash, }) .then((logEntry) => { if (logEntry) { clearInterval(intervalId); resolve(); } }); }, this.options.bulletinBoardWaitTime); }); } } /***/ }), /***/ "./src/voter/voter_wrapper_dummy.js": /*!******************************************!*\ !*** ./src/voter/voter_wrapper_dummy.js ***! \******************************************/ /*! namespace exports */ /*! export VoterWrapper [provided] [no usage info] [missing usage info prevents renaming] */ /*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "VoterWrapper": () => /* binding */ VoterWrapper /* harmony export */ }); /** * This is just a dummy implementation of a possible `VoterWrapper`. * It is based on the dummy voting schema that we are using in the Bulletin Board. */ class VoterWrapper { constructor({ voterId }) { this.voterId = voterId; } encrypt(data) { return JSON.stringify(data); } } /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(__webpack_module_cache__[moduleId]) { /******/ return __webpack_module_cache__[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ loaded: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // 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/harmony module decorator */ /******/ (() => { /******/ __webpack_require__.hmd = (module) => { /******/ module = Object.create(module); /******/ if (!module.children) module.children = []; /******/ Object.defineProperty(module, 'exports', { /******/ enumerable: true, /******/ set: () => { /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id); /******/ } /******/ }); /******/ return module; /******/ }; /******/ })(); /******/ /******/ /* 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 }); /******/ }; /******/ })(); /******/ /************************************************************************/ /******/ // module exports must be returned from runtime so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports /******/ return __webpack_require__("./src/index.js"); /******/ })() ; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kZWNpZGltQnVsbGV0aW5Cb2FyZC8uL25vZGVfbW9kdWxlcy9AYXBvbGxvL2NsaWVudC9jYWNoZS9jb3JlL2NhY2hlLmpzIiwid2VicGFjazovL2RlY2lkaW1CdWxsZXRpbkJvYXJkLy4vbm9kZV9tb2R1bGVzL0BhcG9sbG8vY2xpZW50L2NhY2hlL2NvcmUvdHlwZXMvQ2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Rpb25zLmZyYWdtZW50TmFtZSksXG4gICAgICAgICAgICB2YXJpYWJsZXM6IG9wdGlvbnMudmFyaWFibGVzLFxuICAgICAgICAgICAgcm9vdElkOiBvcHRpb25zLmlkLFxuICAgICAgICAgICAgb3B0aW1pc3RpYzogb3B0aW1pc3RpYyxcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBBcG9sbG9DYWNoZS5wcm90b3R5cGUud3JpdGVRdWVyeSA9IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgIHJldHVybiB0aGlzLndyaXRlKHtcbiAgICAgICAgICAgIGRhdGFJZDogb3B0aW9ucy5pZCB8fCAnUk9PVF9RVUVSWScsXG4gICAgICAgICAgICByZXN1bHQ6IG9wdGlvbnMuZGF0YSxcbiAgICAgICAgICAgIHF1ZXJ5OiBvcHRpb25zLnF1ZXJ5LFxuICAgICAgICAgICAgdmFyaWFibGVzOiBvcHRpb25zLnZhcmlhYmxlcyxcbiAgICAgICAgICAgIGJyb2FkY2FzdDogb3B0aW9ucy5icm9hZGNhc3QsXG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgQXBvbGxvQ2FjaGUucHJvdG90eXBlLndyaXRlRnJhZ21lbnQgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICByZXR1cm4gdGhpcy53cml0ZSh7XG4gICAgICAgICAgICBkYXRhSWQ6IG9wdGlvbnMuaWQsXG4gICAgICAgICAgICByZXN1bHQ6IG9wdGlvbnMuZGF0YSxcbiAgICAgICAgICAgIHZhcmlhYmxlczogb3B0aW9ucy52YXJpYWJsZXMsXG4gICAgICAgICAgICBxdWVyeTogdGhpcy5nZXRGcmFnbWVudERvYyhvcHRpb25zLmZyYWdtZW50LCBvcHRpb25zLmZyYWdtZW50TmFtZSksXG4gICAgICAgICAgICBicm9hZGNhc3Q6IG9wdGlvbnMuYnJvYWRjYXN0LFxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIHJldHVybiBBcG9sbG9DYWNoZTtcb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G4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHRoaXMucG9saWNpZXMgPSBwb2xpY2llcztcbiAgICAgICAgdGhpcy5ncm91cCA9IGdyb3VwO1xuICAgICAgICB0aGlzLmRhdGEgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICB0aGlzLnJvb3RJZHMgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICB0aGlzLnJlZnMgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICB0aGlzLmdldEZpZWxkVmFsdWUgPSBmdW5jdGlvbiAob2JqZWN0T3JSZWZlcmVuY2UsIHN0b3JlRmllbGROYW1lKSB7IHJldHVybiBtYXliZURlZXBGcmVlemUoaXNSZWZlcmVuY2Uob2JqZWN0T3JSZWZlcmVuY2UpXG4gICAgICAgICAgICA/IF90aGlzLmdldChvYmplY3RPclJlZmVyZW5jZS5fX3JlZiwgc3RvcmVGaWVsZE5hbWUpXG4gICAgICAgICAgICA6IG9iamVjdE9yUmVmZXJlbmNlICYmIG9iamVjdE9yUmVmZXJlbmNlW3N0b3JlRmllbGROYW1lXSk7IH07XG4gICAgICAgIHRoaXMuY2FuUmVhZCA9IGZ1bmN0aW9uIChvYmpPclJlZikge1xuICAgICAgICAgICAgcmV0dXJuIGlzUmVmZXJlbmNlKG9iak9yUmVmKVxuICAgICAgICAgICAgICAgID8gX3RoaXMuaGFzKG9iak9yUmVmLl9fcmVmKVxuICAgICAgICAgICAgICAgIDogdHlwZW9mIG9iak9yUmVmID09PSBcIm9iamVjdFwiO1xuICAgICAgICB9O1xuICAgICAgICB0aGlzLnRvUmVmZXJlbmNlID0gZnVuY3Rpb24gKG9iak9ySWRPclJlZiwgbWVyZ2VJbnRvU3RvcmUpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygb2JqT3JJZE9yUmVmID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1ha2VSZWZlcmVuY2Uob2JqT3JJZE9yUmVmKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1JlZmVyZW5jZShvYmpPcklkT3JSZWYpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9iak9ySWRPclJlZjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBpZCA9IF90aGlzLnBvbGljaWVzLmlkZW50aWZ5KG9iak9ySWRPclJlZilbMF07XG4gICAgICAgICAgICBpZiAoaWQpIHtcbiAgICAgICAgICAgICAgICB2YXIgcmVmID0gbWFrZVJlZmVyZW5jZShpZCk7XG4gICAgICAgICAgICAgICAgaWYgKG1lcmdlSW50b1N0b3JlKSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLm1lcmdlKGlkLCBvYmpPcklkT3JSZWYpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgIH1cbiAgICBFbnRpdHlTdG9yZS5wcm90b3R5cGUudG9PYmplY3QgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiBfX2Fzc2lnbih7fSwgdGhpcy5kYXRhKTtcbiAgICB9O1xuICAgIEVudGl0eVN0b3JlLnByb3RvdHlwZS5oYXMgPSBmdW5jdGlvbiAoZGF0YUlkKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmxvb2t1cChkYXRhSWQsIHRydWUpICE9PSB2b2lkIDA7XG4gICAgfTtcbiAgICBFbnRpdHlTdG9yZS5wcm90b3R5cGUuZ2V0ID0gZnVuY3Rpb24gKGRhdGFJZCwgZmllbGROYW1lKSB7XG4gICAgICAgIHRoaXMuZ3JvdXAuZGVwZW5kKGRhdGFJZCwgZmllbGROYW1lKTtcbiAgICAgICAgaWYgKGhhc093bi5jYWxsKHRoaXMuZGF0YSwgZGF0YUlkKSkge1xuICAgICAgICAgICAgdmFyIHN0b3JlT2JqZWN0ID0gdGhpc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uIChkYXRhSWQsIGluY29taW5nKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBleGlzdGluZyA9IHRoaXMubG9va3VwKGRhdGFJZCk7XG4gICAgICAgIHZhciBtZXJnZWQgPSBuZXcgRGVlcE1lcmdlcihzdG9yZU9iamVjdFJlY29uY2lsZXIpLm1lcmdlKGV4aXN0aW5nLCBpbmNvbWluZyk7XG4gICAgICAgIHRoaXMuZGF0YVtkYXRhSWRdID0gbWVyZ2VkO1xuICAgICAgICBpZiAobWVyZ2VkICE9PSBleGlzdGluZykge1xuICAgICAgICAgICAgZGVsZXRlIHRoaXMucmVmc1tkYXRhSWRdO1xuICAgICAgICAgICAgaWYgKHRoaXMuZ3JvdXAuY2FjaGluZykge1xuICAgICAgICAgICAgICAgIHZhciBmaWVsZHNUb0RpcnR5XzEgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICAgICAgICAgIGlmICghZXhpc3RpbmcpXG4gICAgICAgICAgICAgICAgICAgIGZpZWxkc1RvRGlydHlfMS5fX2V4aXN0cyA9IDE7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoaW5jb21pbmcpLmZvckVhY2goZnVuY3Rpb24gKHN0b3JlRmllbGROYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXhpc3RpbmcgfHwgZXhpc3Rpbmdbc3RvcmVGaWVsZE5hbWVdICE9PSBtZXJnZWRbc3RvcmVGaWVsZE5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaWVsZHNUb0RpcnR5XzFbZmllbGROYW1lRnJvbVN0b3JlTmFtZShzdG9yZUZpZWxkTmFtZSldID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXJnZWRbc3RvcmVGaWVsZE5hbWVdID09PSB2b2lkIDAgJiYgIShfdGhpcyBpbnN0YW5jZW9mIExheWVyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBtZXJnZWRbc3RvcmVGaWVsZE5hbWVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoZmllbGRzVG9EaXJ0eV8xKS5mb3JFYWNoKGZ1bmN0aW9uIChmaWVsZE5hbWUpIHsgcmV0dXJuIF90aGlzLmdyb3VwLmRpcnR5KGRhdGFJZCwgZmllbGROYW1lKTsgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIEVudGl0eVN0b3JlLnByb3RvdHlwZS5tb2RpZnkgPSBmdW5jdGlvbiAoZGF0YUlkLCBmaWVsZHMpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdmFyIHN0b3JlT2JqZWN0ID0gdGhpcy5sb29rdXAoZGF0YUlkKTtcbiAgICAgICAgaWYgKHN0b3JlT2JqZWN0KSB7XG4gICAgICAgICAgICB2YXIgY2hhbmdlZEZpZWxkc18xID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICAgICAgICAgIHZhciBuZWVkVG9NZXJnZV8xID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgYWxsRGVsZXRlZF8xID0gdHJ1ZTtcbiAgICAgICAgICAgIHZhciBzaGFyZWREZXRhaWxzXzEgPSB7XG4gICAgICAgICAgICAgICAgREVMRVRFOiBERUxFVEUsXG4gICAgICAgICAgICAgICAgSU5WQUxJREFURTogSU5WQUxJREFURSxcbiAgICAgICAgICAgICAgICBpc1JlZmVyZW5jZTogaXNSZWZlcmVuY2UsXG4gICAgICAgICAgICAgICAgdG9SZWZlcmVuY2U6IHRoaXMudG9SZWZlcmVuY2UsXG4gICAgICAgICAgICAgICAgY2FuUmVhZDogdGhpcy5jYW5SZWFkLFxuICAgICAgICAgICAgICAgIHJlYWRGaWVsZDogZnVuY3Rpb24gKGZpZWxkTmFtZU9yT3B0aW9ucywgZnJvbSkgeyByZXR1cm4gX3RoaXMucG9saWNpZXMucmVhZEZpZWxkKHR5cGVvZiBmaWVsZE5hbWVPck9wdGlvbnMgPT09IFwic3RyaW5nXCIgPyB7XG4gICAgICAgICAgICAgICAgICAgIGZpZWxkTmFtZTogZmllbGROYW1lT3JPcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICBmcm9tOiBmcm9tIHx8IG1ha2VSZWZlcmVuY2UoZGF0YUlkKSxcbiAgICAgICAgICAgICAgICB9IDogZmllbGROYW1lT3JPcHRpb25zLCB7IHN0b3JlOiBfdGhpcyB9KTsgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhzdG9yZU9iamVjdCkuZm9yRWFjaChmdW5jdGlvbiAoc3RvcmVGaWVsZE5hbWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgZmllbGROYW1lID0gZmllbGROYW1lRnJvbVN0b3JlTmFtZShzdG9yZUZpZWxkTmFtZSk7XG4gICAgICAgICAgICAgICAgdmFyIGZpZWxkVmFsdWUgPSBzdG9yZU9iamVjdFtzdG9yZUZpZWxkTmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKGZpZWxkVmFsdWUgPT09IHZvaWQgMClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIHZhciBtb2RpZnkgPSB0eXBlb2YgZmllbGRzID09PSBcImZ1bmN0aW9uXCJcbiAgICAgICAgICAgICAgICAgICAgPyBmaWVsZHNcbiAgICAgICAgICAgICAgICAgICAgOiBmaWVsZHNbc3RvcmVGaWVsZE5hbWVdIHx8IGZpZWxkc1tmaWVsZE5hbWVdO1xuICAgICAgICAgICAgICAgIGlmIChtb2RpZnkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1ZhbHVlID0gbW9kaWZ5ID09PSBkZWxNb2RpZmllciA/IERFTEVURSA6XG4gICAgICAgICAgICAgICAgICAgICAgICBtb2RpZnkobWF5YmVEZWVwRnJlZXplKGZpZWxkVmFsdWUpLCBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgc2hhcmVkRGV0YWlsc18xKSwgeyBmaWVsZE5hbWU6IGZpZWxkTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZUZpZWxkTmFtZTogc3RvcmVGaWVsZE5hbWUsIHN0b3JhZ2U6IF90aGlzLmdldFN0b3JhZ2UoZGF0YUlkLCBzdG9yZUZpZWxkTmFtZSkgfSkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsdWUgPT09IElOVkFMSURBVEUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmdyb3VwLmRpcnR5KGRhdGFJZCwgc3RvcmVGaWVsZE5hbWUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbHVlID09PSBERUxFVEUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFsdWUgPSB2b2lkIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsdWUgIT09IGZpZWxkVmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFuZ2VkRmllbGRzXzFbc3RvcmVGaWVsZE5hbWVdID0gbmV3VmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZFRvTWVyZ2VfMSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmllbGRWYWx1ZSA9IG5ld1ZhbHVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChmaWVsZFZhbHVlICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICAgICAgYWxsRGVsZXRlZF8xID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAobmVlZFRvTWVyZ2VfMSkge1xuICAgICAgICAgICAgICAgIHRoaXMubWVyZ2UoZGF0YUlkLCBjaGFuZ2VkRmllbGRzXzEpO1xuICAgICAgICAgICAgICAgIGlmIChhbGxEZWxldGVkXzEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBMYXllcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kYXRhW2RhdGFJZF0gPSB2b2lkIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgdGhpcy5kYXRhW2RhdGFJZF07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ncm91cC5kaXJ0eShkYXRhSWQsIFwiX19leGlzdHNcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuICAgIEVudGl0eVN0b3JlLnByb3RvdHlwZS5kZWxldGUgPSBmdW5jdGlvbiAoZGF0YUlkLCBmaWVsZE5hbWUsIGFyZ3MpIHtcbiAgICAgICAgdmFyIF9hO1xuICAgICAgICB2YXIgc3RvcmVPYmplY3QgPSB0aGlzLmxvb2t1cChkYXRhSWQpO1xuICAgICAgICBpZiAoc3RvcmVPYmplY3QpIHtcbiAgICAgICAgICAgIHZhciB0eXBlbmFtZSA9IHRoaXMuZ2V0RmllbGRWYWx1ZShzdG9yZU9iamVjdCwgXCJfX3R5cGVuYW1lXCIpO1xuICAgICAgICAgICAgdmFyIHN0b3JlRmllbGROYW1lID0gZmllbGROYW1lICYmIGFyZ3NcbiAgICAgICAgICAgICAgICA/IHRoaX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ICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZXZpY3RlZDtcbiAgICB9O1xuICAgIEVudGl0eVN0b3JlLnByb3RvdHlwZS5jbGVhciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5yZXBsYWNlKG51bGwpO1xuICAgIH07XG4gICAgRW50aXR5U3RvcmUucHJvdG90eXBlLnJlcGxhY2UgPSBmdW5jdGlvbiAobmV3RGF0YSkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBPYmplY3Qua2V5cyh0aGlzLmRhdGEpLmZvckVhY2goZnVuY3Rpb24gKGRhdGFJZCkge1xuICAgICAgICAgICAgaWYgKCEobmV3RGF0YSAmJiBoYXNPd24uY2FsbChuZXdEYXRhLCBkYXRhSWQpKSkge1xuICAgICAgICAgICAgICAgIF90aGlzLmRlbGV0ZShkYXRhSWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKG5ld0RhdGEpIHtcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKG5ld0RhdGEpLmZvckVhY2goZnVuY3Rpb24gKGRhdGFJZCkge1xuICAgICAgICAgICAgICAgIF90aGlzLm1lcmdlKGRhdGFJZCwgbmV3RGF0YVtkYXRhSWRdKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBFbnRpdHlTdG9yZS5wcm90b3R5cGUucmV0YWluID0gZnVuY3Rpb24gKHJvb3RJZCkge1xuICAgICAgICByZXR1cm4gdGhpcy5yb290SWRzW3Jvb3RJZF0gPSAodGhpcy5yb290SWRzW3Jvb3RJZF0gfHwgMCkgKyAxO1xuICAgIH07XG4gICAgRW50aXR5U3RvcmUucHJvdG90eXBlLnJlbGVhc2UgPSBmdW5jdGlvbiAocm9vdElkKSB7XG4gICAgICAgIGlmICh0aGlzLnJvb3RJZHNbcm9vdElkXSA+IDApIHtcbiAgICAgICAgICAgIHZhciBjb3VudCA9IC0tdGhpcy5yb290SWRzW3Jvb3RJZF07XG4gICAgICAgICAgICBpZiAoIWNvdW50KVxuICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzLnJvb3RJZHNbcm9vdElkXTtcbiAgICAgICAgICAgIHJldHVybiBjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gMDtcbiAgICB9O1xuICAgIEVudGl0eVN0b3JlLnByb3RvdHlwZS5nZXRSb290SWRTZXQgPSBmdW5jdGlvbiAoaWRzKSB7XG4gICAgICAgIGlmIChpZHMgPT09IHZvaWQgMCkgeyBpZHMgPSBuZXcgU2V0KCk7IH1cbiAgICAgICAgT2JqZWN0LmtleXModGhpcy5yb290SWRzKS5mb3JFYWNoKGlkcy5hZGQsIGlkcyk7XG4gICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgTGF5ZXIpIHtcbiAgICAgICAgICAgIHRoaXMucGFyZW50LmdldFJvb3RJZFNldChpZHMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgT2JqZWN0LmtleXModGhpcy5wb2xpY2llcy5yb290VHlwZW5hbWVzQnlJZCkuZm9yRWFjaChpZHMuYWRkLCBpZHMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBpZHM7XG4gICAgfTtcbiAgICBFbnRpdHlTdG9yZS5wcm90b3R5cGUuZ2MgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBpZHMgPSB0aGlzLmdldFJvb3RJZFNldCgpO1xuICAgICAgICB2YXIgc25hcHNob3QgPSB0aGlzLnRvT2JqZWN0KCk7XG4gICAgICAgIGlkcy5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgaWYgKGhhc093bi5jYWxsKHNuYXBzaG90LCBpZCkpIHtcbiAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhfdGhpcy5maW5kQ2hpbGRSZWZJZHMoaWQpK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oaXNSZWZlcmVuY2Uob2JqKSkge1xuICAgICAgICAgICAgICAgICAgICBmb3VuZF8xW29iai5fX3JlZl0gPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChjYW5UcmF2ZXJzZV8xKG9iaikpIHtcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LnZhbHVlcyhvYmopXG4gICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGNhblRyYXZlcnNlXzEpXG4gICAgICAgICAgICAgICAgICAgICAgICAuZm9yRWFjaCh3b3JrU2V0XzEuYWRkLCB3b3JrU2V0XzEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnJlZnNbZGF0YUlkXTtcbiAgICB9O1xuICAgIEVudGl0eVN0b3JlLnByb3RvdHlwZS5tYWtlQ2FjaGVLZXkgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBhcmdzID0gW107XG4gICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCBhcmd1bWVudHMubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgICBhcmdzW19pXSA9IGFyZ3VtZW50c1tfaV07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuZ3JvdXAua2V5TWFrZXIubG9va3VwQXJyYXkoYXJncyk7XG4gICAgfTtcbiAgICByZXR1cm4gRW50aXR5U3RvcmU7XG59KCkpO1xuZXhwb3J0IHsgRW50aXR5U3RvcmUgfTtcbnZhciBDYWNoZUdyb3VwID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBDYWNoZUdyb3VwKGNhY2hpbmcpIHtcbiAgICAgICAgdGhpcy5jYWNoaW5nID0gY2FjaGluZztcbiAgICAgICAgdGhpcy5kID0gbnVsbDtcbiAgICAgICAgdGhpcy5rZXlNYWtlciA9IG5ldyBLZXlUcmllKGNhblVzZ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3N1cGVyKSB7XG4gICAgX19leHRlbmRzKExheWVyLCBfc3VwZXIpO1xuICAgIGZ1bmN0aW9uIExheWVyKGlkLCBwYXJlbnQsIHJlcGxheSwgZ3JvdXApIHtcbiAgICAgICAgdmFyIF90aGlzID0gX3N1cGVyLmNhbGwodGhpcywgcGFyZW50LnBvbGljaWVzLCBncm91cCkgfHwgdGhpcztcbiAgICAgICAgX3RoaXMuaWQgPSBpZDtcbiAgICAgICAgX3RoaXMucGFyZW50ID0gcGFyZW50O1xuICAgICAgICBfdGhpcy5yZXBsYXkgPSByZXBsYXk7XG4gICAgICAgIF90aGlzLmdyb3VwID0gZ3JvdXA7XG4gICAgICAgIHJlcGxheShfdGhpcyk7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgTGF5ZXIucHJvdG90eXBlLmFkZExheWVyID0gZnVuY3Rpb24gKGxheWVySWQsIHJlcGxheSkge1xuICAgICAgICByZXR1cm4gbmV3IExheWVyKGxheWVySWQsIHRoaXMsIHJlcGxheSwgdGhpcy5ncm91cCk7XG4gICAgfTtcbiAgICBMYXllci5wcm90b3R5cGUucmVtb3ZlTGF5ZXIgPSBmdW5jdGlvbiAobGF5ZXJJZCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgcGFyZW50ID0gdGhpcy5wYXJlbnQucmVtb3ZlTGF5ZXIobGF5ZXJJZCk7XG4gICAgICAgIGlmIChsYXllcklkID09PSB0aGlzLmlkKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5ncm91cC5jYWNoaW5nKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXModGhpcy5kYXRhKS5mb3JFYWNoKGZ1bmN0aW9uIChkYXRhSWQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKF90aGlzLmRhdGFbZGF0YUlkXSAhPT0gcGFyZW50Lmxvb2t1cChkYXRhSWQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5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0aWMgPSBmYWxzZTsgfVxuICAgICAgICByZXR1cm4gKG9wdGltaXN0aWMgPyB0aGlzLm9wdGltaXN0aWNEYXRhIDogdGhpcy5kYXRhKS50b09iamVjdCgpO1xuICAgIH07XG4gICAgSW5NZW1vcnlDYWNoZS5wcm90b3R5cGUucmVhZCA9IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgIHZhciBzdG9yZSA9IG9wdGlvbnMub3B0aW1pc3RpYyA/IHRoaXMub3B0aW1pc3RpY0RhdGEgOiB0aGlzLmRhdGE7XG4gICAgICAgIGlmICh0eXBlb2Ygb3B0aW9ucy5yb290SWQgPT09ICdzdHJpbmcnICYmICFzdG9yZS5oYXMob3B0aW9ucy5yb290SWQpKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5zdG9yZVJlYWRlci5kaWZmUXVlcnlBZ2FpbnN0U3RvcmUoe1xuICAgICAgICAgICAgc3RvcmU6IHN0b3JlLFxuICAgICAgICAgICAgcXVlcnk6IG9wdGlvbnMucXVlcnksXG4gICAgICAgICAgICB2YXJpYWJsZXM6IG9wdGlvbnMudmFyaWFibGVzLFxuICAgICAgICAgICAgcm9vdElkOiBvcHRpb25zLnJvb3RJZCxcbiAgICAgICAgICAgIGNvbmZpZzogdGhpcy5jb25maWcsXG4gICAgICAgICAgICByZXR1cm5QYXJ0aWFsRGF0YTogZmFsc2UsXG4gICAgICAgIH0pLnJlc3VsdCB8fCBudWxsO1xuICAgIH07XG4gICAgSW5NZW1vcnlDYWNoZS5wcm90b3R5cGUud3JpdGUgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgKyt0aGlzLnR4Q291bnQ7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5zdG9yZVdyaXRlci53cml0ZVRvU3RvcmUoe1xuICAgICAgICAgICAgICAgIHN0b3JlOiB0aGlzLmRhdGEsXG4gICAgICAgICAgICAgICAgcXVlcnk6IG9wdGlvbnMucXVlcnksXG4gICAgICAgICAgICAgICAgcmVzdWx0OiBvcHRpb25zLnJlc3VsdCxcbiAgICAgICAgICAgICAgICBkYXRhSWQ6IG9wdGlvbnMuZGF0YUlkLFxuICAgICAgICAgICAgICAgIHZhcmlhYmxlczogb3B0aW9ucy52YXJpYWJsZXMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBmaW5hbGx5IHtcbiAgICAgICAgICAgIGlmICghLS10aGlzLnR4Q291bnQgJiYgb3B0aW9ucy5icm9hZGNhc3QgIT09IGZhbHNlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5icm9hZGNhc3RXYXRjaGVzKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIEluTWVtb3J5Q2FjaGUucHJvdG90eXBlLm1vZGlmeSA9IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgIGlmIChoYXNPd24uY2FsbChvcHRpb25zLCBcImlkXCIpICYmICFvcHRpb25zLmlkKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHN0b3JlID0gb3B0aW9ucy5vcHRpbWlzdGljXG4gICAgICAgICAgICA/IHRoaXMub3B0aW1pc3RpY0RhdGFcbiAgICAgICAgICAgIDogdGhpcy5kYXRhO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgKyt0aGlzLnR4Q291bnQ7XG4gICAgICAgICAgICByZXR1cm4gc3RvcmUubW9kaWZ5KG9wdGlvbnMuaWQgfHwgXCJST09UX1FVRVJZXCIsIG9wdGlvbnMuZmllbGRzKTtcbiAgICAgICAgfVxuICAgICAgICBmaW5hbGx5IHtcbiAgICAgICAgICAgIGlmICghLS10aGlzLnR4Q291bnQgJiYgb3B0aW9ucy5icm9hZGNhc3QgIT09IGZhbHNlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5icm9hZGN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iAgICBJbk1lbW9yeUNhY2hlLnByb3RvdHlwZS5wZXJmb3JtVHJhbnNhY3Rpb24gPSBmdW5jdGlvbiAodHJhbnNhY3Rpb24sIG9wdGltaXN0aWNJZCkge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICB2YXIgcGVyZm9ybSA9IGZ1bmN0aW9uIChsYXllcikge1xuICAgICAgICAgICAgdmFyIF9hID0gX3RoaXMsIGRhdGEgPSBfYS5kYXRhLCBvcHRpbWlzdGljRGF0YSA9IF9hLm9wdGltaXN0aWNEYXRhO1xuICAgICAgICAgICAgKytfdGhpcy50eENvdW50O1xuICAgICAgICAgICAgaWYgKGxheWVyKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMuZGF0YSA9IF90aGlzLm9wdGltaXN0aWNEYXRhID0gbGF5ZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHRyYW5zYWN0aW9uKF90aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZpbmFsbHkge1xuICAgICAgICAgICAgICAgIC0tX3RoaXMudHhDb3VudDtcbiAgICAgICAgICAgICAgICBfdGhpcy5kYXRhID0gZGF0YTtcbiAgICAgICAgICAgICAgICBfdGhpcy5vcHRpbWlzdGljRGF0YSA9IG9wdGltaXN0aWNEYXRhO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICB2YXIgZnJvbU9wdGltaXN0aWNUcmFuc2FjdGlvbiA9IGZhbHNlO1xuICAgICAgICBpZiAodHlwZW9mIG9wdGltaXN0aWNJZCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRoaXMub3B0aW1pc3RpY0RhdGEgPSB0aGlzLm9wdGltaXN0aWNEYXRhLmFkZExheWVyKG9wdGltaXN0aWNJZCwgcGVyZm9ybSk7XG4gICAgICAgICAgICBmcm9tT3B0aW1pc3RpY1RyYW5zYWN0aW9uID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChvcHRpbWlzdGljSWQgPT09IG51bGwpIHtcbiAgICAgICAgICAgIHBlcmZvcm0odGhpcy5kYXRhKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHBlcmZvcm0oKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmJyb2FkY2FzdFdhdGNoZXMoZnJvbU9wdGltaXN0aWNUcmFuc2FjdGlvbik7XG4gICAgfTtcbiAgICBJbk1lbW9yeUNhY2hlLnByb3RvdHlwZS50cmFuc2Zvcm1Eb2N1bWVudCA9IGZ1bmN0aW9uIChkb2N1bWVudCkge1xuICAgICAgICBpZiAodGhpcy5hZGRUeXBlbmFtZSkge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IHRoaXMudHlwZW5hbWVEb2N1bWVudENhY2hlLmdldChkb2N1bWVudCk7XG4gICAgICAgICAgICBpZiAoIXJlc3VsdCkge1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGFkZFR5cGVuYW1lVG9Eb2N1bWVudChkb2N1bWVudCk7XG4gICAgICAgICAgICAgICAgdGhpcy50eXBlbmFtZURvY3VtZW50Q2FjaGUuc2V0KGRvY3VtZW50LCByZXN1bHQpO1xuICAgICAgICAgICAgICAgIHRoaXMudHlwZW5hbWVEb2N1bWVudENhY2hlLnNldChyZXN1bHQsIHJlc3VsdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkb2N1bWVudDtcbiAgICB9O1xuICAgIEluTWVtb3J5Q2FjaGUucHJvdG90eXBlLmJyb2FkY2FzdFdhdGNoZXMgPSBmdW5jdGlvbiAoZnJvbU9wdGltaXN0aWNUcmFuc2FjdGlvbikge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBpZiAoIXRoaXMudHhDb3VudCkge1xuICAgICAgICAgICAgdGhpcy53Y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biAgICAgICAgdmFyIHR5cGVuYW1lID0gc2VsZWN0aW9uU2V0ICYmIGZyYWdtZW50TWFwXG4gICAgICAgICAgICA/IGdldFR5cGVuYW1lRnJvbVJlc3VsdChvYmplY3QsIHNlbGVjdGlvblNldCwgZnJhZ21lbnRNYXApXG4gICAgICAgICAgICA6IG9iamVjdC5fX3R5cGVuYW1lO1xuICAgICAgICBpZiAodHlwZW5hbWUgPT09IHRoaXMucm9vdFR5cGVuYW1lc0J5SWQuUk9PVF9RVUVSWSkge1xuICAgICAgICAgICAgcmV0dXJuIFtcIlJPT1RfUVVFUllcIl07XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGNvbnRleHQgPSB7XG4gICAgICAgICAgICB0eXBlbmFtZTogdHlwZW5hbWUsXG4gICAgICAgICAgICBzZWxlY3Rpb25TZXQ6IHNlbGVjdGlvblNldCxcbiAgICAgICAgICAgIGZyYWdtZW50TWFwOiBmcmFnbWVudE1hcCxcbiAgICAgICAgfTtcbiAgICAgICAgdmFyIGlkO1xuICAgICAgICB2YXIgcG9saWN5ID0gdGhpcy5nZXRUeXBlUG9saWN5KHR5cGVuYW1lLCBmYWxzZSk7XG4gICAgICAgIHZhciBrZXlGbiA9IHBvbGljeSAmJiBwb2xpY3kua2V5Rm4gfHwgdGhpcy5jb25maWcuZGF0YUlkRnJvbU9iamVjdDtcbiAgICAgICAgd2hpbGUgKGtleUZuKSB7XG4gICAgICAgICAgICB2YXIgc3BlY2lmaWVyT3JJZCA9IGtleUZuKG9iamVjdCwgY29udGV4dCk7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzcGVjaWZpZXJPcklkKSkge1xuICAgICAgICAgICAgICAgIGtleUZuID0ga2V5RmllbGRzRm5Gcm9tU3BlY2lmaWVyKHNwZWNpZmllck9ySWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWQgPSBzcGVjaWZpZXJPcklkO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlkID0gaWQgJiYgU3RyaW5nKGlkKTtcbiAgICAgICAgcmV0dXJuIGNvbnRleHQua2V5T2JqZWN0ID8gW2lkLCBjb250ZXh0LmtleU9iamVjdF0gOiBbaWRdO1xuICAgIH07XG4gICAgUG9saWNpZXMucHJvdG90eXBlLmFkZFR5cGVQb2xpY2llcyA9IGZ1bmN0aW9uICh0eXBlUG9saWNpZXMpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgT2JqZWN0LmtleXModHlwZVBvbGljaWVzKS5mb3JFYWNoKGZ1bmN0aW9uICh0eXBlbmFtZSkge1xuICAgICAgICAgICAgdmFyIGV4aXN0aW5nID0gX3RoaXMuZ2V0VHlwZVBvbGljeSh0eXBlbmFtZSwgdHJ1ZSk7XG4gICAgICAgICAgICB2YXIgaW5jb21pbmcgPSB0eXBlUG9saWNpZXNbdHlwZW5hbWVdO1xuICAgICAgICAgICAgdmFyIGtleUZpZWxkcyA9IGluY29taW5nLmtleUZpZWxkcywgZmllbGRzID0gaW5jb21pbmcuZmllbGRzO1xuICAgICAgICAgICAgaWYgKGluY29taW5nLnF1ZXJ5VHlwZSlcbiAgICAgICAgICAgICAgICBfdGhpcy5zZXRSb290VHlwZW5hbWUoXCJRdWVyeVwiLCB0eXBlbmFtZSk7XG4gICAgICAgICAgICBpZiAoaW5jb21pbmcubXV0YXRpb25UeXBlKVxuICAgICAgICAgICAgICAgIF90aGlzLnNldFJvb3RUeXBlbmFtZShcIk11dGF0aW9uXCIsIHR5cGVuYW1lKTtcbiAgICAgICAgICAgIGlmIChpbmNvbWluZy5zdWJzY3JpcHRpb25UeXBlKVxuICAgICAgICAgICAgICAgIF90aGlzLnNldFJvb3RUeXBlbmFtZShcIlN1YnNjcmlwdGlvblwiLCB0eXBlbmFtZSk7XG4gICAgICAgICAgICBleGlzdGluZy5rZXlGbiA9XG4gICAgICAgICAgICAgICAga2V5RmllbGRzID09PSBmYWxzZSA/IG51bGxLZXlGaWVsZHNGbiA6XG4gICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkoa2V5RmllbGRzKSA/IGtleUZpZWxkc0ZuRnJvbVNwZWNpZmllcihrZXlGaWVsZHMpIDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiBrZXlGaWVsZHMgPT09IFwiZnVuY3Rpb25cIiA/IGtleUZpZWxkcyA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhpc3Rpbmcua2V5Rm47XG4gICAgICAgICAgICBpZiAoZmllbGRzKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoZmllbGRzKS5mb3JFYWNoKGZ1bmN0aW9uIChmaWVsZE5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV4aXN0aW5nID0gX3RoaXMuZ2V0RmllbGRQb2xpY3kodHlwZW5hbWUsIGZpZWxkTmFtZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbmNvbWluZyA9IGZpZWxkc1tmaWVsZE5hbWVdO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGluY29taW5nID09PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4aXN0aW5nLnJlYWQgPSBpbmNvbWluZztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXlBcmdzID0gaW5jb21pbmcua2V5QXJncywgcmVhZCA9IGluY29taW5nLnJlYWQsIG1lcmdlID0gaW5jb21pbmcubWVyZ2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBleGlzdGluZy5rZXlGbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5QXJncyA9PT0gZmFsc2UgPyBzaW1wbGVLZXlBcmdzRm4gOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KGtleUFyZ3MpID8ga2V5QXJnc0ZuRnJvbVNwZWNpZmllcihrZXlBcmdzKSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlb2Yga2V5QXJncyA9PT0gXCJmdW5jdGlvblwiID8ga2V5QXJncyA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhpc3Rpbmcua2V5Rm47XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlYWQgPT09IFwiZnVuY3Rpb25cIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGlzdGluZy5yZWFkID0gcmVhZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4aXN0aW5nLm1lcmdlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlb2YgbWVyZ2UgPT09IFwiZnVuY3Rpb25cIiA/IG1lcmdlIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVyZ2UgPT09IHRydWUgPyBtZXJnZVRydWVGbiA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXJnZSA9PT0gZmFsc2UgPyBtZXJnZUZhbHNlRm4gOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4aXN0aW5nLm1lcmdlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChleGlzdGluZy5yZWFkICYmIGV4aXN0aW5nLm1lcmdlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBleGlzdGluZy5rZXlGbiA9IGV4aXN0aW5nLmtleUZuIHx8IHNpbXBsZUtleUFyZ3NGbjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIFBvbGljaWVzLnByb3RvdHlwZ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VN1YnR5cGVzID0gISEocmVzdWx0ICYmIHRoaXMuZnV6enlTdWJ0eXBlcy5zaXplKTtcbiAgICAgICAgICAgIHZhciBjaGVja2luZ0Z1enp5U3VidHlwZXMgPSBmYWxzZTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgd29ya1F1ZXVlXzEubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3VwZXJ0eXBlU2V0ID0gd29ya1F1ZXVlXzFbaV07XG4gICAgICAgICAgICAgICAgaWYgKHN1cGVydHlwZVNldC5oYXMoc3VwZXJ0eXBlKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXR5cGVuYW1lU3VwZXJ0eXBlU2V0LmhhcyhzdXBlcnR5cGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tpbmdGdXp6eVN1YnR5cGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPT09IFwicHJvZHVjdGlvblwiIHx8IGludmFyaWFudC53YXJuKFwiSW5mZXJyaW5nIHN1YnR5cGUgXCIgKyB0eXBlbmFtZSArIFwiIG9mIHN1cGVydHlwZSBcIiArIHN1cGVydHlwZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlbmFtZVN1cGVydHlwZVNldC5hZGQoc3VwZXJ0eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3VwZXJ0eXBlU2V0LmZvckVhY2gobWF5YmVFbnF1ZXVlXzEpO1xuICAgICAgICAgICAgICAgIGlmIChuZWVkVG9DaGVja0Z1enp5U3VidHlwZXMgJiZcbiAgICAgICAgICAgICAgICAgICAgaSA9PT0gd29ya1F1ZXVlXzEubGVuZ3RoIC0gMSAmJlxuICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25TZXRNYXRjaGVzUmVzdWx0KGZyYWdtZW50LnNlbGVjdGlvblNldCwgcmVzdWx0LCB2YXJpYWJsZXMpKSB7XG4gICAgICAgICAgICAgICAgICAgIG5lZWRUb0NoZWNrRnV6enlTdWJ0eXBlcyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBjaGVja2luZ0Z1enp5U3VidHlwZXMgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmZ1enp5U3VidHlwZXMuZm9yRWFjaChmdW5jdGlvbiAocmVnRXhwLCBmdXp6eVN0cmluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdGNoID0gdHlwZW5hbWUubWF0Y2gocmVnRXhwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaCAmJiBtYXRjaFswXSA9PT0gdHlwZW5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXliZUVucXVldWVfMShmdXp6eVN0cmluZyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcbiAgICBQb2xpY2llcy5wcm90b3R5cGUuZ2V0U3RvcmVGaWVsZE5hbWUgPSBmdW5jdGlvbiAoZmllbGRTcGVjKSB7XG4gICAgICAgIHZhciB0eXBlbmFtZSA9IGZpZWxkU3BlYy50eXBlbmFtZSwgZmllbGROYW1lID0gZmllbGRTcGVjLmZpZWxkTmFtZTtcbiAgICAgICAgdmFyIHBvbGljeSA9IHRoaXMuZ2V0RmllbGRQb2xpY3kodHlwZW5hbWUsIGZpZWxkTmFtZSwgZmFsc2UpO1xuICAgICAgICB2YXIgc3RvcmVGaWVsZE5hbWU7XG4gICAgICAgIHZhciBrZXlGbiA9IHBvbGljeSAmJiBwb2xpY3kua2V5Rm47XG4gICAgICAgIGlmIChrZXlGbiAmJiB0eXBlbmFtZSkge1xuICAgICAgICAgICAgdmFyIGNvbnRleHQgPSB7XG4gICAgICAgICAgICAgICAgdHlwZW5hbWU6IHR5cGVuYW1lLFxuICAgICAgICAgICAgICAgIGZpZWxkTmFtZTogZmllbGROYW1lLFxuICAgICAgICAgICAgICAgIGZpZWxkOiBmaWVsZFNwZWMuZmllbGQgfHwgbnVsbCxcbiAgICAgICAgICAgICAgICB2YXJpYWJsZXM6IGZpZWxkU3BlYy52YXJpYWJsZXMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdmFyIGFyZ3MgPSBhcmdzRnJvbUZpZWxkU3BlY2lmaWVyKGZpZWxkU3BlYyk7XG4gICAgICAgICAgICB3aGlsZSAoa2V5Rm4pIHtcbiAgICAgICAgICAgICAgICB2YXIgc3BlY2lmaWVyT3JTdHJpbmcgPSBrZXlGbihhcmdzLCBjb250ZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShzcGVjaWZpZXJPclN0cmluZykpIHtcbiAgICAgICAgICAgICAgICAgICAga2V5Rm4gPSBrZXlBcmdzRm5Gcm9tU3BlY2lmaWVyKHNwZWNpZmllck9yU3RyaW5nKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0b3JlRmllbGROYW1lID0gc3BlY2lmaWVyT3JTdHJpbmcgfHwgZmllbGROYW1lO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHN0b3JlRmllbGROYW1lID09PSB2b2lkIDApIHtcbiAgICAgICAgICAgIHN0b3JlRmllbGROYW1lID0gZmllbGRTcGVjLmZpZWxkXG4gICAgICAgICAgICAgICAgPyBzdG9yZUtleU5hbWVGcm9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kTmFtZSwgZmFsc2UpO1xuICAgICAgICByZXR1cm4gISEocG9saWN5ICYmIHBvbGljeS5tZXJnZSk7XG4gICAgfTtcbiAgICBQb2xpY2llcy5wcm90b3R5cGUuYXBwbHlNZXJnZXMgPSBmdW5jdGlvbiAoZXhpc3RpbmcsIGluY29taW5nLCBjb250ZXh0LCBzdG9yYWdlS2V5cykge1xuICAgICAgICB2YXIgX2E7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIGlmIChpc0ZpZWxkVmFsdWVUb0JlTWVyZ2VkKGluY29taW5nKSkge1xuICAgICAgICAgICAgdmFyIGZpZWxkID0gaW5jb21pbmcuX19maWVsZDtcbiAgICAgICAgICAgIHZhciBmaWVsZE5hbWUgPSBmaWVsZC5uYW1lLnZhbHVlO1xuICAgICAgICAgICAgdmFyIG1lcmdlID0gdGhpcy5nZXRGaWVsZFBvbGljeShpbmNvbWluZy5fX3R5cGVuYW1lLCBmaWVsZE5hbWUsIGZhbHNlKS5tZXJnZTtcbiAgICAgICAgICAgIGluY29taW5nID0gbWVyZ2UoZXhpc3RpbmcsIGluY29taW5nLl9fdmFsdWUsIG1ha2VGaWVsZEZ1bmN0aW9uT3B0aW9ucyh0aGlzLCB2b2lkIDAsIHsgdHlwZW5hbWU6IGluY29taW5nLl9fdHlwZW5hbWUsIGZpZWxkTmFtZTogZmllbGROYW1lLFxuICAgICAgICAgICAgICAgIGZpZWxkOiBmaWVsZCwgdmFyaWFibGVzOiBjb250ZXh0LnZhcmlhYmxlcyB9LCBjb250ZXh0LCBzdG9yYWdlS2V5c1xuICAgICAgICAgICAgICAgID8gKF9hID0gY29udGV4dC5zdG9yZSkuZ2V0U3RvcmFnZS5hcHBseShfYSwgc3RvcmFnZUtleXMpIDogT2JqZWN0LmNyZWF0ZShudWxsKSkpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGluY29taW5nKSkge1xuICAgICAgICAgICAgcmV0dXJuIGluY29taW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3RvcmVGaWVsZE5hbWU6IHN0b3JlRmllbGROYW1lLFxuICAgICAgICB2YXJpYWJsZXM6IHZhcmlhYmxlcyxcbiAgICAgICAgaXNSZWZlcmVuY2U6IGlzUmVmZXJlbmNlLFxuICAgICAgICB0b1JlZmVyZW5jZTogdG9SZWZlcmVuY2UsXG4gICAgICAgIHN0b3JhZ2U6IHN0b3JhZ2UsXG4gICAgICAgIGNhY2hlOiBwb2xpY2llcy5jYWNoZSxcbiAgICAgICAgY2FuUmVhZDogY2FuUmVhZCxcbiAgICAgICAgcmVhZEZpZWxkOiBmdW5jdGlvbiAoZmllbGROYW1lT3JPcHRpb25zLCBmcm9tKSB7XG4gICAgICAgICAgICB2YXIgb3B0aW9ucyA9IHR5cGVvZiBmaWVsZE5hbWVPck9wdGlvbnMgPT09IFwic3RyaW5nXCIgPyB7XG4gICAgICAgICAgICAgICAgZmllbGROYW1lOiBmaWVsZE5hbWVPck9wdGlvbnMsXG4gICAgICAgICAgICAgICAgZnJvbTogZnJvbSxcbiAgICAgICAgICAgIH0gOiBfX2Fzc2lnbih7fSwgZmllbGROYW1lT3JPcHRpb25zKTtcbiAgICAgICAgICAgIGlmICh2b2lkIDAgPT09IG9wdGlvbnMuZnJvbSkge1xuICAgICAgICAgICAgICAgIG9wdGlvbnMuZnJvbSA9IG9iamVjdE9yUmVmZXJlbmNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHZvaWQgMCA9PT0gb3B0aW9ucy52YXJpYWJsZXMpIHtcbiAgICAgICAgICAgICAgICBvcHRpb25zLnZhcmlhYmxlcyA9IHZhcmlhYmxlcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBwb2xpY2llcy5yZWFkRmllbGQob3B0aW9ucywgY29udGV4dCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmdlT2JqZWN0czogZnVuY3Rpb24gKGV4aXN0aW5nLCBpbmNvbWluZykge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZXhpc3RpbmcpIHx8IEFycmF5LmlzQXJyYXkoaW5jb21pbmcpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPT09IFwicHJvZHVjdGlvblwiID8gbmV3IEludmFyaWFudEVycm9yKDIpIDogbmV3IEludmFyaWFudEVycm9yKFwiQ2Fubm90IGF1dG9tYXRpY2FsbHkgbWVyZ2UgYXJyYXlzXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4aXN0aW5nICYmIHR5cGVvZiBleGlzdGluZyA9PT0gXCJvYmplY3RcIiAmJlxuICAgICAgICAgICAgICAgIGluY29taW5nICYmIHR5cGVvZiBpbmNvbWluZyA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAgIHZhciBlVHlwZSA9IGdldEZpZWxkVmFsdWUoZXhpc3RpbmcsIFwiX190eXBlbmFtZVwiKTtcbiAgICAgICAgICAgICAgICB2YXIgaVR5cGUgPSBnZXRGaWVsZFZhbHVlKGluY29taW5nLCBcIl9fdHlwZW5hbWVcIik7XG4gICAgICAgICAgICAgICAgdmFyIHR5cGVzRGlmZmVyID0gZVR5cGUgJiYgaVR5cGUgJiYgZVR5cGUgIT09IGlUeXBlO1xuICAgICAgICAgICAgICAgIHZhciBhcHBsaWVkID0gcG9saWNpZXMuYXBwbHlNZXJnZXModHlwZXNEaWZmZXIgPyB2b2lkIDAgOiBleGlzdGluZywgaW5jb21pbmcsIGNvbnRleHQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlc0RpZmZlciB8fFxuICAgICAgICAgICAgICAgICAgICAhc3RvcmVWYWx1ZUlzU3RvcmVPYmplY3QoZXhpc3RpbmcpIHx8XG4gICAgICAgICAgICAgICAgICAgICFzdG9yZVZhbHVlSXNTdG9yZU9iamVjdChhcHBsaWVkKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXBwbGllZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fYXNzaWduKF9fYXNzaWduKHt9LCBleGlzdGluZyksIGFwcGxpZWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGluY29taW5nO1xuICAgICAgICB9XG4gICAgfTtcbn1cbmZ1bmN0aW9uIGtleUFyZ3NGbkZyb21TcGVjaWZpZXIoc3BlY2lmaWVyKSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uIChhcmdzLCBjb250ZXh0KSB7XG4gICAgICAgIHJldHVybiBhcmdzID8gY29udGV4dC5maWVsZE5hbWUgKyBcIjpcIiArIEpTT04uc3RyaW5naWZ5KGNvbXB1dGVLZXlPYmplY3QoYXJncywgc3BlY2lmaWVyKSkgOiBjb250ZXh0LmZpZWxkTmFtZTtcbiAgICB9O1xufVxuZnVuY3Rpb24ga2V5RmllbGRzRm5Gcm9tU3BlY2lmaWVyKHNwZWNpZmllcikge1xuICAgIHZhciB0cmllID0gbmV3IEtleVRyaWUoY2FuVXNlV2Vha01hcCk7XG4gICAgcmV0dXJuIGZ1bmN0aW9uIChvYmplY3QsIGNvbnRleHQpIHtcbiAgICAgICAgdmFyIGFsaWFzTWFwO1xuICAgICAgICBpZiAoY29udGV4dC5zZWxlY3Rpb25TZXQgJiYgY29udGV4dC5mcmFnbWVudE1hcCkge1xuICAgICAgICAgICAgdmFyIGluZm8gPSB0cmllLmxvb2t1cEFycmF5KFtcbiAgICAgICAgICAgICAgICBjb250ZXh0LnNlbGVjdGlvblNldCxcbiAgICAgICAgICAgICAgICBjb250ZXh0LmZyYWdtZW50TWFwLFxuICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICBhbGlhc01hcCA9IGluZm8uYWxpYXNNYXAgfHwgKGluZm8uYWxpYXNNYXAgPSBtYWtlQWxpYXNNYXAoY29udGV4dC5zZWxlY3Rpb25TZXQsIGNvbnRleHQuZnJhZ21lbnRNYXApKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIga2V5T2JqZWN0ID0gY29udGV4dC5rZXlPYmplY3QgPVxuICAgICAgICAgICAgY29tcHV0ZUtleU9iamVjdChvYmplY3QsIHNwZWNpZmllciwgYWxpYXNNYXApO1xuICAgICAgICByZXR1cm4gY29udGV4dC50eXBlbmFtZSArIFwiOlwiICsgSlNPTi5zdHJpbmdpZnkoa2V5T2JqZWN0KTtcbiAgICB9O1xufVxuZnVuY3Rpb24gbWFrZUFsaWFzTWFwKHNlbGVjdGlvblNldCwgZnJhZ21lbnRNYXApIHtcbiAgICB2YXIgbWFwID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICB2YXIgd29ya1F1ZXVlID0gbmV3IFNldChbc2VsZWN0aW9uU2V0XSk7XG4gICAgd29ya1F1ZXVlLmZvckVhY2goZnVuY3Rpb24gKHNlbGVjdGlvblNldCkge1xuICAgICAgICBzZWxlY3Rpb25TZXQuc2VsZWN0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uIChzZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIGlmIChpc0ZpZWxkKHNlbGVjdGlvbikpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2VsZWN0aW9uLmFsaWFzKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXNwb25zZUtleSA9IHNlbGVjdGlvbi5hbGlhcy52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0b3JlS2V5ID0gc2VsZWN0aW9uLm5hbWUudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdG9yZUtleSAhPT0gcmVzcG9uc2VLZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhbGlhc2VzID0gbWFwLmFsaWFzZXMgfHwgKG1hcC5hbGlhc2VzID0gT2JqZWN0LmNyZWF0ZShudWxsKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbGlhc2VzW3N0b3JlS2V5XSA9IHJlc3BvbnNlS2V5O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzZWxlY3Rpb24uc2VsZWN0aW9uU2V0KSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzdWJzZXRzID0gbWFwLnN1YnNldHMgfHwgKG1hcC5zdWJzZXRzID0gT2JqZWN0LmNyZWF0ZShudWxsKSk7XG4gICAgICAgICAgICAgICAgICAgIHN1YnNldHNbc2VsZWN0aW9uLm5hbWUudmFsdWVdID1cbiAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VBbGlhc01hcChzZWxlY3Rpb24uc2VsZWN0aW9uU2V0LCBmcmFnbWVudE1hcCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGZyYWdtZW50ID0gZ2V0RnJhZ21lbnRGcm9tU2VsZWN0aW9uKHNlbGVjdGlvbiwgZnJhZ21lbnRNYXApO1xuICAgICAgICAgICAgICAgIGlmIChmcmFnbWVudCkge1xuICAgICAgICAgICAgICAgICAgICB3b3JrUXVldWUuYWRkKGZyYWdtZW50LnNlbGVjdGlvblNldCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9KTtcbiAgICByZXR1cm4gbWFwO1xufVxuZnVuY3Rpb24gY29tcHV0ZUtleU9iamVjdChyZXNwb25zZSwgc3BlY2lmaWVyLCBhbGlhc01hcCkge1xuICAgIHZhciBrZXlPYmogPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgIHZhciBwcmV2S2V5O1xuICAgIHNwZWNpZmllci5mb3JFYWNoKGZ1bmN0aW9uIChzKSB7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KHMpKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByZXZLZXkgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3Vic2V0cyA9IGFsaWFzTWFwICYmIGFsaW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AgICAgICAgICAgICAgaWYgKHN1cHBvcnRzUmVzdWx0Q2FjaGluZyhjb250ZXh0LnN0b3JlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dC5zdG9yZS5tYWtlQ2FjaGVLZXkoc2VsZWN0aW9uU2V0LCBpc1JlZmVyZW5jZShwYXJlbnQpID8gcGFyZW50Ll9fcmVmIDogcGFyZW50LCBjb250ZXh0LnZhclN0cmluZyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5rbm93blJlc3VsdHMgPSBuZXcgV2Vha01hcCgpO1xuICAgICAgICB0aGlzLmV4ZWN1dGVTdWJTZWxlY3RlZEFycmF5ID0gd3JhcChmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICAgICAgcmV0dXJuIF90aGlzLmV4ZWNTdWJTZWxlY3RlZEFycmF5SW1wbChvcHRpb25zKTtcbiAgICAgICAgfSwge1xuICAgICAgICAgICAgbWFrZUNhY2hlS2V5OiBmdW5jdGlvbiAoX2EpIHtcbiAgICAgICAgICAgICAgICB2YXIgZmllbGQgPSBfYS5maWVsZCwgYXJyYXkgPSBfYS5hcnJheSwgY29udGV4dCA9IF9hLmNvbnRleHQ7XG4gICAgICAgICAgICAgICAgaWYgKHN1cHBvcnRzUmVzdWx0Q2FjaGluZyhjb250ZXh0LnN0b3JlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dC5zdG9yZS5tYWtlQ2FjaGVLZXkoZmllbGQsIGFycmF5LCBjb250ZXh0LnZhclN0cmluZyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5jb25maWcgPSBfX2Fzc2lnbih7IGFkZFR5cGVuYW1lOiB0cnVlIH0sIGNvbmZpZyk7XG4gICAgfVxuICAgIFN0b3JlUmVhZGVyLnByb3RvdHlwZS5kaWZmUXVlcnlB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gICAgICAgICAgIGlmICghc2hvdWxkSW5jbHVkZShzZWxlY3Rpb24sIHZhcmlhYmxlcykpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgaWYgKGlzRmllbGQoc2VsZWN0aW9uKSkge1xuICAgICAgICAgICAgICAgIHZhciBmaWVsZFZhbHVlID0gcG9saWNpZXMucmVhZEZpZWxkKHtcbiAgICAgICAgICAgICAgICAgICAgZmllbGROYW1lOiBzZWxlY3Rpb24ubmFtZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgZmllbGQ6IHNlbGVjdGlvbixcbiAgICAgICAgICAgICAgICAgICAgdmFyaWFibGVzOiBjb250ZXh0LnZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgZnJvbTogb2JqZWN0T3JSZWZlcmVuY2UsXG4gICAgICAgICAgICAgICAgfSwgY29udGV4dCk7XG4gICAgICAgICAgICAgICAgdmFyIHJlc3VsdE5hbWUgPSByZXN1bHRLZXlOYW1lRnJvbUZpZWxkKHNlbGVjdGlvbik7XG4gICAgICAgICAgICAgICAgY29udGV4dC5wYXRoLnB1c2gocmVzdWx0TmFtZSk7XG4gICAgICAgICAgICAgICAgdmFyIHdhc0NsaWVudE9ubHkgPSBjb250ZXh0LmNsaWVudE9ubHk7XG4gICAgICAgICAgICAgICAgY29udGV4dC5jbGllbnRPbmx5ID0gd2FzQ2xpZW50T25seSB8fCAhIShzZWxlY3Rpb24uZGlyZWN0aXZlcyAmJlxuICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24uZGlyZWN0aXZlcy5zb21lKGZ1bmN0aW9uIChkKSB7IHJldHVybiBkLm5hbWUudmFsdWUgPT09IFwiY2xpZW50XCI7IH0pKTtcbiAgICAgICAgICAgICAgICBpZiAoZmllbGRWYWx1ZSA9PT0gdm9pZCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghYWRkVHlwZW5hbWVUb0RvY3VtZW50LmFkZGVkKHNlbGVjdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldE1pc3NpbmcoKS5wdXNoKG1pc3NpbmdGcm9tSW52YXJpYW50KHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSBcInByb2R1Y3Rpb25cIiA/IG5ldyBJbnZhcmlhbnRFcnJvcig1KSA6IG5ldyBJbnZhcmlhbnRFcnJvcihcIkNhbid0IGZpbmQgZmllbGQgJ1wiICsgc2VsZWN0aW9uLm5hbWUudmFsdWUgKyBcIicgb24gXCIgKyAoaXNSZWZlcmVuY2Uob2JqZWN0T3JSZWZlcmVuY2UpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvYmplY3RPclJlZmVyZW5jZS5fX3JlZiArIFwiIG9iamVjdFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBcIm9iamVjdCBcIiArIEpTT04uc3RyaW5naWZ5KG9iamVjdE9yUmVmZXJlbmNlLCBudWxsLCAyKSkpLCBjb250ZXh0KSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheShmaWVsZFZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICBmaWVsZFZhbHVlID0gaGFuZGxlTWlzc2luZyhfdGhpcy5leGVjdXRlU3ViU2VsZWN0ZWRBcnJheSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaWVsZDogc2VsZWN0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXk6IGZpZWxkVmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBjb250ZXh0LFxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFzZWxlY3Rpb24uc2VsZWN0aW9uU2V0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnRTZWxlY3Rpb25TZXRGb3JJZFZhbHVlKGNvbnRleHQuc3RvcmUsIHNlbGVjdGlvbiwgZmllbGRWYWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXliZURlZXBGcmVlemUoZmllbGRWYWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoZmllbGRWYWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpZWxkVmFsdWUgPSBoYW5kbGVNaXNzaW5nKF90aGlzLmV4ZWN1dGVTZWxlY3Rpb25TZXQoe1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uU2V0OiBzZWxlY3Rpb24uc2VsZWN0aW9uU2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgb2JqZWN0T3JSZWZlcmVuY2U6IGZpZWxkVmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBjb250ZXh0LFxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChmaWVsZFZhbHVlICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0c1RvTWVyZ2UucHVzaCgoX2EgPSB7fSwgX2FbcmVzdWx0TmFtZV0gPSBmaWVsZFZhbHVlLCBfYSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb250ZXh0LmNsaWVudE9ubHkgPSB3YXNDbGllbnRPbmx5O1xuICAgICAgICAgICAgICAgIGludmFyaWFudChjb250ZXh0LnBhdGgucG9wKCkgPT09IHJlc3VsdE5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGZyYWd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G4gICAgICAgICAgICAgICAgbWlzc2luZyA9IG1pc3NpbmcgfHwgW107XG4gICAgICAgICAgICAgICAgbWlzc2luZy5wdXNoLmFwcGx5KG1pc3NpbmcsIGNoaWxkUmVzdWx0Lm1pc3NpbmcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaW52YXJpYW50KGNvbnRleHQucGF0aC5wb3AoKSA9PT0gaSk7XG4gICAgICAgICAgICByZXR1cm4gY2hpbGRSZXN1bHQucmVzdWx0O1xuICAgICAgICB9XG4gICAgICAgIGlmIChmaWVsZC5zZWxlY3Rpb25TZXQpIHtcbiAgICAgICAgICAgIGFycmF5ID0gYXJyYXkuZmlsdGVyKGNvbnRleHQuc3RvcmUuY2FuUmVhZCk7XG4gICAgICAgIH1cbiAgICAgICAgYXJyYXkgPSBhcnJheS5tYXAoZnVuY3Rpb24gKGl0ZW0sIGkpIHtcbiAgICAgICAgICAgIGlmIChpdGVtID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb250ZXh0LnBhdGgucHVzaChpKTtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGl0ZW0pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZU1pc3NpbmcoX3RoaXMuZXhlY3V0ZVN1YlNlbGVjdGVkQXJyYXkoe1xuICAgICAgICAgICAgICAgICAgICBmaWVsZDogZmllbGQsXG4gICAgICAgICAgICAgICAgICAgIGFycmF5OiBpdGVtLFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0OiBjb250ZXh0LFxuICAgICAgICAgICAgICAgIH0pLCBpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChmaWVsZC5zZWxlY3Rpb25TZXQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlTWlzc2luZyhfdGhpcy5leGVjdXRlU2VsZWN0aW9uU2V0KHtcbiAgICAgICA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VhdGUobnVsbCksXG4gICAgICAgICAgICBkYXRhSWQ6IGRhdGFJZCxcbiAgICAgICAgICAgIHNlbGVjdGlvblNldDogb3BlcmF0aW9uRGVmaW5pdGlvbi5zZWxlY3Rpb25TZXQsXG4gICAgICAgICAgICBjb250ZXh0OiB7XG4gICAgICAgICAgICAgICAgc3RvcmU6IHN0b3JlLFxuICAgICAgICAgICAgICAgIHdyaXR0ZW46IE9iamVjdC5jcmVhdGUobnVsbCksXG4gICAgICAgICAgICAgICAgbWVyZ2U6IGZ1bmN0aW9uIChleGlzdGluZywgaW5jb21pbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1lcmdlci5tZXJnZShleGlzdGluZywgaW5jb21pbmcpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgdmFyaWFibGVzOiB2YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgdmFyU3RyaW5nOiBKU09OLnN0cmluZ2lmeSh2YXJpYWJsZXMpLFxuICAgICAgICAgICAgICAgIGZyYWdtZW50TWFwOiBjcmVhdGVGcmFnbWVudE1hcChnZXRGcmFnbWVudERlZmluaXRpb25zKHF1ZXJ5KSksXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCFpc1JlZmVyZW5jZShyZWYpKSB7XG4gICAgICAgICAgICB0aHJvdyBwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gXCJwcm9kdWN0aW9uXCIgPyBuZXcgSW52YXJpYW50RXJyb3IoNykgOiBuZXcgSW52YXJpYW50RXJyb3IoXCJDb3VsZCBub3QgaWRlbnRpZnkgb2JqZWN0IFwiICsgSlNPTi5zdHJpbmdpZnkocmVzdWx0KSk7XG4gICAgICAgIH1cbiAgICAgICAgc3RvcmUucmV0YWluKHJlZi5fX3JlZik7XG4gICAgICAgIHJldHVybiByZWY7XG4gICAgfTtcbiAgICBTdG9yZVdyaXRlci5wcm90b3R5cGUucHJvY2Vzc1NlbGVjdGl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b24pO1xuICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IHJlc3VsdFtyZXN1bHRGaWVsZEtleV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHN0b3JlRmllbGROYW1lID0gcG9saWNpZXMuZ2V0U3RvcmVGaWVsZE5hbWUoe1xuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW5hbWU6IHR5cGVuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGROYW1lOiBzZWxlY3Rpb24ubmFtZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpZWxkOiBzZWxlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXJpYWJsZXM6IGNvbnRleHQudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGluY29taW5nVmFsdWUgPSBfdGhpcy5wcm9jZXNzRmllbGRWYWx1ZSh2YWx1ZSwgc2VsZWN0aW9uLCBjb250ZXh0LCBvdXQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAocG9saWNpZXMuaGFzTWVyZ2VGdW5jdGlvbih0eXBlbmFtZSwgc2VsZWN0aW9uLm5hbWUudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmNvbWluZ1ZhbHVlID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZmllbGQ6IHNlbGVjdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX3R5cGVuYW1lOiB0eXBlbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX3ZhbHVlOiBpbmNvbWluZ1ZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG91dC5zaG91bGRBcHBseU1lcmdlcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbWVyZ2VkRmllbGRzID0gY29udGV4dC5tZXJnZShtZXJnZWRGaWVsZHMsIChfYSA9IHt9LFxuICAgICAgICAgICAgICAgICAgICAgICAgX2Fbc3RvcmVGaWVsZE5hbWVdID0gaW5jb21pbmdWYWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF9hKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBvbGljaWVzLnVzaW5nUG9zc2libGVUeXBlcyAmJlxuICAgICAgICAgICAgICAgICAgICAhaGFzRGlyZWN0aXZlcyhbXCJkZWZlclwiLCBcImNsaWVudFwiXSwgc2VsZWN0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gXCJwcm9kdWN0aW9uXCIgPyBuZXcgSW52YXJpYW50RXJyb3IoOCkgOiBuZXcgSW52YXJpYW50RXJyb3IoXCJNaXNzaW5nIGZpZWxkICdcIiArIHJlc3VsdEZpZWxkS2V5ICsgXCInIGluIFwiICsgSlNPTi5zdHJpbmdpZnkocmVzdWx0LCBudWxsLCAyKS5zdWJzdHJpbmcoMCwgMTAwKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGZyYWdtZW50ID0gZ2V0RnJhZ21lbnRGcm9tU2VsZWN0aW9uKHNlbGVjdGlvbiwgY29udGV4dC5mcmFnbWVudE1hcCk7XG4gICAgICAgICAgICAgICAgaWYgKGZyYWdtZW50ICYmXG4gICAgICAgICAgICAgICAgICAgIHBvbGljaWVzLmZyYWdtZW50TWF0Y2hlcyhmcmFnbWVudCwgdHlwZW5hbWUsIHJlc3VsdCwgY29udGV4dC52YXJpYWJsZXMpKSB7XG4gICAgICAgICAgICAgICAgICAgIGZyYWdtZW50LnNlbGVjdGlvblNldC5zZWxlY3Rpb25zLmZvckVhY2god29ya1NldC5hZGQsIHdvcmtTZXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGlmIChcInN0cmluZ1wiID09PSB0eXBlb2YgZGF0YUlkKSB7XG4gICAgICAgICAgICB2YXIgZW50aXR5UmVmXzEgPSBtYWtlUmVmZXJlbmNlKGRhdGFJZCk7XG4gICAgICAgICAgICBpZiAob3V0LnNob3VsZEFwcGx5TWVyZ2VzKSB7XG4gICAgICAgICAgICAgICAgbWVyZ2VkRmllbGRzID0gcG9saWNpZXMuYXBwbHlNZXJnZXMoZW50aXR5UmVmXzEsIG1lcmdlZEZpZWxkcywgY29udGV4dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09IFwicHJvZHVjdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMobWVyZ2VkRmllbGRzKS5mb3JFYWNoKGZ1bmN0aW9uIChzdG9yZUZpZWxkTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZmllbGROYW1lID0gZmllbGROYW1lRnJvbVN0b3JlTmFtZShzdG9yZUZpZWxkTmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcG9saWNpZXMuaGFzTWVyZ2VGdW5jdGlvbih0eXBlbmFtZSwgZmllbGROYW1lKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgd2FybkFib3V0RGF0YUxvc3MoZW50aXR5UmVmXzEsIG1lcmdlZEZpZWxkcywgc3RvcmVGaWVsZE5hbWUsIGNvbnRleHQuc3RvcmUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb250ZXh0LnN0b3JlLm1lcmdlKGRhdGFJZCwgbWVyZ2VkRmllbGRzKTtcbi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ICAgICAgICAgICAgICAgICAgIHdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudC5pbmRleE9mKCdDaHJvbWUnKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmRlYnVnKCdEb3dubG9hZCB0aGUgQXBvbGxvIERldlRvb2xzICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdmb3IgYSBiZXR0ZXIgZGV2ZWxvcG1lbnQgZXhwZXJpZW5jZTogJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY2hyb21lLmdvb2dsZS5jb20vd2Vic3RvcmUvZGV0YWlsL2Fwb2xsby1jbGllbnQtZGV2ZWxvcGVyLXQvamRra25ra2JlYmJhcGlsZ29lY2NjaWdsa2ZibWJuZm0nKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZlcnNpb24gPSB2ZXJzaW9uO1xuICAgICAgICB0aGlzLmxvY2FsU3RhdGUgPSBuZXcgTG9jYWxTdGF0ZSh7XG4gICAgICAgICAgICBjYWNoZTogY2FjaGUsXG4gICAgICAgICAgICBjbGllbnQ6IHRoaXMsXG4gICAgICAgICAgICByZXNvbHZlcnM6IHJlc29sdmVycyxcbiAgICAgICAgICAgIGZyYWdtZW50TWF0Y2hlcjogZnJhZ21lbnRNYXRjaGVyLFxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5xdWVyeU1hbmFnZXIgPSBuZXcgUXVlcnlNYW5hZ2VyKHtcbiAgICAgICAgICAgIGNhY2hlOiB0aGlzLmNhY2hlLFxuICAgICAgICAgICAgbGluazogdGhpcy5saW5rLFxuICAgICAgICAgICAgcXVlcnlEZWR1cGxpY2F0aW9uOiBxdWVyeURlZHVwbGljYXRpb24sXG4gICAgICAgICAgICBzc3JNb2RlOiBzc3JNb2RlLFxuICAgICAgICAgICAgY2xpZW50QXdhcmVuZXNzOiB7XG4gICAgICAgICAgICAgICAgbmFtZTogY2xpZW50QXdhcmVuZXNzTmFtZSxcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBjbGllbnRBd2FyZW5lc3NWZXJzaW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxvY2FsU3RhdGU6IHRoaXMubG9jYWxTdGF0ZSxcbiAgICAgICAgICAgIGFzc3VtZUltbXV0YWJsZVJlc3VsdHM6IGFzc3VtZUltbXV0YWJsZVJlc3VsdHMsXG4gICAgICAgICAgICBvbkJyb2FkY2FzdDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChfdGhpcy5kZXZUb29sc0hvb2tDYikge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5kZXZUb29sc0hvb2tDYih7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb246IHt9LFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWVyaWVzOiBfdGhpcy5xdWVyeU1hbmFnZXIuZ2V0UXVlcnlTdG9yZSgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11dGF0aW9uczogX3RoaXMucXVlcnlNYW5hZ2VyLm11dGF0aW9uU3RvcmUuZ2V0U3RvcmUoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhV2l0aE9wdGltaXN0aWNSZXN1bHRzOiBfdGhpcy5jYWNoZS5leHRyYWN0KHRydWUpLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG4gICAgQXBvbGxvQ2xpZW50LnByb3RvdHlwZS5zdG9wID0gZnVuY3R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ibGVzKS50aGVuKGZ1bmN0aW9uIChkYXRhKSB7IHJldHVybiAoX19hc3NpZ24oX19hc3NpZ24oe30sIHZhcmlhYmxlcyksIGRhdGEuZXhwb3J0ZWRWYXJpYWJsZXMpKTsgfSldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gWzIsIF9fYXNzaWduKHt9LCB2YXJpYWJsZXMpXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIExvY2FsU3RhdGUucHJvdG90eXBlLnNob3VsZEZvcmNlUmVzb2x2ZXJzID0gZnVuY3Rpb24gKGRvY3VtZW50KSB7XG4gICAgICAgIHZhciBmb3JjZVJlc29sdmVycyA9IGZhbHNlO1xuICAgICAgICB2aXNpdChkb2N1bWVudCwge1xuICAgICAgICAgICAgRGlyZWN0aXZlOiB7XG4gICAgICAgICAgICAgICAgZW50ZXI6IGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChub2RlLm5hbWUudmFsdWUgPT09ICdjbGllbnQnICYmIG5vZGUuYXJndW1lbnRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3JjZVJlc29sdmVycyA9IG5vZGUuYXJndW1lbnRzLnNvbWUoZnVuY3Rpb24gKGFyZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcmcubmFtZS52YWx1ZSA9PT0gJ2Fsd2F5cycgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnLnZhbHVlLmtpbmQgPT09ICdCb29sZWFuVmFsdWUnICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZy52YWx1ZS52YWx1ZSA9PT0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvcmNlUmVzb2x2ZXJzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIC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m9pZCAwKSB7IG9ubHlSdW5Gb3JjZWRSZXNvbHZlcnMgPSBmYWxzZTsgfVxuICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgbWFpbkRlZmluaXRpb24sIGZyYWdtZW50cywgZnJhZ21lbnRNYXAsIGRlZmluaXRpb25PcGVyYXRpb24sIGRlZmF1bHRPcGVyYXRpb25UeXBlLCBfYSwgY2FjaGUsIGNsaWVudCwgZXhlY0NvbnRleHQ7XG4gICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9iKSB7XG4gICAgICAgICAgICAgICAgbWFpbkRlZmluaXRpb24gPSBnZXRNYWluRGVmaW5pdGlvbihkb2N1bWVudCk7XG4gICAgICAgICAgICAgICAgZnJhZ21lbnRzID0gZ2V0RnJhZ21lbnREZWZpbml0aW9ucyhkb2N1bWVudCk7XG4gICAgICAgICAgICAgICAgZnJhZ21lbnRNYXAgPSBjcmVhdGVGcmFnbWVudE1hcChmcmFnbWVudHMpO1xuICAgICAgICAgICAgICAgIGRlZmluaXRpb25PcGVyYXRpb24gPSBtYWluRGVmaW5pdGlvblxuICAgICAgICAgICAgICAgICAgICAub3BlcmF0aW9uO1xuICAgICAgICAgICAgICAgIGRlZmF1bHRPcGVyYXRpb25UeXBlID0gZGVmaW5pdGlvbk9wZXJhdGlvblxuICAgICAgICAgICAgICAgICAgICA/IGRlZmluaXRpb25PcGVyYXRpb24uY2hhckF0KDApLnRvVXBwZXJDYXNlKCkgK1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmaW5pdGlvbk9wZXJhdGlvbi5zbGljZSgxKVxuICAgICAgICAgICAgICAgICAgICA6ICdRdWVyeSc7XG4gICAgICAgICAgICAgICAgX2EgPSB0aGlzLCBjYWNoZSA9IF9hLmNhY2hlLCBjbGllbnQgPSBfYS5jbGllbnQ7XG4gICAgICAgICAgICAgICAgZXhlY0NvbnRleHQgPSB7XG4gICAgICAgICAgICAgICAgICAgIGZyYWdtZW50TWFwOiBmcmFnbWVudE1hcCxcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dDogX19hc3NpZ24oX19hc3NpZ24oe30sIGNvbnRleHQpLCB7IGNhY2hlOiBjYWNoZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsaWVudDogY2xpZW50IH0pLFxuICAgICAgICAgICAgICAgICAgICB2YXJpYWJsZXM6IHZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgZnJhZ21lbnRNYXRjaGVyOiBmcmFnbWVudE1hdGNoZXIsXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHRPcGVyYXRpb25UeXBlOiBkZWZhdWx0T3BlcmF0aW9uVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgZXhwb3J0ZWRWYXJpYWJsZXM6IHt9LFxuICAgICAgICAgICAgICAgICAgICBvbmx5UnVuRm9yY2VkUmVzb2x2ZXJzOiBvbmx5UnVuRm9yY2VkUmVzb2x2ZXJzLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmV0dXJuIFsyLCB0aGlzLnJlc29sdmVTZWxlY3Rpb25TZXQobWFpbkRlZmluaXRpb24uc2VsZWN0aW9uU2V0LCByb290VmFsdWUsIGV4ZWNDb250ZXh0KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHsgcmV0dXJuICh7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQ6IHJlc3VsdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4cG9ydGVkVmFyaWFibGVzOiBleGVjQ29udGV4dC5leHBvcnRlZFZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgfSk7IH0pXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIExvY2FsU3RhdGUucHJvdG90eXBlLnJlc29sdmVTZWxlY3Rpb25TZXQgPSBmdW5jdGlvbiAoc2VsZWN0aW9uU2V0LCByb290VmFsdWUsIGV4ZWNDb250ZXh0KSB7XG4gICAgICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBmcmFnbWVudE1hcCwgY29udGV4dCwgdmFyaWFibGVzLCByZXN1bHRzVG9NZXJnZSwgZXhlY3V0ZTtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgICAgICAgICAgZnJhZ21lbnRNYXAgPSBleGVjQ29udGV4dC5mcmFnbWVudE1hcCwgY29udGV4dCA9IGV4ZWNDb250ZXh0LmNvbnRleHQsIHZhcmlhYmxlcyA9IGV4ZWNDb250ZXh0LnZhcmlhYmxlcztcbiAgICAgICAgICAgICAgICByZXN1bHRzVG9NZXJnZSA9IFtyb290VmFsdWVdO1xuICAgICAgICAgICAgICAgIGV4ZWN1dGUgPSBmdW5jdGlvbiAoc2VsZWN0aW9uKSB7IHJldHVybiBfX2F3YWl0ZXIoX3RoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmcmFnbWVudCwgdHlwZUNvbmRpdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzaG91bGRJbmNsdWRlKHNlbGVjdGlvbiwgdmFyaWFibGVzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMl07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNGaWVsZChzZWxlY3Rpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyLCB0aGlzLnJlc29sdmVGaWVsZChzZWxlY3Rpb24sIHJvb3RWYWx1ZSwgZXhlY0NvbnRleHQpLnRoZW4oZnVuY3Rpb24gKGZpZWxkUmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2E7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZpZWxkUmVzdWx0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdHNUb01lcmdlLnB1c2goKF9hID0ge30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9hW3Jlc3VsdEtleU5hbWVGcm9tRmllbGQoc2VsZWN0aW9uKV0gPSBmaWVsZFJlc3VsdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2EpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSldO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzSW5saW5lRnJhZ21lbnQoc2VsZWN0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYWdtZW50ID0gc2VsZWN0aW9uO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhZ21lbnQgPSBmcmFnbWVudE1hcFtzZWxlY3Rpb24ubmFtZS52YWx1ZV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPT09IFwicHJvZHVjdGlvblwiID8gaW52YXJpYW50KGZyYWdtZW50LCAxMSkgOiBpbnZhcmlhbnQoZnJhZ21lbnQsIFwiTm8gZnJhZ21lbnQgbmFtZWQgXCIgKyBzZWxlY3Rpb24ubmFtZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnJhZ21lbnQgJiYgZnJhZ21lbnQudHlwZUNvbmRpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVDb25kaXRpb24gPSBmcmFnbWVudC50eXBlQ29uZGl0aW9uLm5hbWUudmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4ZWNDb250ZXh0LmZyYWdtZW50TWF0Y2hlcihyb290VmFsdWUsIHR5cGVDb25kaXRpb24sIGNvbnRleHQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiwgdGhpcy5yZXNvbHZlU2VsZWN0aW9uU2V0KGZyYWdtZW50LnNlbGVjdGlvblNldCwgcm9vdFZhbHVlLCBleGVjQ29udGV4dCkudGhlbihmdW5jdGlvbiAoZnJhZ21lbnRSZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHRzVG9NZXJnZS5wdXNoKGZyYWdtZW50UmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzJdO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTsgfTtcbiAgICAgICAgICAgICAgICByZXR1cm4gWzIsIFByb21pc2UuYWxsKHNlbGVjdGlvblNldC5zZWxlY3Rpb25zLm1hcChleGVjdXRlKSkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICA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bHZlKGRlZmF1bHRSZXN1bHQpO1xuICAgICAgICAgICAgICAgIGlmICghZXhlY0NvbnRleHQub25seVJ1bkZvcmNlZFJlc29sdmVycyB8fFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3VsZEZvcmNlUmVzb2x2ZXJzKGZpZWxkKSkge1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlclR5cGUgPSByb290VmFsdWUuX190eXBlbmFtZSB8fCBleGVjQ29udGV4dC5kZWZhdWx0T3BlcmF0aW9uVHlwZTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZXJNYXAgPSB0aGlzLnJlc29sdmVycyAmJiB0aGlzLnJlc29sdmVyc1tyZXNvbHZlclR5cGVdO1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzb2x2ZXJNYXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgPSByZXNvbHZlck1hcFthbGlhc1VzZWQgPyBmaWVsZE5hbWUgOiBhbGlhc2VkRmllbGROYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNvbHZlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0UHJvbWlzZSA9IFByb21pc2UucmVzb2x2ZShjYWNoZVNsb3Qud2l0aFZhbHVlKHRoaXMuY2FjaGUsIHJlc29sdmUsIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmd1bWVudHNPYmplY3RGcm9tRmllbGQoZmllbGQsIHZhcmlhYmxlcyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4ZWNDb250ZXh0LmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgZmllbGQ6IGZpZWxkLCBmcmFnbWVudE1hcDogZXhlY0NvbnRleHQuZnJhZ21lbnRNYXAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIFsyLCByZXN1bHRQcm9taXNlLnRoZW4oZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PT0gdm9pZCAwKSB7IHJlc3VsdCA9IGRlZmF1bHRSZXN1bHQ7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC5kaXJlY3RpdmVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmllbGQuZGlyZWN0aXZlcy5mb3JFYWNoKGZ1bmN0aW9uIChkaXJlY3RpdmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpcmVjdGl2ZS5uYW1lLnZhbHVlID09PSAnZXhwb3J0JyAmJiBkaXJlY3RpdmUuYXJndW1lbnRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXJlY3RpdmUuYXJndW1lbnRzLmZvckVhY2goZnVuY3Rpb24gKGFyZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmcubmFtZS52YWx1ZSA9PT0gJ2FzJyAmJiBhcmcudmFsdWUua2luZCA9PT0gJ1N0cmluZ1ZhbHVlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGVjQ29udGV4dC5leHBvcnRlZFZhcmlhYmxlc1thcmcudmFsdWUudmFsdWVdID0gcmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZpZWxkLnNlbGVjdGlvblNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkocmVzdWx0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5yZXNvbHZlU3ViU2VsZWN0ZWRBcnJheShmaWVsZCwgcmVzdWx0LCBleGVjQ29udGV4dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmllbGQuc2VsZWN0aW9uU2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF90aGlzLnJlc29sdmVTZWxlY3Rpb25TZXQoZmllbGQuc2VsZWN0aW9uU2V0LCByZXN1bHQsIGV4ZWNDb250ZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSldO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgTG9jYWxTdGF0ZS5wcm90b3R5cGUucmVzb2x2ZVN1YlNlbGVjdGVkQXJyYXkgPSBmdW5jdGlvbiAoZmllbGQsIHJlc3VsdCwgZXhlY0NvbnRleHQpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgcmV0dXJuIFByb21pc2UuYWxsKHJlc3VsdC5tYXAoZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICAgIGlmIChpdGVtID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShpdGVtKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5yZXNvbHZlU3ViU2VsZWN0ZWRBcnJheShmaWVsZCwgaXRlbSwgZXhlY0NvbnRleHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGZpZWxkLnNlbGVjdGlvblNldCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5yZXNvbHZlU2VsZWN0aW9uU2V0KGZpZWxkLnNlbGVjdGlvblNldCwgaXRlbSwgZXhlY0NvbnRleHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KSk7XG4gICAgfTtcbiAgICByZXR1cm4gTG9jYWxTdGF0ZTtcbn0oKSk7XG5leHBvcnQgeyBMb2NhbFN0YXRlIH07XG4vLyMgc291cmNlTWFwcGluZ1VSTD1Mb2NhbFN0YXRlLmpzLm1hcCIsInZhciBNdXRhdGlvblN0b3JlID0gKGZ1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBNdXRhdGlvblN0b3JlKCkge1xuICAgICAgICB0aGlzLnN0b3JlID0ge307XG4gICAgfVxuICAgIE11dGF0aW9uU3RvcmUucHJvdG90eXBlLmdldFN0b3JlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zdG9yZTtcbiAgICB9O1xuICAgIE11dGF0aW9uU3RvcmUucHJvdG90eXBlLmdldCA9IGZ1bmN0aW9uIChtdXRhdGlvbklkKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnN0b3JlW211dGF0aW9uSWRdO1xuICAgIH07XG4gICAgTXV0YXRpb25TdG9yZS5wcm90b3R5cGUuaW5pdE11dGF0aW9uID0gZnVuY3Rpb24gKG11dGF0aW9uSWQsIG11dGF0aW9uLCB2YXJpYWJsZXMpIHtcbiAgICAgICAgdGhpcy5zdG9yZVttdXRhdGlvbklkXSA9IHtcbiAgICAgICAgICAgIG11dGF0aW9uOiBtdXRhdGlvbixcbiAgICAgICAgICAgIHZhcmlhYmxlczogdmFyaWFibGVzIHx8IHt9LFxuICAgICAgICAgICAgbG9hZGluZzogdHJ1ZSxcbiAgICAgICAgICAgIGVycm9yOiBudWxsLFxuICAgICAgICB9O1xuICAgIH07XG4gICAgTXV0YXRpb25TdG9yZS5wcm90b3R5cGUubWFya011dGF0aW9uRXJyb3IgPSBmdW5jdGlvbiAobXV0YXRpb25JZCwgZXJyb3IpIHtcbiAgICAgICAgdmFyIG11dGF0aW9uID0gdGhpcy5zdG9yZVttdXRhdGlvbklkXTtcbiAgICAgICAgaWYgKG11dGF0aW9uKSB7XG4gICAgICAgICAgICBtdXRhdGlvbi5sb2FkaW5nID0gZmFsc2U7XG4gICAgICAgICAgICBtdXRhdGlvbi5lcnJvciA9IGVycm9yO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBNdXRhdGlvblN0b3JlLnByb3RvdHlwZS5tYXJrTXV0YXRpb25SZXN1bHQgPSBmdW5jdGlvbiAobXV0YXRpb25JZCkge1xuICAgICAgICB2YXIgbXV0YXRpb24gPSB0aGlzLnN0b3JlW211dGF0aW9uSWRdO1xuICAgICAgICBpZiAobXV0YXRpb24pIHtcbiAgICAgICAgICAgIG11dGF0aW9uLmxvYWRpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIG11dGF0aW9uLmVycm9yID0gbnVsbDtcbiAgICAgICAgfVxuICAgIH07XG4gICAgTXV0YXRpb25TdG9yZS5wcm90b3R5cGUucmVzZXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMuc3RvcmUgPSB7fTtcbiAgICB9O1xuICAgIHJldHVybiBNdXRhdGlvblN0b3JlO1xufSgpKTtcbmV4cG9ydCB7IE11dGF0aW9uU3RvcmUgfTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPU11dGF0aW9uU3RvcmUuanMubWFw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JZCgpO1xuICAgICAgICB2YXIgb3BEZWYgPSBnZXRPcGVyYXRpb25EZWZpbml0aW9uKG9wdGlvbnMucXVlcnkpO1xuICAgICAgICBfdGhpcy5xdWVyeU5hbWUgPSBvcERlZiAmJiBvcERlZi5uYW1lICYmIG9wRGVmLm5hbWUudmFsdWU7XG4gICAgICAgIF90aGlzLnF1ZXJ5TWFuYWdlciA9IHF1ZXJ5TWFuYWdlcjtcbiAgICAgICAgX3RoaXMucXVlcnlJbmZvID0gcXVlcnlJbmZvO1xuICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgfVxuICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShPYnNlcnZhYmxlUXVlcnkucHJvdG90eXBlLCBcInZhcmlhYmxlc1wiLCB7XG4gICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMub3B0aW9ucy52YXJpYWJsZXM7XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9KTtcbiAgICBPYnNlcnZhYmxlUXVlcnkucHJvdG90eXBlLnJlc3VsdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgIHZhciBvYnNlcnZlciA9IHtcbiAgICAgICAgICAgICAgICBuZXh0OiBmdW5jdGlvbiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmUocmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMub2JzZXJ2ZXJzLmRlbGV0ZShvYnNlcnZlcik7XG4gICAgICAgICAgICAgICAgICAgIGlmICghX3RoaXMub2JzZXJ2ZXJzLnNpemUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90a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J2ZSgpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIE9ic2VydmFibGVRdWVyeS5wcm90b3R5cGUuc3Vic2NyaWJlVG9Nb3JlID0gZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdmFyIHN1YnNjcmlwdGlvbiA9IHRoaXMucXVlcnlNYW5hZ2VyXG4gICAgICAgICAgICAuc3RhcnRHcmFwaFFMU3Vic2NyaXB0aW9uKHtcbiAgICAgICAgICAgIHF1ZXJ5OiBvcHRpb25zLmRvY3VtZW50LFxuICAgICAgICAgICAgdmFyaWFibGVzOiBvcHRpb25zLnZhcmlhYmxlcyxcbiAgICAgICAgICAgIGNvbnRleHQ6IG9wdGlvbnMuY29udGV4dCxcbiAgICAgICAgfSlcbiAgICAgICAgICAgIC5zdWJzY3JpYmUoe1xuICAgICAgICAgICAgbmV4dDogZnVuY3Rpb24gKHN1YnNjcmlwdGlvbkRhdGEpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlUXVlcnkgPSBvcHRpb25zLnVwZGF0ZVF1ZXJ5O1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVRdWVyeSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy51cGRhdGVRdWVyeShmdW5jdGlvbiAocHJldmlvdXMsIF9hKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFyaWFibGVzID0gX2EudmFyaWFibGVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVwZGF0ZVF1ZXJ5KHByZXZpb3VzLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uRGF0YTogc3Vic2NyaXB0aW9uRGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXJpYWJsZXM6IHZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZXJyb3I6IGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbkVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25FcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSBcInByb2R1Y3Rpb25cIiB8fCBpbnZhcmlhbnQuZXJyb3IoJ1VuaGFuZGxlZCBHcmFwaFFMIHN1YnNjcmlwdGlvbiBlcnJvcicsIGVycik7XG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5zdWJzY3JpcHRpb25zLmFkZChzdWJzY3JpcHRpb24pO1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKF90aGlzLnN1YnNjcmlwdGlvbnMuZGVsZXRlKHN1YnNjcmlwdGlvbikpIHtcbiAgICAgICAgICAgICAgICBzdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICB9O1xuICAgIE9ic2VydmFibGVRdWVyeS5wcm90b3R5cGUuc2V0T3B0aW9ucyA9IGZ1bmN0aW9uIChuZXdPcHRpb25zKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnJlb2JzZXJ2ZShuZXdPcHRpb25zKTtcbiAgICB9O1xuICAgIE9ic2VydmFibGVRdWVyeS5wcm90b3R5cGUuc2V0VmFyaWFibGVzID0gZnVuY3Rpb24gKHZhcmlhYmxlcykge1xuICAgICAgICBpZiAoZXF1YWwodGhpcy52YXJpYWJsZXMsIHZhcmlhYmxlcykpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9ic2VydmVycy5zaXplXG4gICAgICA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SB7XG4gICAgICAgICAgICB0aGlzLnNldE9ic2VydmFibGVRdWVyeShxdWVyeS5vYnNlcnZhYmxlUXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChxdWVyeS5sYXN0UmVxdWVzdElkKSB7XG4gICAgICAgICAgICB0aGlzLmxhc3RSZXF1ZXN0SWQgPSBxdWVyeS5sYXN0UmVxdWVzdElkO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH07XG4gICAgUXVlcnlJbmZvLnByb3RvdHlwZS5nZXREaWZmID0gZnVuY3Rpb24gKHZhcmlhYmxlcykge1xuICAgICAgICBpZiAodmFyaWFibGVzID09PSB2b2lkIDApIHsgdmFyaWFibGVzID0gdGhpcy52YXJpYWJsZXM7IH1cbiAgICAgICAgaWYgKHRoaXMuZGlmZiAmJiBlcXVhbCh2YXJpYWJsZXMsIHRoaXMudmFyaWFibGVzKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGlmZjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnVwZGF0ZVdhdGNoKHRoaXMudmFyaWFibGVzID0gdmFyaWFibGVzKTtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGlmZiA9IHRoaXMuY2FjaGUuZGlmZih7XG4gICAgICAgICAgICBxdWVyeTogdGhpcy5kb2N1bWVudCxcbiAgICAgICAgICAgIHZhcmlhYmxlczogdmFyaWFibGVzLFxuICAgICAgICAgICAgcmV0dXJuUGFydGlhbERhdGE6IHRydWUsXG4gICAgICAgICAgICBvcHRpbWlzdGljOiB0cnVlLFxuICAgICAgICB9KTtcbiAgICB9O1xuICAgIFF1ZXJ5SW5mby5wcm90b3R5cGUuc2V0RGlmZiA9IGZ1bmN0aW9uIChkaWZmKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBvbGREaWZmID0gdGhpcy5kaWZmO1xuICAgICAgICB0aGlzLmRpZmYgPSBkaWZmO1xuICAgICAgICBpZ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lzO1xuICAgICAgICB0aGlzLmdyYXBoUUxFcnJvcnMgPSBpc05vbkVtcHR5QXJyYXkocmVzdWx0LmVycm9ycykgPyByZXN1bHQuZXJyb3JzIDogW107XG4gICAgICAgIGlmIChvcHRpb25zLmZldGNoUG9saWN5ID09PSAnbm8tY2FjaGUnKSB7XG4gICAgICAgICAgICB0aGlzLmRpZmYgPSB7IHJlc3VsdDogcmVzdWx0LmRhdGEsIGNvbXBsZXRlOiB0cnVlIH07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoYWxsb3dDYWNoZVdyaXRlKSB7XG4gICAgICAgICAgICBpZiAoc2hvdWxkV3JpdGVSZXN1bHQocmVzdWx0LCBvcHRpb25zLmVycm9yUG9saWN5KSkge1xuICAgICAgICAgICAgICAgIHRoaXMuY2FjaGUucGVyZm9ybVRyYW5zYWN0aW9uKGZ1bmN0aW9uIChjYWNoZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoX3RoaXMuc2hvdWxkV3JpdGUocmVzdWx0LCBvcHRpb25zLnZhcmlhYmxlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlLndyaXRlUXVlcnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXJ5OiBfdGhpcy5kb2N1bWVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiByZXN1bHQuZGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXJpYWJsZXM6IG9wdGlvbnMudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5sYXN0V3JpdGUgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0OiByZXN1bHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFibGVzOiBvcHRpb25zLnZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbUNvdW50OiBkZXN0cnVjdGl2ZU1ldGhvZENvdW50cy5nZXQoX3RoaXMuY2FjaGUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfdGhpcy5kaWZmICYmIF90aGlzLmRpZmYuY29tcGxldGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuZGF0YSA9IF90aGlzLmRpZmYucmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgZGlmZiA9IGNhY2hlLmRpZmYoe1xuICAgICAgICAgICAgICAgICAgICAgICAgcXVlcnk6IF90aGlzLmRvY3VtZW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFibGVzOiBvcHRpb25zLnZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVyblBhcnRpYWxEYXRhOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW1pc3RpYzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLnVwZGF0ZVdhdGNoKG9wdGlvbnMudmFyaWFibGVzKTtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuZGlmZiA9IGRpZmY7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkaWZmLmNvbXBsZXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuZGF0YSA9IGRpZmYucmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGl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YXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZVVwZGF0ZVF1ZXJpZXNJbmZvID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXQgPSB7fTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXBkYXRlUXVlcmllc0J5TmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5xdWVyaWVzLmZvckVhY2goZnVuY3Rpb24gKF9hLCBxdWVyeUlkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JzZXJ2YWJsZVF1ZXJ5ID0gX2Eub2JzZXJ2YWJsZVF1ZXJ5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9ic2VydmFibGVRdWVyeSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBxdWVyeU5hbWUgPSBvYnNlcnZhYmxlUXVlcnkucXVlcnlOYW1lO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChxdWVyeU5hbWUgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzT3duUHJvcGVydHkuY2FsbCh1cGRhdGVRdWVyaWVzQnlOYW1lLCBxdWVyeU5hbWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldFtxdWVyeUlkXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZXI6IHVwZGF0ZVF1ZXJpZXNCeU5hbWVbcXVlcnlOYW1lXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXJ5SW5mbzogX3RoaXMucXVlcmllcy5nZXQocXVlcnlJZCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm11dGF0aW9uU3RvcmUuaW5pdE11dGF0aW9uKG11dGF0aW9uSWQsIG11dGF0aW9uLCB2YXJpYWJsZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGltaXN0aWNSZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGltaXN0aWNfMSA9IHR5cGVvZiBvcHRpbWlzdGljUmVzcG9uc2UgPT09ICdmdW5jdGlvbidcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvcHRpbWlzdGljUmVzcG9uc2UodmFyaWFibGVzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG9wdGltaXN0aWNSZXNwb25zZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNhY2hlLnJlY29yZE9wdGltaXN0aWNUcmFuc2FjdGlvbihmdW5jdGlvbiAoY2FjaGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmtNdXRhdGlvblJlc3VsdCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXV0YXRpb25JZDogbXV0YXRpb25JZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQ6IHsgZGF0YTogb3B0aW1pc3RpY18xIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQ6IG11dGF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhcmlhYmxlczogdmFyaWFibGVzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yUG9saWN5OiBlcnJvclBvbGljeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWVyeVVwZGF0ZXJzQnlJZDogZ2VuZXJhdGVVcGRhdGVRdWVyaWVzSW5mbygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZTogdXBkYXRlV2l0aFByb3h5Rm4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBjYWNoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gXCJwcm9kdWN0aW9uXCIgfHwgaW52YXJpYW50LmVycm9yKGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG11dGF0aW9uSWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5icm9hZGNhc3RRdWVyaWVzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmID0gdGhpcztcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiwgbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RvcmVSZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlcnJvcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5nZXRPYnNlcnZhYmxlRnJvbUxpbmsobXV0YXRpb24sIF9fYXNzaWduKF9fYXNzaWduKHt9LCBjb250ZXh0KSwgeyBvcHRpbWlzdGljUmVzcG9uc2U6IG9wdGltaXN0aWNSZXNwb25zZSB9KSwgdmFyaWFibGVzLCBmYWxzZSkuc3Vic2NyaWJlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQ6IGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JhcGhRTFJlc3VsdEhhc0Vycm9yKHJlc3VsdCkgJiYgZXJyb3JQb2xpY3kgPT09ICdub25lJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvciA9IG5ldyBBcG9sbG9FcnJvcih7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmFwaFFMRXJyb3JzOiByZXN1bHQuZXJyb3JzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm11dGF0aW9uU3RvcmUubWFya011dGF0aW9uUmVzdWx0KG11dGF0aW9uSWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmZXRjaFBvbGljeSAhPT0gJ25vLWNhY2hlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFya011dGF0aW9uUmVzdWx0KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdXRhdGlvbklkOiBtdXRhdGlvbklkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdDogcmVzdWx0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50OiBtdXRhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXJpYWJsZXM6IHZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvclBvbGljeTogZXJyb3JQb2xpY3ksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVlcnlVcGRhdGVyc0J5SWQ6IGdlbmVyYXRlVXBkYXRlUXVlcmllc0luZm8oKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGU6IHVwZGF0ZVdpdGhQcm94eUZuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2VsZi5jYWNoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yID0gbmV3IEFwb2xsb0Vycm9yKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXR3b3JrRXJyb3I6IGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZVJlc3VsdCA9IHJlc3VsdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubXV0YXRpb25TdG9yZS5tYXJrTXV0YXRpb25FcnJvcihtdXRhdGlvbklkLCBlcnIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpbWlzdGljUmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5jYWNoZS5yZW1vdmVPcHRpbWlzdGljKG11dGF0aW9uSWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmJyb2FkY2FzdFF1ZXJpZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEFwb2xsb0Vycm9yKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV0d29ya0Vycm9yOiBlcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubXV0YXRpb25TdG9yZS5tYXJrTXV0YXRpb25FcnJvcihtdXRhdGlvbklkLCBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpbWlzdGljUmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5jYWNoZS5yZW1vdmVPcHRpbWlzdGljKG11dGF0aW9uSWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmJyb2FkY2FzdFF1ZXJpZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlZmV0Y2hRdWVyaWVzID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZmV0Y2hRdWVyaWVzID0gcmVmZXRjaFF1ZXJpZXMoc3RvcmVSZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVmZXRjaFF1ZXJ5UHJvbWlzZXMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNOb25FbXB0eUFycmF5KHJlZmV0Y2hRdWVyaWVzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZldGNoUXVlcmllcy5mb3JFYWNoKGZ1bmN0aW9uIChyZWZldGNoUXVlcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVmZXRjaFF1ZXJ5ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucXVlcmllcy5mb3JFYWNoKGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JzZXJ2YWJsZVF1ZXJ5ID0gX2Eub2JzZXJ2YWJsZVF1ZXJ5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2JzZXJ2YWJsZVF1ZXJ5ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYnNlcnZhYmxlUXVlcnkucXVlcnlOYW1lID09PSByZWZldGNoUXVlcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZmV0Y2hRdWVyeVByb21pc2VzLnB1c2gob2JzZXJ2YWJsZVF1ZXJ5LnJlZmV0Y2goKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBxdWVyeU9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXJ5OiByZWZldGNoUXVlcnkucXVlcnksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhcmlhYmxlczogcmVmZXRjaFF1ZXJ5LnZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmV0Y2hQb2xpY3k6ICduZXR3b3JrLW9ubHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlZmV0Y2hRdWVyeS5jb250ZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXJ5T3B0aW9ucy5jb250ZXh0ID0gcmVmZXRjaFF1ZXJ5LmNvbnRleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZmV0Y2hRdWVyeVByb21pc2VzLnB1c2goc2VsZi5xdWVyeShxdWVyeU9wdGlvbnMpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFByb21pc2UuYWxsKGF3YWl0UmVmZXRjaFF1ZXJpZXMgPyByZWZldGNoUXVlcnlQcm9taXNlcyA6IFtdKS50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yUG9saWN5ID09PSAnaWdub3JlJyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmVSZXN1bHQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyYXBoUUxSZXN1bHRIYXNFcnJvcihzdG9yZVJlc3VsdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBzdG9yZVJlc3VsdC5lcnJvcnM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShzdG9yZVJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcmVqZWN0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBRdWVyeU1hbmFnZXIucHJvdG90eXBlLmZldGNoUXVlcnkgPSBmdW5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biAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWVyeTogcXVlcnksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0OiByZXN1bHQuZGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhSWQ6ICdST09UX1NVQlNDUklQVElPTicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFibGVzOiB2YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBfdGhpcy5icm9hZGNhc3RRdWVyaWVzKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChncmFwaFFMUmVzdWx0SGFzRXJyb3IocmVzdWx0KSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXBvbGxvRXJyb3Ioe1xuICAgICAgICAgICAgICAgICAgICAgICAgZ3JhcGhRTEVycm9yczogcmVzdWx0LmVycm9ycyxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHRoaXMudHJhbnNmb3JtKHF1ZXJ5KS5oYXNDbGllbnRFeHBvcnRzKSB7XG4gICAgICAgICAgICB2YXIgb2JzZXJ2YWJsZVByb21pc2VfMSA9IHRoaXMubG9jYWxTdGF0ZS5hZGRFeHBvcnRlZFZhcmlhYmxlcyhxdWVyeSwgdmFyaWFibGVzLCBjb250ZXh0KS50aGVuKG1ha2VPYnNlcnZhYmxlKTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgT2JzZXJ2YWJsZShmdW5jdGlvbiAob2JzZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3ViID0gbnVsbDtcbiAgICAgICAgICAgICAgICBvYnNlcnZhYmxlUH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VzXzEgPSBfYi5pbkZsaWdodExpbmtPYnNlcnZhYmxlcywgbGluayA9IF9iLmxpbms7XG4gICAgICAgICAgICB2YXIgb3BlcmF0aW9uID0ge1xuICAgICAgICAgICAgICAgIHF1ZXJ5OiBzZXJ2ZXJRdWVyeSxcbiAgICAgICAgICAgICAgICB2YXJpYWJsZXM6IHZhcmlhYmxlcyxcbiAgICAgICAgICAgICAgICBvcGVyYXRpb25OYW1lOiBnZXRPcGVyYXRpb25OYW1lKHNlcnZlclF1ZXJ5KSB8fCB2b2lkIDAsXG4gICAgICAgICAgICAgICAgY29udGV4dDogdGhpcy5wcmVwYXJlQ29udGV4dChfX2Fzc2lnbihfX2Fzc2lnbih7fSwgY29udGV4dCksIHsgZm9yY2VGZXRjaDogIWRlZHVwbGljYXRpb24gfSkpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGNvbnRleHQgPSBvcGVyYXRpb24uY29udGV4dDtcbiAgICAgICAgICAgIGlmIChkZWR1cGxpY2F0aW9uKSB7XG4gICAgICAgICAgICAgICAgdmFyIGJ5VmFyaWFibGVzXzEgPSBpbkZsaWdodExpbmtPYnNlcnZhYmxlc18xLmdldChzZXJ2ZXJRdWVyeSkgfHwgbmV3IE1hcCgpO1xuICAgICAgICAgICAgICAgIGluRmxpZ2h0TGlua09ic2VydmFibGVzXzEuc2V0KHNlcnZlclF1ZXJ5LCBieVZhcmlhYmxlc18xKTtcbiAgICAgICAgICAgICAgICB2YXIgdmFySnNvbl8xID0gSlNPTi5zdHJpbmdpZnkodmFyaWFibGVzKTtcbiAgICAgICAgICAgICAgICBvYnNlcnZhYmxlID0gYnlWYXJpYWJsZXNfMS5nZXQodmFySnNvbl8xKTtcbiAgICAgICAgICAgICAgICBpZiAoIW9ic2VydmFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbmNhc3QgPSBuZXcgQ29uY2FzdChbXG4gICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRlKGxpbmssIG9wZXJhdGlvbilcbiAgICAgICAgICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICAgICAgICAgIGJ5VmFyaWFibGVzXzEuc2V0KHZhckpzb25fMSwgb2JzZXJ2YWJsZSA9IGNvbmNhc3QpO1xuICAgICAgICAgICAgICAgICAgICBjb25jYXN0LmNsZWFudXAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJ5VmFyaWFibGVzXzEuZGVsZXRlKHZhckpzb25fMSkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBieVZhcmlhYmxlc18xLnNpemUgPCAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5GbGlnaHRMaW5rT2JzZXJ2YWJsZXNfMS5kZWxldGUoc2VydmVyUXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBvYnNlcnZhYmxlID0gbmV3IENvbmNhc3QoW1xuICAgICAgICAgICAgICAgICAgICBleGVjdXRlKGxpbmssIG9wZXJhdGlvbilcbiAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIG9ic2VydmFibGUgPSBuZXcgQ29uY2FzdChbXG4gICAgICAgICAgICAgICAgT2JzZXJ2YWJsZS5vZih7IGRhdGE6IHt9IH0pXG4gICAgICAgICAgICBdKTtcbiAgICAgICAgICAgIGNvbnRleHQgPSB0aGlzLnByZXBhcmVDb250ZXh0KGNvbnRleHQpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBjbGllbnRRdWVyeSA9IHRoaXMudHJhbnNmb3JtKHF1ZXJ5KS5jbGllbnRRdWVyeTtcbiAgICAgICAgaWYgKGNsaWVudFF1ZXJ5KSB7XG4gICAgICAgICAgICBvYnNlcnZhYmxlID0gYXN5bmNNYXAob2JzZXJ2YWJsZSwgZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfdGhpcy5sb2NhbFN0YXRlLnJ1blJlc29sdmVycyh7XG4gICAgICAgICAgICAgICAgICAgIGRvY3VtZW50OiBjbGllbnRRdWVyeSxcbiAgICAgICAgICAgICAgICAgICAgcmVtb3RlUmVzdWx0OiByZXN1bHQsXG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQ6IGNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgIHZhcmlhYmxlczogdmFyaWFibGVzLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG9ic2VydmFibGU7XG4gICAgfTtcbiAgICBRdWVyeU1hbmFnZXIucHJvdG90eXBlLmdldFJlc3VsdHNGcm9tTGluayA9IGZ1bmN0aW9uIChxdWVyeUluZm8sIGFsbG93Q2FjaGVXcml0ZSwgb3B0aW9ucykge1xuICAgICAgICB2YXIgbGFzdFJlcXVlc3RJZCA9IHF1ZXJ5SW5mby5sYXN0UmVxdWVzdElkO1xuICAgICAgICByZXR1cm4gYXN5bmNNYXAodGhpcy5nZXRPYnNlcnZhYmxlRnJvbUxpbmsocXVlcnlJbmZvLmRvY3VtZW50LCBvcHRpb25zLmNvbnRleHQsIG9wdGlvbnMudmFyaWFibGVzKSwgZnVuY3Rpb24gKHJlc3VsdCkge1xuICAgICAgICAgICAgdmFyIGhhc0Vycm9ycyA9IGlzTm9uRW1wdHlBcnJheShyZXN1bHQuZXJyb3JzKTtcbiAgICAgICAgICAgIGlmIChsYXN0UmVxdWVzdElkID49IHF1ZXJ5SW5mby5sYXN0UmVxdWVzdElkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGhhc0Vycm9ycyAmJiBvcHRpb25zLmVycm9yUG9saWN5ID09PSBcIm5vbmVcIikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBxdWVyeUluZm8ubWFya0Vycm9yKG5ldyBBcG9sbG9FcnJvcih7XG4gICAgICAgICAgICAgICAgICAgICAgICBncmFwaFFMRXJyb3JzOiByZXN1bHQuZXJyb3JzLFxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHF1ZXJ5SW5mby5tYXJrUmVzdWx0KHJlc3VsdCwgb3B0aW9ucywgYWxsb3dDYWNoZVdyaXRlKTtcbiAgICAgICAgICAgICAgICBxdWVyeUluZm8ubWFya1JlYWR5KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgYXFyID0ge1xuICAgICAgICAgICAgICAgIGRhdGE6IHJlc3VsdC5kYXRhLFxuICAgICAgICAgICAgICAgIGxvYWRpbmc6IGZhbHNlLFxuICAgICAgICAgICAgICAgIG5ldHdvcmtTdGF0dXM6IHF1ZXJ5SW5mby5uZXR3b3JrU3RhdHVzIHx8IE5ldHdvcmtTdGF0dXMucmVhZHksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGhhc0Vycm9ycyAmJiBvcHRpb25zLmVycm9yUG9saWN5ICE9PSBcImlnbm9yZVwiKSB7XG4gICAgICAgICAgICAgICAgYXFyLmVycm9ycyA9IHJlc3VsdC5lcnJvcnM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXFyO1xuICAgICAgICB9LCBmdW5jdGlvbiAobmV0d29ya0Vycm9yKSB7XG4gICAgICAgICAgICB2YXIgZXJyb3IgPSBpc0Fwb2xsb0Vycm9yKG5ldHdvcmtFcnJvcilcbiAgICAgICAgICAgICAgICA/IG5ldHdvcmtFcnJvclxuICAgICAgICAgICAgICAgIDogbmV3IEFwb2xsb0Vycm9yKHsgbmV0d29ya0Vycm9yOiBuZXR3b3JrRXJyb3IgfSk7XG4gICAgICAgICAgICBpZiAobGFzdFJlcXVlc3RJZCA+PSBxdWVyeUluZm8ub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GZyb21EYXRhKGRhdGEpO1xuICAgICAgICB9O1xuICAgICAgICB2YXIgcmVzdWx0c0Zyb21MaW5rID0gZnVuY3Rpb24gKGFsbG93Q2FjaGVXcml0ZSkge1xuICAgICAgICAgICAgcmV0dXJuIF90aGlzLmdldFJlc3VsdHNGcm9tTGluayhxdWVyeUluZm8sIGFsbG93Q2FjaGVXcml0ZSwge1xuICAgICAgICAgICAgICAgIHZhcmlhYmxlczogdmFyaWFibGVzLFxuICAgICAgICAgICAgICAgIGNvbnRleHQ6IGNvbnRleHQsXG4gICAgICAgICAgICAgICAgZmV0Y2hQb2xpY3k6IGZldGNoUG9saWN5LFxuICAgICAgICAgICAgICAgIGVycm9yUG9saWN5OiBlcnJvclBvbGljeSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBzd2l0Y2ggKGZldGNoUG9saWN5KSB7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgY2FzZSBcImNhY2hlLWZpcnN0XCI6IHtcbiAgICAgICAgICAgICAgICB2YXIgZGlmZiA9IHJlYWRDYWNoZSgpO1xuICAgICAgICAgICAgICAgIGlmIChkaWZmLmNvbXBsZXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHRzRnJvbUNhY2hlKGRpZmYsIHF1ZXJ5SW5mby5tYXJrUmVhZHkoKSksXG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChyZXR1cm5QYXJ0aWFsRGF0YSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0c0Zyb21DYWNoZShkaWZmKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdHNGcm9tTGluayh0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0c0Zyb21MaW5rKHRydWUpLFxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlIFwiY2FjaGUtYW5kLW5ldHdvcmtcIjoge1xuICAgICAgICAgICAgICAgIHZhciBkaWZmID0gcmVhZENhY2hlKCk7XG4gICAgICAgICAgICAgICAgaWYgKGRpZmYuY29tcGxldGUgfHwgcmV0dXJuUGFydGlhbERhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdHNGcm9tQ2FjaGUoZGlmZiksXG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHRzRnJvbUxpbmsodHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdHNGcm9tTGluayh0cnVlKSxcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSBcImNhY2hlLW9ubHlcIjpcbiAgICAgICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRzRnJvbUNhY2hlKHJlYWRDYWNoZSgpLCBxdWVyeUluZm8ubWFya1JlYWR5KCkpLFxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICBjYXNlIFwibmV0d29yay1vbmx5XCI6XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtyZXN1bHRzRnJvbUxpbmsodHJ1ZSldO1xuICAgICAgICAgICAgY2FzZSBcIm5vLWNhY2hlXCI6XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtyZXN1bHRzRnJvbUxpbmsoZmFsc2UpXTtcbiAgICAgICAgICAgIGNhc2UgXCJzdGFuZGJ5XCI6XG4gICAgICAgIC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9IHVwZGF0ZXIoY3VycmVudFF1ZXJ5UmVzdWx0LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRhdGlvblJlc3VsdDogbXV0YXRpb24ucmVzdWx0LFxuICAgICAgICAgICAgICAgICAgICAgICAgcXVlcnlOYW1lOiBnZXRPcGVyYXRpb25OYW1lKGRvY3VtZW50KSB8fCB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBxdWVyeVZhcmlhYmxlczogdmFyaWFibGVzLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRRdWVyeVJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVXcml0ZXNfMS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQ6IG5leHRRdWVyeVJlc3VsdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhSWQ6ICdST09UX1FVRVJZJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWVyeTogZG9jdW1lbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFibGVzOiB2YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGNhY2hlLnBlcmZvcm1UcmFuc2FjdGlvbihmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgY2FjaGVXcml0ZXNfMS5mb3JFYWNoKGZ1bmN0aW9uICh3cml0ZSkgeyByZXR1cm4gYy53cml0ZSh3cml0ZSk7IH0pO1xuICAgICAgICAgICAgdmFyIHVwZGF0ZSA9IG11dGF0aW9uLnVwZGF0ZTtcbiAgICAgICAgICAgIGlmICh1cGRhdGUpIHtcbiAgICAgICAgICAgICAgICB1cGRhdGUoYywgbXV0YXRpb24ucmVzdWx0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ge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZW9ic2VydmUoe1xuICAgICAgICAgICAgICAgICAgICAgICAgZmV0Y2hQb2xpY3k6IFwibmV0d29yay1vbmx5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0RmV0Y2hQb2xpY3k6IF90aGlzLm9wdGlvbnMuZmV0Y2hQb2xpY3kgfHwgXCJjYWNoZS1maXJzdFwiLFxuICAgICAgICAgICAgICAgICAgICB9LCBOZXR3b3JrU3RhdHVzLnBvbGwpLnRoZW4ocG9sbCwgcG9sbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwb2xsKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgO1xuICAgICAgICB9O1xuICAgICAgICB2YXIgcG9sbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBpbmZvID0gX3RoaXMucG9sbGluZ0luZm87XG4gICAgICAgICAgICBpZiAoaW5mbykge1xuICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChpbmZvLnRpbWVvdXQpO1xuICAgICAgICAgICAgICAgIGluZm8udGltZW91dCA9IHNldFRpbWVvdXQobWF5YmVGZXRjaCwgaW5mby5pbnRlcnZhbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHBvbGwoKTtcbiAgICB9O1xuICAgIHJldHVybiBSZW9ic2VydmVyO1xufSgpKTtcbmV4cG9ydCB7IFJlb2JzZXJ2ZXIgfTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVJlb2JzZXJ2ZXIuanMubWFwIiwiZXhwb3J0IHsgQXBvbGxvQ2xpZW50LCB9IGZyb20gXCIuL0Fwb2xsb0NsaWVudC5qc1wiO1xuZXhwb3J0IHsgT2JzZXJ2YWJsZVF1ZXJ5LCB9IGZyb20gXCIuL09ic2VydmFibGVRdWVyeS5qc1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W5rLmVtcHR5ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gbmV3IEFwb2xsb0xpbmsoZnVuY3Rpb24gKCkgeyByZXR1cm4gT2JzZXJ2YWJsZS5vZigpOyB9KTtcbiAgICB9O1xuICAgIEFwb2xsb0xpbmsuZnJvbSA9IGZ1bmN0aW9uIChsaW5rcykge1xuICAgICAgICBpZiAobGlua3MubGVuZ3RoID09PSAwKVxuICAgICAgICAgICAgcmV0dXJuIEFwb2xsb0xpbmsuZW1wdHkoKTtcbiAgICAgICAgcmV0dXJuIGxpbmtzLm1hcCh0b0xpbmspLnJlZHVjZShmdW5jdGlvbiAoeCwgeSkgeyByZXR1cm4geC5jb25jYXQoeSk7IH0pO1xuICAgIH07XG4gICAgQXBvbGxvTGluay5zcGxpdCA9IGZ1bmN0aW9uICh0ZXN0LCBsZWZ0LCByaWdodCkge1xuICAgICAgICB2YXIgbGVmdExpbmsgPSB0b0xpbmsobGVmdCk7XG4gICAgICAgIHZhciByaWdodExpbmsgPSB0b0xpbmsocmlnaHQgfHwgbmV3IEFwb2xsb0xpbmsocGFzc3Rocm91Z2gpKTtcbiAgICAgICAgaWYgKGlzVGVybWluYXRpbmcobGVmdExpbmspICYmIGlzVGVybWluYXRpbmcocmlnaHRMaW5rKSkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBBcG9sbG9MaW5rKGZ1bmN0aW9uIChvcGVyYXRpb24pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGVzdChvcGVyYXRpb24pXG4gICAgICAgICAgICAgICAgICAgID8gbGVmdExpbmsucmVxdWVzdChvcGVyYXRpb24pIHx8IE9ic2VydmFibGUub2YoKVxuICAgICAgICAgICAgICAgICAgICA6IHJpZ2h0TGluay5yZXF1ZXN0KG9wZXJhdGlvbikgfHwgT2JzZXJ2YWJsZS5vZigpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4g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ICAgICAgICB2YXIgbmV4dExpbmsgPSB0b0xpbmsoc2Vjb25kKTtcbiAgICAgICAgaWYgKGlzVGVybWluYXRpbmcobmV4dExpbmspKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IEFwb2xsb0xpbmsoZnVuY3Rpb24gKG9wZXJhdGlvbikge1xuICAgICAgICAgICAgICAgIHJldHVybiBmaXJzdExpbmsucmVxdWVzdChvcGVyYXRpb24sIGZ1bmN0aW9uIChvcCkgeyByZXR1cm4gbmV4dExpbmsucmVxdWVzdChvcCkgfHwgT2JzZXJ2YWJsZS5vZigpOyB9KSB8fCBPYnNlcnZhYmxlLm9mKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgQXBvbGxvTGluayhmdW5jdGlvbiAob3BlcmF0aW9uLCBmb3J3YXJkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChmaXJzdExpbmsucmVxdWVzdChvcGVyYXRpb24sIGZ1bmN0aW9uIChvcCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV4dExpbmsucmVxdWVzdChvcCwgZm9yd2FyZCkgfHwgT2JzZXJ2YWJsZS5vZigpO1xuICAgICAgICAgICAgICAgIH0pIHx8IE9ic2VydmFibGUub2YoKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgQXBvbGxvTGluay5wcm90b3R5cGUuc3BsaXQgPSBmdW5jdGlvbiAodGVzdCwgbGVmdCwgcmlnaHQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29uY2F0KEFwb2xsb0xpbmsuc3BsaXQodGVzdCwgbGVmdCwgcmlnaHQgfHwgbmV3IEFwb2xsb0xpbmsocGFzc3Rocm91Z2gpKSk7XG4gICAgfTtcbiAgICBBcG9sbG9MaW5rLnByb3RvdHlwZS5jb25jYXQgPSBmdW5jdGlvbiAobmV4dCkge1xuICAgICAgICByZXR1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lc3NIZWFkZXJzKSwgY29udGV4dC5oZWFkZXJzKTtcbiAgICAgICAgdmFyIGNvbnRleHRDb25maWcgPSB7XG4gICAgICAgICAgICBodHRwOiBjb250ZXh0Lmh0dHAsXG4gICAgICAgICAgICBvcHRpb25zOiBjb250ZXh0LmZldGNoT3B0aW9ucyxcbiAgICAgICAgICAgIGNyZWRlbnRpYWxzOiBjb250ZXh0LmNyZWRlbnRpYWxzLFxuICAgICAgICAgICAgaGVhZGVyczogY29udGV4dEhlYWRlcnMsXG4gICAgICAgIH07XG4gICAgICAgIHZhciBfYiA9IHNlbGVjdEh0dHBPcHRpb25zQW5kQm9keShvcGVyYXRpb24sIGZhbGxiYWNrSHR0cENvbmZpZywgbGlua0NvbmZpZywgY29udGV4dENvbmZpZyksIG9wdGlvbnMgPSBfYi5vcHRpb25zLCBib2R5ID0gX2IuYm9keTtcbiAgICAgICAgdmFyIGNvbnRyb2xsZXI7XG4gICAgICAgIGlmICghb3B0aW9ucy5zaWduYWwpIHtcbiAgICAgICAgICAgIHZhciBfYyA9IGNyZWF0ZVNpZ25hbElmU3VwcG9ydGVkKCksIF9jb250cm9sbGVyID0gX2MuY29udHJvbGxlciwgc2lnbmFsID0gX2Muc2lnbmFsO1xuICAgICAgICAgICAgY29udHJvbGxlciA9IF9jb250cm9sbGVyO1xuICAgICAgICAgICAgaWYgKGNvbnRyb2xsZXIpXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5zaWduYWwgPSBzaWduYWw7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGRlZmluaXRpb25Jc011dGF0aW9uID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHJldHVybiBkLmtpbmQgPT09ICdPcGVyYXRpb25EZWZpbml0aW9uJyAmJiBkLm9wZXJhdGlvbiA9PT0gJ211dGF0aW9uJztcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHVzZUdFVEZvclF1ZXJpZXMgJiZcbiAgICAgICAgICAgICFvcGVyYXRpb24ucXVlcnkuZGVmaW5pdGlvbnMuc29tZShkZWZpbml0aW9uSXNNdXRhdGlvbikpIHtcbiAgICAgICAgICAgIG9wdGlvbnMubWV0aG9kID0gJ0dFVCc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9wdGlvbnMubWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgdmFyIF9kID0gcmV3cml0ZVVSSUZvckdFVChjaG9zZW5VUkksIGJvZHkpLCBuZXdVUkkgPSBfZC5uZXdVUkksIHBhcnNlRXJyb3IgPSBfZC5wYXJzZUVycm9yO1xuICAgICAgICAgICAgaWYgKHBhcnNlRXJyb3IpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnJvbUVycm9yKHBhcnNlRXJyb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2hvc2VuVVJJID0gbmV3VVJJO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBvcHRpb25zLmJvZHkgPSBzZXJpYWxpemVGZXRjaFBhcmFtZXRlcihib2R5LCAnUGF5bG9hZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2ggKHBhcnNlRXJyb3IpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnJvbUVycm9yKHBhcnNlRXJyb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgT2JzZXJ2YWJsZShmdW5jdGlvbiAob2JzZXJ2ZXIpIHtcbiAgICAgICAgICAgIGZldGNoZXIoY2hvc2VuVVJJLCBvcHRpb25zKVxuICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIG9wZXJhdGlvbi5zZXRDb250ZXh0KHsgcmVzcG9uc2U6IHJlc3BvbnNlIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnRoZW4ocGFyc2VBbmRDaGVja0h0dHBSZXNwb25zZShvcGVyYXRpb24pKVxuICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KHJlc3VsdCk7XG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXIuY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgIGlmIChlcnIubmFtZSA9PT0gJ0Fib3J0RXJyb3InKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgaWYgKGVyci5yZXN1bHQgJiYgZXJyLnJlc3VsdC5lcnJvcnMgJiYgZXJyLnJlc3VsdC5kYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIG9ic2VydmVyLm5leHQoZXJyLnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG9ic2VydmVyLmVycm9yKGVycik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbnRyb2xsZXIpXG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuYWJvcnQoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuICAgIH0pO1xufTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNyZWF0ZUh0dHBMaW5rLmpzLm1hcCIsImV4cG9ydCB2YXIgY3JlYXRlU2lnbmFsSWZTdXBwb3J0ZWQgPSBmdW5jdGlvbiAoKSB7XG4gICAgaWYgKHR5cGVvZiBBYm9ydENvbnRyb2xsZXIgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICByZXR1cm4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KyBlbmNvZGVVUklDb21wb25lbnQodmFsdWUpKTtcbiAgICB9O1xuICAgIGlmICgncXVlcnknIGluIGJvZHkpIHtcbiAgICAgICAgYWRkUXVlcnlQYXJhbSgncXVlcnknLCBib2R5LnF1ZXJ5KTtcbiAgICB9XG4gICAgaWYgKGJvZHkub3BlcmF0aW9uTmFtZSkge1xuICAgICAgICBhZGRRdWVyeVBhcmFtKCdvcGVyYXRpb25OYW1lJywgYm9keS5vcGVyYXRpb25OYW1lKTtcbiAgICB9XG4gICAgaWYgKGJvZHkudmFyaWFibGVzKSB7XG4gICAgICAgIHZhciBzZXJpYWxpemVkVmFyaWFibGVzID0gdm9pZCAwO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgc2VyaWFsaXplZFZhcmlhYmxlcyA9IHNlcmlhbGl6ZUZldGNoUGFyYW1ldGVyKGJvZHkudmFyaWFibGVzLCAnVmFyaWFibGVzIG1hcCcpO1xuICAgICAgICB9XG4gICAgICAgIGNhdGNoIChwYXJzZUVycm9yKSB7XG4gICAgICAgICAgICByZXR1cm4geyBwYXJzZUVycm9yOiBwYXJzZUVycm9yIH07XG4gICAgICAgIH1cbiAgICAgICAgYWRkUXVlcnlQYXJhbSgndmFyaWFibGVzJywgc2VyaWFsaXplZFZhcmlhYmxlcyk7XG4gICAgfVxuICAgIGlmIChib2R5LmV4dGVuc2lvbnMpIHtcbiAgICAgICAgdmFyIHNlcmlhbGl6ZWRFeHRlbnNpb25zID0gdm9pZCAwO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgc2VyaWFsaXplZEV4dGVuc2lvbnMgPSBzZXJpYWxpemVGZXRjaFBhcmFtZXRlcihib2R5LmV4dGVuc2lvbnMsICdFeHRlbnNpb25zIG1hcCcpO1xuICAgICAgICB9XG4gICAgICAgIGNhdGNoIChwYXJzZUVycm9yKSB7XG4gICAgICAgICAgICByZXR1cm4geyBwYXJzZUVycm9yOiBwYXJzZUVycm9yIH07XG4gICAgICAgIH1cbiAgICAgICA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hcyh2YWwpKVxuICAgICAgICAgICAgICAgIHJldHVybiBzZWVuLmdldCh2YWwpO1xuICAgICAgICAgICAgdmFyIGNvcHlfMiA9IE9iamVjdC5jcmVhdGUoT2JqZWN0LmdldFByb3RvdHlwZU9mKHZhbCkpO1xuICAgICAgICAgICAgc2Vlbi5zZXQodmFsLCBjb3B5XzIpO1xuICAgICAgICAgICAgT2JqZWN0LmtleXModmFsKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICBjb3B5XzJba2V5XSA9IGNsb25lRGVlcEhlbHBlcih2YWxba2V5XSwgc2Vlbik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBjb3B5XzI7XG4gICAgICAgIH1cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiB2YWw7XG4gICAgfVxufVxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2xvbmVEZWVwLmpzLm1hcCIsImV4cG9ydCBmdW5jdGlvbiBjb21wYWN0KCkge1xuICAgIHZhciBvYmplY3RzID0gW107XG4gICAgZm9yICh2YXIgX2kgPSAwOyBfaSA8IGFyZ3VtZW50cy5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgb2JqZWN0c1tfaV0gPSBhcmd1bWVudHNbX2ldO1xuICAgIH1cbiAgICB2YXIgcmVzdWx0ID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICBvYmplY3RzLmZvckVhY2goZnVuY3Rpb24gKG9iaikge1xuICAgICAgICBpZiAoIW9iailcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgT2JqZWN0LmtleXMob2JqKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IG9ialtrZXldO1xuICAgICAgICAgICAgaWYgKHZhbHVlICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgICAgICByZXN1bHRba2V5XSA9IHZhbHVlO1xuIC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biAgICAgICAgICAgICAgICAgICAgdmFyIHRhcmdldFZhbHVlID0gdGFyZ2V0W3NvdXJjZUtleV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2Vbc291cmNlS2V5XSAhPT0gdGFyZ2V0VmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBfdGhpcy5yZWNvbmNpbGVyLmFwcGx5KF90aGlzLCBfX3NwcmVhZEFycmF5cyhbdGFyZ2V0LCBzb3VyY2UsIHNvdXJjZUtleV0sIGNvbnRleHQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT09IHRhcmdldFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0ID0gX3RoaXMuc2hhbGxvd0NvcHlGb3JNZXJnZSh0YXJnZXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldFtzb3VyY2VLZXldID0gcmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXQgPSBfdGhpcy5zaGFsbG93Q29weUZvck1lcmdlKHRhcmdldCk7XG4gICAgICAgICAgICAgICAgICAgIHRhcmdldFtzb3VyY2VLZXldID0gc291cmNlW3NvdXJjZUtleV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzb3VyY2U7XG4gICAgfTtcbiAgICBEZWVwTWVyZ2VyLnByb3RvdHlwZS5zaGFsbG93Q29weUZvck1lcmdlID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgIGlmIChpc09iamVjdCh2YWx1ZSkgJiYgIXRoaXMucGFzdENvcGllcy5oYXModm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NlbGVjdGlvblNldCcsXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbnM6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBraW5kOiAnRnJhZ21lbnRTcHJlYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2luZDogJ05hbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogYWN0dWFsRnJhZ21lbnROYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9XG4gICAgICAgIF0sIGRvY3VtZW50LmRlZmluaXRpb25zKSB9KTtcbiAgICByZXR1cm4gcXVlcnk7XG59XG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlRnJhZ21lbnRNYXAoZnJhZ21lbnRzKSB7XG4gICAgaWYgKGZyYWdtZW50cyA9PT0gdm9pZCAwKSB7IGZyYWdtZW50cyA9IFtdOyB9XG4gICAgdmFyIHN5bVRhYmxlID0ge307XG4gICAgZnJhZ21lbnRzLmZvckVhY2goZnVuY3Rpb24gKGZyYWdtZW50KSB7XG4gICAgICAgIHN5bVRhYmxlW2ZyYWdtZW50Lm5hbWUudmFsdWVdID0gZnJhZ21lbnQ7XG4gICAgfSk7XG4gICAgcmV0dXJuIHN5bVRhYmxlO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGdldEZyYWdtZW50RnJvbVNlbGVjdGlvbihzZWxlY3Rpb24sIGZyYWdtZW50TWFwKSB7XG4gICAgc3dpdGNoIChzZWxlY3Rpb24ua2luZCkge1xuICAgICAgICBjYXNlICdJbmxpbmVGcmFnbWVudCc6XG4gICAgICAgICAgICByZXR1cm4gc2VsZWN0aW9uO1xu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YWluRGVmaW5pdGlvbihxdWVyeURvYykge1xuICAgIGNoZWNrRG9jdW1lbnQocXVlcnlEb2MpO1xuICAgIHZhciBmcmFnbWVudERlZmluaXRpb247XG4gICAgZm9yICh2YXIgX2kgPSAwLCBfYSA9IHF1ZXJ5RG9jLmRlZmluaXRpb25zOyBfaSA8IF9hLmxlbmd0aDsgX2krKykge1xuICAgICAgICB2YXIgZGVmaW5pdGlvbiA9IF9hW19pXTtcbiAgICAgICAgaWYgKGRlZmluaXRpb24ua2luZCA9PT0gJ09wZXJhdGlvbkRlZmluaXRpb24nKSB7XG4gICAgICAgICAgICB2YXIgb3BlcmF0aW9uID0gZGVmaW5pdGlvbi5vcGVyYXRpb247XG4gICAgICAgICAgICBpZiAob3BlcmF0aW9uID09PSAncXVlcnknIHx8XG4gICAgICAgICAgICAgICAgb3BlcmF0aW9uID09PSAnbXV0YXRpb24nIHx8XG4gICAgICAgICAgICAgICAgb3BlcmF0aW9uID09PSAnc3Vic2NyaXB0aW9uJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBkZWZpbml0aW9uO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChkZWZpbml0aW9uLmtpbmQgPT09ICdGcmFnbWVudERlZmluaXRpb24nICYmICFmcmFnbWVudERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIGZyYWdtZW50RGVmaW5pdGlvbiA9IGRlZmluaXRpb247XG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKGZyYWdtZW50RGVmaW5pdGlvbikge1xuICAgICAgICByZXR1cm4gZnJhZ21lbnREZWZpbml0aW9uO1xuICAgIH1cbiAgICB0aHJvdyBwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gXCJwcm9kdWN0aW9uXCIgPyBuZXcgSW52YXJpYW50RXJyb3IoNTIpIDogbmV3IEludmFyaWFudEVycm9yKCdFeHBlY3RlZCBhIHBhcnNlZCBHcmFwaFFMIHF1ZXJ5IHdpdGggYSBxdWVyeSw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9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGRpcmVjdGl2ZXNbJ2Nvbm5lY3Rpb24nXVsna2V5J107XG4gICAgICAgIH1cbiAgICB9XG4gICAgdmFyIGNvbXBsZXRlRmllbGROYW1lID0gZmllbGROYW1lO1xuICAgIGlmIChhcmdzKSB7XG4gICAgICAgIHZhciBzdHJpbmdpZmllZEFyZ3MgPSBzdHJpbmdpZnkoYXJncyk7XG4gICAgICAgIGNvbXBsZXRlRmllbGROYW1lICs9IFwiKFwiICsgc3RyaW5naWZpZWRBcmdzICsgXCIpXCI7XG4gICAgfVxuICAgIGlmIChkaXJlY3RpdmVzKSB7XG4gICAgICAgIE9iamVjdC5rZXlzKGRpcmVjdGl2ZXMpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgaWYgKEtOT1dOX0RJUkVDVElWRVMuaW5kZXhPZihrZXkpICE9PSAtMSlcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBpZiAoZGlyZWN0aXZlc1trZXldICYmIE9iamVjdC5rZXlzKGRpcmVjdGl2ZXNba2V5XSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgY29tcGxldGVGaWVsZE5hbWUgKz0gXCJAXCIgKyBrZXkgKyBcIihcIiArIEpTT04uc3RyaW5naWZ5KGRpcmVjdGl2ZXNba2V5XSkgKyBcIilcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbXBsZXRlRmllbGROYW1lICs9IFwiQFwiICsga2V5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgcmV0dXJuIGNvbXBsZXRlRmllbGROYW1lO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGFyZ3VtZW50c09iamVjdEZyb21GaWVsZChmaWVsZCwgdmFyaWFibGVzKSB7XG4gICAgaWYgKGZpZWxkLmFyZ3VtZW50cyAmJiB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lcykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgc2hvdWxkUmVtb3ZlRmllbGQgPSBkaXJlY3RpdmVzLnNvbWUoZnVuY3Rpb24gKGRpcmVjdGl2ZSkgeyByZXR1cm4gZGlyZWN0aXZlLnJlbW92ZTsgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzaG91bGRSZW1vdmVGaWVsZCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5kaXJlY3RpdmVzICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmRpcmVjdGl2ZXMuc29tZShnZXREaXJlY3RpdmVNYXRjaGVyKGRpcmVjdGl2ZXMpKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5vZGUuYXJndW1lbnRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5hcmd1bWVudHMuZm9yRWFjaChmdW5jdGlvbiAoYXJnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmcudmFsdWUua2luZCA9PT0gJ1ZhcmlhYmxlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFibGVzVG9SZW1vdmUucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogYXJnLnZhbHVlLm5hbWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5vZGUuc2VsZWN0aW9uU2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0QWxsRnJhZ21lbnRTcHJlYWRzRnJvbVNlbGVjdGlvblNldChub2RlLnNlbGVjdGlvblNldCkuZm9yRWFjaChmdW5jdGlvbiAoZnJhZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFnbWVudFNwcmVhZHNUb1JlbW92ZS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGZyYWcubmFtZS52YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIEZyYWdtZW50U3ByZWFkOiB7XG4gICAgICAgICAgICBlbnRlcjogZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgICAgICAgICBmcmFnbWVudFNwcmVhZHNJblVzZVtub2RlLm5hbWUudmFsdWVdID0gdHJ1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIERpcmVjdGl2ZToge1xuICAgICAgICAgICAgZW50ZXI6IGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGdldERpcmVjdGl2ZU1hdGNoZXIoZGlyZWN0aXZlcykobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICB9KSk7XG4gICAgaWYgKG1vZGlmaWVkRG9jICYmXG4gICAgICAgIGZpbHRlckluUGxhY2UodmFyaWFibGVzVG9SZW1vdmUsIGZ1bmN0aW9uICh2KSB7IHJldHVybiAhIXYubmFtZSAmJiAhdmFyaWFibGVzSW5Vc2Vbdi5uYW1lXTsgfSkubGVuZ3RoKSB7XG4gICAgICAgIG1vZGlmaWVkRG9jID0gcmVtb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Muc29tZShmdW5jdGlvbiAoc2VsZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoaXNGaWVsZChzZWxlY3Rpb24pICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAoc2VsZWN0aW9uLm5hbWUudmFsdWUgPT09ICdfX3R5cGVuYW1lJyB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbi5uYW1lLnZhbHVlLmxhc3RJbmRleE9mKCdfXycsIDApID09PSAwKSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgaWYgKHNraXApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgZmllbGQgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgICAgaWYgKGlzRmllbGQoZmllbGQpICYmXG4gICAgICAgICAgICAgICAgICAgIGZpZWxkLmRpcmVjdGl2ZXMgJiZcbiAgICAgICAgICAgICAgICAgICAgZmllbGQuZGlyZWN0aXZlcy5zb21lKGZ1bmN0aW9uIChkKSB7IHJldHVybiBkLm5hbWUudmFsdWUgPT09ICdleHBvcnQnOyB9KSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgbm9kZSksIHsgc2VsZWN0aW9uczogX19zcHJlYWRBcnJheXMoc2VsZWN0aW9ucywgW1RZUEVOQU1FX0ZJRUxEXSkgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgIH0pO1xufVxuYWRkVHlwZW5hbWVUb0RvY3VtZW50LmFkZGVkID0gZnVuY3Rpb24gKGZpZWxkKSB7XG4gICAgcmV0dXJuIGZpZWxkID09PSBUWVBFTkFNRV9GSUVMRDtcbn07XG52YXIgY29ubmVjdGlvblJlbW92ZUNvbmZpZyA9IHtcb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jb25maWcuc29tZShmdW5jdGlvbiAoYUNvbmZpZykge1xuICAgICAgICAgICAgcmV0dXJuIGFyZ3VtZW50LnZhbHVlICYmXG4gICAgICAgICAgICAgICAgYXJndW1lbnQudmFsdWUua2luZCA9PT0gJ1ZhcmlhYmxlJyAmJlxuICAgICAgICAgICAgICAgIGFyZ3VtZW50LnZhbHVlLm5hbWUgJiZcbiAgICAgICAgICAgICAgICAoYUNvbmZpZy5uYW1lID09PSBhcmd1bWVudC52YWx1ZS5uYW1lLnZhbHVlIHx8XG4gICAgICAgICAgICAgICAgICAgIChhQ29uZmlnLnRlc3QgJiYgYUNvbmZpZy50ZXN0KGFyZ3VtZW50KSkpO1xuICAgICAgICB9KTtcbiAgICB9O1xufVxuZXhwb3J0IGZ1bmN0aW9uIHJlbW92ZUFyZ3VtZW50c0Zyb21Eb2N1bWVudChjb25maWcsIGRvYykge1xuICAgIHZhciBhcmdNYXRjaGVyID0gZ2V0QXJndW1lbnRNYXRjaGVyKGNvbmZpZyk7XG4gICAgcmV0dXJuIG51bGxJZkRvY0lzRW1wdHkodmlzaXQoZG9jLCB7XG4gICAgICAgIE9wZXJhdGlvbkRlZmluaXRpb246IHtcbiAgICAgICAgICAgIGVudGVyOiBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgbm9kZSksIHsgdmFyaWFibGVEZWZpbml0aW9uczogbm9kZS52YXJpYWJsZURlZmluaXRpb25zID8gbm9kZS52YXJpYWJsZURlZmluaXRpb25zLmZpbHRlcihmdW5jdGlvbiAodmFyRGVmKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gIWNvbmZpZy5zb21lKGZ1bmN0aW9uIChhcmcpIHsgcmV0dXJuIGFyZy5uYW1lID09PSB2YXJEZWYudmFyaWFibGUubmFtZS52YWx1ZTsgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pIDogW10gfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBGaWVsZDoge1xuICAgICAgICAgICAgZW50ZXI6IGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNob3VsZFJlbW92ZUZpZWxkID0gY29uZmlnLnNvbWUoZnVuY3Rpb24gKGFyZ0NvbmZpZykgeyByZXR1cm4gYXJnQ29uZmlnLnJlbW92ZTsgfSk7XG4gICAgICAgICAgICAgICAgaWYgKHNob3VsZFJlbW92ZUZpZWxkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhcmdNYXRjaENvdW50XzEgPSAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAobm9kZS5hcmd1bWVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXJndW1lbnRzLmZvckVhY2goZnVuY3Rpb24gKGFyZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmdNYXRjaGVyKGFyZykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJnTWF0Y2hDb3VudF8xICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ01hdGNoQ291bnRfMSA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBBcmd1bWVudDoge1xuICAgICAgICAgICAgZW50ZXI6IGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGFyZ01hdGNoZXIobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICA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bGllbnQnOyB9LFxuICAgICAgICAgICAgcmVtb3ZlOiB0cnVlLFxuICAgICAgICB9LFxuICAgIF0sIGRvY3VtZW50KTtcbiAgICBpZiAobW9kaWZpZWREb2MpIHtcbiAgICAgICAgbW9kaWZpZWREb2MgPSB2aXNpdChtb2RpZmllZERvYywge1xuICAgICAgICAgICAgRnJhZ21lbnREZWZpbml0aW9uOiB7XG4gICAgICAgICAgICAgICAgZW50ZXI6IGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChub2RlLnNlbGVjdGlvblNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzVHlwZW5hbWVPbmx5ID0gbm9kZS5zZWxlY3Rpb25TZXQuc2VsZWN0aW9ucy5ldmVyeShmdW5jdGlvbiAoc2VsZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlzRmllbGQoc2VsZWN0aW9uKSAmJiBzZWxlY3Rpb24ubmFtZS52YWx1ZSA9PT0gJ19fdHlwZW5hbWUnO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNUeXBlbmFtZU9ubHkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG4gICAgcmV0dXJuIG1vZGlmaWVkRG9jO1xufVxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9dHJhbnNmb3JtLmpzLm1hcCIsImV4cG9ydCB7IHNob3VsZEluY2x1ZGUsIGhhc0RpcmVjdGl2ZXMsIGhhc0NsaWVudEV4cG9ydHMsIGdldERpcmVjdGl2ZU5hbWVzLCBnZXRJbmNsdXNpb25EaXJlY3RpdmVzLCB9IGZy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x5KF90aGlzLm9ic2VydmVycywgXCJuZXh0XCIsIHJlc3VsdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGVycm9yOiBmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBpZiAoX3RoaXMuc3ViICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChfdGhpcy5zdWIpXG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3ViID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMubGF0ZXN0ID0gW1wiZXJyb3JcIiwgZXJyb3JdO1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICBpdGVyYXRlT2JzZXJ2ZXJzU2FmZWx5KF90aGlzLm9ic2VydmVycywgXCJlcnJvclwiLCBlcnJvcik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNvbXBsZXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKF90aGlzLnN1YiAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBfdGhpcy5zb3VyY2VzLnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnN1YiA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX3RoaXMubGF0ZXN0ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMubGF0ZXN0WzBdID09PSBcIm5leHRcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnJlc29sdmUoX3RoaXMubGF0ZXN0WzFdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnJlc29sdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZXJhdGVPYnNlcnZlcnNTYWZlbHkoX3RoaXMub2JzZXJ2ZXJzLCBcImNvbXBsZXRlXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlzUHJvbWlzZUxpa2UodmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS50aGVuKGZ1bmN0aW9uIChvYnMpIHsgcmV0dXJuIF90aGlzLnN1YiA9IG9icy5zdWJzY3JpYmUoX3RoaXMuaGFuZGxlcnMpOyB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnN1YiA9IHZhbHVlLnN1YnNjcmliZShfdGhpcy5oYW5kbGVycyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICB9O1xuICAgICAgICBfdGhpcy5jYW5jZWwgPSBmdW5jdGlvbiAocmVhc29uKSB7XG4gICAgICAgICAgICBfdGhpcy5yZWplY3QocmVhc29uKTtcbiAgICAgICAgICAgIF90aGlzLnNvdXJjZXMgPSBbXTtcbiAgICAgICAgICAgIF90aGlzLmhhbmRsZXJzLmNvbXBsZXRlKCk7XG4gICAgICAgIH07XG4gICAgICAgIF90aGlzLnByb21pc2UuY2F0Y2goZnVuY3Rpb24gKF8pIHsgfSk7XG4gICAgICAgIGlmIChpc1Byb21pc2VMaWtlKHNvdXJjZXMpKSB7XG4gICAgICAgICAgICBzb3VyY2VzLnRoZW4oZnVuY3Rpb24gKGl0ZXJhYmxlKSB7IHJldHVybiBfdGhpcy5zdGFydChpdGVyYWJsZSk7IH0sIF90aGlzLmhhbmRsZXJzLmVycm9yKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIF90aGlzLnN0YXJ0KHNvdXJjZXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgQ29uY2FzdC5wcm90b3R5cGUuc3RhcnQgPSBmdW5jdGlvbiAoc291cmNlcykge1xuICAgICAgICBpZiAodGhpcy5zdWIgIT09IHZvaWQgMClcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgdGhpcy5zb3VyY2VzID0gQXJyYXkuZnJvbShzb3VyY2VzKTtcbiAgICAgICAgdGhpcy5oYW5kbGVycy5jb21wbGV0ZSgpO1xuICAgIH07XG4gICAgQ29uY2FzdC5wcm90b3R5cGUuYWRkT2JzZXJ2ZXIgPSBmdW5jdGlvbiAob2JzZXJ2ZXIpIHtcbiAgICAgICAgaWYgKCF0aGlzLm9ic2VydmVycy5oYXMob2JzZXJ2ZXIpKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXRlc3QpIHtcbiAgICAgICAgICAgICAgICB2YXIgbmV4dE9yRXJyb3IgPSB0aGlzLmxhdGVzdFswXTtcbiAgICAgICAgICAgICAgICB2YXIgbWV0aG9kID0gb2JzZXJ2ZXJbbmV4dE9yRXJyb3JdO1xuICAgICAgICAgICAgICAgIGlmIChtZXRob2QpIHtcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kLmNhbGwob2JzZXJ2ZXIsIHRoaXMubGF0ZXN0WzFdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuc3ViID09PSBudWxsICYmXG4gICAgICAgICAgICAgICAgICAgIG5leHRPckVycm9yID09PSBcIm5leHRcIiAmJlxuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5jb21wbGV0ZSkge1xuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5jb21wbGV0ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMub2JzZXJ2ZXJzLmFkZChvYnNlcnZlcik7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIENvbmNhc3QucHJvdG90eXBlLnJlbW92ZU9ic2VydmVyID0gZnVuY3Rpb24gKG9ic2VydmVyLCBxdWlldGx5KSB7XG4gICAgICAgIGlmICh0aGlzLm9ic2VydmVycy5kZWxldGUob2JzZXJ2ZXIpICYmXG4gICAgICAgICAgICB0aGlzLm9ic2VydmVycy5zaXplIDwgMSkge1xuICAgICAgICAgICAgaWYgKHF1aWV0bHkpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgaWYgKHRoaXMuc3ViKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnJlamVjdChuZXcgRXJyb3IoXCJPYnNlcnZhYmxlIGNhbmNlbGxlZCBwcmVtYXR1cmVseVwiKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnN1YiA9IG51bGw7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIENvbmNhc3QucHJvdG90eXBlLmNsZWFudXAgPSBmdW5jdGlvbiAoY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgdmFyIGNhbGxlZCA9IGZhbHNlO1xuICAgICAgICB2YXIgb25jZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICghY2FsbGVkKSB7XG4gICAgICAgICAgICAgICAgY2FsbGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBfdGhpcy5vYnNlcnZlcnMuZGVsZXRlKG9ic2VydmVyKTtcbiAgICAgICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgICAgfVxuICAgICAgIC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HQsIGVycm9yID0gb2JzZXJ2ZXIuZXJyb3IsIGNvbXBsZXRlID0gb2JzZXJ2ZXIuY29tcGxldGU7XG4gICAgICAgIHZhciBhY3RpdmVDYWxsYmFja0NvdW50ID0gMDtcbiAgICAgICAgdmFyIGNvbXBsZXRlZCA9IGZhbHNlO1xuICAgICAgICBmdW5jdGlvbiBtYWtlQ2FsbGJhY2soZXhhbWluZXIsIGRlbGVnYXRlKSB7XG4gICAgICAgICAgICBpZiAoZXhhbWluZXIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGFyZykge1xuICAgICAgICAgICAgICAgICAgICArK2FjdGl2ZUNhbGxiYWNrQ291bnQ7XG4gICAgICAgICAgICAgICAgICAgIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlKSB7IHJldHVybiByZXNvbHZlKGV4YW1pbmVyKGFyZykpOyB9KS50aGVuKGZ1bmN0aW9uIChyZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC0tYWN0aXZlQ2FsbGJhY2tDb3VudDtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgJiYgbmV4dC5jYWxsKG9ic2VydmVyLCByZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXBsZXRlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZXIuY29tcGxldGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC0tYWN0aXZlQ2FsbGJhY2tDb3VudDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yICYmIGVycm9yLmNhbGwob2JzZXJ2ZXIsIGUpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAg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xpY2UoMCkgOiBbXTtcbiAgICAgICAgICAgIGlmIChhcmdzKSB7XG4gICAgICAgICAgICAgICAgdmFyIF9iID0gYXJncy5vZmZzZXQsIG9mZnNldCA9IF9iID09PSB2b2lkIDAgPyAwIDogX2I7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBpbmNvbWluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICBtZXJnZWRbb2Zmc2V0ICsgaV0gPSBpbmNvbWluZ1tpXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBtZXJnZWQucHVzaC5hcHBseShtZXJnZWQsIGluY29taW5nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBtZXJnZWQ7XG4gICAgICAgIH0sXG4gICAgfTtcbn1cbmV4cG9ydCBmdW5jdGlvbiByZWxheVN0eWxlUGFnaW5hdGlvbihrZXlBcmdzKSB7XG4gICAgaWYgKGtleUFyZ3MgPT09IHZvaWQgMCkgeyBrZXlBcmdzID0gZmFsc2U7IH1cbiAgICByZXR1cm4ge1xuICAgICAgICBrZXlBcmdzOiBrZXlBcmdzLFxuICAgICAgICByZWFkOiBmdW5jdGlvbiAoZXhpc3RpbmcsIF9hKSB7XG4gICAgICAgICAgICB2YXIgY2FuUmVhZCA9IF9hLmNhblJlYWQsIHJlYWRGaWVsZCA9IF9hLnJlYWRGaWVsZDtcbiAgICAgICAgICAgIGlmICghZXhpc3RpbmcpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgdmFyIGVkZ2VzID0gW107XG4gICAgICAgICAgICB2YXIgc3RhcnRDdXJzb3IgPSBcIlwiO1xuICAgICAgICAgICAgdmFyIGVuZEN1cnNvciA9IFwiXCI7XG4gICAgICAgICAgICBleGlzdGluZy5lZGdlcy5mb3JFYWNoKGZ1bmN0aW9uIChlZGdlKSB7X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AgICAgICAgICAgICBpZiAoaXNSZWZlcmVuY2UoZWRnZSA9IF9fYXNzaWduKHt9LCBlZGdlKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgZWRnZS5jdXJzb3IgPSByZWFkRmllbGQoXCJjdXJzb3JcIiwgZWRnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBlZGdlO1xuICAgICAgICAgICAgfSkgOiBbXTtcbiAgICAgICAgICAgIGlmIChpbmNvbWluZy5wYWdlSW5mbykge1xuICAgICAgICAgICAgICAgIHZhciBwYWdlSW5mb18xID0gaW5jb21pbmcucGFnZUluZm87XG4gICAgICAgICAgICAgICAgdmFyIHN0YXJ0Q3Vyc29yID0gcGFnZUluZm9fMS5zdGFydEN1cnNvciwgZW5kQ3Vyc29yID0gcGFnZUluZm9fMS5lbmRDdXJzb3I7XG4gICAgICAgICAgICAgICAgdmFyIGZpcnN0RWRnZSA9IGluY29taW5nRWRnZXNbMF07XG4gICAgICAgICAgICAgICAgdmFyIGxhc3RFZGdlID0gaW5jb21pbmdFZGdlc1tpbmNvbWluZ0VkZ2VzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICAgIGlmIChmaXJzdEVkZ2UgJiYgc3RhcnRDdXJzb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgZmlyc3RFZGdlLmN1cnNvciA9IHN0YXJ0Q3Vyc29yO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAobGFzdEVkZ2UgJiYgZW5kQ3Vyc29yKSB7XG4gICAgICAgICAgICAgICAgICAgIGxhc3RFZGdlLmN1cnNvciA9IGVuZEN1cnNvcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGZpcnN0Q3Vyc29yID0gZmlyc3RFZGdlICYmIGZpcnN0RWRnZS5jdXJzb3I7XG4gICAgICAgICAgICAgICAgaWYgKGZpcnN0Q3Vyc29yICYmICFzdGFydEN1cnNvcikge1xuICAgICAgICAgICAgICAgICAgICBpbmNvbWluZyA9IG1lcmdlRGVlcChpbmNvbWluZywge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZUluZm86IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydEN1cnNvcjogZmlyc3RDdXJzb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGxhc3RDdXJzb3IgPSBsYXN0RWRnZSAmJiBsYXN0RWRnZS5jdXJzb3I7XG4gICAgICAgICAgICAgICAgaWYgKGxhc3RDdXJzb3IgJiYgIWVuZEN1cnNvcikge1xuICAgICAgICAgICAgICAgICAgICBpbmNvbWluZyA9IG1lcmdlRGVlcChpbmNvbWluZywge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZUluZm86IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRDdXJzb3I6IGxhc3RDdXJzb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgcHJlZml4ID0gZXhpc3RpbmcuZWRnZXM7XG4gICAgICAgICAgICB2YXIgc3VmZml4ID0gW107XG4gICAgICAgICAgICBpZiAoYXJncyAmJiBhcmdzLmFmdGVyKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gcHJlZml4LmZpbmRJbmRleChmdW5jdGlvbiAoZWRnZSkgeyByZXR1cm4gZWRnZS5jdXJzb3IgPT09IGFyZ3MuYWZ0ZXI7IH0pO1xuICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHByZWZpeCA9IHByZWZpeC5zbGljZSgwLCBpbmRleCArIDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGFyZ3MgJiYgYXJncy5iZWZvcmUpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBwcmVmaXguZmluZEluZGV4KGZ1bmN0aW9uIChlZGdlKSB7IHJldHVybiBlZGdlLmN1cnNvciA9PT0gYXJncy5iZWZvcmU7IH0pO1xuICAgICAgICAgICAgICAgIHN1ZmZpeCA9IGluZGV4IDwgMCA/IHByZWZpeCA6IHByZWZpeC5zbGljZShpbmRleCk7XG4gICAgICAgICAgICAgICAgcHJlZml4ID0gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChpbmNvbWluZy5lZGdlcykge1xuICAgICAgICAgICAgICAgIHByZWZpeCA9IFtdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGVkZ2VzID0gX19zcHJlYWRBcnJheXMocHJlZml4LCBpbmNvbWluZ0VkZ2VzLCBzdWZmaXgpO1xuICAgICAgICAgICAgdmFyIHBhZ2VJbmZvID0gX19hc3NpZ24oX19hc3NpZ24oe30sIGluY29taW5nLnBhZ2VJbmZvKSwgZXhpc3RpbmcucGFnZUluZm8pO1xuICAgICAgICAgICAgaWYgKGluY29taW5nLnBhZ2VJbmZvKSB7XG4gICAgICAgICAgICAgICAgdmFyIF9iID0gaW5jb21pbmcucGFnZUluZm8sIGhhc1ByZXZpb3VzUGFnZSA9IF9iLmhhc1ByZXZpb3VzUGFnZSwgaGFzTmV4dFBhZ2UgPSBfYi5oYXNOZXh0UGFnZSwgc3RhcnRDdXJzb3IgPSBfYi5zdGFydEN1cnNvciwgZW5kQ3Vyc29yID0gX2IuZW5kQ3Vyc29yO1xuICAgICAgICAgICAgICAgIGlmICghcHJlZml4Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodm9pZCAwICE9PSBoYXNQcmV2aW91c1BhZ2UpXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlSW5mby5oYXNQcmV2aW91c1BhZ2UgPSBoYXNQcmV2aW91c1BhZ2U7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2b2lkIDAgIT09IHN0YXJ0Q3Vyc29yKVxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZUluZm8uc3RhcnRDdXJzb3IgPSBzdGFydEN1cnNvcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWZmaXgubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2b2lkIDAgIT09IGhhc05leHRQYWdlKVxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZUluZm8uaGFzTmV4dFBhZ2UgPSBoYXNOZXh0UGFnZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZvaWQgMCAhPT0gZW5kQ3Vyc29yKVxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZUluZm8uZW5kQ3Vyc29yID0gZW5kQ3Vyc29yO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBfX2Fzc2lnbihfX2Fzc2lnbihfX2Fzc2lnbih7fSwgZ2V0RXh0cmFzKGV4aXN0aW5nKSksIGdldEV4dHJhcyhpbmNvbWluZykpLCB7IGVkZ2VzOiBlZGdlcyxcbiAgICAgICAgICAgICAgICBwYWdlSW5mbzogcGFnZUluZm8gfSk7XG4gICAgICAgIH0sXG4gICAgfTtcbn1cbnZhciBnZXRFeHRyYXMgPSBmdW5jdGlvbiAob2JqKSB7IHJldHVybiBfX3Jlc3Qob2JqLCBub3RFeHRyYXMpOyB9O1xudmFyIG5vdEV4dHJhcyA9IFtcImVkZ2VzXCIsIFwicGFnZUluZm9cIl07XG5mdW5jdGlvbiBtYWtlRW1wdHlEYXRhKCkge1xuICAgIHJldHVybiB7XG4gICAgICAgIGVkZ2VzOiBbXSxcbiAgICAgICAgcGFnZUluZm86IHtcbiAgICAgICAgICAgIGhhc1ByZXZpb3VzUGFnZTogZmFs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W5jZSB0byB0aGUgU2xvdCBvYmplY3QuXHJcbiAgICAgICAgICAgIGlmICh0aGlzLmlkIGluIGNvbnRleHRfMS5zbG90cykge1xyXG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gY29udGV4dF8xLnNsb3RzW3RoaXMuaWRdO1xyXG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSBNSVNTSU5HX1ZBTFVFKVxyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgaWYgKGNvbnRleHRfMSAhPT0gY3VycmVudENvbnRleHQpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBDYWNoZSB0aGUgdmFsdWUgaW4gY3VycmVudENvbnRleHQuc2xvdHMgc28gdGhlIG5leHQgbG9va3VwIHdpbGxcclxuICAgICAgICAgICAgICAgICAgICAvLyBiZSBmYXN0ZXIuIFRoaXMgY2FjaGluZyBpcyBzYWZlIGJlY2F1c2UgdGhlIHRyZWUgb2YgY29udGV4dHMgYW5kXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHZhbHVlcyBvZiB0aGUgc2xvdHMgYXJlIGxvZ2ljYWxseSBpbW11dGFibGUuXHJcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudENvbnRleHQuc2xvdHNbdGhpcy5pZF0gPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChjdXJyZW50Q29udGV4dCkge1xyXG4gICAgICAgICAgICAvLyBJZiBhIHZhbHVlIHdhcyBub3QgZm91bmQgZm9yIHRoaXMgU2xvdCwgaXQncyBuZXZlciBnb2luZyB0byBiZSBmb3VuZFxyXG4gICAgICAgICAgICAvLyBubyBtYXR0ZXIgaG93IG1hbnkgdGltZXMgd2UgbG9vayBpdCB1cCwgc28gd2UgbWlnaHQgYXMgd2VsbCBj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cnkge1xyXG4gICAgICAgICAgICAvLyBGdW5jdGlvbi5wcm90b3R5cGUuYXBwbHkgYWxsb3dzIHRoZSBhcmd1bWVudHMgYXJyYXkgYXJndW1lbnQgdG8gYmVcclxuICAgICAgICAgICAgLy8gb21pdHRlZCBvciB1bmRlZmluZWQsIHNvIGFyZ3MhIGlzIGZpbmUgaGVyZS5cclxuICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrLmFwcGx5KHRoaXNBcmcsIGFyZ3MpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBmaW5hbGx5IHtcclxuICAgICAgICAgICAgY3VycmVudENvbnRleHQgPSBwYXJlbnQ7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIC8vIENhcHR1cmUgdGhlIGN1cnJlbnQgY29udGV4dCBhbmQgd3JhcCBhIGNhbGxiYWNrIGZ1bmN0aW9uIHNvIHRoYXQgaXRcclxuICAgIC8vIHJlZXN0YWJsaXNoZXMgdGhlIGNhcHR1cmVkIGNvbnRleHQgd2hlbiBjYWxsZWQuXHJcbiAgICBTbG90LmJpbmQgPSBmdW5jdGlvbiAoY2FsbGJhY2spIHtcclxuICAgICAgICB2YXIgY29udGV4dCA9IGN1cnJlbnRDb250ZXh0O1xyXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgIHZhciBzYXZlZCA9IGN1cnJlbnRDb250ZXh0O1xyXG4gICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgY3VycmVudENvbnRleHQgPSBjb250ZXh0O1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZmluYWxseSB7XHJcbiAgICAgICAgICAgICAgICBjdXJyZW50Q29udGV4dCA9IHNhdmVkO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgIH07XHJc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UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICBmdW5jdGlvbiBpbnZva2UobWV0aG9kLCBhcmd1bWVudCkge1xyXG4gICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gbWV0aG9kLmNhbGwoZ2VuLCBhcmd1bWVudCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KGVycm9yKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHZhciBuZXh0ID0gcmVzdWx0LmRvbmUgPyByZXNvbHZlIDogaW52b2tlTmV4dDtcclxuICAgICAgICAgICAgICAgIGlmIChpc1Byb21pc2VMaWtlKHJlc3VsdC52YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXN1bHQudmFsdWUudGhlbihuZXh0LCByZXN1bHQuZG9uZSA/IHJlamVjdCA6IGludm9rZVRocm93KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIG5leHQocmVzdWx0LnZhbHVlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB2YXIgaW52b2tlTmV4dCA9IGZ1bmN0aW9uICh2YWx1ZSkgeyByZXR1cm4gaW52b2tlKGJvdW5kTmV4dCwgdmFsdWUpOyB9O1xyXG4gICAgICAgICAgICB2YXIgaW52b2tlVGhyb3cgPSBmdW5jdGlvbiAoZXJyb3IpIHsgcmV0dXJuIGludm9rZShib3VuZFRocm93LCBlcnJvcik7IH07XHJcbiAgICAgICAgICAgIGludm9rZU5leHQoKTtcclxuICAgICAgICB9KTtcclxuICAgIH07XHJcbn1cclxuZnVuY3Rpb24gaXNQcm9taXNl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Y2FuIGNoZWFwbHkgY29tcGFyZSB0aGVpclxyXG4gICAgICAgICAgICAvLyBsZW5ndGhzIGFzIGEgc2hvcnQtY3V0IGJlZm9yZSBjb21wYXJpbmcgdGhlaXIgZWxlbWVudHMuXHJcbiAgICAgICAgICAgIGlmIChhLmxlbmd0aCAhPT0gYi5sZW5ndGgpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgLy8gRmFsbCB0aHJvdWdoIHRvIG9iamVjdCBjYXNlLi4uXHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBPYmplY3RdJzoge1xyXG4gICAgICAgICAgICBpZiAocHJldmlvdXNseUNvbXBhcmVkKGEsIGIpKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIHZhciBhS2V5cyA9IE9iamVjdC5rZXlzKGEpO1xyXG4gICAgICAgICAgICB2YXIgYktleXMgPSBPYmplY3Qua2V5cyhiKTtcclxuICAgICAgICAgICAgLy8gSWYgYGFgIGFuZCBgYmAgaGF2ZSBhIGRpZmZlcmVudCBudW1iZXIgb2YgZW51bWVyYWJsZSBrZXlzLCB0aGV5XHJcbiAgICAgICAgICAgIC8vIG11c3QgYmUgZGlmZmVyZW50LlxyXG4gICAgICAgICAgICB2YXIga2V5Q291bnQgPSBhS2V5cy5sZW5ndGg7XHJcbiAgICAgICAgICAgIGlmIChrZXlDb3VudCAhPT0gYktleXMubGVuZ3RoKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICAvLyBOb3cgbWFrZSBzdXJlIHRoZXkgaGF2ZSB0aGUgc2FtZSBrZXlzLlxyXG4gICAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IGtleUNvdW50OyArK2spIHtcclxuICAgICAgICAgICAgICAgIGlmICghaGFzT3duUHJvcGVydHkuY2FsbChiLCBhS2V5c1trXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gRmluYWxseSwgY2hlY2sgZGVlcCBlcXVhbGl0eSBvZiBhbGwgY2hpbGQgcHJvcGVydGllcy5cclxuICAgICAgICAgICAgZm9yICh2YXIgayA9IDA7IGsgPCBrZXlDb3VudDsgKytrKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIga2V5ID0gYUtleXNba107XHJcbiAgICAgICAgICAgICAgICBpZiAoIWNoZWNrKGFba2V5XSwgYltrZXldKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBFcnJvcl0nOlxyXG4gICAgICAgICAgICByZXR1cm4gYS5uYW1lID09PSBiLm5hbWUgJiYgYS5tZXNzYWdlID09PSBiLm1lc3NhZ2U7XHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBOdW1iZXJdJzpcclxuICAgICAgICAgICAgLy8gSGFuZGxlIE5hTiwgd2hpY2ggaXMgIT09IGl0c2VsZi5cclxuICAgICAgICAgICAgaWYgKGEgIT09IGEpXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gYiAhPT0gYjtcclxuICAgICAgICAvLyBGYWxsIHRocm91Z2ggdG8gc2hhcmVkICthID09PSArYiBjYXNlLi4uXHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBCb29sZWFuXSc6XHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBEYXRlXSc6XHJcbiAgICAgICAgICAgIHJldHVybiArYSA9PT0gK2I7XHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBSZWdFeHBdJzpcclxuICAgICAgICBjYXNlICdbb2JqZWN0IFN0cmluZ10nOlxyXG4gICAgICAgICAgICByZXR1cm4gYSA9PSBcIlwiICsgYjtcclxuICAgICAgICBjYXNlICdbb2JqZWN0IE1hcF0nOlxyXG4gICAgICAgIGNhc2UgJ1tvYmplY3QgU2V0XSc6IHtcclxuICAgICAgICAgICAgaWYgKGEuc2l6ZSAhPT0gYi5zaXplKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICBpZiAocHJldmlvdXNseUNvbXBhcmVkKGEsIGIpKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIHZhciBhSXRlcmF0b3IgPSBhLmVudHJpZXMoKTtcclxuICAgICAgICAgICAgdmFyIGlzTWFwID0gYVRhZyA9PT0gJ1tvYmplY3QgTWFwXSc7XHJcbiAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgaW5mbyA9IGFJdGVyYXRvci5uZXh0KCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoaW5mby5kb25lKVxyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgLy8gSWYgYSBpbnN0YW5jZW9mIFNldCwgYVZhbHVlID09PSBhS2V5LlxyXG4gICAgICAgICAgICAgICAgdmFyIF9hID0gaW5mby52YWx1ZSwgYUtleSA9IF9hWzBdLCBhVmFsdWUgPSBfYVsxXTtcclxuICAgICAgICAgICAgICAgIC8vIFNvIHRoaXMgd29ya3MgdGhlIHNhbWUgd2F5IGZvciBib3RoIFNldCBhbmQgTWFwLlxyXG4gICAgICAgICAgICAgICAgaWYgKCFiLmhhcyhhS2V5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIEhvd2V2ZXIsIHdlIGNhcmUgYWJvdXQgZGVlcCBlcXVhbGl0eSBvZiB2YWx1ZXMgb25seSB3aGVuIGRlYWxpbmdcclxu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G4gICAgICAgIGNyZWF0ZVdlYlNvY2tldFVSTDogZnVuY3Rpb24odXJsKSB7XG4gICAgICAgICAgdmFyIGE7XG4gICAgICAgICAgaWYgKHVybCAmJiAhL153c3M/Oi9pLnRlc3QodXJsKSkge1xuICAgICAgICAgICAgYSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJhXCIpO1xuICAgICAgICAgICAgYS5ocmVmID0gdXJsO1xuICAgICAgICAgICAgYS5ocmVmID0gYS5ocmVmO1xuICAgICAgICAgICAgYS5wcm90b2NvbCA9IGEucHJvdG9jb2wucmVwbGFjZShcImh0dHBcIiwgXCJ3c1wiKTtcbiAgICAgICAgICAgIHJldHVybiBhLmhyZWY7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB1cmw7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBzdGFydERlYnVnZ2luZzogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXMuZGVidWdnaW5nID0gdHJ1ZTtcbiAgICAgICAgfSxcbiAgICAgICAgc3RvcERlYnVnZ2luZzogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXMuZGVidWdnaW5nID0gbnVsbDtcbiAgICAgICAgfSxcbiAgICAgICAgbG9nOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgbWVzc2FnZXMsIHJlZjtcbiAgICAgICAgICBtZXNzYWdlcyA9IDEgPD0gYXJndW1lbnRzLmxlbmd0aCA/IHNsaWNlLmNhbGwoYXJndW1lbnRzLCAwKSA6IFtdO1xuICAgICAgICAgIGlmICh0aGlzLmRlYnVnZ2luZykge1xuICAgICAgICAgICAgbWVzc2FnZXMucHVzaChEYXRlLm5vdygpKTtcbiAgICAgICAgICAgIHJldHVybiAocmVmID0gdGhpcy5sb2dnZXIpLmxvZy5hcHBseShyZWYsIFtcIltBY3Rpb25DYWJsZV1cIl0uY29uY2F0KHNsaWNlL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GlmICghYWxsb3dSZWNvbm5lY3QpIHtcbiAgICAgICAgICAgIHRoaXMubW9uaXRvci5zdG9wKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh0aGlzLmlzQWN0aXZlKCkpIHtcbiAgICAgICAgICAgIHJldHVybiAocmVmMSA9IHRoaXMud2ViU29ja2V0KSAhPSBudWxsID8gcmVmMS5jbG9zZSgpIDogdm9pZCAwO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICBDb25uZWN0aW9uLnByb3RvdHlwZS5yZW9wZW4gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgZXJyb3I7XG4gICAgICAgICAgQWN0aW9uQ2FibGUubG9nKFwiUmVvcGVuaW5nIFdlYlNvY2tldCwgY3VycmVudCBzdGF0ZSBpcyBcIiArICh0aGlzLmdldFN0YXRlKCkpKTtcbiAgICAgICAgICBpZiAodGhpcy5pc0FjdGl2ZSgpKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jbG9zZSgpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IxKSB7XG4gICAgICAgICAgICAgIGVycm9yID0gZXJyb3IxO1xuICAgICAgICAgICAgICByZXR1cm4gQWN0aW9uQ2FibGUubG9nKFwiRmFpbGVkIHRvIHJlb3BlbiBXZWJTb2NrZXRcIiwgZXJyb3IpO1xuICAgICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgQWN0aW9uQ2FibGUubG9nKFwiUmVvcGVuaW5nIFdlYlNvY2tldCBpbiBcIiArIHRoaXMuY29uc3RydWN0b3IucmVvcGVuRGVsYXkgKyBcIm1zXCIpO1xuICAgICAgICAgICAgICBzZXRUaW1lb3V0KHRoaXMub3BlbiwgdGhpcy5jb25zdHJ1Y3Rvci5yZW9wZW5EZWxheSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVyb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RleE9mLmNhbGwoc3RhdGVzLCByZWYxKSA+PSAwO1xuICAgICAgICB9O1xuXG4gICAgICAgIENvbm5lY3Rpb24ucHJvdG90eXBlLmdldFN0YXRlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIHJlZjEsIHN0YXRlLCB2YWx1ZTtcbiAgICAgICAgICBmb3IgKHN0YXRlIGluIFdlYlNvY2tldCkge1xuICAgICAgICAgICAgdmFsdWUgPSBXZWJTb2NrZXRbc3RhdGVdO1xuICAgICAgICAgICAgaWYgKHZhbHVlID09PSAoKHJlZjEgPSB0aGlzLndlYlNvY2tldCkgIT0gbnVsbCA/IHJlZjEucmVhZHlTdGF0ZSA6IHZvaWQgMCkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHN0YXRlLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9O1xuXG4gICAgICAgIENvbm5lY3Rpb24ucHJvdG90eXBlLmluc3RhbGxFdmVudEhhbmRsZXJzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGV2ZW50TmFtZSwgaGFuZGxlcjtcbiAgICAgICAgICBmb3IgKGV2ZW50TmFtZSBpbiB0aGlzLmV2ZW50cykge1xuICAgICAgICAgICAgaGFuZGxlciA9IHRoaXMuZXZlbnRzW2V2ZW50TmFtZV0uYmluZCh0aGlzKTtcbiAgICAgICAgICAgIHRoaXMud2ViU29ja2V0W1wib25cIiArIGV2ZW50TmFtZV0gPSBoYW5kbGVyO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICBDb25uZWN0aW9uLnByb3RvdHlwZS51bmluc3RhbGxFdmVudEhhbmRsZXJzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGV2ZW50TmFtZTtcbiAgICAgICAgICBmb3IgKGV2ZW50TmFtZSBpbiB0aGlzLmV2ZW50cykge1xuICAgICAgICAgICAgdGhpcy53ZWJTb2NrZXRbXCJvblwiICsgZXZlbnROYW1lXSA9IGZ1bmN0aW9uKCkge307XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIENvbm5lY3Rpb24ucHJvdG90eXBlLmV2ZW50cyA9IHtcbiAgICAgICAgICBtZXNzYWdlOiBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgdmFyIGlkZW50aWZpZXIsIG1lc3NhZ2UsIHJlZjEsIHR5cGU7XG4gICAgICAgICAgICBpZiAoIXRoaXMuaXNQcm90b2NvbFN1cHBvcnRlZCgpKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlZjEgPSBKU09OLnBhcnNlKGV2ZW50LmRhdGEpLCBpZGVudGlmaWVyID0gcmVmMS5pZGVudGlmaWVyLCBtZXNzYWdlID0gcmVmMS5tZXNzYWdlLCB0eXBlID0gcmVmMS50eXBlO1xuICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgICAgICAgIGNhc2UgbWVzc2FnZV90eXBlcy53ZWxjb21lOlxuICAgICAgICAgICAgICAgIHRoaXMubW9uaXRvci5yZWNvcmRDb25uZWN0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3Vic2NyaXB0aW9ucy5yZWxvYWQoKTtcbiAgICAgICAgICAgICAgY2FzZSBtZXNzYWdlX3R5cGVzLnBpbmc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubW9uaXRvci5yZWNvcmRQaW5nKCk7XG4gICAgICAgICAgICAgIGNhc2UgbWVzc2FnZV90eXBlcy5jb25maXJtYXRpb246XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3Vic2NyaXB0aW9ucy5ub3RpZnkoaWRlbnRpZmllciwgXCJjb25uZWN0ZWRcIik7XG4gICAgICAgICAgICAgIGNhc2UgbWVzc2FnZV90eXBlcy5yZWplY3Rpb246XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3Vic2NyaXB0aW9ucy5yZWplY3QoaWRlbnRpZmllcik7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3Vic2NyaXB0aW9ucy5ub3RpZnkoaWRlbnRpZmllciwgXCJyZWNlaXZlZFwiLCBtZXNzYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIG9wZW46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgQWN0aW9uQ2FibGUubG9nKFwiV2ViU29ja2V0IG9ub3BlbiBldmVudCwgdXNpbmcgJ1wiICsgKHRoaXMuZ2V0UHJvdG9jb2woKSkgKyBcIicgc3VicHJvdG9jb2xcIik7XG4gICAgICAgICAgICB0aGlzLmRpc2Nvbm5lY3RlZCA9IGZhbHNlO1xuICAgICAgICAgICAgaWYgKCF0aGlzLmlzUHJvdG9jb2xTdXBwb3J0ZWQoKSkge1xuICAgICAgICAgICAgICBBY3Rpb25DYWJsZS5sb2coXCJQcm90b2NvbCBpcyB1bnN1cHBvcnRlZC4gU3RvcHBpbmcgbW9uaXRvciBhbmQgZGlzY29ubmVjdGluZy5cIik7XG4gICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsb3NlKHtcbiAgICAgICAgICAgICAgICBhbGxvd1JlY29ubmVjdDogZmFsc2VcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjbG9zZTogZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgIEFjdGlvbkNhYmxlLmxvZyhcIldlYlNvY2tldCBvbmNsb3NlIGV2ZW50XCIpO1xuICAgICAgICAgICAgaWYgKHRoaXMuZGlzY29ubmVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZGlzY29ubmVjdGVkID0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Byb3RvdHlwZS5yZWplY3QgPSBmdW5jdGlvbihpZGVudGlmaWVyKSB7XG4gICAgICAgICAgdmFyIGksIGxlbiwgcmVmLCByZXN1bHRzLCBzdWJzY3JpcHRpb247XG4gICAgICAgICAgcmVmID0gdGhpcy5maW5kQWxsKGlkZW50aWZpZXIpO1xuICAgICAgICAgIHJlc3VsdHMgPSBbXTtcbiAgICAgICAgICBmb3IgKGkgPSAwLCBsZW4gPSByZWYubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICAgIHN1YnNjcmlwdGlvbiA9IHJlZltpXTtcbiAgICAgICAgICAgIHRoaXMuZm9yZ2V0KHN1YnNjcmlwdGlvbik7XG4gICAgICAgICAgICB0aGlzLm5vdGlmeShzdWJzY3JpcHRpb24sIFwicmVqZWN0ZWRcIik7XG4gICAgICAgICAgICByZXN1bHRzLnB1c2goc3Vic2NyaXB0aW9uKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHJlc3VsdHM7XG4gICAgICAgIH07XG5cbiAgICAgICAgU3Vic2NyaXB0aW9ucy5wcm90b3R5cGUuZm9yZ2V0ID0gZnVuY3Rpb24oc3Vic2NyaXB0aW9uKSB7XG4gICAgICAgICAgdmFyIHM7XG4gICAgICAgICAgdGhpcy5zdWJzY3JpcHRpb25zID0gKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGksIGxlbiwgcmVmLCByZXN1bHRzO1xuICAgICAgICAgICAgcmVmID0gdGhpcy5zdWJzY3JpcHRpb25zO1xuICAgICAgICAgICAgcmVzdWx0cyA9IFtdO1xuICAgICAgICAgICAgZm9yIChpID0gMCwgbGVuID0gcmVmLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgICAgIHMgPSByZWZbaV07XG4gICAgICAgICAgICAgIGlmIChzICE9PSBzdWJzY3JpcHRpb24pIHtcbiAgICAgICAgICAgICAgICByZXN1bHRzLnB1c2gocyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXN1bHRzO1xuICAgICAgICAgIH0pLmNhbGwodGhpcyk7XG4gICAgICAgICAgcmV0dXJuIHN1YnNjcmlwdGlvbjtcbiAgICAgICAgfTtcblxuICAgICAgICBTdWJzY3JpcHRpb25zLnByb3RvdHlwZS5maW5kQWxsID0gZnVuY3Rpb24oaWRlbnRpZmllcikge1xuICAgICAgICAgIHZhciBpLCBsZW4sIHJlZiwgcmVzdWx0cywgcztcbiAgICAgICAgICByZWYgPSB0aGlzLnN1YnNjcmlwdGlvbnM7XG4gICAgICAgICAgcmVzdWx0cyA9IFtdO1xuICAgICAgICAgIGZvciAoaSA9IDAsIGxlbiA9IHJlZi5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xuICAgICAgICAgICAgcyA9IHJlZltpXTtcbiAgICAgICAgICAgIGlmIChzLmlkZW50aWZpZXIgPT09IGlkZW50aWZpZXIpIHtcbiAgICAgICAgICAgICAgcmVzdWx0cy5wdXNoKHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gcmVzdWx0cztcbiAgICAgICAgfTtcblxuICAgICAgICBTdWJzY3JpcHRpb25zLnByb3RvdHlwZS5yZWxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgaSwgbGVuLCByZWYsIHJlc3VsdHMsIHN1YnNjcmlwdGlvbjtcbiAgICAgICAgICByZWYgPSB0aGlzLnN1YnNjcmlwdGlvbnM7XG4gICAgICAgICAgcmVzdWx0cyA9IFtdO1xuICAgICAgICAgIGZvciAoaSA9IDAsIGxlbiA9IHJlZi5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xuICAgICAgICAgICAgc3Vic2NyaXB0aW9uID0gcmVmW2ldO1xuICAgICAgICAgICAgcmVzdWx0cy5wdXNoKHRoaXMuc2VuZENvbW1hbmQoc3Vic2NyaXB0aW9uLCBcInN1YnNjcmliZVwiKSk7X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XG4gICAgICAgIHJldHVybiBTdWJzY3JpcHRpb25zO1xuXG4gICAgICB9KSgpO1xuXG4gICAgfSkuY2FsbCh0aGlzKTtcbiAgICAoZnVuY3Rpb24oKSB7XG4gICAgICBBY3Rpb25DYWJsZS5TdWJzY3JpcHRpb24gPSAoZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBleHRlbmQ7XG5cbiAgICAgICAgZnVuY3Rpb24gU3Vic2NyaXB0aW9uKGNvbnN1bWVyLCBwYXJhbXMsIG1peGluKSB7XG4gICAgICAgICAgdGhpcy5jb25zdW1lciA9IGNvbnN1bWVyO1xuICAgICAgICAgIGlmIChwYXJhbXMgPT0gbnVsbCkge1xuICAgICAgICAgICAgcGFyYW1zID0ge307XG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuaWRlbnRpZmllciA9IEpTT04uc3RyaW5naWZ5KHBhcmFtcyk7XG4gICAgICAgICAgZXh0ZW5kKHRoaXMsIG1peGluKTtcbiAgICAgICAgfVxuXG4gICAgICAgIFN1YnNjcmlwdGlvbi5wcm90b3R5cGUucGVyZm9ybSA9IGZ1bmN0aW9uKGFjdGlvbiwgZGF0YSkge1xuICAgICAgICAgIGlmIChkYXRhID09IG51bGwpIHtcbiAgICAgICAgICAgIGRhdGEgPSB7fTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZGF0YS5hY3Rpb24gPSBhY3Rpb247XG4gICAgICAgICAgcmV0dXJuIHRoaXMuc2VuZChkYXRhKTtcbiAgICAgICAgfTtcblxuICAgICAgICBTdWJzY3JpcHRpb24ucHJvdG90eXBlLnNlbmQgPSBmdW5jdGlvbihkYXRhKSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXMuY29uc3VtZXIuc2VuZCh7XG4gICAgICAgICAgICBjb21tYW5kOiBcIm1lc3NhZ2VcIixcbiAgICAgICAgICAgIGlkZW50aWZpZXI6IHRoaXMuaWRlbnRpZmllcixcbiAgICAgICAgICAgIGRhdGE6IEpTT04uc3RyaW5naWZ5KGRhdGEpXG4gICAgICAgICAgfSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgU3Vic2NyaXB0aW9uLnByb3RvdHlwZS51bnN1YnNjcmliZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiB0aGlzLmNvbnN1bWVyLnN1YnNjcmlwdGlvbnMucmVtb3ZlKHRoaXMpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGV4dGVuZCA9IGZ1bmN0aW9uKG9iamVjdCwgcHJvcGVydGllcykge1xuICAgICAgICAgIHZhciBrZXksIHZhbHVlO1xuICAgICAgICAgIGlmIChwcm9wZXJ0aWVzICE9IG51bGwpIHtcbiAgICAgICAgICAgIGZvciAoa2V5IGluIHByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgICAgdmFsdWUgPSBwcm9wZXJ0aWVzW2tleV07XG4gICAgICAgICAgICAgIG9iamVjdFtrZXldID0gdmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuIFN1YnNjcmlwdGlvbjtcblxuICAgICAgfSkoKTtcblxuICAgIH0pLmNhbGwodGhpcyk7XG4gICAgKGZ1bmN0aW9uKCkge1xuICAgICAgQWN0aW9uQ2FibGUuQ29uc3VtZXIgPSAoZnVuY3Rpb24oKSB7XG4gICAgICAgIGZ1bmN0aW9uIENvbnN1bWVyKHVybCkge1xuICAgICAgICAgIHRoaXMudXJsID0gdXJsO1xuICAgICAgICAgIHRoaXMuc3Vic2NyaXB0aW9ucyA9IG5ldyBBY3Rpb25DYWJsZS5TdWJzY3JpcHRpb25zKHRoaXMpO1xuICAgICAgICAgIHRoaXMuY29ubmVjdGlvbiA9IG5ldyBBY3Rpb25DYWJsZS5Db25uZWN0aW9uKHRoaXMpO1xuICAgICAgICB9XG5cbiAgICAgICAgQ29uc3VtZXIucHJvdG90eXBlLnNlbmQgPSBmdW5jdGlvbihkY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3NfMVtrZXldO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gZGlyZWN0aXZlc1snY29ubmVjdGlvbiddWydrZXknXSArIFwiKFwiICsgSlNPTi5zdHJpbmdpZnkoZmlsdGVyZWRBcmdzXzEpICsgXCIpXCI7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gZGlyZWN0aXZlc1snY29ubmVjdGlvbiddWydrZXknXTtcbiAgICAgICAgfVxuICAgIH1cbiAgICB2YXIgY29tcGxldGVGaWVsZE5hbWUgPSBmaWVsZE5hbWU7XG4gICAgaWYgKGFyZ3MpIHtcbiAgICAgICAgdmFyIHN0cmluZ2lmaWVkQXJncyA9IHN0cmluZ2lmeShhcmdzKTtcbiAgICAgICAgY29tcGxldGVGaWVsZE5hbWUgKz0gXCIoXCIgKyBzdHJpbmdpZmllZEFyZ3MgKyBcIilcIjtcbiAgICB9XG4gICAgaWYgKGRpcmVjdGl2ZXMpIHtcbiAgICAgICAgT2JqZWN0LmtleXMoZGlyZWN0aXZlcykuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICBpZiAoS05PV05fRElSRUNUSVZFUy5pbmRleE9mKGtleSkgIT09IC0xKVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIGlmIChkaXJlY3RpdmVzW2tleV0gJiYgT2JqZWN0LmtleXMoZGlyZWN0aXZlc1trZXldKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBjb21wbGV0ZUZpZWxkTmFtZSArPSBcIkBcIiArIGtleSArIFwiKFwiICsgSlNPTi5zdHJpbmdpZnkoZGlyZWN0aXZlc1trZXldKSArIFwiKVwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29tcGxldGVGaWVsZE5hbWUgKz0gXCJAXCIgKyBrZXk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO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c3ByZWFkQXJyYXlzKFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBraW5kOiAnT3BlcmF0aW9uRGVmaW5pdGlvbicsXG4gICAgICAgICAgICAgICAgb3BlcmF0aW9uOiAncXVlcnknLFxuICAgICAgICAgICAgICAgIHNlbGVjdGlvblNldDoge1xuICAgICAgICAgICAgICAgICAgICBraW5kOiAnU2VsZWN0aW9uU2V0JyxcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uczogW1xuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtpbmQ6ICdGcmFnbWVudFNwcmVhZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBraW5kOiAnTmFtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBhY3R1YWxGcmFnbWVudE5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH1cbiAgICAgICAgXSwgZG9jdW1lbnQuZGVmaW5pdGlvbnMpIH0pO1xuICAgIHJldHVybiBxdWVyeTtcbn1cblxuZnVuY3Rpb24gYXNzaWduKHRhcmdldCkge1xuICAgIHZhciBzb3VyY2VzID0gW107XG4gICAgZm9yICh2YXIgX2kgPSAxOyBfaSA8IGFyZ3VtZW50cy5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgc291cmNlc1tfaSAtIDFdID0gYXJndW1lbnRzW19pXTtcbiAgICB9XG4gICAgc291cmNlcy5mb3JFYWNoKGZ1bmN0aW9uIChzb3VyY2UpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBzb3VyY2UgPT09ICd1bmRlZmluZWQnIHx8IHNvdXJjZSA9PT0gbnVsbCkge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IHtcbiAgICAgICAgICAgICAgICBpZiAoZGlyZWN0aXZlcyAmJiBub2RlLmRpcmVjdGl2ZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNob3VsZFJlbW92ZUZpZWxkID0gZGlyZWN0aXZlcy5zb21lKGZ1bmN0aW9uIChkaXJlY3RpdmUpIHsgcmV0dXJuIGRpcmVjdGl2ZS5yZW1vdmU7IH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc2hvdWxkUmVtb3ZlRmllbGQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuZGlyZWN0aXZlcyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5kaXJlY3RpdmVzLnNvbWUoZ2V0RGlyZWN0aXZlTWF0Y2hlcihkaXJlY3RpdmVzKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChub2RlLmFyZ3VtZW50cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuYXJndW1lbnRzLmZvckVhY2goZnVuY3Rpb24gKGFyZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnLnZhbHVlLmtpbmQgPT09ICdWYXJpYWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhcmlhYmxlc1RvUmVtb3ZlLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGFyZy52YWx1ZS5uYW1lLnZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChub2RlLnNlbGVjdGlvblNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldEFsbEZyYWdtZW50U3ByZWFkc0Zyb21TZWxlY3Rpb25TZXQobm9kZS5zZWxlY3Rpb25TZXQpLmZvckVhY2goZnVuY3Rpb24gKGZyYWcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhZ21lbnRTcHJlYWRzVG9SZW1vdmUucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBmcmFnLm5hbWUudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBGcmFnbWVudFNwcmVhZDoge1xuICAgICAgICAgICAgZW50ZXI6IGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICAgICAgZnJhZ21lbnRTcHJlYWRzSW5Vc2Vbbm9kZS5uYW1lLnZhbHVlXSA9IHRydWU7XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBEaXJlY3RpdmU6IHtcbiAgICAgICAgICAgIGVudGVyOiBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICAgICAgICAgIGlmIChnZXREaXJlY3RpdmVNYXRjaGVyKGRpcmVjdGl2ZXMpKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgfSkpO1xuICAgIGlmIChtb2RpZmllZERvYyAmJlxuICAgICAgICBmaWx0ZXJJblBsYWNlKHZhcmlhYmxlc1RvUmVtb3ZlLCBmdW5jdGlvbiAodikgeyByZXR1cm4gIXZhcmlhYmxlc0luVXNlW3YubmFtZV07IH0pLmxlbmd0aCkge1xuICAgICAgICBtb2RpZmllZERvYyA9IHJlbW92ZUFyZ3VtZW50c0Zyb21Eb2N1bWVudCh2YXJpYWJsZXNUb1JlbW92ZSwgbW9kaWZpZWREb2MpO1xuICAgIH1cbiAgICBpZiAobW9kaWZpZWREb2MgJiZcbiAgICAgICAgZmlsdGVySW5QbGFjZShmcmFnbWVudFNwcmVhZHNUb1JlbW92ZSwgZnVuY3Rpb24gKGZzKSB7IHJldHVybiAhZnJhZ21lbnRTcHJlYWRzSW5Vc2VbZnMubmFtZV07IH0pXG4gICAgICAgICAgICAubGVuZ3RoKSB7XG4gICAgICAgIG1vZGlmaWVkRG9jID0gcmVtb3ZlRnJhZ21lbnRTcHJlYWRGcm9tRG9jdW1lbnQoZnJhZ21lbnRTcHJlYWRzVG9SZW1vdmUsIG1vZGlmaWVkRG9jKTtcbiAgICB9XG4gICAgcmV0dXJuIG1vZGlmaWVkRG9jO1xufVxuZnVuY3Rpb24gYWRkVHlwZW5hbWVUb0RvY3VtZW50KGRvYykge1xuICAgIHJldHVybiB2aXNpdChjaGVja0RvY3VtZW50KGRvYyksIHtcbiAgICAgICAgU2VsZWN0aW9uU2V0OiB7XG4gICAgICAgICAgICBlbnRlcjogZnVuY3Rpb24gKG5vZGUsIF9rZXksIHBhcmVudCkge1xuICAgICAgICAgICAgICAgIGlmIChwYXJlbnQgJiZcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50LmtpbmQgPT09ICdPcGVyYXRpb25EZWZpbml0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBzZWxlY3Rpb25zID0gbm9kZS5zZWxlY3Rpb25zO1xuICAgICAgICAgICAgICAgIGlmICghc2VsZWN0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBza2lwID0gc2VsZWN0aW9ucy5zb21lKGZ1bmN0aW9uIChzZWxlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChpc0ZpZWxkKHNlbGVjdGlvbikgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIChzZWxlY3Rpb24ubmFtZS52YWx1ZSA9PT0gJ19fdHlwZW5hbWUnIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uLm5hbWUudmFsdWUubGFzdEluZGV4T2YoJ19fJywgMCkgPT09IDApKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBpZiAoc2tpcCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBmaWVsZCA9IHBhcmVudDtcbiAgICAgICAgICAgICAgICBpZiAoaXNGaWVsZChmaWVsZCkgJiZcbiAgICAgICAgICAgICAgICAgICAgZmllbGQuZGlyZWN0aXZlcyAmJlxuICAgICAgICAgICAgICAgICAgICBmaWVsZC5kaXJlY3RpdmVzLnNvbWUoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQubmFtZS52YWx1ZSA9PT0gJ2V4cG9ydCc7IH0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fYXNzaWduKF9fYXNzaWduKHt9LCBub2RlKSwgeyBzZWxlY3Rpb25zOiBfX3NwcmVhZEFycmF5cyhzZWxlY3Rpb25zLCBbVFlQRU5BTUVfRklFTERdKSB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgfSk7XG59XG52YXIgY29ubmVjdGlvblJlbW92ZUNvbmZpZyA9IHtcbiAgICB0ZXN0OiBmdW5jdGlvbiAoZGlyZWN0aXZlKSB7XG4gICAgICAgIHZhciB3aWxsUmVtb3ZlID0gZGlyZWN0aXZlLm5hbWUudmFsd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vbiAobm9kZSwgX2tleSwgX3BhcmVudCwgcGF0aCkge1xuICAgICAgICAgICAgICAgIHZhciBjdXJyZW50UGF0aCA9IHBhdGguam9pbignLScpO1xuICAgICAgICAgICAgICAgIGlmICghcGFyZW50UGF0aCB8fFxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGF0aCA9PT0gcGFyZW50UGF0aCB8fFxuICAgICAgICAgICAgICAgICAgICAhY3VycmVudFBhdGguc3RhcnRzV2l0aChwYXJlbnRQYXRoKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobm9kZS5zZWxlY3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0aW9uc1dpdGhEaXJlY3RpdmVzID0gbm9kZS5zZWxlY3Rpb25zLmZpbHRlcihmdW5jdGlvbiAoc2VsZWN0aW9uKSB7IHJldHVybiBoYXNEaXJlY3RpdmVzSW5TZWxlY3Rpb24oZGlyZWN0aXZlcywgc2VsZWN0aW9uKTsgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzRGlyZWN0aXZlc0luU2VsZWN0aW9uU2V0KGRpcmVjdGl2ZXMsIG5vZGUsIGZhbHNlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudFBhdGggPSBjdXJyZW50UGF0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfX2Fzc2lnbihfX2Fzc2lnbih7fSwgbm9kZSksIHsgc2VsZWN0aW9uczogc2VsZWN0aW9uc1dpdGhEaXJlY3RpdmVzIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgIH0pKTtcbn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Lm5hbWUgPT09IHZhckRlZi52YXJpYWJsZS5uYW1lLnZhbHVlOyB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSkgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBGaWVsZDoge1xuICAgICAgICAgICAgZW50ZXI6IGZ1bmN0aW9uIChub2RlKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNob3VsZFJlbW92ZUZpZWxkID0gY29uZmlnLnNvbWUoZnVuY3Rpb24gKGFyZ0NvbmZpZykgeyByZXR1cm4gYXJnQ29uZmlnLnJlbW92ZTsgfSk7XG4gICAgICAgICAgICAgICAgaWYgKHNob3VsZFJlbW92ZUZpZWxkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhcmdNYXRjaENvdW50XzEgPSAwO1xuICAgICAgICAgICAgICAgICAgICBub2RlLmFyZ3VtZW50cy5mb3JFYWNoKGZ1bmN0aW9uIChhcmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmdNYXRjaGVyKGFyZykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdNYXRjaENvdW50XzEgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhcmdNYXRjaENvdW50XzEgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgQXJndW1lbnQ6IHtcbiAgICAgICAgICAgIGVudGVyOiBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICAgICAgICAgIGlmIChhcmdNYXRjaGVyKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4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biAgICAgICAgICAgIHJlbW92ZTogdHJ1ZSxcbiAgICAgICAgfSxcbiAgICBdLCBkb2N1bWVudCk7XG4gICAgaWYgKG1vZGlmaWVkRG9jKSB7XG4gICAgICAgIG1vZGlmaWVkRG9jID0gdmlzaXQobW9kaWZpZWREb2MsIHtcbiAgICAgICAgICAgIEZyYWdtZW50RGVmaW5pdGlvbjoge1xuICAgICAgICAgICAgICAgIGVudGVyOiBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobm9kZS5zZWxlY3Rpb25TZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc1R5cGVuYW1lT25seSA9IG5vZGUuc2VsZWN0aW9uU2V0LnNlbGVjdGlvbnMuZXZlcnkoZnVuY3Rpb24gKHNlbGVjdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpc0ZpZWxkKHNlbGVjdGlvbikgJiYgc2VsZWN0aW9uLm5hbWUudmFsdWUgPT09ICdfX3R5cGVuYW1lJztcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzVHlwZW5hbWVPbmx5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIHJldHVybiBtb2RpZmllZERvYztcbn1cblxudmFyIGNhblVzZVdlYWtNYXAgPSB0eXBlb2YgV2Vha01hcCA9PT0gJ2Z1bmN0aW9uJyAmJiAhKHR5cGVvZiBuYXZpZ2F0b3IgPT09ICdvYmplY3QnICYmXG4gICAgbmF2aWdhdG9yLnByb2R1Y3QgPT09ICdSZWFjdE5hdGl2ZScpO1xuXG52YXIgdG9TdHJpbmcgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xuZnVuY3Rpb24gY2xvbmVEZWVwKHZhbHVlKSB7XG4gICAgcmV0dXJuIGNsb25lRGVlcEhlbHBlcih2YWx1ZSwgbmV3IE1hcCgpKTtcbn1cbmZ1bmN0aW9uIGNsb25lRGVlcEhlbHBlcih2YWwsIHNlZW4pIHtcbiAgICBzd2l0Y2ggKHRvU3RyaW5nLmNhbGwodmFsKSkge1xuICAgICAgICBjYXNlIFwiW29iamVjdCBBcnJheV1cIjoge1xuICAgICAgICAgICAgaWYgKHNlZW4uaGFzKHZhbCkpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHNlZW4uZ2V0KHZhbCk7XG4gICAgICAgICAgICB2YXIgY29weV8xID0gdmFsLnNsaWNlKDApO1xuICAgICAgICAgICAgc2Vlbi5zZXQodmFsLCBjb3B5XzEpO1xuICAgICAgICAgICAgY29weV8xLmZvckVhY2goZnVuY3Rpb24gKGNoaWxkLCBpKSB7XG4gICAgICAgICAgICAgICAgY29weV8xW2ldID0gY2xvbmVEZWVwSGVscGVyKGNoaWxkLCBzZWVuKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIGNvcHlfMTtcbiAgICAgICAgfVxuICAgICAgICBjYXNlIFwiW29iamVjdCBPYmplY3RdXCI6IHtcbiAgICAgICAgICAgIGlmIChzZWVuLmhhcyh2YWwpKVxuICAgICAgICAgICAgICAgIHJldHVybiBzZWVuLmdldCh2YWwpO1xuICAgICAgICAgICAgdmFyIGNvcHlfMiA9IE9iamVjdC5jcmVhdGUoT2JqZWN0LmdldFByb3RvdHlwZU9mKHZhbCkpO1xuICAgICAgICAgICAgc2Vlbi5zZXQodmFsLCBjb3B5XzIpO1xuICAgICAgICAgICAgT2JqZWN0LmtleXModmFsKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICBjb3B5XzJba2V5XSA9IGNsb25lRGVlcEhlbHBlcih2YWxba2V5XSwgc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ywgdGhleVxyXG4gICAgICAgICAgICAvLyBtdXN0IGJlIGRpZmZlcmVudC5cclxuICAgICAgICAgICAgdmFyIGtleUNvdW50ID0gYUtleXMubGVuZ3RoO1xyXG4gICAgICAgICAgICBpZiAoa2V5Q291bnQgIT09IGJLZXlzLmxlbmd0aClcclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgLy8gTm93IG1ha2Ugc3VyZSB0aGV5IGhhdmUgdGhlIHNhbWUga2V5cy5cclxuICAgICAgICAgICAgZm9yICh2YXIgayA9IDA7IGsgPCBrZXlDb3VudDsgKytrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIWhhc093blByb3BlcnR5LmNhbGwoYiwgYUtleXNba10pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIEZpbmFsbHksIGNoZWNrIGRlZXAgZXF1YWxpdHkgb2YgYWxsIGNoaWxkIHByb3BlcnRpZXMuXHJcbiAgICAgICAgICAgIGZvciAodmFyIGsgPSAwOyBrIDwga2V5Q291bnQ7ICsraykge1xyXG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IGFLZXlzW2tdO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFjaGVjayhhW2tleV0sIGJba2V5XSkpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgJ1tvYmplY3QgRXJyb3JdJzpcclxuICAgICAgICAgICAgcmV0dXJuIGEubmFtZSA9PT0gYi5uYW1lICYmIGEubWVzc2FnZSA9PT0gYi5tZXNzYWdlO1xyXG4gICAgICAgIGNhc2UgJ1tvYmplY3QgTnVtYmVyXSc6XHJcbiAgICAgICAgICAgIC8vIEhhbmRsZSBOYU4sIHdoaWNoIGlzICE9PSBpdHNlbGYuXHJcbiAgICAgICAgICAgIGlmIChhICE9PSBhKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGIgIT09IGI7XHJcbiAgICAgICAgLy8gRmFsbCB0aHJvdWdoIHRvIHNoYXJlZCArYSA9PT0gK2IgY2FzZS4uLlxyXG4gICAgICAgIGNhc2UgJ1tvYmplY3QgQm9vbGVhbl0nOlxyXG4gICAgICAgIGNhc2UgJ1tvYmplY3QgRGF0ZV0nOlxyXG4gICAgICAgICAgICByZXR1cm4gK2EgPT09ICtiO1xyXG4gICAgICAgIGNhc2UgJ1tvYmplY3QgUmVnRXhwXSc6XHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBTdHJpbmddJzpcclxuICAgICAgICAgICAgcmV0dXJuIGEgPT0gXCJcIiArIGI7XHJcbiAgICAgICAgY2FzZSAnW29iamVjdCBNYXBdJzpcclxuICAgICAgICBjYXNlICdbb2JqZWN0IFNldF0nOiB7XHJcbiAgICAgICAgICAgIGlmIChhLnNpemUgIT09IGIuc2l6ZSlcclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgaWYgKHByZXZpb3VzbHlDb21wYXJlZChhLCBiKSlcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB2YXIgYUl0ZXJhdG9yID0gYS5lbnRyaWVzKCk7XHJcbiAgICAgICAgICAgIHZhciBpc01hcCA9IGFUYWcgPT09ICdbb2JqZWN0IE1hcF0nO1xyXG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xyXG4gICAgICAgICAgICAgICAgdmFyIGluZm8gPSBhSXRlcmF0b3IubmV4dCgpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGluZm8uZG9uZSlcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIC8vIElmI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AgICAgICAgICB2YXIgYm9iaiA9IHsga2V5OiBiLCB2YWx1ZTogbm9kZVtiXSB9O1xuICAgICAgICAgICAgICAgIHJldHVybiBmKGFvYmosIGJvYmopO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfTtcbiAgICB9KShvcHRzLmNtcCk7XG5cbiAgICB2YXIgc2VlbiA9IFtdO1xuICAgIHJldHVybiAoZnVuY3Rpb24gc3RyaW5naWZ5IChub2RlKSB7XG4gICAgICAgIGlmIChub2RlICYmIG5vZGUudG9KU09OICYmIHR5cGVvZiBub2RlLnRvSlNPTiA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgbm9kZSA9IG5vZGUudG9KU09OKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobm9kZSA9PT0gdW5kZWZpbmVkKSByZXR1cm47XG4gICAgICAgIGlmICh0eXBlb2Ygbm9kZSA9PSAnbnVtYmVyJykgcmV0dXJuIGlzRmluaXRlKG5vZGUpID8gJycgKyBub2RlIDogJ251bGwnO1xuICAgICAgICBpZiAodHlwZW9mIG5vZGUgIT09ICdvYmplY3QnKSByZXR1cm4gSlNPTi5zdHJpbmdpZnkobm9kZSk7XG5cbiAgICAgICAgdmFyIGksIG91dDtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobm9kZSkpIHtcbiAgICAgICAgICAgIG91dCA9ICdbJztcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBub2RlLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGkpIG91dCArPSAnLCc7XG4gICAgICAgICAgICAgICAgb3V0ICs9IHN0cmluZ2lmeShub2RlW2ldKSB8fCAnbnVsbCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gb3V0ICsgJ10nO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG5vZGUgPT09IG51bGwpIHJldHVybiAnbnVsbCc7XG5cbiAgICAgICAgaWYgKHNlZW4uaW5kZX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LmNvbm5lY3Rpb25QYXJhbXMpLCB7XG4gICAgICAgICAgICAgICAgY29ubmVjdGVkOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGVyZm9ybShhY3Rpb25OYW1lLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBxdWVyeTogb3BlcmF0aW9uLnF1ZXJ5ID8gZ3JhcGhxbF8xLnByaW50KG9wZXJhdGlvbi5xdWVyeSkgOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFibGVzOiBvcGVyYXRpb24udmFyaWFibGVzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyBhZGRlZCBmb3IgcGVyc2lzdGVkIG9wZXJhdGlvbiBzdXBwb3J0OlxuICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uSWQ6IG9wZXJhdGlvbi5vcGVyYXRpb25JZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbk5hbWU6IG9wZXJhdGlvbi5vcGVyYXRpb25OYW1lXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcmVjZWl2ZWQ6IGZ1bmN0aW9uIChwYXlsb2FkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXlsb2FkLnJlc3VsdC5kYXRhIHx8IHBheWxvYWQucmVzdWx0LmVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICAgICAgb2JzZXJ2ZXIubmV4dChwYXlsb2FkLnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFwYXlsb2FkLm1vcmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIC8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gICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIG5hbWUgPSBnZXRGaWVsZEVudHJ5S2V5KHNlbGVjdGlvbik7XG5cbiAgICAgICAgICBpZiAoIWZpZWxkc1tuYW1lXSkge1xuICAgICAgICAgICAgZmllbGRzW25hbWVdID0gW107XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZmllbGRzW25hbWVdLnB1c2goc2VsZWN0aW9uKTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIF9raW5kcy5LaW5kLklOTElORV9GUkFHTUVOVDpcbiAgICAgICAge1xuICAgICAgICAgIGlmICghc2hvdWxkSW5jbHVkZU5vZGUoZXhlQ29udGV4dCwgc2VsZWN0aW9uKSB8fCAhZG9lc0ZyYWdtZW50Q29uZGl0aW9uTWF0Y2goZXhlQ29udGV4dCwgc2VsZWN0aW9uLCBydW50aW1lVHlwZSkpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbGxlY3RGaWVsZHMoZXhlQ29udGV4dCwgcnVudGltZVR5cGUsIHNlbGVjdGlvbi5zZWxlY3Rpb25TZXQsIGZpZWxkcywgdmlzaXRlZEZyYWdtZW50TmFtZXMpO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgIGNhc2UgX2tpbmRzLktpbmQuRlJBR01FTlRfU1BSRUFEOlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIGZyYWdOYW1lID0gc2VsZWN0aW9uLm5hbWUudmFsdWU7XG5cbiAgICAgICAgICBpZiAodmlzaXRlZEZyYWdtZW50TmFtZXNbZnJhZ05hbWVdIHx8ICFzaG91bGRJbmNsdWRlTm9kZShleGVDb250ZXh0LCBzZWxlY3Rpb24pKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB2aXNpdGVkRnJhZ21lbnROYW1lc1tm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gICAgY2FzZSA0NzpcbiAgICAgICAgICB2YWx1ZSArPSAnLyc7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSA5MjpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxcXCc7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSA5ODpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxiJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDEwMjpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxmJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExMDpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxuJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExNDpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxyJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExNjpcbiAgICAgICAgICB2YWx1ZSArPSAnXFx0JztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExNzpcbiAgICAgICAgICB7XG4gICAgICAgICAgICAvLyB1WFhYWFxuICAgICAgICAgICAgdmFyIGNoYXJDb2RlID0gdW5pQ2hhckNvZGUoYm9keS5jaGFyQ29kZUF0KHBvc2l0aW9uICsgMSksIGJvZHkuY2hhckNvZGVBdChwb3NpdGlvbiArIDIpLCBib2R5LmNoYXJDb2RlQXQocG9zaXRpb24gKyAzKSwgYm9keS5jaGFyQ29kZUF0KHBvc2l0aW9uICsgNCkpO1xuXG4gICAgICAgICAgICBpZiAoY2hhckNvZGUgPCAwKSB7XG4gICAgICAgICAgICAgIHZhciBpbnZhbGlkU2VxdWVuY2UgPSBib2R5LnNsaWNlKHBvc2l0aW9uICsgMSwgcG9zaXRpb24gKyA1KTtcbiAgICAgICAgICAgICAgdGhyb3cgKDAsIF9zeW50YXhFcnJvci5zeW50YXhFcnJvcikoc291cmNlLCBwb3NpdGlvbiwgXCJJbnZhbGlkIGNoYXJ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AgICB9O1xuXG4gICAgICBjYXNlIF90b2tlbktpbmQuVG9rZW5LaW5kLlNUUklORzpcbiAgICAgIGNhc2UgX3Rva2VuS2luZC5Ub2tlbktpbmQuQkxPQ0tfU1RSSU5HOlxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVN0cmluZ0xpdGVyYWwoKTtcblxuICAgICAgY2FzZSBfdG9rZW5LaW5kLlRva2VuS2luZC5OQU1FOlxuICAgICAgICBpZiAodG9rZW4udmFsdWUgPT09ICd0cnVlJyB8fCB0b2tlbi52YWx1ZSA9PT0gJ2ZhbHNlJykge1xuICAgICAgICAgIHRoaXMuX2xleGVyLmFkdmFuY2UoKTtcblxuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBraW5kOiBfa2luZHMuS2luZC5CT09MRUFOLFxuICAgICAgICAgICAgdmFsdWU6IHRva2VuLnZhbHVlID09PSAndHJ1ZScsXG4gICAgICAgICAgICBsb2M6IHRoaXMubG9jKHRva2VuKVxuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAodG9rZW4udmFsdWUgPT09ICdudWxsJykge1xuICAgICAgICAgIHRoaXMuX2xleGVyLmFkdmFuY2UoKTtcblxuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBraW5kOiBfa2luZHMuS2luZC5OVUxMLFxuICAgICAgICAgICAgbG9jOiB0aGlzLmxvYyh0b2tlbilcbiAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fbGV4ZXIuYWR2YW5jZSgpO1xuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAga2luZDogX2tpbmRzLktpbmQuRU5VTSxcbiAgICAgICAgICB2YWx1ZTogdG9rZW4udmFsdWUsXG4gICAgICAgICAgbG9jOiB0aGlzLmxvYyh0b2tlbilcbiAgICAgICAgfTtcblxuICAgICAgY2FzZSBfdG9rZW5LaW5kLlRva2VuS2luZC5ET0xMQVI6XG4gICAgICAgIGlmICghaXNDb25zdCkge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SA9IGNsb25lO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGVkaXRPZmZzZXQgPSAwO1xuXG4gICAgICAgIGZvciAodmFyIGlpID0gMDsgaWkgPCBlZGl0cy5sZW5ndGg7IGlpKyspIHtcbiAgICAgICAgICB2YXIgZWRpdEtleSA9IGVkaXRzW2lpXVswXTtcbiAgICAgICAgICB2YXIgZWRpdFZhbHVlID0gZWRpdHNbaWldWzFdO1xuXG4gICAgICAgICAgaWYgKGluQXJyYXkpIHtcbiAgICAgICAgICAgIGVkaXRLZXkgLT0gZWRpdE9mZnNldDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoaW5BcnJheSAmJiBlZGl0VmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgIG5vZGUuc3BsaWNlKGVkaXRLZXksIDEpO1xuICAgICAgICAgICAgZWRpdE9mZnNldCsrO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBub2RlW2VkaXRLZXldID0gZWRpdFZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpbmRleCA9IHN0YWNrLmluZGV4O1xuICAgICAga2V5cyA9IHN0YWNrLmtleXM7XG4gICAgICBlZGl0cyA9IHN0YWNrLmVkaXRzO1xuICAgICAgaW5BcnJheSA9IHN0YWNrLmluQXJyYXk7XG4gICAgICBzdGFjayA9IHN0YWNrLnByZXY7XG4gICAgfSBlbHNlIHtcbiAgICAgIGtleSA9IHBhcmVudCA/IGluQXJyYXkgPyBpbmRleCA6IGtleXNbaW5kZXhdIDogdW5kZWZpbmVkO1xuICAgICAgbm9kZSA9IHBhcmVudCA/IHBhcmVudFtrZXldIDogbmV3Um9vdDtcblxuICAgICAgaWYgKG5vZGUgPT09IG51bGwgfHwgbm9kZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuXG4gICAgICBpZiAocGFyZW50KSB7XG4gICAgICAgIHBhdGgucHVzaChrZXkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHZhciByZXN1bHQgPSB2b2lkIDA7XG5cbiAgICBpZiAoIUFycmF5LmlzQXJyYXkobm9kZSkpIHtcbiAgICAgIGlmICghaXNOb2RlKG5vZGUpKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignSW52YWxpZCBBU1QgTm9kZTogJyArICgwLCBfaW5zcGVjdC5kZWZhdWx0KShub2RlKSk7XG4gICAgICB9XG5cbiAgICAgIHZhciB2aXNpdEZuID0gZ2V0VmlzaXRGbih2aXNpdG9yLCBub2RlLmtpbmQsIGlzTGVhdmluZyk7XG5cbiAgICAgIGlmICh2aXNpdEZuKSB7XG4gICAgICAgIHJlc3VsdCA9IHZpc2l0Rm4uY2FsbCh2aXNpdG9yLCBub2RlLCBrZXksIHBhcmVudCwgcGF0aCwgYW5jZXN0b3JzKTtcblxuICAgICAgICBpZiAocmVzdWx0ID09PSBCUkVBSykge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHJlc3VsdCA9PT0gZmFsc2UpIHtcbiAgICAgICAgICBpZiAoIWlzTGVhdmluZykge1xuICAgICAgICAgICAgcGF0aC5wb3AoKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGVkaXRzLnB1c2goW2tleSwgcmVzdWx0XSk7XG5cbiAgICAgICAgICBpZiAoIWlzTGVhdmluZykge1xuICAgICAgICAgICAgaWYgKGlzTm9kZShyZXN1bHQpKSB7XG4gICAgICAgICAgICAgIG5vZGUgPSByZXN1bHQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwYXRoLnBvcCgpO1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbi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Rpb24gZmllbGRzKCkge1xuICAgIHJldHVybiB7XG4gICAgICBuYW1lOiB7XG4gICAgICAgIHR5cGU6ICgwLCBfZGVmaW5pdGlvbi5HcmFwaFFMTm9uTnVsbCkoX3NjYWxhcnMuR3JhcGhRTFN0cmluZyksXG4gICAgICAgIHJlc29sdmU6IGZ1bmN0aW9uIHJlc29sdmUob2JqKSB7XG4gICAgICAgICAgcmV0dXJuIG9iai5uYW1lO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgZGVzY3JpcHRpb246IHtcbiAgICAgICAgdHlwZTogX3NjYWxhcnMuR3JhcGhRTFN0cmluZyxcbiAgICAgICAgcmVzb2x2ZTogZnVuY3Rpb24gcmVzb2x2ZShvYmopIHtcbiAgICAgICAgICByZXR1cm4gb2JqLmRlc2NyaXB0aW9uO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgYXJnczoge1xuICAgICAgICB0eXBlOiAoMCwgX2RlZmluaXRpb24uR3JhcGhRTE5vbk51bGwpKCgwLCBfZGVmaW5pdGlvbi5HcmFwaFFMTGlzdCkoKDAsIF9kZWZpbml0aW9uLkdyYXBoUUxOb25OdWxsKShfX0lucHV0VmFsdWUpKSksXG4gICAgICAgIHJlc29sdmU6IGZ1bmN0aW9uIHJlc29sdmUoZmllbGQpIHtcbiAgICAgICAgICByZXR1cm4gZmllbGQuYXJncztcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIHR5cGU6IHtcbiAgICAgICAgdHlwZTogKDAsIF9kZWZpbml0aW9uLkdyYXBoUUxOb25OdWxsKShfX1R5cGUpLFxuICAgICAgICByZXNvbHZlOiBmdW5jdGlvbiByZXNvbHZlKG9iaikge1xuICAgICAgICAgIHJldHVybiBvYmoudHlwZTtcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGlzRGVwcmVjYXRlZDoge1xuICAgICAgICB0eXBlOiAoMCwgX2RlZmluaXRpb24uR3JhcGhRTE5vbk51bGwpKF9zY2FsYXJzLkdyYXBo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5IHtcXG4gICAgICBfX3NjaGVtYSB7XFxuICAgICAgICBxdWVyeVR5cGUgeyBuYW1lIH1cXG4gICAgICAgIG11dGF0aW9uVHlwZSB7IG5hbWUgfVxcbiAgICAgICAgc3Vic2NyaXB0aW9uVHlwZSB7IG5hbWUgfVxcbiAgICAgICAgdHlwZXMge1xcbiAgICAgICAgICAuLi5GdWxsVHlwZVxcbiAgICAgICAgfVxcbiAgICAgICAgZGlyZWN0aXZlcyB7XFxuICAgICAgICAgIG5hbWVcXG4gICAgICAgICAgXCIuY29uY2F0KGRlc2NyaXB0aW9ucyA/ICdkZXNjcmlwdGlvbicgOiAnJywgXCJcXG4gICAgICAgICAgbG9jYXRpb25zXFxuICAgICAgICAgIGFyZ3Mge1xcbiAgICAgICAgICAgIC4uLklucHV0VmFsdWVcXG4gICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgIH1cXG4gICAgfVxcblxcbiAgICBmcmFnbWVudCBGdWxsVHlwZSBvbiBfX1R5cGUge1xcbiAgICAgIGtpbmRcXG4gICAgICBuYW1lXFxuICAgICAgXCIpLmNvbmNhdChkZXNjcmlwdGlvbnMgPyAnZGVzY3JpcHRpb24nIDogJycsIFwiXFxuICAgICAgZmllbGRzKGluY2x1ZGVEZXByZWNhdGVkOiB0cnVlKSB7XFxuICAgICAgICBuYW1lXFxuICAgICAgICBcIikuY29uY2F0KGRlc2NyaXB0aW9ucyA/ICdkZXNjcmlwdGlvbicgOiAnJywgXCJcXG4gICAgICAgIGFyZ3Mge1xcbiAgICAgICAgICAuLi5JbnB1dFZhbHVlXFxuICAgICAgICB9XFxuICAgICAgICB0eXBlIHtcXG4gICAgICAgICAgLi4uVHlwZVJlZlxcbiAgICAgICAgfVxcbiAgICAgICAgaXNEZXByZWNhdGVkXFxuICAgICAgICBkZXByZWNhdGlvblJlYXNvblxcbiAgICAgIH1cXG4gICAgICBpbnB1dEZpZWxkcyB7XFxuICAgICAgICAuLi5JbnB1dFZhbHVlXFxuICAgICAgfVxcbiAgICAgIGludGVyZmFjZXMge1xcbiAgICAgICAgLi4uVHlwZVJlZlxcbiAgICAgIH1cXG4gICAgICBlbnVtVmFsdWVzKGluY2x1ZGVEZXByZWNhdGVkOiB0cnVlKSB7XFxuICAgICAgICBuYW1lXFxuICAgICAgICBcIikuY29uY2F0KGRlc2NyaXB0aW9ucyA/ICdkZXNjcmlwdGlvbicgOiAnJywgXCJcXG4gICAgICAgIGlzRGVwcmVjYXRlZFxcbiAgICAgICAgZGVwcmVjYXRpb25SZWFzb25cXG4gICAgICB9XFxuICAgICAgcG9zc2libGVUeXBlcyB7XFxuICAgICAgICAuLi5UeXBlUmVmXFxuICAgICAgfVxcbiAgICB9XFxuXFxuICAgIGZyYWdtZW50IElucHV0VmFsdWUgb24gX19JbnB1dFZhbHVlIHtcXG4gICAgICBuYW1lXFxuICAgICAgXCIpLmNvbmNhdChkZXNjcmlwdGlvbnMgPyAnZGVzY3JpcHRpb24nIDogJycsIFwiXFxuICAgICAgdHlwZSB7IC4uLlR5cGVSZWYgfVxcbiAgICAgIGRlZmF1bHRWYWx1ZVxcbiAgICB9XFxuXFxuICAgIGZyYWdtZW50IFR5cGVSZWYgb24gX19UeXBlIHtcXG4gICAgICBraW5kXFxuICAgICAgbmFtZVxcbiAgICAgIG9mVHlwZSB7XFxuICAgICAgICBraW5kXFxuICAgICAgICBuYW1lXFxuICAgICAgICBvZlR5cGUge1xcbiAgICAgICAgICBraW5kXFxuICAgICAgICAgIG5hbWVcXG4gICAgICAgICAgb2ZUeXBlIHtcXG4gICAgICAgICAgICBraW5kXFxuICAgICAgICAgICAgbmFtZVxcbiAgICAgICAgICAgIG9mVHlwZSB7XFxuICAgICAgICAgICAgICBraW5kXFxuICAgICAgICAgICAgICBuYW1lXFxuICAgICAgICAgICAgICBvZlR5cGUge1xcbiAgICAgICAgICAgICAgICBraW5kXFxuICAgICAgICAgICAgICAgIG5hbWVcXG4gICAgICAgICAgICAgICAgb2ZUeXBlIHtcXG4gICAgICAg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bGl0ZXJhbHMuXG4gKlxuICogUmV0dXJucyBgdW5kZWZpbmVkYCB3aGVuIHRoZSB2YWx1ZSBjb3VsZCBub3QgYmUgdmFsaWRseSBjb2VyY2VkIGFjY29yZGluZyB0b1xuICogdGhlIHByb3ZpZGVkIHR5cGUuXG4gKlxuICogfCBHcmFwaFFMIFZhbHVlICAgICAgICB8IEpTT04gVmFsdWUgICAgfFxuICogfCAtLS0tLS0tLS0tLS0tLS0tLS0tLSB8IC0tLS0tLS0tLS0tLS0gfFxuICogfCBJbnB1dCBPYmplY3QgICAgICAgICB8IE9iamVjdCAgICAgICAgfFxuICogfCBMaXN0ICAgICAgICAgICAgICAgICB8IEFycmF5ICAgICAgICAgfFxuICogfCBCb29sZWFuICAgICAgICAgICAgICB8IEJvb2xlYW4gICAgICAgfFxuICogfCBTdHJpbmcgICAgICAgICAgICAgICB8IFN0cmluZyAgICAgICAgfFxuICogfCBJbnQgLyBGbG9hdCAgICAgICAgICB8IE51bWJlciAgICAgICAgfFxuICogfCBFbnVtIFZhbHVlICAgICAgICAgICB8IE1peGVkICAgICAgICAgfFxuICogfCBOdWxsVmFsdWUgICAgICAgICAgICB8IG51bGwgICAgICAgICAgfFxuICpcbiAqL1xuZnVuY3Rpb24gdmFsdWVGcm9tQVNUKHZhbHVlTm9kZSwgdHlwZSwgdmFyaWFibGVzKSB7XG4gIGlmICghdmFsdWVOb2RlKSB7XG4gICAgLy8gV2hlbiB0aGVyZSBpcyBubyBub2RlLCB0aGVuIHRoZXJlIGlzIGFsc28gbm8gdmFsdWUuXG4gICAgLy8gSW1wb3J0YW50bHksIHRoaXMgaXMgZGlmZmVyZW50IGZyb20gcmV0dXJuaW5nIHRoZSB2YWx1ZSBudWxsLlxuICAgIHJldHVybjtcbiAgfVxuXG4gIGlmICgoMCwgX2RlZmluaXRpb24uaXNOb25OdWxsVHlwZSkodHlwZSkpIHtcbiAgICBpZiAodmFsdWVOb2RlLmtpbmQgPT09IF9raW5kcy5LaW5kLk5VT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JldHVybiBkZWZzLmZpbHRlcihcbiAgICAgICAgZnVuY3Rpb24oZGVmKSB7XG4gICAgICAgICAgaWYgKGRlZi5raW5kICE9PSAnRnJhZ21lbnREZWZpbml0aW9uJykgcmV0dXJuIHRydWU7XG4gICAgICAgICAgdmFyIG5hbWUgPSBkZWYubmFtZS52YWx1ZVxuICAgICAgICAgIGlmIChuYW1lc1tuYW1lXSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuYW1lc1tuYW1lXSA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIClcbiAgICB9XG4gIFxuXG4gICAgLy8gQ29sbGVjdCBhbnkgZnJhZ21lbnQvdHlwZSByZWZlcmVuY2VzIGZyb20gYSBub2RlLCBhZGRpbmcgdGhlbSB0byB0aGUgcmVmcyBTZXRcbiAgICBmdW5jdGlvbiBjb2xsZWN0RnJhZ21lbnRSZWZlcmVuY2VzKG5vZGUsIHJlZnMpIHtcbiAgICAgIGlmIChub2RlLmtpbmQgPT09IFwiRnJhZ21lbnRTcHJlYWRcIikge1xuICAgICAgICByZWZzLmFkZChub2RlLm5hbWUudmFsdWUpO1xuICAgICAgfSBlbHNlIGlmIChub2RlLmtpbmQgPT09IFwiVmFyaWFibGVEZWZpbml0aW9uXCIpIHtcbiAgICAgICAgdmFyIHR5cGUgPSBub2RlLnR5cGU7XG4gICAgICAgIGlmICh0eXBlLmtpbmQgPT09IFwiTmFtZWRUeXBlXCIpIHtcbiAgICAgICAgICByZWZzLmFkZCh0eXBlLm5hbWUudmFsdWUpO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChub2RlLnNlbGVjdGlvblNldCkge1xuICAgICAgICBub2RlLnNlbGVjdGlvblNldC5zZWxlY3Rpb25zLmZvckVhY2goZnVuY3Rpb24oc2VsZWN0aW9uKSB7XG4gIC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2VzIGZyb20gYSBub2RlLCBhZGRpbmcgdGhlbSB0byB0aGUgcmVmcyBTZXRcbiAgICBmdW5jdGlvbiBjb2xsZWN0RnJhZ21lbnRSZWZlcmVuY2VzKG5vZGUsIHJlZnMpIHtcbiAgICAgIGlmIChub2RlLmtpbmQgPT09IFwiRnJhZ21lbnRTcHJlYWRcIikge1xuICAgICAgICByZWZzLmFkZChub2RlLm5hbWUudmFsdWUpO1xuICAgICAgfSBlbHNlIGlmIChub2RlLmtpbmQgPT09IFwiVmFyaWFibGVEZWZpbml0aW9uXCIpIHtcbiAgICAgICAgdmFyIHR5cGUgPSBub2RlLnR5cGU7XG4gICAgICAgIGlmICh0eXBlLmtpbmQgPT09IFwiTmFtZWRUeXBlXCIpIHtcbiAgICAgICAgICByZWZzLmFkZCh0eXBlLm5hbWUudmFsdWUpO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChub2RlLnNlbGVjdGlvblNldCkge1xuICAgICAgICBub2RlLnNlbGVjdGlvblNldC5zZWxlY3Rpb25zLmZvckVhY2goZnVuY3Rpb24oc2VsZWN0aW9uKSB7XG4gICAgICAgICAgY29sbGVjdEZyYWdtZW50UmVmZXJlbmNlcyhzZWxlY3Rpb24sIHJlZnMpO1xuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgaWYgKG5vZGUudmFyaWFibGVEZWZpbml0aW9ucykge1xuICAgICAgICBub2RlLnZhcmlhYmxlRGVmaW5pdGlvbnMuZm9yRWFjaChmdW5jdGlvbihkZWYpIHtcbiAgICAgICAgICBjb2xsZWN0RnJhZ21lbnRSZWZlcmVuY2VzKGRlZiwgcmVmcyk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICBpZiAobm9kZS5kZWZpbml0aW9ucykge1xuICAgICAgICBub2RlLmRlZmluaXRpb25zLmZvckVhY2goZnVuY3Rpb24oZGVmKSB7XG4gICAgICAgICAgY29sbGVjdEZyYWdtZW50UmVmZXJlbmNlcyhkZWYsI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gPEJPTT5cblxuICAgICAgY2FzZSA5OiAvLyAgIFxcdFxuXG4gICAgICBjYXNlIDMyOiAvLyAgPHNwYWNlPlxuXG4gICAgICBjYXNlIDQ0OlxuICAgICAgICAvLyAgLFxuICAgICAgICArK3BvcztcbiAgICAgICAgY29udGludWU7XG5cbiAgICAgIGNhc2UgMTA6XG4gICAgICAgIC8vICBcXG5cbiAgICAgICAgKytwb3M7XG4gICAgICAgICsrbGV4ZXIubGluZTtcbiAgICAgICAgbGV4ZXIubGluZVN0YXJ0ID0gcG9zO1xuICAgICAgICBjb250aW51ZTtcblxuICAgICAgY2FzZSAxMzpcbiAgICAgICAgLy8gIFxcclxuICAgICAgICBpZiAoYm9keS5jaGFyQ29kZUF0KHBvcyArIDEpID09PSAxMCkge1xuICAgICAgICAgIHBvcyArPSAyO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICsrcG9zO1xuICAgICAgICB9XG5cbiAgICAgICAgKytsZXhlci5saW5lO1xuICAgICAgICBsZXhlci5saW5lU3RhcnQgPSBwb3M7XG4gICAgICAgIGNvbnRpbnVlO1xuXG4gICAgICBjYXNlIDMzOlxuICAgICAgICAvLyAgIVxuICAgICAgICByZXR1cm4gbmV3IF9hc3QuVG9rZW4oX3Rva2VuS2luZC5Ub2tlbktpbmQuQkFORywgcG9zLCBwb3MgKyAxLCBfbGluZSwgX2NvbCwgcHJldik7XG5cbiAgICAgIGNhc2UgMzU6XG4gICAgICAgIC8vICAjXG4gICAgICAgIHJldHVybiByZWFkQ29tbWVudChzb3VyY2UsIHBvcywgX2xpbmUsIF9jb2wsIHByZXYpO1xuXG4gICAgICBjYXNlIDM2OlxuICAgICAgICAvLyAgJFxuICAgICAgICByZXR1cm4gbmV3IF9hc3QuVG9rZW4oX3Rva2VuS2luZC5Ub2tlbktpbmQuRE9MTEFSLCBwb3MsIHBvcyArIDEsIF9saW5lLCBfY29sLCBwcmV2KTtcblxuICAgICAgY2FzZSAzODpcbiAgICAgICAgLy8gICZcb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gMSkgPT09IDM0ICYmIGJvZHkuY2hhckNvZGVBdChwb3MgKyAyKSA9PT0gMzQpIHtcbiAgICAgICAgICByZXR1cm4gcmVhZEJsb2NrU3RyaW5nKHNvdXJjZSwgcG9zLCBfbGluZSwgX2NvbCwgcHJldiwgbGV4ZXIpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlYWRTdHJpbmcoc291cmNlLCBwb3MsIF9saW5lLCBfY29sLCBwcmV2KTtcblxuICAgICAgY2FzZSA0NTogLy8gIC1cblxuICAgICAgY2FzZSA0ODogLy8gIDBcblxuICAgICAgY2FzZSA0OTogLy8gIDFcblxuICAgICAgY2FzZSA1MDogLy8gIDJcblxuICAgICAgY2FzZSA1MTogLy8gIDNcblxuICAgICAgY2FzZSA1MjogLy8gIDRcblxuICAgICAgY2FzZSA1MzogLy8gIDVcblxuICAgICAgY2FzZSA1NDogLy8gIDZcblxuICAgICAgY2FzZSA1NTogLy8gIDdcblxuICAgICAgY2FzZSA1NjogLy8gIDhcblxuICAgICAgY2FzZSA1NzpcbiAgICAgICAgLy8gIDlcbiAgICAgICAgcmV0dXJuIHJlYWROdW1iZXIoc291cmNlLCBwb3MsIGNvZGUsIF9saW5lLCBfY29sLCBwcmV2KTtcblxuICAgICAgY2FzZSA2NTogLy8gIEFcblxuICAgICAgY2FzZSA2NjogLy8gIEJcblxuICAgICAgY2FzZSA2NzogLy8gIENcblxuICAgICAgY2FzZSA2ODogLy8gIERcblxuICAgICAgY2FzZSA2OTogLy8gIEVcblxuICAgICAgY2FzZSA3MDogLy8gIEZcblxuICAgICAgY2FzZSA3MTogLy8gIEdcblxuICAgICAgY2FzZSA3MjogLy8gIEhcblxuICAgICAgY2FzZSA3MzogLy8gIElcblxuICAgICAgY2FzZSA3NDogLy8gIEpcblxuICAgICAgY2FzZSA3NTogLy8gIEtcblxuICAgICAgY2FzZSA3NjogLy8gIExcblxuICAgICAgY2FzZSA3NzogLy8gIE1cblxuICAgICAgY2FzZSA3ODogLy8gIE5cblxuICAgICAgY2FzZSA3OTogLy8gIE9cblxuICAgICAgY2FzZSA4MDogLy8gIFBcblxuICAgICAgY2FzZSA4MTogLy8gIFFcblxuICAgICAgY2FzZSA4MjogLy8gIFJcblxuICAgICAgY2FzZSA4MzogLy8gIFNcblxuICAgICAgY2FzZSA4NDogLy8gIFRcblxuICAgICAgY2FzZSA4NTogLy8gIFVcblxuICAgICAgY2FzZSA4NjogLy8gIFZcblxuICAgICAgY2FzZSA4NzogLy8gIFdcblxuICAgICAgY2FzZSA4ODogLy8gIFhcblxuICAgICAgY2FzZSA4OTogLy8gIFlcblxuICAgICAgY2FzZSA5MDogLy8gIFpcblxuICAgICAgY2FzZSA5NTogLy8gIF9cblxuICAgICAgY2FzZSA5NzogLy8gIGFcblxuICAgICAgY2FzZSA5ODogLy8gIGJcblxuICAgICAgY2FzZSA5OTogLy8gIGNcblxuICAgICAgY2FzZSAxMDA6IC8vIGRcblxuICAgICAgY2FzZSAxMDE6IC8vIGVcblxuICAgICAgY2FzZSAxMDI6IC8vIGZcblxuICAgICAgY2FzZSAxMDM6IC8vIGdcblxuICAgICAgY2FzZSAxMDQ6IC8vIGhcblxuICAgICAgY2FzZSAxMDU6IC8vIGlcblxuICAgICAgY2FzZSAxMDY6IC8vIGpcblxuICAgICAgY2FzZSAxMDc6IC8vIGtcblxuICAgICAgY2FzZSAxMDg6IC8vIGxcblxuICAgICAgY2FzZSAxMDk6IC8vIG1cblxuICAgICAgY2FzZSAxMTA6IC8vIG5cblxuICAgICAgY2FzZSAxMTE6IC8vIG9cblxuICAgICAgY2FzZSAxMTI6IC8vIHBcblxuICAgICAgY2FzZSAxMTM6IC8vIHFcblxuICAgICAgY2FzZSAxMTQ6IC8vIHJcblxuICAgICAgY2FzZSAxMTU6IC8vIHNcblxuICAgICAgY2FzZSAxMTY6IC8vIHRcblxuICAgICAgY2FzZSAxMTc6IC8vIHVcblxuICAgICAgY2FzZSAxMTg6IC8vIHZcblxuICAgICAgY2FzZS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s7XG5cbiAgICAgICAgY2FzZSA0NzpcbiAgICAgICAgICB2YWx1ZSArPSAnLyc7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSA5MjpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxcXCc7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSA5ODpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxiJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDEwMjpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxmJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExMDpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxuJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExNDpcbiAgICAgICAgICB2YWx1ZSArPSAnXFxyJztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExNjpcbiAgICAgICAgICB2YWx1ZSArPSAnXFx0JztcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIDExNzpcbiAgICAgICAgICB7XG4gICAgICAgICAgICAvLyB1WFhYWFxuICAgICAgICAgICAgdmFyIGNoYXJDb2RlID0gdW5pQ2hhckNvZGUoYm9keS5jaGFyQ29kZUF0KHBvc2l0aW9uICsgMSksIGJvZHkuY2hhckNvZGVBdChwb3NpdGlvbiArIDIpLCBib2R5LmNoYXJDb2RlQXQocG9zaXRpb24gKyAzKSwgYm9keS5jaGFyQ29kZUF0KHBvc2l0aW9uICsgNCkpO1xuXG4gICAgICAgICAgICBpZiAoY2hhckNvZGUgPCAwKSB7XG4gICAgICAgICAgICAgIHZhciBpbnZhbGlkU2VxdWVuY2UgPSBib2R5LnNsaWNlKHBvc2l0aW9uICsgMSwgcG9zaXRpb24gKyA1KTtcbiAgICAgICAgICAgICAgdGhyb3cgKDAsIF9zeW50YXhFcnJvci5zeW50YXhFcnJvcikoc291cmNlLCBwb3NpdGlvbiwgXCJJbnZ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hc2UgX3Rva2VuS2luZC5Ub2tlbktpbmQuSU5UOlxuICAgICAgICB0aGlzLl9sZXhlci5hZHZhbmNlKCk7XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBraW5kOiBfa2luZHMuS2luZC5JTlQsXG4gICAgICAgICAgdmFsdWU6IHRva2VuLnZhbHVlLFxuICAgICAgICAgIGxvYzogdGhpcy5sb2ModG9rZW4pXG4gICAgICAgIH07XG5cbiAgICAgIGNhc2UgX3Rva2VuS2luZC5Ub2tlbktpbmQuRkxPQVQ6XG4gICAgICAgIHRoaXMuX2xleGVyLmFkdmFuY2UoKTtcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGtpbmQ6IF9raW5kcy5LaW5kLkZMT0FULFxuICAgICAgICAgIHZhbHVlOiB0b2tlbi52YWx1ZSxcbiAgICAgICAgICBsb2M6IHRoaXMubG9jKHRva2VuKVxuICAgICAgICB9O1xuXG4gICAgICBjYXNlIF90b2tlbktpbmQuVG9rZW5LaW5kLlNUUklORzpcbiAgICAgIGNhc2UgX3Rva2VuS2luZC5Ub2tlbktpbmQuQkxPQ0tfU1RSSU5HOlxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVN0cmluZ0xpdGVyYWwoKTtcblxuICAgICAgY2FzZSBfdG9rZW5LaW5kLlRva2VuS2luZC5OQU1FOlxuICAgICAgICB0aGlzLl9sZXhlci5hZHZhbmNlKCk7XG5cbiAgICAgICAgc3dpdGNoICh0b2tlbi52YWx1ZSkge1xuICAgICAgICAgIGNhc2UgJ3RydWUnOlxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAga2luZDogX2tpbmRzLktpbmQuQk9PTEVBTixcbiAgICAgICAgICAgICAgdmFsdWU6IHRydWUsXG4gICAgICAgICAgICAgIGxvYzogdGhpcy5sb2ModG9rZW4pXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgY2FzZSAnZmFsc2UnOlxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAga2luZDogX2tpbmRzLktpbmQuQk9PTEVBTixcbiAgICAgICAgICAgICAgdmFsdWU6IGZhbHNlLFxuICAgICAgICAgICAgICBsb2M6IHRoaXMubG9jKHRva2VuKVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgIGNhc2UgJ251bGwnOlxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAga2luZDogX2tpbmRzLktpbmQuTlVMTCxcbiAgICAgICAgICAgICAgbG9jOiB0aGlzLmxvYyh0b2tlbilcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAga2luZDogX2tpbmRzLktpbmQuRU5VTSxcbiAgICAgICAgICAgICAgdmFsdWU6IHRva2VuLnZhbHVlLFxuICAgICAgICAgICAgICBsb2M6IHRoaXMubG9jKHRva2VuKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIF90b2tlbktpbmQuVG9rZW5LaW5kLkRPTExBUjpcbiAgICAgICAgaWYgKCFpc0NvbnN0KSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VWYXJpYWJsZSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgdGhyb3cgdGhpcy51bmV4cGVjdGVkKCk7XG4gIH07XG5cbiAgX3Byb3RvLnBhcnNlU3RyaW5nTGl0ZXJhbCA9IGZ1bmN0aW9uIHBhcnNlU3RyaW5nTGl0ZXJhbCgpIHtcbiAgICB2YXIgdG9rZW4gPSB0aGlzLl9sZXhlci50b2tlbjtcblxuICAgIHRoaXMuX2xleGVyLmFkdmFuY2UoKTtcblxuICAgIHJldHVybiB7XG4gICAgICBraW5kOiBfa2luZHMuS2luZC5TVFJJTkcsXG4gICAgICB2YWx1ZTogdG9rZW4udmFsdWUsXG4gICAgICBibG9jazogdG9rZW4ua2luZCA9PT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ZW50ZXJpbmcgYW5kIGxlYXZpbmcgYW55IG5vZGUuXG4gKlxuICogICAgIHZpc2l0KGFzdCwge1xuICogICAgICAgZW50ZXIobm9kZSkge1xuICogICAgICAgICAvLyBlbnRlciBhbnkgbm9kZVxuICogICAgICAgfSxcbiAqICAgICAgIGxlYXZlKG5vZGUpIHtcbiAqICAgICAgICAgLy8gbGVhdmUgYW55IG5vZGVcbiAqICAgICAgIH1cbiAqICAgICB9KVxuICpcbiAqIDQpIFBhcmFsbGVsIHZpc2l0b3JzIGZvciBlbnRlcmluZyBhbmQgbGVhdmluZyBub2RlcyBvZiBhIHNwZWNpZmljIGtpbmQuXG4gKlxuICogICAgIHZpc2l0KGFzdCwge1xuICogICAgICAgZW50ZXI6IHtcbiAqICAgICAgICAgS2luZChub2RlKSB7XG4gKiAgICAgICAgICAgLy8gZW50ZXIgdGhlIFwiS2luZFwiIG5vZGVcbiAqICAgICAgICAgfVxuICogICAgICAgfSxcbiAqICAgICAgIGxlYXZlOiB7XG4gKiAgICAgICAgIEtpbmQobm9kZSkge1xuICogICAgICAgICAgIC8vIGxlYXZlIHRoZSBcIktpbmRcIiBub2RlXG4gKiAgICAgICAgIH1cbiAqICAgICAgIH1cbiAqICAgICB9KVxuICovXG5cbmV4cG9ydHMuQlJFQUsgPSBCUkVBSztcblxuZnVuY3Rpb24gdmlzaXQocm9vdCwgdmlzaXRvcikge1xuICB2YXIgdmlzaXRvcktleXMgPSBhcmd1bWVudHMubGVuZ3RoID4gMiAmJiBhcmd1bWVudHNbMl0gIT09IHVuZGVmaW5lZCA/IGFyZ3VtZW50c1syXSA6IFF1ZXJ5RG9jdW1lbnRLZXlzO1xuXG4gIC8qIGVzbGludC1kaXNhYmxlIG5vLXVuZGVmLWluaXQgKi9cbiAgdmFyIHN0YWNrID0gdW5kZWZpbmVkO1xuICB2YXIgaW5BcnJheSA9IEFycmF5LmlzQXJyYXkocm9vdCk7XG4gIHZhciBrZXlzID0gW3Jvb3RdO1xuICB2YXIg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AgdmFyIGVkaXRPZmZzZXQgPSAwO1xuXG4gICAgICAgIGZvciAodmFyIGlpID0gMDsgaWkgPCBlZGl0cy5sZW5ndGg7IGlpKyspIHtcbiAgICAgICAgICB2YXIgZWRpdEtleSA9IGVkaXRzW2lpXVswXTtcbiAgICAgICAgICB2YXIgZWRpdFZhbHVlID0gZWRpdHNbaWldWzFdO1xuXG4gICAgICAgICAgaWYgKGluQXJyYXkpIHtcbiAgICAgICAgICAgIGVkaXRLZXkgLT0gZWRpdE9mZnNldDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoaW5BcnJheSAmJiBlZGl0VmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgIG5vZGUuc3BsaWNlKGVkaXRLZXksIDEpO1xuICAgICAgICAgICAgZWRpdE9mZnNldCsrO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBub2RlW2VkaXRLZXldID0gZWRpdFZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpbmRleCA9IHN0YWNrLmluZGV4O1xuICAgICAga2V5cyA9IHN0YWNrLmtleXM7XG4gICAgICBlZGl0cyA9IHN0YWNrLmVkaXRzO1xuICAgICAgaW5BcnJheSA9IHN0YWNrLmluQXJyYXk7XG4gICAgICBzdGFjayA9IHN0YWNrLnByZXY7XG4gICAgfSBlbHNlIHtcbiAgICAgIGtleSA9IHBhcmVudCA/IGluQXJyYXkgPyBpbmRleCA6IGtleXNbaW5kZXhdIDogdW5kZWZpbmVkO1xuICAgICAgbm9kZSA9IHBhcmVudCA/IHBhcmVudFtrZXldIDogbmV3Um9vdDtcblxuICAgICAgaWYgKG5vZGUgPT09IG51bGwgfHwgbm9kZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuXG4gICAgICBpZiAocGFyZW50KSB7XG4gICAgICAgIHBhdGgucHVzaChrZXkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHZhciByZXN1bHQgPSB2b2lkIDA7XG5cbiAgICBpZiAoIUFycmF5LmlzQXJyYXkobm9kZSkpIHtcbiAgICAgIGlmICghKDAsIF9hc3QuaXNOb2RlKShub2RlKSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJJbnZhbGlkIEFTVCBOb2RlOiBcIi5jb25jYXQoKDAsIF9pbnNwZWN0LmRlZmF1bHQpKG5vZGUpLCBcIi5cIikpO1xuICAgICAgfVxuXG4gICAgICB2YXIgdmlzaXRGbiA9IGdldFZpc2l0Rm4odmlzaXRvciwgbm9kZS5raW5kLCBpc0xlYXZpbmcpO1xuXG4gICAgICBpZiAodmlzaXRGbikge1xuICAgICAgICByZXN1bHQgPSB2aXNpdEZuLmNhbGwodmlzaXRvciwgbm9kZSwga2V5LCBwYXJlbnQsIHBhdGgsIGFuY2VzdG9ycyk7XG5cbiAgICAgICAgaWYgKHJlc3VsdCA9PT0gQlJFQUspIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyZXN1bHQgPT09IGZhbHNlKSB7XG4gICAgICAgICAgaWYgKCFpc0xlYXZpbmcpIHtcbiAgICAgICAgICAgIHBhdGgucG9wKCk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAocmVzdWx0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBlZGl0cy5wdXNoKFtrZXksIHJlc3VsdF0pO1xuXG4gICAgICAgICAgaWYgKCFpc0xlYXZpbmcpIHtcbiAgICAgICAgICAgIGlmICgoMCwgX2FzdC5pc05vZGUpKHJlc3VsdCkpIHtcbiAgICAgICAgICAgICAgbm9kZSA9IHJlc3VsdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBhdGgucG9wKCk7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChyZXN1bHQgPT09IHVuZGVmaW5lZCAmJiBpc0VkaXRlZCkge1xuICAgICAgZWRpdHMucHVzaChba2V5LCBub2RlXSk7XG4gICAgfVxuXG4gICAgaWYgKGlzTGVhdmluZykge1xuICAgICAgcGF0aC5wb3AoKTtcbiAgICB9IGVsc2Uge1xuICAgICAgdmFyIF92aXNpdG9yS2V5cyRub2RlJGtpbjtcblxuICAgICAgc3RhY2sgPSB7XG4gICAgICAgIGluQXJyYXk6IGluQXJyYXksXG4gICAgICAgIGluZGV4OiBpbmRleCxcbiAgICAgICAga2V5czoga2V5cyxcbiAgICAgICAgZWRpdHM6IGVkaXRzLFxuICAgICAgICBwcmV2OiBzdGFja1xuICAgICAgfTtcbiAgICAgIGluQXJyYXkgPSBBcnJheS5pc0FycmF5KG5vZGUpO1xuICAgICAga2V5cyA9IGluQXJyYXkgPyBub2RlIDogKF92aXNpdG9yS2V5cyRub2RlJGtpbiA9IHZpc2l0b3JLZXlzW25vZGUua2luZF0pICE9PSBudWxsICYmIF92aXNpdG9yS2V5cyRub2RlJGtpbiAhPT0gdm9pZCAwID8gX3Zpc2l0b3JLZXlzJG5vZGUka2luIDogW107XG4gICAgICBpbmRleCA9IC0xO1xuICAgICAgZWRpdHMgPSBbXTtcblxuICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICBhbmNlc3RvcnMucHVzaChwYXJlbnQpO1xuICAgICAgfVxuXG4gICAgICBwYXJlbnQgPSBub2RlO1xuICAgIH1cbiAgfSB3aGlsZSAoc3RhY2sgIT09IHVuZGVmaW5lZCk7XG5cbiAgaWYgKGVkaXRzLmxlbmd0aCAhPT0gMCkge1xuICAgIG5ld1Jvb3QgPSBlZGl0c1tlZGl0cy5sZW5ndGggLSAxXVsxXTtcbiAgfVxuXG4gIHJldHVybiBuZXdSb290O1xufVxuLyoqXG4gKiBDcmVhdGVzIGEgbmV3IHZpc2l0b3IgaW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XG4gICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcbiAgICBsZWF2ZTogZnVuY3Rpb24gbGVhdmUobm9kZSkge1xuICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aXNpdG9ycy5sZW5ndGg7IGkrKykge1xuICAgICAgICBpZiAoc2tpcHBpbmdbaV0gPT0gbnVsbCkge1xuICAgICAgICAgIHZhciBmbiA9IGdldFZpc2l0Rm4odmlzaXRvcnNbaV0sIG5vZGUua2luZCxcbiAgICAgICAgICAvKiBpc0xlYXZpbmcgKi9cbiAgICAgICAgICB0cnVlKTtcblxuICAgICAgICAgIGlmIChmbikge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGZuLmFwcGx5KHZpc2l0b3JzW2ldLCBhcmd1bWVudHMpO1xuXG4gICAgICAgICAgICBpZiAocmVzdWx0ID09PSBCUkVBSykge1xuICAgICAgICAgICAgICBza2lwcGluZ1tpXSA9IEJSRUFLO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQgIT09IHVuZGVmaW5lZCAmJiByZXN1bHQgIT09IGZhbHNlKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHNraXBwaW5nW2ldID09PSBub2RlKSB7XG4gICAgICAgICAgc2tpcHBpbmdbaV0gPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9O1xufVxuLyoqXG4gKiBHaXZlbiBhIHZpc2l0b3IgaW5zdGFuY2UsIGlmIGl0IGlzIGxlYXZpbmcgb3Igbm90LCBhbmQgYSBub2RlIGtpbmQsIHJldHVyblxuICogdGhlIGZ1bmN0aW9uIHRoZSB2aXNpdG9yIHJ1bnRpbWUgc2hvdWxkIGNhbGwuXG4gKi9cblxuXG5mdW5jdGl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AgICAgICAgLy8gbGVhdmUgdGhlIFwiS2luZFwiIG5vZGVcbiAqICAgICAgICAgfVxuICogICAgICAgfVxuICogICAgIH0pXG4gKlxuICogMykgR2VuZXJpYyB2aXNpdG9ycyB0aGF0IHRyaWdnZXIgdXBvbiBlbnRlcmluZyBhbmQgbGVhdmluZyBhbnkgbm9kZS5cbiAqXG4gKiAgICAgdmlzaXQoYXN0LCB7XG4gKiAgICAgICBlbnRlcihub2RlKSB7XG4gKiAgICAgICAgIC8vIGVudGVyIGFueSBub2RlXG4gKiAgICAgICB9LFxuICogICAgICAgbGVhdmUobm9kZSkge1xuICogICAgICAgICAvLyBsZWF2ZSBhbnkgbm9kZVxuICogICAgICAgfVxuICogICAgIH0pXG4gKlxuICogNCkgUGFyYWxsZWwgdmlzaXRvcnMgZm9yIGVudGVyaW5nIGFuZCBsZWF2aW5nIG5vZGVzIG9mIGEgc3BlY2lmaWMga2luZC5cbiAqXG4gKiAgICAgdmlzaXQoYXN0LCB7XG4gKiAgICAgICBlbnRlcjoge1xuICogICAgICAgICBLaW5kKG5vZGUpIHtcbiAqICAgICAgICAgICAvLyBlbnRlciB0aGUgXCJLaW5kXCIgbm9kZVxuICogICAgICAgICB9XG4gKiAgICAgICB9LFxuICogICAgICAgbGVhdmU6IHtcbiAqICAgICAgICAgS2luZChub2RlKSB7XG4gKiAgICAgICAgICAgLy8gbGVhdmUgdGhlIFwiS2luZFwiIG5vZGVcbiAqICAgICAgICAgfVxuICogICAgICAgfVxuICogICAgIH0pXG4gKi9cblxuZXhwb3J0IGZ1bmN0aW9uIHZpc2l0KHJvb3QsIHZpc2l0b3IpIHtcbiAgdmFyIHZpc2l0b3JLZXlzID0gYXJndW1lbnRzLmxlbmd0aCA+IDIgJiYgYXJndW1lbnRzWzJdICE9PSB1bmRlZmluZWQgPyBhcmd1bWVudHNbMl0gOiBRdWVyeURvY3VtZW50S2V5cztcblxuICAvKiBlc2xpbnQtZGlzYWJsZSBuby11bmRlZi1pbml0ICovXG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09iamVjdCRrZXlzMltfaTJdO1xuICAgICAgICAgICAgY2xvbmVba10gPSBub2RlW2tdO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIG5vZGUgPSBjbG9uZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBlZGl0T2Zmc2V0ID0gMDtcblxuICAgICAgICBmb3IgKHZhciBpaSA9IDA7IGlpIDwgZWRpdHMubGVuZ3RoOyBpaSsrKSB7XG4gICAgICAgICAgdmFyIGVkaXRLZXkgPSBlZGl0c1tpaV1bMF07XG4gICAgICAgICAgdmFyIGVkaXRWYWx1ZSA9IGVkaXRzW2lpXVsxXTtcblxuICAgICAgICAgIGlmIChpbkFycmF5KSB7XG4gICAgICAgICAgICBlZGl0S2V5IC09IGVkaXRPZmZzZXQ7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGluQXJyYXkgJiYgZWRpdFZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICBub2RlLnNwbGljZShlZGl0S2V5LCAxKTtcbiAgICAgICAgICAgIGVkaXRPZmZzZXQrKztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9kZVtlZGl0S2V5XSA9IGVkaXRWYWx1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaW5kZXggPSBzdGFjay5pbmRleDtcbiAgICAgIGtleXMgPSBzdGFjay5rZXlzO1xuICAgICAgZWRpdHMgPSBzdGFjay5lZGl0cztcbiAgICAgIGluQXJyYXkgPSBzdGFjay5pbkFycmF5O1xuICAgICAgc3RhY2sgPSBzdGFjay5wcmV2O1xuICAgIH0gZWxzZSB7XG4gICAgICBrZXkgPSBwYXJlbnQgPyBpbkFycmF5ID8gaW5kZXggOiBrZXlzW2luZGV4XSA6IHVuZGVmaW5lZDtcbiAgICAgIG5vZGUgPSBwYXJlbnQgPyBwYXJlbnRba2V5XSA6IG5ld1Jvb3Q7XG5cbiAgICAgIGlmIChub2RlID09PSBudWxsIHx8IG5vZGUgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICBwYXRoLnB1c2goa2V5KTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgcmVzdWx0ID0gdm9pZCAwO1xuXG4gICAgaWYgKCFBcnJheS5pc0FycmF5KG5vZGUpKSB7XG4gICAgICBpZiAoIWlzTm9kZShub2RlKSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJJbnZhbGlkIEFTVCBOb2RlOiBcIi5jb25jYXQoaW5zcGVjdChub2RlKSwgXCIuXCIpKTtcbiAgICAgIH1cblxuICAgICAgdmFyIHZpc2l0Rm4gPSBnZXRWaXNpdEZuKHZpc2l0b3IsIG5vZGUua2luZCwgaXNMZWF2aW5nKTtcblxuICAgICAgaWYgKHZpc2l0Rm4pIHtcbiAgICAgICAgcmVzdWx0ID0gdmlzaXRGbi5jYWxsKHZpc2l0b3IsIG5vZGUsIGtleSwgcGFyZW50LCBwYXRoLCBhbmNlc3RvcnMpO1xuXG4gICAgICAgIGlmIChyZXN1bHQgPT09IEJSRUFLKSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocmVzdWx0ID09PSBmYWxzZSkge1xuICAgICAgICAgIGlmICghaXNMZWF2aW5nKSB7XG4gICAgICAgICAgICBwYXRoLnBvcCgpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgZWRpdHMucHVzaChba2V5LCByZXN1bHRdKTtcblxuICAgICAgICAgIGlmICghaXNMZWF2aW5nKSB7XG4gICAgICAgICAgICBpZiAoaXNOb2RlKHJlc3VsdCkpIHtcbiAgICAgICAgICAgICAgbm9kZSA9IHJlc3VsdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBhdGgucG9wKCk7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChyZXN1bHQgPT09IHVuZGVmaW5lZCAmJiBpc0VkaXRlZCkge1xuICAgICAgZWRpdHMucHVzaChba2V5LCBub2RlXSk7XG4gICAgfVxuXG4gICAgaWYgKGlzTGVhdmluZykge1xuICAgICAgcGF0aC5wb3AoKTtcbiAgICB9IGVsc2Uge1xuICAgICAgdmFyIF92aXNpdG9yS2V5cyRub2RlJGtpbjtcblxuICAgICAgc3RhY2sgPSB7XG4gICAgICAgIGluQXJyYXk6IGluQXJyYXksXG4gICAgICAgIGluZGV4OiBpbmRleCxcbiAgICAgICAga2V5czoga2V5cyxcbiAgICAgICAgZWRpdHM6IGVkaXRzLFxuICAgICAgICBwcmV2OiBzdGFja1xuICAgICAgfTtcbiAgICAgIGluQXJyYXkgPSBBcnJheS5pc0FycmF5KG5vZGUpO1xuICAgICAga2V5cyA9IGluQXJyYXkgPyBub2RlIDogKF92aXNpdG9yS2V5cyRub2RlJGtpbiA9IHZpc2l0b3JLZXlzW25vZGUua2luZF0pICE9PSBudWxsICYmIF92aXNpdG9yS2V5cyRub2RlJGtpbiAhPT0gdm9pZCAwID8gX3Zpc2l0b3JLZXlzJG5vZGUka2luIDogW107XG4gICAgICBpbmRleCA9IC0xO1xuICAgICAgZWRpdHMgPSBbXTtcblxuICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICBhbmNlc3RvcnMucHVzaChwYXJlbnQpO1xuICAgICAgfVxuXG4gICAgICBwYXJlbnQgPSBub2RlO1xuICAgIH1cbiAgfSB3aGlsZSAoc3RhY2sgIT09IHVuZGVmaW5lZCk7XG5cbiAgaWYgKGVkaXRzLmxlbmd0aCAhPT0gMCkge1xuICAgIG5ld1Jvb3QgPSBlZGl0c1tlZGl0cy5sZW5nd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RlcmF0b3IgPSBjcmVhdGVBc3luY0l0ZXJhdG9yKHNvdXJjZSlcbiAgaWYgKGFzeW5jSXRlcmF0b3IpIHtcbiAgICB2YXIgaSA9IDBcbiAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICBmdW5jdGlvbiBuZXh0KCkge1xuICAgICAgICBhc3luY0l0ZXJhdG9yXG4gICAgICAgICAgLm5leHQoKVxuICAgICAgICAgIC50aGVuKGZ1bmN0aW9uKHN0ZXApIHtcbiAgICAgICAgICAgIGlmICghc3RlcC5kb25lKSB7XG4gICAgICAgICAgICAgIFByb21pc2UucmVzb2x2ZShjYWxsYmFjay5jYWxsKHRoaXNBcmcsIHN0ZXAudmFsdWUsIGkrKywgc291cmNlKSlcbiAgICAgICAgICAgICAgICAudGhlbihuZXh0KVxuICAgICAgICAgICAgICAgIC5jYXRjaChyZWplY3QpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXNvbHZlKClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEV4cGxpY2l0bHkgcmV0dXJuIG51bGwsIHNpbGVuY2luZyBibHVlYmlyZC1zdHlsZSB3YXJuaW5ncy5cbiAgICAgICAgICAgIHJldHVybiBudWxsXG4gICAgICAgICAgfSlcbiAgICAgICAgICAuY2F0Y2gocmVqZWN0KVxuICAgICAgICAvLyBFeHBsaWNpdGx5IHJldHVybiBudWxsLCBzaWxlbmNpbmcgYmx1ZWJpcmQtc3R5bGUgd2FybmluZ3MuXG4gICAgICAgIHJldHVybiBudWxsXG4gICAgICB9XG4gICAgICBuZXh0KClcbiAgICB9KVxuICB9XG59XG4iLCJpbXBvcnQgeyBTbG90IH0gZnJvbSAnQHdyeS9jb250ZXh0JztcbmV4cG9ydCB7IGFzeW5jRnJvbUdlbiwgYmluZCBhcyBiaW5kQ29udGV4dCwgbm9Db250ZXh0LCBzZXRUaW1lb3V0IH0gZnJ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yID0gZW50cnkubmV3ZXI7XHJcbiAgICAgICAgICAgIGlmIChuZXdlcikge1xyXG4gICAgICAgICAgICAgICAgbmV3ZXIub2xkZXIgPSBvbGRlcjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAob2xkZXIpIHtcclxuICAgICAgICAgICAgICAgIG9sZGVyLm5ld2VyID0gbmV3ZXI7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZW50cnkub2xkZXIgPSB0aGlzLm5ld2VzdDtcclxuICAgICAgICAgICAgZW50cnkub2xkZXIubmV3ZXIgPSBlbnRyeTtcclxuICAgICAgICAgICAgZW50cnkubmV3ZXIgPSBudWxsO1xyXG4gICAgICAgICAgICB0aGlzLm5ld2VzdCA9IGVudHJ5O1xyXG4gICAgICAgICAgICBpZiAoZW50cnkgPT09IHRoaXMub2xkZXN0KSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLm9sZGVzdCA9IG5ld2VyO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBlbnRyeTtcclxuICAgIH07XHJcbiAgICBDYWNoZS5wcm90b3R5cGUuc2V0ID0gZnVuY3Rpb24gKGtleSwgdmFsdWUpIHtcclxuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLmdldEVudHJ5KGtleSk7XHJcbiAgICAgICAgaWYgKGVudHJ5KSB7XHJcbiAgICAgICAgICAgIHJldHVybiBlbnRyeS52YWx1ZSA9IHZhbHVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbnRyeSA9IHtcclxuICAgICAgICAgICAga2V5OiBrZXksXHJcbiAgICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcclxuICAgICAgICAgICAgbmV3ZXI6IG51bGwsXHJcbiAgICAgICAgICAgIG9sZGVyOiB0aGlzLm5ld2VzdFxyXG4gICAgICAgIH07XHJcbiAgICAgICAgaWYgKHRoaXMubmV3ZXN0KSB7XHJcbiAgICAgICAgICAgIHRoa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biAgICAgICAgdmFyIF90aGlzID0gdGhpcztcclxuICAgICAgICBpZiAodGhpcy5kZXBzKSB7XHJcbiAgICAgICAgICAgIHRoaXMuZGVwcy5mb3JFYWNoKGZ1bmN0aW9uIChkZXApIHsgcmV0dXJuIGRlcC5kZWxldGUoX3RoaXMpOyB9KTtcclxuICAgICAgICAgICAgdGhpcy5kZXBzLmNsZWFyKCk7XHJcbiAgICAgICAgICAgIGVtcHR5U2V0UG9vbC5wdXNoKHRoaXMuZGVwcyk7XHJcbiAgICAgICAgICAgIHRoaXMuZGVwcyA9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIEVudHJ5LmNvdW50ID0gMDtcclxuICAgIHJldHVybiBFbnRyeTtcclxufSgpKTtcclxuZnVuY3Rpb24gcmVtZW1iZXJQYXJlbnQoY2hpbGQpIHtcclxuICAgIHZhciBwYXJlbnQgPSBwYXJlbnRFbnRyeVNsb3QuZ2V0VmFsdWUoKTtcclxuICAgIGlmIChwYXJlbnQpIHtcclxuICAgICAgICBjaGlsZC5wYXJlbnRzLmFkZChwYXJlbnQpO1xyXG4gICAgICAgIGlmICghcGFyZW50LmNoaWxkVmFsdWVzLmhhcyhjaGlsZCkpIHtcclxuICAgICAgICAgICAgcGFyZW50LmNoaWxkVmFsdWVzLnNldChjaGlsZCwgW10pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAobWlnaHRCZURpcnR5KGNoaWxkKSkge1xyXG4gICAgICAgICAgICByZXBvcnREaXJ0eUNoaWxkKHBhcmVudCwgY2hpbGQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgcmVwb3J0Q2xlYW5DaGlsZChwYXJlbnQsIGNoaWxkKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHBhcmVudDtcclxuICAgIH1cclxufVxyXG5mdW5jdGlvbiByZWFsbHlSZWNvbXB1dGUoZW50cnkpIHtcclxuICAgIGZvcmdldEN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W5rLmFkZChvcGVyYXRvci5jYWxsKHNpbmssIHRoaXMuc291cmNlKSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzaW5rLmFkZCh0aGlzLnNvdXJjZSB8fCAoY29uZmlnLnVzZURlcHJlY2F0ZWRTeW5jaHJvbm91c0Vycm9ySGFuZGxpbmcgJiYgIXNpbmsuc3luY0Vycm9yVGhyb3dhYmxlKSA/XG4gICAgICAgICAgICAgICAgdGhpcy5fc3Vic2NyaWJlKHNpbmspIDpcbiAgICAgICAgICAgICAgICB0aGlzLl90cnlTdWJzY3JpYmUoc2luaykpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb25maWcudXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZykge1xuICAgICAgICAgICAgaWYgKHNpbmsuc3luY0Vycm9yVGhyb3dhYmxlKSB7XG4gICAgICAgICAgICAgICAgc2luay5zeW5jRXJyb3JUaHJvd2FibGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBpZiAoc2luay5zeW5jRXJyb3JUaHJvd24pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgc2luay5zeW5jRXJyb3JWYWx1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNpbms7XG4gICAgfTtcbiAgICBPYnNlcnZhYmxlLnByb3RvdHlwZS5fdHJ5U3Vic2NyaWJlID0gZnVuY3Rpb24gKHNpbmspIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9zdWJzY3JpYmUoc2luayk7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgaWYgKGNvbmZpZy51c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nKSB7XG4gICAgICAgICAgICAgICAgc2luay5zeW5jRXJyb3JUaHJvd24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHNpbmsuc3luY0Vycm9yVmFsdWUgPSBlcnI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2FuUmVwb3J0RXJyb3Ioc2luaykpIHtcbiAgICAgICAgICAgICAgICBzaW5rLmVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oZXJyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgT2JzZXJ2YWJsZS5wcm90b3R5cGUuZm9yRWFjaCA9IGZ1bmN0aW9uIChuZXh0LCBwcm9taXNlQ3Rvcikge1xuICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICBwcm9taXNlQ3RvciA9IGdldFByb21pc2VDdG9yKHByb21pc2VDdG9yKTtcbiAgICAgICAgcmV0dXJuIG5ldyBwcm9taXNlQ3RvcihmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICB2YXIgc3Vic2NyaXB0aW9uO1xuICAgICAgICAgICAgc3Vic2NyaXB0aW9uID0gX3RoaXMuc3Vic2NyaWJlKGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQodmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3Vic2NyaXB0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIHJlamVjdCwgcmVzb2x2ZSk7XG4gICAgICAgIH0p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gfSBmcm9tICcuL2NvbmZpZyc7XG5pbXBvcnQgeyBob3N0UmVwb3J0RXJyb3IgfSBmcm9tICcuL3V0aWwvaG9zdFJlcG9ydEVycm9yJztcbnZhciBTdWJzY3JpYmVyID0gLypAX19QVVJFX18qLyAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgIHRzbGliXzEuX19leHRlbmRzKFN1YnNjcmliZXIsIF9zdXBlcik7XG4gICAgZnVuY3Rpb24gU3Vic2NyaWJlcihkZXN0aW5hdGlvbk9yTmV4dCwgZXJyb3IsIGNvbXBsZXRlKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMpIHx8IHRoaXM7XG4gICAgICAgIF90aGlzLnN5bmNFcnJvclZhbHVlID0gbnVsbDtcbiAgICAgICAgX3RoaXMuc3luY0Vycm9yVGhyb3duID0gZmFsc2U7XG4gICAgICAgIF90aGlzLnN5bmNFcnJvclRocm93YWJsZSA9IGZhbHNlO1xuICAgICAgICBfdGhpcy5pc1N0b3BwZWQgPSBmYWxzZTtcbiAgICAgICAgc3dpdGNoIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBlbXB0eU9ic2VydmVyO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgIGlmICghZGVzdGluYXRpb25Pck5leHQpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBlbXB0eU9ic2VydmVyO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkZXN0aW5hdGlvbk9yTmV4dCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRlc3RpbmF0aW9uT3JOZXh0IGluc3RhbmNlb2YgU3Vic2NyaWJlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3luY0Vycm9yVGhyb3dhYmxlID0gZGVzdGluYXRpb25Pck5leHQuc3luY0Vycm9yVGhyb3dhYmxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBkZXN0aW5hdGlvbk9yTmV4dDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RpbmF0aW9uT3JOZXh0LmFkZChfdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zeW5jRXJyb3JUaHJvd2FibGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBuZXcgU2FmZVN1YnNjcmliZXIoX3RoaXMsIGRlc3RpbmF0aW9uT3JOZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIF90aGlzLnN5bmNFcnJvclRocm93YWJsZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgX3RoaXMuZGVzdGluYXRpb24gPSBuZXcgU2FmZVN1YnNjcmliZXIoX3RoaXMsIGRlc3RpbmF0aW9uT3JOZXh0LCBlcnJvciwgY29tcGxldGUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgU3Vic2NyaWJlci5wcm90b3R5cGVbcnhTdWJzY3JpYmVyU3ltYm9sXSA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXM7IH07XG4gICAgU3Vic2NyaWJlci5jcmVhdGUgPSBmdW5jdGlvbiAobmV4dCwgZXJyb3IsIGNvbXBsZ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dWJzY3JpYmVyLCBfc3VwZXIpO1xuICAgIGZ1bmN0aW9uIFNhZmVTdWJzY3JpYmVyKF9wYXJlbnRTdWJzY3JpYmVyLCBvYnNlcnZlck9yTmV4dCwgZXJyb3IsIGNvbXBsZXRlKSB7XG4gICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMpIHx8IHRoaXM7XG4gICAgICAgIF90aGlzLl9wYXJlbnRTdWJzY3JpYmVyID0gX3BhcmVudFN1YnNjcmliZXI7XG4gICAgICAgIHZhciBuZXh0O1xuICAgICAgICB2YXIgY29udGV4dCA9IF90aGlzO1xuICAgICAgICBpZiAoaXNGdW5jdGlvbihvYnNlcnZlck9yTmV4dCkpIHtcbiAgICAgICAgICAgIG5leHQgPSBvYnNlcnZlck9yTmV4dDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChvYnNlcnZlck9yTmV4dCkge1xuICAgICAgICAgICAgbmV4dCA9IG9ic2VydmVyT3JOZXh0Lm5leHQ7XG4gICAgICAgICAgICBlcnJvciA9IG9ic2VydmVyT3JOZXh0LmVycm9yO1xuICAgICAgICAgICAgY29tcGxldGUgPSBvYnNlcnZlck9yTmV4dC5jb21wbGV0ZTtcbiAgICAgICAgICAgIGlmIChvYnNlcnZlck9yTmV4dCAhPT0gZW1wdHlPYnNlcnZlcikge1xuICAgICAgICAgICAgICAgIGNvbnRleHQgPSBPYmplY3QuY3JlYXRlKG9ic2VydmVyT3JOZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250ZXh0LnVuc3Vic2NyaWJlKSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5hZGQoY29udGV4dC51bnN1YnNjcmliZS5iaW5kKGNvbnRleHQpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29udGV4dC51bnN1YnNjcmliZSA9IF90aGlzLnVuc3Vic2NyaWJlLmJpbmQoX3RoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIF90aGlzLl9jb250ZXh0ID0gY29udGV4dDtcbiAgICAgICAgX3RoaXMuX25leHQgPSBuZXh0O1xuICAgICAgICBfdGhpcy5fZXJyb3IgPSBlcnJvcjtcbiAgICAgICAgX3RoaXMuX2NvbXBsZXRlID0gY29tcGxldGU7XG4gICAgICAgIHJldHVybiBfdGhpcztcbiAgICB9XG4gICAgU2FmZVN1YnNjcmliZXIucHJvdG90eXBlLm5leHQgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzU3RvcHBlZCAmJiB0aGlzLl9uZXh0KSB7XG4gICAgICAgICAgICB2YXIgX3BhcmVudFN1YnNjcmliZXIgPSB0aGlzLl9wYXJlbnRTdWJzY3JpYmVyO1xuICAgICAgICAgICAgaWYgKCFjb25maWcudXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZyB8fCAhX3BhcmVudFN1YnNjcmliZXIuc3luY0Vycm9yVGhyb3dhYmxlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fX3RyeU9yVW5zdWIodGhpcy5fbmV4dCwgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5fX3RyeU9yU2V0RXJyb3IoX3BhcmVudFN1YnNjcmliZXIsIHRoaXMuX25leHQsIHZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHRoaXMudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgU2FmZVN1YnNjcmliZXIucHJvdG90eXBlLmVycm9yID0gZnVuY3Rpb24gKGVycikge1xuICAgICAgICBpZiAoIXRoaXMuaXNTdG9wcGVkKSB7XG4gICAgICAgICAgICB2YXIgX3BhcmVudFN1YnNjcmliZXIgPSB0aGlzLl9wYXJlbnRTdWJzY3JpYmVyO1xuICAgICAgICAgICAgdmFyIHVzZURlcHJlY2F0ZWRTeW5jaHJvbm91c0Vycm9ySGFuZGxpbmcgPSBjb25maWcudXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZztcbiAgICAgICAgICAgIGlmICh0aGlzLl9lcnJvcikge1xuICAgICAgICAgICAgICAgIGlmICghdXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZyB8fCAhX3BhcmVudFN1YnNjcmliZXIuc3luY0Vycm9yVGhyb3dhYmxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX190cnlPclVuc3ViKHRoaXMuX2Vycm9yLCBlcnIpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9fdHJ5T3JTZXRFcnJvcihfcGFyZW50U3Vic2NyaWJlciwgdGhpcy5fZXJyb3IsIGVycik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICghX3BhcmVudFN1YnNjcmliZXIuc3luY0Vycm9yVGhyb3dhYmxlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgICAgIGlmICh1c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaG9zdFJlcG9ydEVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZykge1xuICAgICAgICAgICAgICAgICAgICBfcGFyZW50U3Vic2NyaWJlci5zeW5jRXJyb3JWYWx1ZSA9IGVycjtcbiAgICAgICAgICAgICAgICAgICAgX3BhcmVudFN1YnNjcmliZXIuc3luY0Vycm9yVGhyb3duID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGhvc3RSZXBvcnRFcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFNhZmVTdWJzY3JpYmVyLnByb3RvdHlwZS5jb21wbGV0ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgaWYgKCF0aGlzLmlzU3RvcHBlZCkge1xuICAgICAgICAgICAgdmFyIF9wYXJlbnRTdWJzY3JpYmVyID0gdGhpcy5fcGFyZW50U3Vic2NyaWJlcjtcbiAgICAgICAgICAgIGlmICh0aGlzLl9jb21wbGV0ZSkge1xuICAgICAgICAgICAgICAgIHZhciB3cmFwcGVkQ29tcGxldGUgPSBmdW5jdGlvbiAoKSB7IHJldHVybiBfdGhpcy5fY29tcGxldGUuY2FsbChfdGhpcy5fY29udGV4dCk7IH07XG4gICAgICAgICAgICAgICAgaWYgKCFjb25maWcudXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZyB8fCAhX3BhcmVudFN1YnNjcmliZXIuc3luY0Vycm9yVGhyb3dhYmxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX190cnlPclVuc3ViKHdyYXBwZWRDb21wbGV0ZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX190cnlPclNldEVycm9yKF9wYXJlbnRTdWJzY3JpYmVyLCB3cmFwcGVkQ29tcGxldGUpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBTYWZlU3Vic2NyaWJlci5wcm90b3R5cGUuX190cnlPclVuc3ViID0gZnVuY3Rpb24gKGZuLCB2YWx1ZSkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgZm4uY2FsbCh0aGlzLl9jb250ZXh0LCB2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgdGhpcy51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgaWYgKGNvbmZpZy51c2VEZXByZWNhdGVkU3luY2hyb25vdXNFcnJvckhhbmRsaW5nKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaG9zdFJlcG9ydEVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFNhZmVTdWJzY3JpYmVyLnByb3RvdHlwZS5fX3RyeU9yU2V0RXJyb3IgPSBmdW5jdGlvbiAocGFyZW50LCBmbiwgdmFsdWUpIHtcbiAgICAgICAgaWYgKCFjb25maWcudXNlRGVwcmVjYXRlZFN5bmNocm9ub3VzRXJyb3JIYW5kbGluZykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdiYWQgY2FsbCcpO1xuICAgICAgICB9XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBmbi5jYWxsKHRoaXMuX2NvbnRleHQsIHZhbHVlKTtcbiAg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vbnMgPSBfYS5fc3Vic2NyaXB0aW9ucztcbiAgICAgICAgdGhpcy5jbG9zZWQgPSB0cnVlO1xuICAgICAgICB0aGlzLl9wYXJlbnRPclBhcmVudHMgPSBudWxsO1xuICAgICAgICB0aGlzLl9zdWJzY3JpcHRpb25zID0gbnVsbDtcbiAgICAgICAgaWYgKF9wYXJlbnRPclBhcmVudHMgaW5zdGFuY2VvZiBTdWJzY3JpcHRpb24pIHtcbiAgICAgICAgICAgIF9wYXJlbnRPclBhcmVudHMucmVtb3ZlKHRoaXMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKF9wYXJlbnRPclBhcmVudHMgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gMDsgaW5kZXggPCBfcGFyZW50T3JQYXJlbnRzLmxlbmd0aDsgKytpbmRleCkge1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnRfMSA9IF9wYXJlbnRPclBhcmVudHNbaW5kZXhdO1xuICAgICAgICAgICAgICAgIHBhcmVudF8xLnJlbW92ZSh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNGdW5jdGlvbihfdW5zdWJzY3JpYmUpKSB7XG4gICAgICAgICAgICBpZiAoX2N0b3JVbnN1YnNjcmliZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3Vuc3Vic2NyaWJlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBfdW5zdWJzY3JpYmUuY2FsbCh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgZXJyb3JzID0gZSBpbnN0YW5jZW9mIFVuc3Vic2NyaXB0aW9uRXJyb3IgPyBmbGF0dGVuVW5zdWJzY3JpcHRpb25FcnJvcnMoZS5lcnJvcnMpIDogW2VdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChpc0FycmF5KF9zdWJzY3JpcHRpb25zKSkge1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gLTE7XG4gICAgICAgICAgICB2YXIgbGVuID0gX3N1YnNjcmlwdGlvbnMubGVuZ3RoO1xuICAgICAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW4pIHtcbiAgICAgICAgICAgICAgICB2YXIgc3ViID0gX3N1YnNjcmlwdGlvbnNbaW5kZXhdO1xuICAgICAgICAgICAgICAgIGlmIChpc09iamVjdChzdWIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzID0gZXJyb3JzIHx8IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBVbnN1YnNjcmlwdGlvbkVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzID0gZXJyb3JzLmNvbmNhdChmbGF0dGVuVW5zdWJzY3JpcHRpb25FcnJvcnMoZS5lcnJvcnMpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ycy5wdXNoKGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChlcnJvcnMpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBVbnN1YnNjcmlwdGlvbkVycm9yKGVycm9ycyk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIFN1YnNjcmlwdGlvbi5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24gKHRlYXJkb3duKSB7XG4gICAgICAgIHZhciBzdWJzY3JpcHRpb24gPSB0ZWFyZG93bjtcbiAgICAgICAgaWYgKCF0ZWFyZG93bikge1xuICAgICAgICAgICAgcmV0dXJuIFN1YnNjcmlwdGlvbi5FTVBUWTtcbiAgICAgICAgfVxuICAgICAgICBzd2l0Y2ggKHR5cGVvZiB0ZWFyZG93bikge1xuICAgICAgICAgICAgY2FzZSAnZnVuY3Rpb24nOlxuICAgICAgICAgICAgICAgIHN1YnNjcmlwdGlvbiA9IG5ldyBTdWJzY3JpcHRpb24odGVhcmRvd24pO1xuICAgICAgICAgICAgY2FzZSAnb2JqZWN0JzpcbiAgICAgICAgICAgICAgICBpZiAoc3Vic2NyaXB0aW9uID09PSB0aGlzIHx8IHN1YnNjcmlwdGlvbi5jbG9zZWQgfHwgdHlwZW9mIHN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3Vic2NyaXB0aW9uO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0aGlzLmNsb3NlZCkge1xuICAgICAgICAgICAgICAgICAgICBzdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN1YnNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoIShzdWJzY3JpcHRpb24gaW5zdGFuY2VvZiBTdWJzY3JpcHRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSBzdWJzY3JpcHRpb247XG4gICAgICAgICAgICAgICAgICAgIHN1YnNjcmlwdGlvbiA9IG5ldyBTdWJzY3JpcHRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uLl9zdWJzY3JpcHRpb25zID0gW3RtcF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigndW5yZWNvZ25pemVkIHRlYXJkb3duICcgKyB0ZWFyZG93biArICcgYWRkZWQgdG8gU3Vic2NyaXB0aW9uLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhciBfcGFyZW50T3JQYXJlbnRzID0gc3Vic2NyaXB0aW9uLl9wYXJlbnRPclBhcmVudHM7XG4gICAgICAgIGlmIChfcGFyZW50T3JQYXJlbnRzID09PSBudWxsKSB7XG4gICAgICAgICAgICBzdWJzY3JpcHRpb24uX3BhcmVudE9yUGFyZW50cyA9IHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoX3BhcmVudE9yUGFyZW50cyBpbnN0YW5jZW9mIFN1YnNjcmlwdGlvbikge1xuICAgICAgICAgICAgaWYgKF9wYXJlbnRPclBhcmVudHMgPT09IHRoaXMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc3Vic2NyaXB0aW9uO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc3Vic2NyaXB0aW9uLl9wYXJlbnRPclBhcmVudHMgPSBbX3BhcmVudE9yUGFyZW50cywgdGhpc107XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoX3BhcmVudE9yUGFyZW50cy5pbmRleE9mKHRoaXMpID09PSAtMSkge1xuICAgICAgICAgICAgX3BhcmVudE9yUGFyZW50cy5wdXNoKHRoaXMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHN1YnNjcmlwdGlvbjtcbiAgICAgICAgfVxuICAgICAgICB2YXIgc3Vic2NyaXB0aW9ucyA9IHRoaXMuX3N1YnNjcmlwdGlvbnM7XG4gICAgICAgIGlmIChzdWJzY3JpcHRpb25z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FR5cGVFcnJvcihmbiArICcgaXMgbm90IGEgZnVuY3Rpb24nKSk7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gZG9uZSgpIHtcbiAgICAgICAgICBzdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgc3Vic2NyaXB0aW9uID0gX3RoaXMuc3Vic2NyaWJlKHtcbiAgICAgICAgICBuZXh0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGZuKHZhbHVlLCBkb25lKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgICBzdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGVycm9yOiByZWplY3QsXG4gICAgICAgICAgY29tcGxldGU6IHJlc29sdmVcbiAgICAgICAgfSk7XG4gICAgICB9KTtcbiAgICB9XG4gIH0sIHtcbiAgICBrZXk6IFwibWFwXCIsXG4gICAgdmFsdWU6IGZ1bmN0aW9uIG1hcChmbikge1xuICAgICAgdmFyIF90aGlzMiA9IHRoaXM7XG5cbiAgICAgIGlmICh0eXBlb2YgZm4gIT09ICdmdW5jdGlvbicpIHRocm93IG5ldyBUeXBlRXJyb3IoZm4gKyAnIGlzIG5vdCBhIGZ1bmN0aW9uJyk7XG4gICAgICB2YXIgQyA9IGdldFNwZWNpZXModGhpcyk7XG4gICAgICByZXR1cm4gbmV3IEMoZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgIHJldHVybiBfdGhpczIuc3Vic2NyaWJlKHtcbiAgICAgICAgICBuZXh0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHZhbHVlID0gZm4odmFsdWUpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICByZXR1cm4gb2JzZXJ2ZXIuZXJyb3IoZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG9ic2VydmVyLm5leHQodmFsdWUpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZXJyb3I6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICBvYnNlcnZlci5lcnJvcihlKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNvbXBsZXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBvYnNlcnZlci5jb21wbGV0ZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9KTtcbiAgICB9XG4gIH0sIHtcbiAgICBrZXk6IFwiZmlsdGVyXCIsXG4gICAgdmFsdWU6IGZ1bmN0aW9uIGZpbHRlcihmbikge1xuICAgICAgdmFyIF90aGlzMyA9IHRoaXM7XG5cbiAgICAgIGlmICh0eXBlb2YgZm4gIT09ICdmdW5jdGlvbicpIHRocm93IG5ldyBUeXBlRXJyb3IoZm4gKyAnIGlzIG5vdCBhIGZ1bmN0aW9uJyk7XG4gICAgICB2YXIgQyA9IGdldFNwZWNpZXModGhpcyk7XG4gICAgICByZXR1cm4gbmV3IEMoZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgIHJldHVybiBfdGhpczMuc3Vic2NyaWJlKHtcbiAgICAgICAgICBuZXh0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGlmICghZm4odmFsdWUpKSByZXR1cm47XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgIHJldHVybiBvYnNlcnZlci5lcnJvcihlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgb2JzZXJ2ZXIubmV4dCh2Y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AgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb2JzZXJ2ZXIuZXJyb3IoZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGFjYyA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZXJyb3I6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICBvYnNlcnZlci5lcnJvcihlKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNvbXBsZXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoIWhhc1ZhbHVlICYmICFoYXNTZWVkKSByZXR1cm4gb2JzZXJ2ZXIuZXJyb3IobmV3IFR5cGVFcnJvcignQ2Fubm90IHJlZHVjZSBhbiBlbXB0eSBzZXF1ZW5jZScpKTtcbiAgICAgICAgICAgIG9ic2VydmVyLm5leHQoYWNjKTtcbiAgICAgICAgICAgIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgIH1cbiAgfSwge1xuICAgIGtleTogXCJjb25jYXRcIixcbiAgICB2YWx1ZTogZnVuY3Rpb24gY29uY2F0KCkge1xuICAgICAgdmFyIF90aGlzNSA9IHRoaXM7XG5cbiAgICAgIGZvciAodmFyIF9sZW4gPSBhcmd1bWVudHMubGVuZ3RoLCBzb3VyY2VzID0gbmV3IEFycmF5KF9sZW4pLCBfa2V5ID0gMDsgX2tleSA8IF9sZW47IF9rZXkrKykge1xuICAgICAgICBzb3VyY2VzW19rZXldID0gYXJndW1lbnRzW19rZXldO1xuICAgICAgfVxuXG4gICAgICB2YXIgQyA9IGdldFNwZWNpZXModGhpcyk7XG4gICAgICByZXR1cm4gbmV3IEMoZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgIHZhciBzdWJzY3JpcHRpb247XG4gICAgICAgIHZhciBpbmRleCA9IDA7XG5cbiAgICAgICAgZnVuY3Rpb24gc3RhcnROZXh0KG5leHQpIHtcbiAgICAgICAgICBzdWJzY3JpcHRpb24gPSBuZXh0LnN1YnNjcmliZSh7XG4gICAgICAgICAgICBuZXh0OiBmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KHYpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGVycm9yOiBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICBvYnNlcnZlci5lcnJvcihlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IHNvdXJjZXMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3RhcnROZXh0KEMuZnJvbShzb3VyY2VzW2luZGV4KytdKSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN0YXJ0TmV4dChfdGhpczUpO1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIGlmIChzdWJzY3JpcHRpb24pIHtcbiAgICAgICAgICAgIHN1YnNjcmlwdGlvbi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgc3Vic2NyaXB0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH1cbiAgfSwge1xuICAgIGtleTogXCJmbGF0TWFwXCIsXG4gICAgdmFsdWU6IGZ1bmN0aW9uIGZsYXRNYXAoZm4pIHtcbiAgICAgIHZhciBfdGhpczYgPSB0aGlzO1xuXG4gICAgICBpZiAodHlwZW9mIGZuICE9PSAnZnVuY3Rpb24nKSB0aHJvdyBuZXcgVHlwZUVycm9yKGZuICsgJyBpcyBub3QgYSBmdW5jdGlvbicpO1xuICAgICAgdmFyIEMgPSBnZXRTcGVjaWVzKHRoaXMpO1xuICAgICAgcmV0dXJuIG5ldyBDKGZ1bmN0aW9uIChvYnNlcnZlcikge1xuICAgICAgICB2YXIgc3Vic2NyaXB0aW9ucyA9IFtdO1xuXG4gICAgICAgIHZhciBvdXRlciA9IF90aGlzNi5zdWJzY3JpYmUoe1xuICAgICAgICAgIG5leHQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGZuKSB7XG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBmbih2YWx1ZSk7XG4gICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb2JzZXJ2ZXIuZXJyb3IoZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGlubmVyID0gQy5mcm9tKHZhbHVlKS5zdWJzY3JpYmUoe1xuICAgICAgICAgICAgICBuZXh0OiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KHZhbHVlKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgZXJyb3I6IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXIuZXJyb3IoZSk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGNvbXBsZXRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGkgPSBzdWJzY3JpcHRpb25zLmluZGV4T2YoaW5uZXIpO1xuICAgICAgICAgICAgICAgIGlmIChpID49IDApIHN1YnNjcmlwdGlvbnMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgIGNvbXBsZXRlSWZEb25lKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgc3Vic2NyaXB0aW9ucy5wdXNoKGlubmVyKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGVycm9yOiBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgb2JzZXJ2ZXIuZXJyb3IoZSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY29tcGxldGVJZkRvbmUoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGZ1bmN0aW9uIGNvbXBsZXRlSWZEb25lKCkge1xuICAgICAgICAgIGlmIChvdXRlci5jbG9zZWQgJiYgc3Vic2NyaXB0aW9ucy5sZW5ndGggPT09IDApIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHN1YnNjcmlwdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgcmV0dXJuIHMudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBvdXRlci51bnN1YnNjcmliZSgpO1xuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgfVxuICB9LCB7XG4gICAga2V5OiBTeW1ib2xPYnNlcnZhYmxlLFxuICAgIHZhbHVlOiBmdW5jdGlvbiAoKSB7XG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9XG4gIH1dLCBbe1xuICAgIGtleTogXCJmcm9tXCIsXG4gICAgdmFsdWU6IGZ1bmN0aW9uIGZyb20oeCkge1xuICAgICAgdmFyIEMgPSB0eXBlb2YgdGhpcyA9PT0gJ2Z1bmN0aW9uJyA/IHRoaXMgOiBPYnNlcnZhYmxlO1xuICAgICAgaWYgKHgg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pdGVyYXRvckVycm9yID0gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgX2l0ZXJhdG9yID0gbWV0aG9kLmNhbGwoeClbU3ltYm9sLml0ZXJhdG9yXSgpLCBfc3RlcDsgIShfaXRlcmF0b3JOb3JtYWxDb21wbGV0aW9uID0gKF9zdGVwID0gX2l0ZXJhdG9yLm5leHQoKSkuZG9uZSk7IF9pdGVyYXRvck5vcm1hbENvbXBsZXRpb24gPSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgICB2YXIgX2l0ZW0gPSBfc3RlcC52YWx1ZTtcbiAgICAgICAgICAgICAgICAgIG9ic2VydmVyLm5leHQoX2l0ZW0pO1xuICAgICAgICAgICAgICAgICAgaWYgKG9ic2VydmVyLmNsb3NlZCkgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICAgICAgX2RpZEl0ZXJhdG9yRXJyb3IgPSB0cnVlO1xuICAgICAgICAgICAgICAgIF9pdGVyYXRvckVycm9yID0gZXJyO1xuICAgICAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICBpZiAoIV9pdGVyYXRvck5vcm1hbENvbXBsZXRpb24gJiYgX2l0ZXJhdG9yLnJldHVybiAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIF9pdGVyYXRvci5yZXR1cm4oKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgICAgICAgICAgaWYgKF9kaWRJdGVyYXRvckVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IF9pdGVyYXRvckVycm9yO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoQXJyYXkuaXNBcnJheSh4KSkge1xuICAgICAgICByZXR1cm4gbmV3IEMoZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgICAgZW5xdWV1ZShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAob2JzZXJ2ZXIuY2xvc2VkKSByZXR1cm47XG5cbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgeC5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KHhbaV0pO1xuICAgICAgICAgICAgICBpZiAob2JzZXJ2ZXIuY2xvc2VkKSByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKHggKyAnIGlzIG5vdCBvYnNlcnZhYmxlJyk7XG4gICAgfVxuICB9LCB7XG4gICAga2V5OiBcIm9mXCIsXG4gICAgdmFsdWU6IGZ1bmN0aW9uIG9mKCkge1xuICAgICAgZm9yICh2YXIgX2xlbjIgPSBhcmd1bWVudHMubGVuZ3RoLCBpdGVtcyA9IG5ldyBBcnJheShfbGVuMiksIF9rZXkyID0gMDsgX2tleTIgPCBfbGVuMjsgX2tleTIrKykge1xuICAgICAgICBpdGVtc1tfa2V5Ml0gPSBhcmd1bWVudHNbX2tleTJdO1xuICAgICAgfVxuXG4gICAgICB2YXIgQyA9IHR5cGVvZiB0aGlzID09PSAnZnVuY3Rpb24nID8gdGhpcyA6IE9ic2VydmFibGU7XG4gICAgICByZXR1cm4gbmV3IEMoZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgIGVucXVld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gICAgc2F2ZTogdHJ1ZSxcbiAgICAgICAgICAgIG1lc3NhZ2U6IHtcbiAgICAgICAgICAgICAgbWVzc2FnZV9pZDogTWVzc2FnZUlkZW50aWZpZXIuZm9ybWF0KFxuICAgICAgICAgICAgICAgIHRoaXMuZWxlY3Rpb25JZCxcbiAgICAgICAgICAgICAgICBLRVlfQ0VSRU1PTllfU1RFUF8xLFxuICAgICAgICAgICAgICAgIFRSVVNURUVfVFlQRSxcbiAgICAgICAgICAgICAgICB0aGlzLnRydXN0ZWVJZFxuICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICBjb250ZW50OiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgZWxlY3Rpb25fcHVibGljX2tleTogNyxcbiAgICAgICAgICAgICAgICBvd25lcl9pZDogdGhpcy50cnVzdGVlSWQsXG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgY2FzZSBLRVlfQ0VSRU1PTllfU1RFUF8xOiB7XG4gICAgICAgIGlmIChtZXNzYWdlSWRlbnRpZmllci50eXBlU3VidHlwZSA9PT0gS0VZX0NFUkVNT05ZX1NURVBfMSkge1xuICAgICAgICAgIHRoaXMucHJvY2Vzc2VkTWVzc2FnZXMgPSBbLi4udGhpcy5wcm9jZXNzZWRNZXNzYWdlcywgbWVzc2FnZV07XG4gICAgICAgICAgaWYgKHRoaXMucHJvY2Vzc2VkTWVzc2FnZXMubGVuZ3RoID09PSB0aGlzLmVsZWN0aW9uVHJ1c3RlZXNDb3VudCkge1xuICAgICAgICAgICAgdGhpcy5zdGF0dXMgPSBLRVlfQ0VSRU1PTllfSk9JTlRfRUxFQ1RJT05fS0VZO1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgZG9uZTogZmFsc2UsXG4gICAgICAgICAgICAgIHNhdmU6IGZhbHNlLFxuICAgIC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