From 1a2a08e1e9c2912a399143b267d9fcce69eff4b6 Mon Sep 17 00:00:00 2001 From: Marc Morera Date: Thu, 12 Jul 2018 10:35:41 +0200 Subject: [PATCH] Fixed the way a repository is built from Apisearch (#12) - Added some tests under Apisearch class --- dist/apisearch.js | 49 +++++++++++------ dist/apisearch.js.map | 2 +- dist/apisearch.min.js | 2 +- dist/apisearch.min.js.map | 2 +- package.json | 4 +- src/Apisearch.ts | 73 ++++++++++++++++---------- src/Result/Result.ts | 2 +- src/index.ts | 2 +- test/Apisearch.test.ts | 65 +++++++++++++++++++++++ test/Repository/HttpRepository.test.ts | 6 +++ 10 files changed, 157 insertions(+), 50 deletions(-) create mode 100644 test/Apisearch.test.ts diff --git a/dist/apisearch.js b/dist/apisearch.js index e5d13ad..d777400 100644 --- a/dist/apisearch.js +++ b/dist/apisearch.js @@ -2015,8 +2015,8 @@ var Query_2 = __webpack_require__(/*! ./Query/Query */ "./src/Query/Query.ts"); var Query_3 = __webpack_require__(/*! ./Query/Query */ "./src/Query/Query.ts"); var SortBy_1 = __webpack_require__(/*! ./Query/SortBy */ "./src/Query/SortBy.ts"); var HttpRepository_1 = __webpack_require__(/*! ./Repository/HttpRepository */ "./src/Repository/HttpRepository.ts"); -var ResultAggregations_1 = __webpack_require__(/*! ./Result/ResultAggregations */ "./src/Result/ResultAggregations.ts"); var Result_1 = __webpack_require__(/*! ./Result/Result */ "./src/Result/Result.ts"); +var ResultAggregations_1 = __webpack_require__(/*! ./Result/ResultAggregations */ "./src/Result/ResultAggregations.ts"); var Transformer_1 = __webpack_require__(/*! ./Transformer/Transformer */ "./src/Transformer/Transformer.ts"); /** * Apisearch class @@ -2029,16 +2029,33 @@ var Apisearch = /** @class */ (function () { * * @param config * - * @returns {Repository} + * @return {HttpRepository} */ Apisearch.createRepository = function (config) { - config.options = __assign({ api_version: "v1", cache: new NoCache_1.NoCache(), timeout: 10000, override_queries: true }, config.options); + Apisearch.ensureIsDefined(config.app_id, "app_id"); + Apisearch.ensureIsDefined(config.index_id, "index_id"); + Apisearch.ensureIsDefined(config.token, "token"); + Apisearch.ensureIsDefined(config.options.endpoint, "options.endpoint"); + config.options = __assign({ api_version: "v1", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options); /** * Client */ - var httpClient = new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache); + var httpClient = typeof config.options.http_client !== "undefined" + ? config.options.http_client + : new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache); return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer()); }; + /** + * Ensure the value is not undefined + * + * @param param + * @param name + */ + Apisearch.ensureIsDefined = function (param, name) { + if (typeof param === "undefined") { + throw new TypeError(name + " parameter must be defined."); + } + }; /** * Created located * @@ -2050,9 +2067,9 @@ var Apisearch = /** @class */ (function () { * @returns {Query} */ Apisearch.createQueryLocated = function (coordinate, queryText, page, size) { - if (page === void 0) { page = Query_2.QUERY_DEFAULT_PAGE; } - if (size === void 0) { size = Query_3.QUERY_DEFAULT_SIZE; } - return Query_1.Query.createLocated(coordinate, queryText, page, size); + if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; } + if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; } + return Query_3.Query.createLocated(coordinate, queryText, page, size); }; /** * Create @@ -2064,9 +2081,9 @@ var Apisearch = /** @class */ (function () { * @returns {Query} */ Apisearch.createQuery = function (queryText, page, size) { - if (page === void 0) { page = Query_2.QUERY_DEFAULT_PAGE; } - if (size === void 0) { size = Query_3.QUERY_DEFAULT_SIZE; } - return Query_1.Query.create(queryText, page, size); + if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; } + if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; } + return Query_3.Query.create(queryText, page, size); }; /** * Create match all @@ -2074,7 +2091,7 @@ var Apisearch = /** @class */ (function () { * @return {Query} */ Apisearch.createQueryMatchAll = function () { - return Query_1.Query.createMatchAll(); + return Query_3.Query.createMatchAll(); }; /** * Create by UUID @@ -2084,7 +2101,7 @@ var Apisearch = /** @class */ (function () { * @return {Query} */ Apisearch.createQueryByUUID = function (uuid) { - return Query_1.Query.createByUUID(uuid); + return Query_3.Query.createByUUID(uuid); }; /** * Create by UUIDs @@ -2098,7 +2115,7 @@ var Apisearch = /** @class */ (function () { for (var _i = 0; _i < arguments.length; _i++) { uuids[_i] = arguments[_i]; } - return Query_1.Query.createByUUIDs.apply(Query_1.Query, uuids); + return Query_3.Query.createByUUIDs.apply(Query_3.Query, uuids); }; /** * Create empty result @@ -3927,7 +3944,7 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { return t; }; exports.__esModule = true; -var InvalidFormatError_1 = __webpack_require__(/*! ../../src/Error/InvalidFormatError */ "./src/Error/InvalidFormatError.ts"); +var InvalidFormatError_1 = __webpack_require__(/*! ../Error/InvalidFormatError */ "./src/Error/InvalidFormatError.ts"); var Coordinate_1 = __webpack_require__(/*! ./Coordinate */ "./src/Model/Coordinate.ts"); var ItemUUID_1 = __webpack_require__(/*! ./ItemUUID */ "./src/Model/ItemUUID.ts"); /** @@ -6144,8 +6161,8 @@ exports.SORT_BY_LOCATION_MI_ASC = { unit: "mi" } }; -var Coordinate_1 = __webpack_require__(/*! ../../src/Model/Coordinate */ "./src/Model/Coordinate.ts"); -var Filter_1 = __webpack_require__(/*! ../../src/Query/Filter */ "./src/Query/Filter.ts"); +var Coordinate_1 = __webpack_require__(/*! ../Model/Coordinate */ "./src/Model/Coordinate.ts"); +var Filter_1 = __webpack_require__(/*! ./Filter */ "./src/Query/Filter.ts"); /** * ScoreStrategy */ diff --git a/dist/apisearch.js.map b/dist/apisearch.js.map index 292371c..d7ea34e 100644 --- a/dist/apisearch.js.map +++ b/dist/apisearch.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://apisearch/webpack/universalModuleDefinition","webpack://apisearch/webpack/bootstrap","webpack://apisearch/./node_modules/axios/index.js","webpack://apisearch/./node_modules/axios/lib/adapters/xhr.js","webpack://apisearch/./node_modules/axios/lib/axios.js","webpack://apisearch/./node_modules/axios/lib/cancel/Cancel.js","webpack://apisearch/./node_modules/axios/lib/cancel/CancelToken.js","webpack://apisearch/./node_modules/axios/lib/cancel/isCancel.js","webpack://apisearch/./node_modules/axios/lib/core/Axios.js","webpack://apisearch/./node_modules/axios/lib/core/InterceptorManager.js","webpack://apisearch/./node_modules/axios/lib/core/createError.js","webpack://apisearch/./node_modules/axios/lib/core/dispatchRequest.js","webpack://apisearch/./node_modules/axios/lib/core/enhanceError.js","webpack://apisearch/./node_modules/axios/lib/core/settle.js","webpack://apisearch/./node_modules/axios/lib/core/transformData.js","webpack://apisearch/./node_modules/axios/lib/defaults.js","webpack://apisearch/./node_modules/axios/lib/helpers/bind.js","webpack://apisearch/./node_modules/axios/lib/helpers/btoa.js","webpack://apisearch/./node_modules/axios/lib/helpers/buildURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/combineURLs.js","webpack://apisearch/./node_modules/axios/lib/helpers/cookies.js","webpack://apisearch/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://apisearch/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://apisearch/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://apisearch/./node_modules/axios/lib/helpers/spread.js","webpack://apisearch/./node_modules/axios/lib/utils.js","webpack://apisearch/./node_modules/is-buffer/index.js","webpack://apisearch/./node_modules/process/browser.js","webpack://apisearch/./src/Apisearch.ts","webpack://apisearch/./src/Cache/InMemoryCache.ts","webpack://apisearch/./src/Cache/NoCache.ts","webpack://apisearch/./src/Config/Config.ts","webpack://apisearch/./src/Config/ImmutableConfig.ts","webpack://apisearch/./src/Config/Synonym.ts","webpack://apisearch/./src/Error/ConnectionError.ts","webpack://apisearch/./src/Error/ErrorWithMessage.ts","webpack://apisearch/./src/Error/EventError.ts","webpack://apisearch/./src/Error/ForbiddenError.ts","webpack://apisearch/./src/Error/InvalidFormatError.ts","webpack://apisearch/./src/Error/InvalidTokenError.ts","webpack://apisearch/./src/Error/ResourceExistsError.ts","webpack://apisearch/./src/Error/ResourceNotAvailableError.ts","webpack://apisearch/./src/Error/UnsupportedContentTypeError.ts","webpack://apisearch/./src/Geo/LocationRange.ts","webpack://apisearch/./src/Http/AxiosClient.ts","webpack://apisearch/./src/Http/Client.ts","webpack://apisearch/./src/Http/HttpClient.ts","webpack://apisearch/./src/Http/Response.ts","webpack://apisearch/./src/Http/Retry.ts","webpack://apisearch/./src/Http/RetryMap.ts","webpack://apisearch/./src/Model/Changes.ts","webpack://apisearch/./src/Model/Coordinate.ts","webpack://apisearch/./src/Model/Item.ts","webpack://apisearch/./src/Model/ItemUUID.ts","webpack://apisearch/./src/Model/Metadata.ts","webpack://apisearch/./src/Model/User.ts","webpack://apisearch/./src/Query/Aggregation.ts","webpack://apisearch/./src/Query/Filter.ts","webpack://apisearch/./src/Query/Query.ts","webpack://apisearch/./src/Query/Range.ts","webpack://apisearch/./src/Query/ScoreStrategy.ts","webpack://apisearch/./src/Query/SortBy.ts","webpack://apisearch/./src/Repository/HttpRepository.ts","webpack://apisearch/./src/Repository/Repository.ts","webpack://apisearch/./src/Result/Counter.ts","webpack://apisearch/./src/Result/Result.ts","webpack://apisearch/./src/Result/ResultAggregation.ts","webpack://apisearch/./src/Result/ResultAggregations.ts","webpack://apisearch/./src/Transformer/Transformer.ts","webpack://apisearch/./src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA,6F;;;;;;;;;;;;ACAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnLA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDA;;AAEA;AACA;AACA;;;;;;;;;;;;;ACJA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,iDAAiD,gBAAgB;AACjE;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;AC9EA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACnDA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACrFA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpBA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzBA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;+CCnBA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,OAAO,YAAY;AACnB;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;;AC3FA;;AAEA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACnCA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACnEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC,OAAO;;AAEP;AACA,0DAA0D,wBAAwB;AAClF;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,gCAAgC;AAChC,6BAA6B,aAAa,EAAE;AAC5C;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACpDA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1BA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9SA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mCAAmC,4FAA4F;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACzHA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,iDAAiD,gCAAgC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,0BAA0B,EAAE;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,mDAAmD,EAAE;AACnI;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChEA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChBA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,0FAA0F,GAAG,EAAE,KAAK;AACpG;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvIA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvEA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvCA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnNA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,iEAAiE,uBAAuB,EAAE,4BAA4B;AACrJ;AACA,KAAK;AACL;AACA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oCAAoC,iBAAiB;AACrD,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,6BAA6B,EAAE;AAC/F,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB,8BAA8B,uBAAuB,EAAE;AAChF,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,6CAA6C,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,2BAA2B;AACzD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/DA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yLAAyL,wEAAwE,mFAAmF;AACpV,uHAAuH,wEAAwE,mFAAmF;AAClR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,8BAA8B,+CAA+C;AAC7E,+BAA+B,sCAAsC;AACrE;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACrKA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA,2CAA2C,6BAA6B;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,0CAA0C,gCAAgC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA,uCAAuC,6BAA6B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,wCAAwC;AAC3E,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA,uCAAuC,6BAA6B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,kCAAkC,wBAAwB,gFAAgF,4BAA4B,EAAE;AACxK;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC19BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,0DAA0D;AAC1D;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,yDAAyD;AACzD;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChTA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,iEAAiE,uBAAuB,EAAE,4BAA4B;AACrJ;AACA,KAAK;AACL;AACA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,8EAA8E,kBAAkB,EAAE;AAClG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B,8DAA8D,kBAAkB,EAAE;AAClF;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B,8DAA8D,kBAAkB,EAAE;AAClF;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,IAAI;AAClF;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,IAAI;AACtF;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,IAAI;AAChF;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtZA;AACA;AACA;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,iEAAiE,uBAAuB,EAAE,4BAA4B;AACrJ;AACA,KAAK;AACL;AACA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,kBAAkB,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,kBAAkB,EAAE;AAClG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,2CAA2C,EAAE;AAC/F;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uBAAuB,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iDAAiD,EAAE;AACzG;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvOA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"apisearch.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apisearch\"] = factory();\n\telse\n\t\troot[\"apisearch\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Result_1 = require(\"./Result/Result\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @returns {Repository}\n */\n Apisearch.createRepository = function (config) {\n config.options = __assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 10000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_2.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_3.QUERY_DEFAULT_SIZE; }\n return Query_1.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_2.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_3.QUERY_DEFAULT_SIZE; }\n return Query_1.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_1.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_1.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_1.Query.createByUUIDs.apply(Query_1.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = __assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n function Config() {\n }\n /**\n * To array\n *\n * @returns {any}\n */\n Config.prototype.toArray = function () {\n return {};\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar ImmutableConfig = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function ImmutableConfig(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n ImmutableConfig.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n ImmutableConfig.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n ImmutableConfig.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n ImmutableConfig.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n ImmutableConfig.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n ImmutableConfig.createFromArray = function (array) {\n var immutableConfig = new ImmutableConfig(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return ImmutableConfig;\n}());\nexports.ImmutableConfig = ImmutableConfig;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n __extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n __extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n __extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n __extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n __extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n __extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n __extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n __extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n __extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n __extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n __extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n __extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = axios_1[\"default\"].CancelToken.source();\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return __generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort();\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n //noinspection TypeScriptValidateTypes\n axios_1[\"default\"]\n .request({\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n cancelToken: _this.cancelToken.token,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n })\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (thrown) { return reject(thrown); });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n */\n AxiosClient.prototype.abort = function () {\n this.cancelToken.cancel();\n this.cancelToken = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../../src/Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return __assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (array.is_promoted) {\n item.promoted = true;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n return Item;\n}());\nexports.Item = Item;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Filter.getFilterPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.filterFields = [];\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = __assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length !== 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategy\n *\n * @return {ScoreStrategy}\n */\n Query.prototype.getScoreStrategy = function () {\n return this.scoreStrategy;\n };\n /**\n * Set score strategy\n *\n * @param scoreStrategy\n */\n Query.prototype.setScoreStrategy = function (scoreStrategy) {\n this.scoreStrategy = scoreStrategy;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategy\n */\n if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) {\n var scoreStrategyAsArray = this.scoreStrategy.toArray();\n if (Object.keys(scoreStrategyAsArray).length > 0) {\n array.score_strategy = scoreStrategyAsArray;\n }\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray);\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategy = array.score_strategy instanceof Object\n ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.SCORE_STRATEGY_DEFAULT = 0;\nexports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1;\nexports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.SCORE_STRATEGY_DEFAULT;\n this.innerFunction = null;\n }\n /**\n * Get type\n *\n * @returns {number}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get function\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getFunction = function () {\n return this.innerFunction;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create relevance boosting\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createRelevanceBoosting = function () {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD;\n return scoreStrategy;\n };\n /**\n * Create relevance boosting\n *\n * @param innerFunction\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (innerFunction) {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION;\n scoreStrategy.innerFunction = innerFunction;\n return scoreStrategy;\n };\n /**\n *\n * @return {{type: number, function: string}}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n \"function\": this.innerFunction\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type == \"undefined\") {\n array.type = exports.SCORE_STRATEGY_DEFAULT;\n }\n if (typeof array[\"function\"] == \"undefined\") {\n array.innerFunction = null;\n }\n scoreStrategy.type = array.type;\n scoreStrategy.innerFunction = array[\"function\"];\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../../src/Model/Coordinate\");\nvar Filter_1 = require(\"../../src/Query/Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n __extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * flush items\n *\n * @param itemsToUpdate\n * @param itemsToDelete\n *\n * @Returns {Promise}\n */\n HttpRepository.prototype.flushItems = function (itemsToUpdate, itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, _b, _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n _b = (_a = Promise).all;\n return [4 /*yield*/, this.flushUpdateItems(itemsToUpdate)];\n case 1:\n _c = [\n _d.sent()\n ];\n return [4 /*yield*/, this.flushDeleteItems(itemsToDelete)];\n case 2: return [4 /*yield*/, _b.apply(_a, [_c.concat([\n _d.sent()\n ])]).then(function (_) {\n return;\n })];\n case 3:\n _d.sent();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToUpdate.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentials(), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToDelete.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentials(), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return __awaiter(this, void 0, void 0, function () {\n var that;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentials(), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentials(), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param immutableConfig\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (immutableConfig) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentials(), {}, {\n config: immutableConfig.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (config) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/config\", \"post\", this.getCredentials(), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n index: this.indexId,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return __awaiter(this, void 0, void 0, function () {\n var offset, items, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n offset = 0;\n items = [];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, , 7]);\n _a.label = 2;\n case 2:\n if (!true) return [3 /*break*/, 4];\n items = this\n .itemsToUpdate\n .slice(offset, offset + bulkNumber);\n if (items.length === 0) {\n return [3 /*break*/, 4];\n }\n return [4 /*yield*/, this.flushItems(items, [])];\n case 3:\n _a.sent();\n offset += bulkNumber;\n return [3 /*break*/, 2];\n case 4: return [4 /*yield*/, this.flushItems([], this.itemsToDelete)];\n case 5:\n _a.sent();\n return [3 /*break*/, 7];\n case 6:\n error_1 = _a.sent();\n this.resetCachedElements();\n throw error_1;\n case 7:\n this.resetCachedElements();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return __assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nexports.__esModule = true;\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\n__export(require(\"./Cache/InMemoryCache\"));\n__export(require(\"./Config/Config\"));\n__export(require(\"./Config/ImmutableConfig\"));\n__export(require(\"./Config/Synonym\"));\n__export(require(\"./Error/ConnectionError\"));\n__export(require(\"./Error/ErrorWithMessage\"));\n__export(require(\"./Error/EventError\"));\n__export(require(\"./Error/ForbiddenError\"));\n__export(require(\"./Error/InvalidFormatError\"));\n__export(require(\"./Error/InvalidTokenError\"));\n__export(require(\"./Error/ResourceExistsError\"));\n__export(require(\"./Error/ResourceNotAvailableError\"));\n__export(require(\"./Error/UnsupportedContentTypeError\"));\n__export(require(\"./Geo/LocationRange\"));\n__export(require(\"./Http/AxiosClient\"));\n__export(require(\"./Http/Client\"));\n__export(require(\"./Http/HttpClient\"));\n__export(require(\"./Http/Response\"));\n__export(require(\"./Http/Retry\"));\n__export(require(\"./Http/RetryMap\"));\n__export(require(\"./Model/Changes\"));\n__export(require(\"./Model/Coordinate\"));\n__export(require(\"./Model/Item\"));\n__export(require(\"./Model/ItemUUID\"));\n__export(require(\"./Model/Metadata\"));\n__export(require(\"./Model/User\"));\n__export(require(\"./Query/Aggregation\"));\n__export(require(\"./Query/Filter\"));\n__export(require(\"./Query/Query\"));\n__export(require(\"./Query/Range\"));\n__export(require(\"./Query/ScoreStrategy\"));\n__export(require(\"./Query/SortBy\"));\n__export(require(\"./Repository/HttpRepository\"));\n__export(require(\"./Repository/Repository\"));\n__export(require(\"./Result/ResultAggregation\"));\n__export(require(\"./Result/ResultAggregations\"));\n__export(require(\"./Result/Counter\"));\n__export(require(\"./Result/Result\"));\n__export(require(\"./Transformer/Transformer\"));\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://apisearch/webpack/universalModuleDefinition","webpack://apisearch/webpack/bootstrap","webpack://apisearch/./node_modules/axios/index.js","webpack://apisearch/./node_modules/axios/lib/adapters/xhr.js","webpack://apisearch/./node_modules/axios/lib/axios.js","webpack://apisearch/./node_modules/axios/lib/cancel/Cancel.js","webpack://apisearch/./node_modules/axios/lib/cancel/CancelToken.js","webpack://apisearch/./node_modules/axios/lib/cancel/isCancel.js","webpack://apisearch/./node_modules/axios/lib/core/Axios.js","webpack://apisearch/./node_modules/axios/lib/core/InterceptorManager.js","webpack://apisearch/./node_modules/axios/lib/core/createError.js","webpack://apisearch/./node_modules/axios/lib/core/dispatchRequest.js","webpack://apisearch/./node_modules/axios/lib/core/enhanceError.js","webpack://apisearch/./node_modules/axios/lib/core/settle.js","webpack://apisearch/./node_modules/axios/lib/core/transformData.js","webpack://apisearch/./node_modules/axios/lib/defaults.js","webpack://apisearch/./node_modules/axios/lib/helpers/bind.js","webpack://apisearch/./node_modules/axios/lib/helpers/btoa.js","webpack://apisearch/./node_modules/axios/lib/helpers/buildURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/combineURLs.js","webpack://apisearch/./node_modules/axios/lib/helpers/cookies.js","webpack://apisearch/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://apisearch/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://apisearch/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://apisearch/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://apisearch/./node_modules/axios/lib/helpers/spread.js","webpack://apisearch/./node_modules/axios/lib/utils.js","webpack://apisearch/./node_modules/is-buffer/index.js","webpack://apisearch/./node_modules/process/browser.js","webpack://apisearch/./src/Apisearch.ts","webpack://apisearch/./src/Cache/InMemoryCache.ts","webpack://apisearch/./src/Cache/NoCache.ts","webpack://apisearch/./src/Config/Config.ts","webpack://apisearch/./src/Config/ImmutableConfig.ts","webpack://apisearch/./src/Config/Synonym.ts","webpack://apisearch/./src/Error/ConnectionError.ts","webpack://apisearch/./src/Error/ErrorWithMessage.ts","webpack://apisearch/./src/Error/EventError.ts","webpack://apisearch/./src/Error/ForbiddenError.ts","webpack://apisearch/./src/Error/InvalidFormatError.ts","webpack://apisearch/./src/Error/InvalidTokenError.ts","webpack://apisearch/./src/Error/ResourceExistsError.ts","webpack://apisearch/./src/Error/ResourceNotAvailableError.ts","webpack://apisearch/./src/Error/UnsupportedContentTypeError.ts","webpack://apisearch/./src/Geo/LocationRange.ts","webpack://apisearch/./src/Http/AxiosClient.ts","webpack://apisearch/./src/Http/Client.ts","webpack://apisearch/./src/Http/HttpClient.ts","webpack://apisearch/./src/Http/Response.ts","webpack://apisearch/./src/Http/Retry.ts","webpack://apisearch/./src/Http/RetryMap.ts","webpack://apisearch/./src/Model/Changes.ts","webpack://apisearch/./src/Model/Coordinate.ts","webpack://apisearch/./src/Model/Item.ts","webpack://apisearch/./src/Model/ItemUUID.ts","webpack://apisearch/./src/Model/Metadata.ts","webpack://apisearch/./src/Model/User.ts","webpack://apisearch/./src/Query/Aggregation.ts","webpack://apisearch/./src/Query/Filter.ts","webpack://apisearch/./src/Query/Query.ts","webpack://apisearch/./src/Query/Range.ts","webpack://apisearch/./src/Query/ScoreStrategy.ts","webpack://apisearch/./src/Query/SortBy.ts","webpack://apisearch/./src/Repository/HttpRepository.ts","webpack://apisearch/./src/Repository/Repository.ts","webpack://apisearch/./src/Result/Counter.ts","webpack://apisearch/./src/Result/Result.ts","webpack://apisearch/./src/Result/ResultAggregation.ts","webpack://apisearch/./src/Result/ResultAggregations.ts","webpack://apisearch/./src/Transformer/Transformer.ts","webpack://apisearch/./src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA,6F;;;;;;;;;;;;ACAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnLA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDA;;AAEA;AACA;AACA;;;;;;;;;;;;;ACJA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,iDAAiD,gBAAgB;AACjE;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;AC9EA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACnDA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACrFA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpBA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzBA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;+CCnBA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,OAAO,YAAY;AACnB;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;;AC3FA;;AAEA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACnCA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACnEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wCAAwC;AACxC,OAAO;;AAEP;AACA,0DAA0D,wBAAwB;AAClF;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,gCAAgC;AAChC,6BAA6B,aAAa,EAAE;AAC5C;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACpDA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACbA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1BA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9SA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,2FAA2F;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC1IA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,iDAAiD,gCAAgC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,0BAA0B,EAAE;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,mDAAmD,EAAE;AACnI;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChEA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChBA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,0FAA0F,GAAG,EAAE,KAAK;AACpG;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvIA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvEA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvCA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnNA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,iEAAiE,uBAAuB,EAAE,4BAA4B;AACrJ;AACA,KAAK;AACL;AACA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oCAAoC,iBAAiB;AACrD,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,6BAA6B,EAAE;AAC/F,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB,8BAA8B,uBAAuB,EAAE;AAChF,qBAAqB;AACrB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,6CAA6C,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,2BAA2B;AACzD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/DA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,yCAAyC,sBAAsB;AAC/D,4CAA4C,yBAAyB;AACrE,+CAA+C,4BAA4B;AAC3E,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yLAAyL,wEAAwE,mFAAmF;AACpV,uHAAuH,wEAAwE,mFAAmF;AAClR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,kCAAkC,eAAe;AACjD,8BAA8B,+CAA+C;AAC7E,+BAA+B,sCAAsC;AACrE;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC3KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACrKA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mCAAmC;AACjE,8BAA8B,mCAAmC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA,2CAA2C,6BAA6B;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA,8CAA8C,gCAAgC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,wCAAwC;AAC3E,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gDAAgD;AACzF,mCAAmC,kBAAkB;AACrD,yCAAyC,gEAAgE;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,0CAA0C,gCAAgC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA,uCAAuC,6BAA6B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,mCAAmC,wCAAwC;AAC3E,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA,uCAAuC,6BAA6B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,yCAAyC,gEAAgE;AACzG,+BAA+B,4CAA4C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,kCAAkC,wBAAwB,gFAAgF,4BAA4B,EAAE;AACxK;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC19BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA,0DAA0D;AAC1D;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,yDAAyD;AACzD;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AChTA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,iEAAiE,uBAAuB,EAAE,4BAA4B;AACrJ;AACA,KAAK;AACL;AACA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,8EAA8E,kBAAkB,EAAE;AAClG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B,8DAA8D,kBAAkB,EAAE;AAClF;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B,8DAA8D,kBAAkB,EAAE;AAClF;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,IAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,IAAI;AAClF;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,IAAI;AACtF;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,IAAI;AAChF;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtZA;AACA;AACA;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,iEAAiE,uBAAuB,EAAE,4BAA4B;AACrJ;AACA,KAAK;AACL;AACA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,kBAAkB,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,kBAAkB,EAAE;AAClG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC9JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,2CAA2C,EAAE;AAC/F;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uBAAuB,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iDAAiD,EAAE;AACzG;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACvOA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AC/OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"apisearch.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apisearch\"] = factory();\n\telse\n\t\troot[\"apisearch\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar Result_1 = require(\"./Result/Result\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @return {HttpRepository}\n */\n Apisearch.createRepository = function (config) {\n Apisearch.ensureIsDefined(config.app_id, \"app_id\");\n Apisearch.ensureIsDefined(config.index_id, \"index_id\");\n Apisearch.ensureIsDefined(config.token, \"token\");\n Apisearch.ensureIsDefined(config.options.endpoint, \"options.endpoint\");\n config.options = __assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = typeof config.options.http_client !== \"undefined\"\n ? config.options.http_client\n : new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Ensure the value is not undefined\n *\n * @param param\n * @param name\n */\n Apisearch.ensureIsDefined = function (param, name) {\n if (typeof param === \"undefined\") {\n throw new TypeError(name + \" parameter must be defined.\");\n }\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_3.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_3.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_3.Query.createByUUIDs.apply(Query_3.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = __assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n function Config() {\n }\n /**\n * To array\n *\n * @returns {any}\n */\n Config.prototype.toArray = function () {\n return {};\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar ImmutableConfig = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function ImmutableConfig(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n ImmutableConfig.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n ImmutableConfig.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n ImmutableConfig.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n ImmutableConfig.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n ImmutableConfig.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n ImmutableConfig.createFromArray = function (array) {\n var immutableConfig = new ImmutableConfig(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return ImmutableConfig;\n}());\nexports.ImmutableConfig = ImmutableConfig;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n __extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n __extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n __extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n __extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n __extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n __extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n __extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n __extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n __extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n __extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n __extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n __extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = axios_1[\"default\"].CancelToken.source();\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return __generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort();\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n //noinspection TypeScriptValidateTypes\n axios_1[\"default\"]\n .request({\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n cancelToken: _this.cancelToken.token,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n })\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (thrown) { return reject(thrown); });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n */\n AxiosClient.prototype.abort = function () {\n this.cancelToken.cancel();\n this.cancelToken = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return __assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (array.is_promoted) {\n item.promoted = true;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n return Item;\n}());\nexports.Item = Item;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Filter.getFilterPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.filterFields = [];\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = __assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length !== 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategy\n *\n * @return {ScoreStrategy}\n */\n Query.prototype.getScoreStrategy = function () {\n return this.scoreStrategy;\n };\n /**\n * Set score strategy\n *\n * @param scoreStrategy\n */\n Query.prototype.setScoreStrategy = function (scoreStrategy) {\n this.scoreStrategy = scoreStrategy;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategy\n */\n if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) {\n var scoreStrategyAsArray = this.scoreStrategy.toArray();\n if (Object.keys(scoreStrategyAsArray).length > 0) {\n array.score_strategy = scoreStrategyAsArray;\n }\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray);\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategy = array.score_strategy instanceof Object\n ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.SCORE_STRATEGY_DEFAULT = 0;\nexports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1;\nexports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.SCORE_STRATEGY_DEFAULT;\n this.innerFunction = null;\n }\n /**\n * Get type\n *\n * @returns {number}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get function\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getFunction = function () {\n return this.innerFunction;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create relevance boosting\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createRelevanceBoosting = function () {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD;\n return scoreStrategy;\n };\n /**\n * Create relevance boosting\n *\n * @param innerFunction\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (innerFunction) {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION;\n scoreStrategy.innerFunction = innerFunction;\n return scoreStrategy;\n };\n /**\n *\n * @return {{type: number, function: string}}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n \"function\": this.innerFunction\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type == \"undefined\") {\n array.type = exports.SCORE_STRATEGY_DEFAULT;\n }\n if (typeof array[\"function\"] == \"undefined\") {\n array.innerFunction = null;\n }\n scoreStrategy.type = array.type;\n scoreStrategy.innerFunction = array[\"function\"];\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n __extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * flush items\n *\n * @param itemsToUpdate\n * @param itemsToDelete\n *\n * @Returns {Promise}\n */\n HttpRepository.prototype.flushItems = function (itemsToUpdate, itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, _b, _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n _b = (_a = Promise).all;\n return [4 /*yield*/, this.flushUpdateItems(itemsToUpdate)];\n case 1:\n _c = [\n _d.sent()\n ];\n return [4 /*yield*/, this.flushDeleteItems(itemsToDelete)];\n case 2: return [4 /*yield*/, _b.apply(_a, [_c.concat([\n _d.sent()\n ])]).then(function (_) {\n return;\n })];\n case 3:\n _d.sent();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToUpdate.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentials(), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToDelete.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentials(), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return __awaiter(this, void 0, void 0, function () {\n var that;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentials(), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentials(), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param immutableConfig\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (immutableConfig) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentials(), {}, {\n config: immutableConfig.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (config) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/config\", \"post\", this.getCredentials(), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n index: this.indexId,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return __awaiter(this, void 0, void 0, function () {\n var offset, items, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n offset = 0;\n items = [];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, , 7]);\n _a.label = 2;\n case 2:\n if (!true) return [3 /*break*/, 4];\n items = this\n .itemsToUpdate\n .slice(offset, offset + bulkNumber);\n if (items.length === 0) {\n return [3 /*break*/, 4];\n }\n return [4 /*yield*/, this.flushItems(items, [])];\n case 3:\n _a.sent();\n offset += bulkNumber;\n return [3 /*break*/, 2];\n case 4: return [4 /*yield*/, this.flushItems([], this.itemsToDelete)];\n case 5:\n _a.sent();\n return [3 /*break*/, 7];\n case 6:\n error_1 = _a.sent();\n this.resetCachedElements();\n throw error_1;\n case 7:\n this.resetCachedElements();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return __assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nexports.__esModule = true;\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\n__export(require(\"./Cache/InMemoryCache\"));\n__export(require(\"./Config/Config\"));\n__export(require(\"./Config/ImmutableConfig\"));\n__export(require(\"./Config/Synonym\"));\n__export(require(\"./Error/ConnectionError\"));\n__export(require(\"./Error/ErrorWithMessage\"));\n__export(require(\"./Error/EventError\"));\n__export(require(\"./Error/ForbiddenError\"));\n__export(require(\"./Error/InvalidFormatError\"));\n__export(require(\"./Error/InvalidTokenError\"));\n__export(require(\"./Error/ResourceExistsError\"));\n__export(require(\"./Error/ResourceNotAvailableError\"));\n__export(require(\"./Error/UnsupportedContentTypeError\"));\n__export(require(\"./Geo/LocationRange\"));\n__export(require(\"./Http/AxiosClient\"));\n__export(require(\"./Http/Client\"));\n__export(require(\"./Http/HttpClient\"));\n__export(require(\"./Http/Response\"));\n__export(require(\"./Http/Retry\"));\n__export(require(\"./Http/RetryMap\"));\n__export(require(\"./Model/Changes\"));\n__export(require(\"./Model/Coordinate\"));\n__export(require(\"./Model/Item\"));\n__export(require(\"./Model/ItemUUID\"));\n__export(require(\"./Model/Metadata\"));\n__export(require(\"./Model/User\"));\n__export(require(\"./Query/Aggregation\"));\n__export(require(\"./Query/Filter\"));\n__export(require(\"./Query/Query\"));\n__export(require(\"./Query/Range\"));\n__export(require(\"./Query/ScoreStrategy\"));\n__export(require(\"./Query/SortBy\"));\n__export(require(\"./Repository/HttpRepository\"));\n__export(require(\"./Repository/Repository\"));\n__export(require(\"./Result/ResultAggregation\"));\n__export(require(\"./Result/ResultAggregations\"));\n__export(require(\"./Result/Counter\"));\n__export(require(\"./Result/Result\"));\n__export(require(\"./Transformer/Transformer\"));\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/apisearch.min.js b/dist/apisearch.min.js index 834766c..44ff771 100644 --- a/dist/apisearch.min.js +++ b/dist/apisearch.min.js @@ -5,5 +5,5 @@ * @author Feross Aboukhadijeh * @license MIT */ -t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var n=r(0),o=r(34),i=r(62),s=r(12);function a(t){var e=new i(t),r=o(i.prototype.request,e);return n.extend(r,i.prototype,e),n.extend(r,e),r}var u=a(s);u.Axios=i,u.create=function(t){return a(n.merge(s,t))},u.Cancel=r(30),u.CancelToken=r(47),u.isCancel=r(31),u.all=function(t){return Promise.all(t)},u.spread=r(46),t.exports=u,t.exports.default=u},function(t,e,r){t.exports=r(64)},function(t,e,r){"use strict";e.__esModule=!0;var n=function(){function t(){}return t.prototype.set=function(t,e){},t.prototype.get=function(t){},t.prototype.del=function(t){},t.prototype.clear=function(){},t}();e.NoCache=n},function(t,e,r){"use strict";var n=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;r undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Filter.getFilterPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n __extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.filterFields = [];\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = __assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length !== 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategy\n *\n * @return {ScoreStrategy}\n */\n Query.prototype.getScoreStrategy = function () {\n return this.scoreStrategy;\n };\n /**\n * Set score strategy\n *\n * @param scoreStrategy\n */\n Query.prototype.setScoreStrategy = function (scoreStrategy) {\n this.scoreStrategy = scoreStrategy;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategy\n */\n if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) {\n var scoreStrategyAsArray = this.scoreStrategy.toArray();\n if (Object.keys(scoreStrategyAsArray).length > 0) {\n array.score_strategy = scoreStrategyAsArray;\n }\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray);\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategy = array.score_strategy instanceof Object\n ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../../src/Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return __assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (array.is_promoted) {\n item.promoted = true;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n return Item;\n}());\nexports.Item = Item;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nexports.__esModule = true;\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../../src/Model/Coordinate\");\nvar Filter_1 = require(\"../../src/Query/Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return __awaiter(this, void 0, void 0, function () {\n var offset, items, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n offset = 0;\n items = [];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, , 7]);\n _a.label = 2;\n case 2:\n if (!true) return [3 /*break*/, 4];\n items = this\n .itemsToUpdate\n .slice(offset, offset + bulkNumber);\n if (items.length === 0) {\n return [3 /*break*/, 4];\n }\n return [4 /*yield*/, this.flushItems(items, [])];\n case 3:\n _a.sent();\n offset += bulkNumber;\n return [3 /*break*/, 2];\n case 4: return [4 /*yield*/, this.flushItems([], this.itemsToDelete)];\n case 5:\n _a.sent();\n return [3 /*break*/, 7];\n case 6:\n error_1 = _a.sent();\n this.resetCachedElements();\n throw error_1;\n case 7:\n this.resetCachedElements();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return __assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n __extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n __extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n __extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n __extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n __extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * flush items\n *\n * @param itemsToUpdate\n * @param itemsToDelete\n *\n * @Returns {Promise}\n */\n HttpRepository.prototype.flushItems = function (itemsToUpdate, itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, _b, _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n _b = (_a = Promise).all;\n return [4 /*yield*/, this.flushUpdateItems(itemsToUpdate)];\n case 1:\n _c = [\n _d.sent()\n ];\n return [4 /*yield*/, this.flushDeleteItems(itemsToDelete)];\n case 2: return [4 /*yield*/, _b.apply(_a, [_c.concat([\n _d.sent()\n ])]).then(function (_) {\n return;\n })];\n case 3:\n _d.sent();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToUpdate.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentials(), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToDelete.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentials(), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return __awaiter(this, void 0, void 0, function () {\n var that;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentials(), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentials(), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param immutableConfig\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (immutableConfig) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentials(), {}, {\n config: immutableConfig.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (config) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/config\", \"post\", this.getCredentials(), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n index: this.indexId,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.SCORE_STRATEGY_DEFAULT = 0;\nexports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1;\nexports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.SCORE_STRATEGY_DEFAULT;\n this.innerFunction = null;\n }\n /**\n * Get type\n *\n * @returns {number}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get function\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getFunction = function () {\n return this.innerFunction;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create relevance boosting\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createRelevanceBoosting = function () {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD;\n return scoreStrategy;\n };\n /**\n * Create relevance boosting\n *\n * @param innerFunction\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (innerFunction) {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION;\n scoreStrategy.innerFunction = innerFunction;\n return scoreStrategy;\n };\n /**\n *\n * @return {{type: number, function: string}}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n \"function\": this.innerFunction\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type == \"undefined\") {\n array.type = exports.SCORE_STRATEGY_DEFAULT;\n }\n if (typeof array[\"function\"] == \"undefined\") {\n array.innerFunction = null;\n }\n scoreStrategy.type = array.type;\n scoreStrategy.innerFunction = array[\"function\"];\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n __extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = axios_1[\"default\"].CancelToken.source();\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return __generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort();\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n //noinspection TypeScriptValidateTypes\n axios_1[\"default\"]\n .request({\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n cancelToken: _this.cancelToken.token,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n })\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (thrown) { return reject(thrown); });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n */\n AxiosClient.prototype.abort = function () {\n this.cancelToken.cancel();\n this.cancelToken = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n __extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n __extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n __extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n __extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n __extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n __extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar ImmutableConfig = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function ImmutableConfig(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n ImmutableConfig.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n ImmutableConfig.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n ImmutableConfig.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n ImmutableConfig.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n ImmutableConfig.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n ImmutableConfig.createFromArray = function (array) {\n var immutableConfig = new ImmutableConfig(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return ImmutableConfig;\n}());\nexports.ImmutableConfig = ImmutableConfig;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n function Config() {\n }\n /**\n * To array\n *\n * @returns {any}\n */\n Config.prototype.toArray = function () {\n return {};\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = __assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Result_1 = require(\"./Result/Result\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @returns {Repository}\n */\n Apisearch.createRepository = function (config) {\n config.options = __assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 10000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_2.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_3.QUERY_DEFAULT_SIZE; }\n return Query_1.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_2.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_3.QUERY_DEFAULT_SIZE; }\n return Query_1.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_1.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_1.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_1.Query.createByUUIDs.apply(Query_1.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nexports.__esModule = true;\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\n__export(require(\"./Cache/InMemoryCache\"));\n__export(require(\"./Config/Config\"));\n__export(require(\"./Config/ImmutableConfig\"));\n__export(require(\"./Config/Synonym\"));\n__export(require(\"./Error/ConnectionError\"));\n__export(require(\"./Error/ErrorWithMessage\"));\n__export(require(\"./Error/EventError\"));\n__export(require(\"./Error/ForbiddenError\"));\n__export(require(\"./Error/InvalidFormatError\"));\n__export(require(\"./Error/InvalidTokenError\"));\n__export(require(\"./Error/ResourceExistsError\"));\n__export(require(\"./Error/ResourceNotAvailableError\"));\n__export(require(\"./Error/UnsupportedContentTypeError\"));\n__export(require(\"./Geo/LocationRange\"));\n__export(require(\"./Http/AxiosClient\"));\n__export(require(\"./Http/Client\"));\n__export(require(\"./Http/HttpClient\"));\n__export(require(\"./Http/Response\"));\n__export(require(\"./Http/Retry\"));\n__export(require(\"./Http/RetryMap\"));\n__export(require(\"./Model/Changes\"));\n__export(require(\"./Model/Coordinate\"));\n__export(require(\"./Model/Item\"));\n__export(require(\"./Model/ItemUUID\"));\n__export(require(\"./Model/Metadata\"));\n__export(require(\"./Model/User\"));\n__export(require(\"./Query/Aggregation\"));\n__export(require(\"./Query/Filter\"));\n__export(require(\"./Query/Query\"));\n__export(require(\"./Query/Range\"));\n__export(require(\"./Query/ScoreStrategy\"));\n__export(require(\"./Query/SortBy\"));\n__export(require(\"./Repository/HttpRepository\"));\n__export(require(\"./Repository/Repository\"));\n__export(require(\"./Result/ResultAggregation\"));\n__export(require(\"./Result/ResultAggregations\"));\n__export(require(\"./Result/Counter\"));\n__export(require(\"./Result/Result\"));\n__export(require(\"./Transformer/Transformer\"));\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://apisearch/webpack/universalModuleDefinition","webpack://apisearch/webpack/bootstrap","webpack://apisearch/./node_modules/axios/lib/utils.js","webpack://apisearch/./src/Error/ErrorWithMessage.ts","webpack://apisearch/./src/Query/Filter.ts","webpack://apisearch/./src/Error/InvalidFormatError.ts","webpack://apisearch/./src/Model/ItemUUID.ts","webpack://apisearch/./src/Model/Coordinate.ts","webpack://apisearch/./src/Query/Query.ts","webpack://apisearch/./src/Model/Item.ts","webpack://apisearch/./src/Result/ResultAggregations.ts","webpack://apisearch/./src/Result/Result.ts","webpack://apisearch/./src/Query/SortBy.ts","webpack://apisearch/./src/Query/Aggregation.ts","webpack://apisearch/./node_modules/axios/lib/defaults.js","webpack://apisearch/./src/Config/Synonym.ts","webpack://apisearch/./src/Transformer/Transformer.ts","webpack://apisearch/./src/Repository/Repository.ts","webpack://apisearch/./src/Model/Metadata.ts","webpack://apisearch/./src/Result/Counter.ts","webpack://apisearch/./src/Result/ResultAggregation.ts","webpack://apisearch/./src/Error/ResourceNotAvailableError.ts","webpack://apisearch/./src/Error/ResourceExistsError.ts","webpack://apisearch/./src/Error/InvalidTokenError.ts","webpack://apisearch/./src/Error/ConnectionError.ts","webpack://apisearch/./src/Repository/HttpRepository.ts","webpack://apisearch/./src/Query/ScoreStrategy.ts","webpack://apisearch/./src/Model/User.ts","webpack://apisearch/./src/Http/Retry.ts","webpack://apisearch/./src/Http/RetryMap.ts","webpack://apisearch/./src/Http/Response.ts","webpack://apisearch/./src/Http/Client.ts","webpack://apisearch/./node_modules/axios/lib/cancel/Cancel.js","webpack://apisearch/./node_modules/axios/lib/cancel/isCancel.js","webpack://apisearch/./node_modules/axios/lib/core/createError.js","webpack://apisearch/./node_modules/axios/lib/adapters/xhr.js","webpack://apisearch/./node_modules/axios/lib/helpers/bind.js","webpack://apisearch/./src/Http/AxiosClient.ts","webpack://apisearch/./src/Query/Range.ts","webpack://apisearch/./src/Model/Changes.ts","webpack://apisearch/./src/Http/HttpClient.ts","webpack://apisearch/./src/Geo/LocationRange.ts","webpack://apisearch/./src/Error/UnsupportedContentTypeError.ts","webpack://apisearch/./src/Error/ForbiddenError.ts","webpack://apisearch/./src/Error/EventError.ts","webpack://apisearch/./src/Config/ImmutableConfig.ts","webpack://apisearch/./src/Config/Config.ts","webpack://apisearch/./src/Cache/InMemoryCache.ts","webpack://apisearch/./node_modules/axios/lib/helpers/spread.js","webpack://apisearch/./node_modules/axios/lib/cancel/CancelToken.js","webpack://apisearch/./node_modules/axios/lib/helpers/combineURLs.js","webpack://apisearch/./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://apisearch/./node_modules/axios/lib/core/transformData.js","webpack://apisearch/./node_modules/axios/lib/core/dispatchRequest.js","webpack://apisearch/./node_modules/axios/lib/core/InterceptorManager.js","webpack://apisearch/./node_modules/axios/lib/helpers/cookies.js","webpack://apisearch/./node_modules/axios/lib/helpers/btoa.js","webpack://apisearch/./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://apisearch/./node_modules/axios/lib/helpers/parseHeaders.js","webpack://apisearch/./node_modules/axios/lib/helpers/buildURL.js","webpack://apisearch/./node_modules/axios/lib/core/enhanceError.js","webpack://apisearch/./node_modules/axios/lib/core/settle.js","webpack://apisearch/./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack://apisearch/./node_modules/process/browser.js","webpack://apisearch/./node_modules/axios/lib/core/Axios.js","webpack://apisearch/./node_modules/is-buffer/index.js","webpack://apisearch/./node_modules/axios/lib/axios.js","webpack://apisearch/./node_modules/axios/index.js","webpack://apisearch/./src/Cache/NoCache.ts","webpack://apisearch/./src/Apisearch.ts","webpack://apisearch/./src/index.ts"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isBuffer","toString","isArray","val","isObject","isFunction","forEach","obj","fn","length","isArrayBuffer","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isUndefined","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","arguments","extend","a","b","thisArg","trim","str","replace","ErrorWithMessage","message","this","FILTER_MUST_ALL","FILTER_MUST_ALL_WITH_LEVELS","FILTER_AT_LEAST_ONE","FILTER_EXCLUDE","FILTER_PROMOTE","FILTER_TYPE_FIELD","FILTER_TYPE_RANGE","FILTER_TYPE_DATE_RANGE","FILTER_TYPE_GEO","FILTER_TYPE_QUERY","Filter","field","values","applicationType","filterType","filterTerms","getField","getValues","hasValue","getApplicationType","getFilterType","getFilterTerms","toArray","filterAsArray","keys","application_type","filter_type","filter_terms","createFromArray","array","JSON","parse","stringify","getFilterPathByField","indexOf","__extends","extendStatics","setPrototypeOf","__proto__","Array","__","constructor","InvalidFormatError","_super","apply","getTransportableHTTPError","itemRepresentationNotValid","itemUUIDRepresentationNotValid","composedItemUUIDNotValid","querySortedByDistanceWithoutCoordinate","queryFormatNotValid","coordinateFormatNotValid","configFormatNotValid","tokenFormatNotValid","campaignFormatNotValid","changesFormatNotValid","boostClauseFormatNotValid","tokenUUIDFormatNotValid","userFormatNotValid","InvalidFormatError_1","ItemUUID","id","type","createByComposedUUID","composedUUID","parts","split","getId","getType","Coordinate","lat","lon","getLatitude","getLongitude","__assign","assign","Coordinate_1","ItemUUID_1","User_1","Aggregation_1","Filter_1","Filter_2","Aggregation_2","Filter_3","ScoreStrategy_1","SortBy_1","QUERY_DEFAULT_FROM","QUERY_DEFAULT_PAGE","QUERY_DEFAULT_SIZE","QUERY_INFINITE_SIZE","Query","queryText","universeFilters","filters","itemsPromoted","aggregations","filterFields","sortByInstance","SortBy","_query","createLocated","coordinate","page","size","query","Math","max","from","createMatchAll","createByUUID","uuid","createByUUIDs","uuids","_i","ids","push","disableAggregations","disableSuggestions","_id","filterUniverseByTypes","_a","fieldPath","filterByTypes","aggregate","aggregationSort","_b","AGGREGATION_SORT_BY_COUNT_DESC","Aggregation","filterUniverseByIds","filterByIds","filterUniverseBy","filterBy","filterName","aggregateBy","filterUniverseByRange","rangeType","filterUniverseByDateRange","filterByRange","options","aggregateByRange","filterByDateRange","filterUniverseByLocation","locationRange","setFilterFields","getFilterFields","sortBy","isSortedByGeoDistance","setCoordinate","limit","AGGREGATION_NO_LIMIT","aggregateByDateRange","getAggregations","getAggregation","aggregationName","getQueryText","filter","getUniverseFilters","getUniverseFilter","getFilters","getFilter","getFilterByField","fieldName","getSortBy","getFrom","getSize","getPage","enableResults","resultsEnabled","disableResults","areResultsEnabled","enableAggregations","aggregationsEnabled","areAggregationsEnabled","enableSuggestions","suggestionsEnabled","areSuggestionsEnabled","enableHighlights","highlightsEnabled","disableHighlights","areHighlightsEnabled","promoteUUID","itemUUID","promoteUUIDs","getItemsPromoted","excludeUUID","excludeUUIDs","map","getScoreStrategy","scoreStrategy","setScoreStrategy","byUser","user","anonymously","getUser","q","universe_filters","universeFilter","aggregation","sort","results_enabled","suggestions_enabled","highlights_enabled","aggregations_enabled","filter_fields","ScoreStrategy","scoreStrategyAsArray","score_strategy","User","userAsArray","items_promoted","aggregationsAsArray","sortAsArray","filtersAsArray","universeFiltersAsArray","itemsPromotedAsArray","score_stategy","Item","metadata","indexedMetadata","searchableMetadata","exactMatchingMetadata","suggest","highlights","promoted","getUUID","getCoordinate","getDistance","distance","getMetadata","setMetadata","addMetadata","getIndexedMetadata","setIndexedMetadata","addIndexedMetadata","getSearchableMetadata","setSearchableMetadata","addSearchableMetadata","getExactMatchingMetadata","setExactMatchingMetadata","addExactMatchingMetadata","getAllMetadata","allMetadata","getSuggest","getHighlights","getHighlight","isPromoted","itemAsArray","indexed_metadata","searchable_metadata","exact_matching_metadata","is_promoted","item","composeUUID","ResultAggregation_1","ResultAggregations","totalElements","addAggregation","ResultAggregation","hasNotEmptyAggregation","isEmpty","getTotalElements","aggregationCollection","total_elements","Item_1","Query_1","ResultAggregations_1","Result","totalItems","totalHits","items","suggests","addItem","getItems","getItemsGroupedByTypes","itemsGroupedByTypeCache","itemsGroupedByTypes","getItemsByType","getItemsByTypes","types","getFirstItem","setAggregations","addSuggest","getSuggests","getQuery","getTotalItems","getTotalHits","total_items","total_hits","SORT_BY_TYPE_FIELD","SORT_BY_TYPE_NESTED","SORT_BY_ASC","SORT_BY_DESC","SORT_BY_MODE_AVG","SORT_BY_MODE_SUM","SORT_BY_MODE_MIN","SORT_BY_MODE_MAX","SORT_BY_MODE_MEDIAN","SORT_BY_SCORE","_score","order","SORT_BY_RANDOM","random","SORT_BY_AL_TUN_TUN","SORT_BY_ID_ASC","uuid.id","SORT_BY_ID_DESC","SORT_BY_TYPE_ASC","uuid.type","SORT_BY_TYPE_DESC","SORT_BY_LOCATION_KM_ASC","_geo_distance","unit","SORT_BY_LOCATION_MI_ASC","sortsBy","byFieldsValues","shortSortByElements","byFieldValue","all","byValue","byNestedField","byNestedFieldAndFilter","hasRandomSort","sortsByAsArray","copy","innerArray","element","newSortBy","sortByAsArray","AGGREGATION_SORT_BY_COUNT_ASC","AGGREGATION_SORT_BY_NAME_ASC","AGGREGATION_SORT_BY_NAME_DESC","subgroup","getName","getSubgroup","getSort","getLimit","aggregationAsArray","utils","normalizeHeaderName","DEFAULT_CONTENT_TYPE","Content-Type","setContentTypeIfUnset","headers","defaults","adapter","XMLHttpRequest","process","getDefaultAdapter","transformRequest","data","transformResponse","e","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","validateStatus","status","common","Accept","method","Synonym","words","getWords","createbyWords","expand","join","Transformer","readTransformers","writeTransformers","addReadTransformer","readTransformer","addWriteTransformer","writeTransformer","fromItems","objects","fromItem","transformer","isValidItem","toItems","toItem","isValidObject","toItemUUIDs","itemUUIDs","toItemUUID","__awaiter","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","iterator","v","op","TypeError","pop","Repository","appId","indexId","token","itemsToUpdate","itemsToDelete","resetCachedElements","addItems","deleteItem","deleteItems","itemsUUID","flush","bulkNumber","skipIfLess","offset","error_1","slice","flushItems","Metadata","toMetadata","fromMetadata","splittedParts","lastElement","part","Metadata_1","Counter","used","getSlug","slug","getLevel","level","isUsed","getN","createByActiveElements","activeElements","inActiveElements","Counter_1","counters","highestActiveElement","activeElement","addCounter","counter","counterInstance","getCounters","isFilter","hasLevels","getCounter","getAllElements","getActiveElements","0","cleanCountersByLevel","active_elements","highest_active_level","activeElementsAsArray","activeElementAsArray","parseInt","countersAsArray","counterAsArray","ResourceNotAvailableError","indexNotAvailable","resourceId","eventsIndexNotAvailable","logsIndexNotAvailable","engineNotAvailable","ResourceExistsError","indexAvailable","eventsIndexAvailable","logsIndexAvailable","InvalidTokenError","createInvalidTokenPermissions","tokenReference","createInvalidTokenMaxHitsPerQuery","maxHitsPerQuery","ConnectionError","ConnectionError_1","InvalidTokenError_1","ResourceExistsError_1","ResourceNotAvailableError_1","Result_1","HttpRepository","httpClient","_this","getTransformer","addObject","deleteObject","_c","_d","flushUpdateItems","flushDeleteItems","concat","getCredentials","response","throwTransportableExceptionIfNeeded","that","getBody","updateItems","changes","createIndex","immutableConfig","config","deleteIndex","resetIndex","checkIndex","getCode","configureIndex","app_id","index","SCORE_STRATEGY_DEFAULT","SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD","SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION","innerFunction","getFunction","createDefault","createRelevanceBoosting","createCustomFunction","function","attributes","getAttributes","DEFAULT_MICROSECONDS_BETWEEN_RETRIES","Retry","url","retries","microsecondsBetweenRetries","microseconds_between_retries","getUrl","getMethod","getRetries","getMicrosecondsBetweenRetries","Retry_1","RetryMap","addRetry","retry","retryMap","getRetry","Response","code","Client","version","objectToUrlParameters","params","builtParams","Cancel","__CANCEL__","enhanceError","request","error","Error","settle","buildURL","parseHeaders","isURLSameOrigin","createError","btoa","requestData","requestHeaders","loadEvent","xDomain","XDomainRequest","onprogress","ontimeout","auth","username","password","Authorization","open","toUpperCase","paramsSerializer","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseType","responseText","statusText","onerror","cookies","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","cancel","abort","send","args","axios_1","Client_1","Response_1","AxiosClient","host","overrideQueries","cache","CancelToken","source","credentials","parameters","Content-Encoding","baseURL","axiosResponse","thrown","RANGE_ZERO","RANGE_INFINITE","RANGE_SEPARATOR","Range","stringToArray","string","to","finalFrom","finalTo","arrayToString","finalValues","String","createRanges","incremental","nextTo","ranges","TYPE_VALUE","TYPE_LITERAL","TYPE_ARRAY_ELEMENT_UPDATE","TYPE_ARRAY_ELEMENT_ADD","TYPE_ARRAY_ELEMENT_DELETE","TYPE_ARRAY_EXPECTS_ELEMENT","TYPE_ARRAY","Changes","addChange","updateElementFromList","condition","addElementInList","deleteElementFromList","getChanges","HttpClient","LocationRange","fromFilterObject","toFilterObject","CoordinateAndDistance","Polygon","Square","coordinates","topLeftCoordinate","bottomRightCoordinate","top_left","bottom_right","UnsupportedContentTypeError","createUnsupportedContentTypeException","ForbiddenError","createAppIdIsRequiredException","createIndexIsRequiredException","createTokenIsRequiredException","EventError","throwEndpointNotAvailable","Synonym_1","ImmutableConfig","language","storeSearchableMetadata","synonyms","getLanguage","shouldSearchableMetadataBeStored","addSynonym","synonym","getSynonyms","store_searchable_metadata","Config","InMemoryCache","set","del","clear","callback","arr","executor","resolvePromise","reason","throwIfRequested","relativeURL","test","fns","transformData","isCancel","isAbsoluteURL","combineURLs","throwIfCancellationRequested","InterceptorManager","handlers","use","eject","h","write","expires","path","domain","secure","cookie","encodeURIComponent","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","chars","E","input","block","charCode","output","idx","charAt","charCodeAt","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","search","hash","hostname","port","pathname","location","requestURL","parsed","ignoreDuplicateOf","line","substr","encode","serializedParams","toISOString","normalizedName","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","run","marker","runClearTimeout","noop","nextTick","title","browser","env","argv","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","dispatchRequest","Axios","instanceConfig","interceptors","chain","interceptor","unshift","shift","readFloatLE","isSlowBuffer","_isBuffer","createInstance","defaultConfig","context","instance","axios","promises","spread","default","NoCache","NoCache_1","AxiosClient_1","RetryMap_1","Query_2","Query_3","HttpRepository_1","Transformer_1","Apisearch","createRepository","ensureIsDefined","index_id","endpoint","api_version","override_queries","http_client","param","createQueryLocated","createQuery","createQueryMatchAll","createQueryByUUID","createQueryByUUIDs","createEmptyResult","createEmptySortBy","__export","Apisearch_1"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,aAAwDC,M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AAA0B,KAAA1B,EAAAZ,EAAAqC,eAAAC,KAAAtC,EAAAsC,GAAA1B,EAAA0B,IAEAtC,EAAA4B,YAAA,EACA,IAAAg4B,EAAAt5B,EAAA,IACAN,EAAA,QAAA45B,EAAA,QACAD,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA,KACAq5B,EAAAr5B,EAAA,IACAq5B,EAAAr5B,EAAA","file":"apisearch.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apisearch\"] = factory();\n\telse\n\t\troot[\"apisearch\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 68);\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","\"use strict\";\nexports.__esModule = true;\n/**\n * ConnectError\n */\nvar ErrorWithMessage = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param message\n */\n function ErrorWithMessage(message) {\n this.message = message;\n }\n return ErrorWithMessage;\n}());\nexports.ErrorWithMessage = ErrorWithMessage;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.FILTER_MUST_ALL = 4;\nexports.FILTER_MUST_ALL_WITH_LEVELS = 5;\nexports.FILTER_AT_LEAST_ONE = 8;\nexports.FILTER_EXCLUDE = 16;\nexports.FILTER_PROMOTE = 32;\nexports.FILTER_TYPE_FIELD = \"field\";\nexports.FILTER_TYPE_RANGE = \"range\";\nexports.FILTER_TYPE_DATE_RANGE = \"date_range\";\nexports.FILTER_TYPE_GEO = \"geo\";\nexports.FILTER_TYPE_QUERY = \"query\";\n/**\n * Filter class\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n */\n function Filter(field, values, applicationType, filterType, filterTerms) {\n this.field = field;\n this.values = values;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.filterTerms = filterTerms;\n }\n /**\n * Get field\n *\n * @returns {string}\n */\n Filter.prototype.getField = function () {\n return this.field;\n };\n /**\n * Get values\n *\n * @returns {any}\n */\n Filter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Has value\n *\n * @param value\n *\n * @returns {boolean}\n */\n Filter.prototype.hasValue = function (value) {\n return typeof this.values[value] == \"undefined\";\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Filter.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Filter.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get filter type\n *\n * @return {{}}\n */\n Filter.prototype.getFilterTerms = function () {\n return this.filterTerms;\n };\n /**\n * Create\n *\n * @param field\n * @param values\n * @param applicationType\n * @param filterType\n * @param filterTerms\n *\n * @return {Filter}\n */\n Filter.create = function (field, values, applicationType, filterType, filterTerms) {\n if (filterTerms === void 0) { filterTerms = []; }\n return new Filter(field, values, applicationType, filterType, filterTerms);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Filter.prototype.toArray = function () {\n var filterAsArray = {};\n if (this.field != \"uuid.type\") {\n filterAsArray.field = this.field;\n }\n if (this.values.length > 0 ||\n Object.keys(this.values).length > 0) {\n filterAsArray.values = this.values;\n }\n if (this.applicationType != exports.FILTER_AT_LEAST_ONE) {\n filterAsArray.application_type = this.applicationType;\n }\n if (this.filterType != exports.FILTER_TYPE_FIELD) {\n filterAsArray.filter_type = this.filterType;\n }\n if (this.filterTerms.length > 0) {\n filterAsArray.filter_terms = this.filterTerms;\n }\n return filterAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Filter}\n */\n Filter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.values == \"undefined\") {\n array.values = [];\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = exports.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = exports.FILTER_TYPE_FIELD;\n }\n if (typeof array.filter_terms == \"undefined\") {\n array.filter_terms = [];\n }\n return Filter.create(array.field, array.values, array.application_type, array.filter_type, array.filter_terms);\n };\n /**\n * Get path by field.\n *\n * @param field\n *\n * @returns {string}\n */\n Filter.getFilterPathByField = function (field) {\n return ([\"id\", \"type\"].indexOf(field) > -1)\n ? \"uuid.\" + field\n : \"indexed_metadata.\" + field;\n };\n return Filter;\n}());\nexports.Filter = Filter;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Class InvalidFormatError\n */\nvar InvalidFormatError = /** @class */ (function (_super) {\n __extends(InvalidFormatError, _super);\n function InvalidFormatError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidFormatError.getTransportableHTTPError = function () {\n return 400;\n };\n /**\n * Item representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item representation not valid. Expecting Item array serialized but found malformed data\");\n };\n /**\n * Item UUID representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.itemUUIDRepresentationNotValid = function () {\n return new InvalidFormatError(\"Item UUID representation not valid. Expecting UUID array serialized but found malformed data\");\n };\n /**\n * Create Composed UUID bad format.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.composedItemUUIDNotValid = function () {\n return new InvalidFormatError(\"A composed UUID should always follow this format: {id}~{type}.\");\n };\n /**\n * Create Query sorted by distance without coordinate.\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.querySortedByDistanceWithoutCoordinate = function () {\n return new InvalidFormatError(\"In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()\");\n };\n /**\n * Query representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.queryFormatNotValid = function () {\n return new InvalidFormatError(\"Query Format not valid. Expecting a Query serialized but found malformed data\");\n };\n /**\n * Coordinate representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.coordinateFormatNotValid = function () {\n return new InvalidFormatError(\"A Coordinate should always contain a lat (Latitude) and a lon (Longitude)\");\n };\n /**\n * Config representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.configFormatNotValid = function () {\n return new InvalidFormatError(\"Config Format not valid. Expecting a Config serialized but found malformed data\");\n };\n /**\n * Token representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenFormatNotValid = function () {\n return new InvalidFormatError(\"Token Format not valid. Expecting a Token serialized but found malformed data\");\n };\n /**\n * Campaign representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.campaignFormatNotValid = function () {\n return new InvalidFormatError(\"Campaign Format not valid. Expecting a Campaign serialized but found malformed data\");\n };\n /**\n * Changes representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.changesFormatNotValid = function () {\n return new InvalidFormatError(\"Changes Format not valid. Expecting a Changes serialized but found malformed data\");\n };\n /**\n * Boost clause representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.boostClauseFormatNotValid = function () {\n return new InvalidFormatError(\"Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data\");\n };\n /**\n * token uuid representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.tokenUUIDFormatNotValid = function () {\n return new InvalidFormatError(\"Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data\");\n };\n /**\n * User representation not valid\n *\n * @return {InvalidFormatError}\n */\n InvalidFormatError.userFormatNotValid = function () {\n return new InvalidFormatError(\"User Format not valid. Expecting a User serialized but found malformed data\");\n };\n return InvalidFormatError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidFormatError = InvalidFormatError;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * ItemUUID class\n */\nvar ItemUUID = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param id\n * @param type\n */\n function ItemUUID(id, type) {\n this.id = id;\n this.type = type;\n }\n /**\n * Create composed UUID\n *\n * @param composedUUID\n *\n * @returns {ItemUUID}\n */\n ItemUUID.createByComposedUUID = function (composedUUID) {\n var parts = composedUUID.split(\"~\");\n if (2 != parts.length) {\n throw InvalidFormatError_1.InvalidFormatError.composedItemUUIDNotValid();\n }\n return new ItemUUID(parts[0], parts[1]);\n };\n /**\n * Return id\n *\n * @returns {string}\n */\n ItemUUID.prototype.getId = function () {\n return this.id;\n };\n /**\n * Get type\n *\n * @returns {string}\n */\n ItemUUID.prototype.getType = function () {\n return this.type;\n };\n /**\n * To array\n *\n * @returns {{id: *, type: *}}\n */\n ItemUUID.prototype.toArray = function () {\n return {\n id: this.id,\n type: this.type\n };\n };\n /**\n * Create from array\n *\n * @param array {{id:string, type:string}}\n *\n * @return {ItemUUID}\n */\n ItemUUID.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new ItemUUID(array.id, array.type);\n };\n /**\n * Compose unique id\n *\n * @returns {string}\n */\n ItemUUID.prototype.composedUUID = function () {\n return this.id + \"~\" + this.type;\n };\n return ItemUUID;\n}());\nexports.ItemUUID = ItemUUID;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * Coordinate Type cast\n * @param coordinate\n */\nvar Coordinate = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param {number} lat\n * @param {number} lon\n */\n function Coordinate(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n }\n /**\n * Get latitude\n *\n * @return float\n */\n Coordinate.prototype.getLatitude = function () {\n return this.lat;\n };\n /**\n * Get longitude\n *\n * @return float\n */\n Coordinate.prototype.getLongitude = function () {\n return this.lon;\n };\n /**\n * To array\n *\n * @return {{lat: number, lon: number}}\n */\n Coordinate.prototype.toArray = function () {\n return {\n lat: this.lat,\n lon: this.lon\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return Coordinate\n *\n * @throws InvalidFormatError\n */\n Coordinate.createFromArray = function (array) {\n if (typeof array.lat == \"undefined\" ||\n typeof array.lon == \"undefined\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n return new Coordinate(array.lat, array.lon);\n };\n return Coordinate;\n}());\nexports.Coordinate = Coordinate;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar User_1 = require(\"../Model/User\");\nvar Aggregation_1 = require(\"./Aggregation\");\nvar Filter_1 = require(\"./Filter\");\nvar Filter_2 = require(\"./Filter\");\nvar Aggregation_2 = require(\"./Aggregation\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Filter_3 = require(\"./Filter\");\nvar ScoreStrategy_1 = require(\"./ScoreStrategy\");\nvar SortBy_1 = require(\"./SortBy\");\n/**\n * Query constants\n */\nexports.QUERY_DEFAULT_FROM = 0;\nexports.QUERY_DEFAULT_PAGE = 1;\nexports.QUERY_DEFAULT_SIZE = 10;\nexports.QUERY_INFINITE_SIZE = 1000;\n/**\n * Query class\n */\nvar Query = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param queryText\n */\n function Query(queryText) {\n this.universeFilters = {};\n this.filters = {};\n this.itemsPromoted = [];\n this.aggregations = {};\n this.filterFields = [];\n this.sortByInstance = SortBy_1.SortBy.create();\n this.filters._query = Filter_1.Filter.create(\"\", [queryText], 0, Filter_3.FILTER_TYPE_QUERY);\n }\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.createLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n var query = Query.create(queryText, page, size);\n query.coordinate = coordinate;\n return query;\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Query.create = function (queryText, page, size) {\n if (page === void 0) { page = exports.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = exports.QUERY_DEFAULT_SIZE; }\n page = Math.max(1, page);\n var query = new Query(queryText);\n query.from = (page - 1) * size;\n query.size = size;\n query.page = page;\n return query;\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Query.createMatchAll = function () {\n return Query.create(\"\", exports.QUERY_DEFAULT_PAGE, exports.QUERY_DEFAULT_SIZE);\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Query.createByUUID = function (uuid) {\n return Query.createByUUIDs(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.createByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var ids = [];\n for (var i in uuids) {\n ids.push(uuids[i].composedUUID());\n }\n var query = Query.create(\"\", exports.QUERY_DEFAULT_PAGE, ids.length)\n .disableAggregations()\n .disableSuggestions();\n query.filters._id = Filter_1.Filter.create(\"_id\", ids, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD);\n return query;\n };\n /**\n * Filter universe by types\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByTypes = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.type;\n }\n return this;\n };\n /**\n * Filter by types\n *\n * @param values\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByTypes = function (values, aggregate, aggregationSort) {\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a, _b;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"type\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"type\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.type;\n }\n if (aggregate) {\n this.aggregations = __assign({}, this.aggregations, (_b = {}, _b[\"type\"] = Aggregation_1.Aggregation.create(\"type\", fieldPath, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort), _b));\n }\n return this;\n };\n /**\n * Filter universe by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters.id;\n }\n return this;\n };\n /**\n * Filter by ids\n *\n * @param values\n *\n * @return {Query}\n */\n Query.prototype.filterByIds = function (values) {\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(\"id\");\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"id\"] = Filter_1.Filter.create(fieldPath, values, Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters.id;\n }\n return this;\n };\n /**\n * Filter universe by\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseBy = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter by\n *\n * @param filterName\n * @param field\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterBy = function (filterName, field, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, Filter_2.FILTER_TYPE_FIELD), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateBy(filterName, field, applicationType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter universe by range\n *\n * @param field\n * @param values\n * @param applicationType\n * @param rangeType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByRange = function (field, values, applicationType, rangeType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length > 0) {\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[field] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.universeFilters[field];\n }\n return this;\n };\n /**\n * Filter universe by date range\n *\n * @param field\n * @param values\n * @param applicationType\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByDateRange = function (field, values, applicationType) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n return this.filterUniverseByRange(field, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE);\n };\n /**\n * Filter by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param rangeType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByRange = function (filterName, field, options, values, applicationType, rangeType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n var _a;\n var fieldPath = Filter_1.Filter.getFilterPathByField(field);\n if (values.length !== 0) {\n this.filters = __assign({}, this.filters, (_a = {}, _a[filterName] = Filter_1.Filter.create(fieldPath, values, applicationType, rangeType), _a));\n }\n else {\n delete this.filters[filterName];\n }\n if (aggregate) {\n this.aggregateByRange(filterName, fieldPath, options, applicationType, rangeType, aggregationSort);\n }\n return this;\n };\n /**\n * Filter by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param values\n * @param applicationType\n * @param aggregate\n * @param aggregationSort\n *\n * @return {Query}\n */\n Query.prototype.filterByDateRange = function (filterName, field, options, values, applicationType, aggregate, aggregationSort) {\n if (applicationType === void 0) { applicationType = Filter_2.FILTER_AT_LEAST_ONE; }\n if (aggregate === void 0) { aggregate = true; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n return this.filterByRange(filterName, field, options, values, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregate, aggregationSort);\n };\n /**\n * Filter universe by location\n *\n * @param locationRange\n *\n * @return {Query}\n */\n Query.prototype.filterUniverseByLocation = function (locationRange) {\n var _a;\n this.universeFilters = __assign({}, this.universeFilters, (_a = {}, _a[\"coordinate\"] = Filter_1.Filter.create(\"coordinate\", locationRange.toArray(), Filter_2.FILTER_AT_LEAST_ONE, Filter_2.FILTER_TYPE_GEO), _a));\n return this;\n };\n /**\n * Set filter fields\n *\n * @param filterFields\n *\n * @return {Query}\n */\n Query.prototype.setFilterFields = function (filterFields) {\n this.filterFields = filterFields;\n return this;\n };\n /**\n * Get filter fields\n *\n * @return {string[]}\n */\n Query.prototype.getFilterFields = function () {\n return this.filterFields;\n };\n /**\n * Sort by\n *\n * @param sortBy\n *\n * @return {Query}\n */\n Query.prototype.sortBy = function (sortBy) {\n if (sortBy.isSortedByGeoDistance()) {\n if (!(this.coordinate instanceof Coordinate_1.Coordinate)) {\n throw InvalidFormatError_1.InvalidFormatError.querySortedByDistanceWithoutCoordinate();\n }\n sortBy.setCoordinate(this.coordinate);\n }\n this.sortByInstance = sortBy;\n return this;\n };\n /**\n * Aggregate by\n *\n * @param filterName\n * @param field\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param rangeType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByRange = function (filterName, field, options, applicationType, rangeType, aggregationSort, limit) {\n if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n var _a;\n if (options.length === 0) {\n return this;\n }\n this.aggregations = __assign({}, this.aggregations, (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Filter_1.Filter.getFilterPathByField(field), applicationType, rangeType, options, aggregationSort, limit), _a));\n return this;\n };\n /**\n * Aggregate by date range\n *\n * @param filterName\n * @param field\n * @param options\n * @param applicationType\n * @param aggregationSort\n * @param limit\n *\n * @return {Query}\n */\n Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {\n if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }\n return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);\n };\n /**\n * Get aggregations\n *\n * @return {{}}\n */\n Query.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation by name\n *\n * @param aggregationName\n *\n * @return {Aggregation|null}\n */\n Query.prototype.getAggregation = function (aggregationName) {\n return this.aggregations[aggregationName] instanceof Aggregation_1.Aggregation\n ? this.aggregations[aggregationName]\n : null;\n };\n /**\n * Get query text\n *\n * @return {string}\n */\n Query.prototype.getQueryText = function () {\n var filter = this.filters._query;\n return filter instanceof Filter_1.Filter\n ? filter.getValues()[0]\n : \"\";\n };\n /**\n * Get universe filters\n *\n * @return {{}}\n */\n Query.prototype.getUniverseFilters = function () {\n return this.universeFilters;\n };\n /**\n * Get universe filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getUniverseFilter = function (filterName) {\n return this.universeFilters[filterName] instanceof Filter_1.Filter\n ? this.universeFilters[filterName]\n : null;\n };\n /**\n * Get filters\n *\n * @return {{}}\n */\n Query.prototype.getFilters = function () {\n return this.filters;\n };\n /**\n * Get filter by name\n *\n * @param filterName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilter = function (filterName) {\n return this.filters[filterName] instanceof Filter_1.Filter\n ? this.filters[filterName]\n : null;\n };\n /**\n * Get filter by field\n *\n * @param fieldName\n *\n * @return {Filter|null}\n */\n Query.prototype.getFilterByField = function (fieldName) {\n var fieldPath = Filter_1.Filter.getFilterPathByField(fieldName);\n for (var i in this.filters) {\n if (this.filters[i].getField() == fieldPath) {\n return this.filters[i];\n }\n }\n return null;\n };\n /**\n * Get sort by\n *\n * @return {SortBy}\n */\n Query.prototype.getSortBy = function () {\n return this.sortByInstance;\n };\n /**\n * Get from\n *\n * @return {number}\n */\n Query.prototype.getFrom = function () {\n return this.from;\n };\n /**\n * Get size\n *\n * @return {number}\n */\n Query.prototype.getSize = function () {\n return this.size;\n };\n /**\n * Get page\n *\n * @return {number}\n */\n Query.prototype.getPage = function () {\n return this.page;\n };\n /**\n * Enable results\n *\n * @return {Query}\n */\n Query.prototype.enableResults = function () {\n this.resultsEnabled = true;\n return this;\n };\n /**\n * Disable results\n *\n * @return {Query}\n */\n Query.prototype.disableResults = function () {\n this.resultsEnabled = false;\n return this;\n };\n /**\n * Are results enabled\n *\n * @return {boolean}\n */\n Query.prototype.areResultsEnabled = function () {\n return this.resultsEnabled;\n };\n /**\n * Enable aggregations\n *\n * @return {Query}\n */\n Query.prototype.enableAggregations = function () {\n this.aggregationsEnabled = true;\n return this;\n };\n /**\n * Disable aggregations\n *\n * @return {Query}\n */\n Query.prototype.disableAggregations = function () {\n this.aggregationsEnabled = false;\n return this;\n };\n /**\n * Are aggregations enabled\n *\n * @return {boolean}\n */\n Query.prototype.areAggregationsEnabled = function () {\n return this.aggregationsEnabled;\n };\n /**\n * Enable suggestions\n *\n * @return {Query}\n */\n Query.prototype.enableSuggestions = function () {\n this.suggestionsEnabled = true;\n return this;\n };\n /**\n * Disable suggestions\n *\n * @return {Query}\n */\n Query.prototype.disableSuggestions = function () {\n this.suggestionsEnabled = false;\n return this;\n };\n /**\n * Are suggestions enabled\n *\n * @return {boolean}\n */\n Query.prototype.areSuggestionsEnabled = function () {\n return this.suggestionsEnabled;\n };\n /**\n * Enable highlights\n *\n * @return {Query}\n */\n Query.prototype.enableHighlights = function () {\n this.highlightsEnabled = true;\n return this;\n };\n /**\n * Disable highlights\n *\n * @return {Query}\n */\n Query.prototype.disableHighlights = function () {\n this.highlightsEnabled = false;\n return this;\n };\n /**\n * Are highlights enabled\n *\n * @return {boolean}\n */\n Query.prototype.areHighlightsEnabled = function () {\n return this.highlightsEnabled;\n };\n /**\n * Promote uuid\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.promoteUUID = function (itemUUID) {\n this\n .itemsPromoted\n .push(itemUUID);\n return this;\n };\n /**\n * Promote UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.promoteUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n this.itemsPromoted = uuids;\n return this;\n };\n /**\n * Get promoted UUIDs\n *\n * @return {ItemUUID[]}\n */\n Query.prototype.getItemsPromoted = function () {\n return this.itemsPromoted;\n };\n /**\n * Exclude id\n *\n * @param itemUUID\n *\n * @return {Query}\n */\n Query.prototype.excludeUUID = function (itemUUID) {\n this.excludeUUIDs(itemUUID);\n return this;\n };\n /**\n * Exclude UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Query.prototype.excludeUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n var _a;\n this.filters = __assign({}, this.filters, (_a = {}, _a[\"excluded_ids\"] = Filter_1.Filter.create(\"_id\", uuids.map(function (uuid) { return uuid.composedUUID(); }), Filter_2.FILTER_EXCLUDE, Filter_2.FILTER_TYPE_FIELD), _a));\n return this;\n };\n /**\n * Get score strategy\n *\n * @return {ScoreStrategy}\n */\n Query.prototype.getScoreStrategy = function () {\n return this.scoreStrategy;\n };\n /**\n * Set score strategy\n *\n * @param scoreStrategy\n */\n Query.prototype.setScoreStrategy = function (scoreStrategy) {\n this.scoreStrategy = scoreStrategy;\n return this;\n };\n /**\n * By user\n *\n * @param user\n *\n * @return {Query}\n */\n Query.prototype.byUser = function (user) {\n this.user = user;\n return this;\n };\n /**\n * By anyone\n *\n * @return {null}\n */\n Query.prototype.anonymously = function () {\n this.user = null;\n return null;\n };\n /**\n * Get user\n *\n * @return {User}\n */\n Query.prototype.getUser = function () {\n return this.user;\n };\n /**\n * To array\n *\n * @return {any}\n */\n Query.prototype.toArray = function () {\n var array = {};\n if (this.getQueryText() !== \"\") {\n array.q = this.getQueryText();\n }\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n array.coordinate = this.coordinate.toArray();\n }\n /**\n * Universe Filters\n */\n if (Object.keys(this.universeFilters).length) {\n array.universe_filters = {};\n for (var i in this.universeFilters) {\n var universeFilter = this.universeFilters[i];\n array.universe_filters[i] = universeFilter.toArray();\n }\n }\n /**\n * Filters\n */\n if (this.filters instanceof Object &&\n Object.keys(this.filters).length) {\n array.filters = {};\n for (var i in this.filters) {\n var filter = this.filters[i];\n if (filter.getFilterType() !== Filter_3.FILTER_TYPE_QUERY) {\n array.filters[i] = filter.toArray();\n }\n }\n }\n /**\n * Aggregations\n */\n if (this.aggregations instanceof Object &&\n Object.keys(this.aggregations).length) {\n array.aggregations = {};\n for (var i in this.aggregations) {\n var aggregation = this.aggregations[i];\n array.aggregations[i] = aggregation.toArray();\n }\n }\n /**\n * Sort\n */\n var sort = this.sortByInstance.toArray();\n if (Object.keys(sort).length) {\n array.sort = sort;\n }\n /**\n * Page\n */\n var page = this.page;\n if (page !== exports.QUERY_DEFAULT_PAGE) {\n array.page = page;\n }\n /**\n * Size\n */\n var size = this.size;\n if (size !== exports.QUERY_DEFAULT_SIZE) {\n array.size = size;\n }\n /**\n * Booleans\n */\n if (this.resultsEnabled === false) {\n array.results_enabled = false;\n }\n if (this.suggestionsEnabled === true) {\n array.suggestions_enabled = true;\n }\n if (this.highlightsEnabled === true) {\n array.highlights_enabled = true;\n }\n if (this.aggregationsEnabled === false) {\n array.aggregations_enabled = false;\n }\n /**\n * Filter fields\n */\n if (this.filterFields instanceof Array &&\n this.filterFields.length > 0) {\n array.filter_fields = this.filterFields;\n }\n /**\n * Score strategy\n */\n if (this.scoreStrategy instanceof ScoreStrategy_1.ScoreStrategy) {\n var scoreStrategyAsArray = this.scoreStrategy.toArray();\n if (Object.keys(scoreStrategyAsArray).length > 0) {\n array.score_strategy = scoreStrategyAsArray;\n }\n }\n /**\n * User\n */\n if (this.user instanceof User_1.User) {\n var userAsArray = this.user.toArray();\n if (Object.keys(userAsArray).length > 0) {\n array.user = userAsArray;\n }\n }\n /**\n * items promoted\n */\n if (this.itemsPromoted.length > 0) {\n array.items_promoted = [];\n for (var i in this.itemsPromoted) {\n array\n .items_promoted\n .push(this.itemsPromoted[i].toArray);\n }\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Query}\n */\n Query.createFromArray = function (array) {\n var query = array.coordinate instanceof Object\n ? Query.createLocated(Coordinate_1.Coordinate.createFromArray(array.coordinate), array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE)\n : Query.create(array.q ? array.q : \"\", array.page ? array.page : exports.QUERY_DEFAULT_PAGE, array.size ? array.size : exports.QUERY_DEFAULT_SIZE);\n /**\n * Aggregations\n */\n var aggregationsAsArray = typeof array.aggregations === typeof {}\n ? array.aggregations\n : {};\n for (var i in aggregationsAsArray) {\n query.aggregations[i] = Aggregation_1.Aggregation.createFromArray(aggregationsAsArray[i]);\n }\n /**\n * Sort\n */\n var sortAsArray = typeof array.sort === typeof {}\n ? array.sort\n : {};\n if (Object.keys(sortAsArray).length > 0) {\n query.sortByInstance = SortBy_1.SortBy.createFromArray(sortAsArray);\n }\n /**\n * Filters\n */\n var filtersAsArray = typeof array.filters === typeof {}\n ? array.filters\n : {};\n for (var i in filtersAsArray) {\n query.filters[i] = Filter_1.Filter.createFromArray(filtersAsArray[i]);\n }\n /**\n * Universe Filters\n */\n var universeFiltersAsArray = typeof array.universe_filters === typeof {}\n ? array.universe_filters\n : {};\n for (var i in universeFiltersAsArray) {\n query.universeFilters[i] = Filter_1.Filter.createFromArray(universeFiltersAsArray[i]);\n }\n /**\n * Booleans\n */\n query.resultsEnabled = typeof array.results_enabled === \"boolean\"\n ? array.results_enabled\n : true;\n query.suggestionsEnabled = typeof array.suggestions_enabled === \"boolean\"\n ? array.suggestions_enabled\n : false;\n query.aggregationsEnabled = typeof array.aggregations_enabled === \"boolean\"\n ? array.aggregations_enabled\n : true;\n query.highlightsEnabled = typeof array.highlights_enabled === \"boolean\"\n ? array.highlights_enabled\n : false;\n /**\n * Items promoted\n */\n var itemsPromotedAsArray = typeof array.items_promoted === typeof {}\n ? array.items_promoted\n : {};\n for (var i in itemsPromotedAsArray) {\n query\n .itemsPromoted\n .push(ItemUUID_1.ItemUUID.createFromArray(itemsPromotedAsArray[i]));\n }\n /**\n * Filter fields\n */\n query.filterFields = array.filter_fields instanceof Array\n ? array.filter_fields\n : [];\n query.scoreStrategy = array.score_strategy instanceof Object\n ? ScoreStrategy_1.ScoreStrategy.createFromArray(array.score_stategy)\n : null;\n query.user = array.user instanceof Object\n ? User_1.User.createFromArray(array.user)\n : null;\n return query;\n };\n return Query;\n}());\nexports.Query = Query;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar Coordinate_1 = require(\"./Coordinate\");\nvar ItemUUID_1 = require(\"./ItemUUID\");\n/**\n * Item class\n */\nvar Item = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n */\n function Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n this.metadata = {};\n this.indexedMetadata = {};\n this.searchableMetadata = {};\n this.exactMatchingMetadata = [];\n this.suggest = [];\n this.highlights = {};\n this.promoted = false;\n this.uuid = uuid;\n this.coordinate = coordinate;\n this.metadata = metadata;\n this.indexedMetadata = indexedMetadata;\n this.searchableMetadata = searchableMetadata;\n this.exactMatchingMetadata = exactMatchingMetadata;\n this.suggest = suggest;\n }\n /**\n * Create new Item\n *\n * @param uuid\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.create = function (uuid, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, null, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Create new located Item\n *\n * @param uuid\n * @param coordinate\n * @param metadata\n * @param indexedMetadata\n * @param searchableMetadata\n * @param exactMatchingMetadata\n * @param suggest\n * @returns {Item}\n */\n Item.createLocated = function (uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest) {\n if (metadata === void 0) { metadata = {}; }\n if (indexedMetadata === void 0) { indexedMetadata = {}; }\n if (searchableMetadata === void 0) { searchableMetadata = {}; }\n if (exactMatchingMetadata === void 0) { exactMatchingMetadata = []; }\n if (suggest === void 0) { suggest = []; }\n return new Item(uuid, coordinate, metadata, indexedMetadata, searchableMetadata, exactMatchingMetadata, suggest);\n };\n /**\n * Get uuid\n *\n * @returns ItemUUID\n */\n Item.prototype.getUUID = function () {\n return this.uuid;\n };\n /**\n * Get id\n *\n * @returns string\n */\n Item.prototype.getId = function () {\n return this.uuid.getId();\n };\n /**\n * Get type\n *\n * @returns string\n */\n Item.prototype.getType = function () {\n return this.uuid.getType();\n };\n /**\n * Get coordinate\n *\n * @returns Coordinate|null\n */\n Item.prototype.getCoordinate = function () {\n return this.coordinate;\n };\n /**\n * Get distance\n *\n * @returns int\n */\n Item.prototype.getDistance = function () {\n return this.distance;\n };\n /**\n * Get metadata\n *\n * @returns Array\n */\n Item.prototype.getMetadata = function () {\n return this.metadata;\n };\n /**\n * Set metadata\n *\n * @param metadata\n */\n Item.prototype.setMetadata = function (metadata) {\n this.metadata = metadata;\n };\n /**\n * Add metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addMetadata = function (key, value) {\n this.metadata[key] = value;\n };\n /**\n * Get indexed metadata\n *\n * @returns Array\n */\n Item.prototype.getIndexedMetadata = function () {\n return this.indexedMetadata;\n };\n /**\n * Set indexed metadata\n *\n * @param indexedMetadata\n */\n Item.prototype.setIndexedMetadata = function (indexedMetadata) {\n this.indexedMetadata = indexedMetadata;\n };\n /**\n * Add indexed metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addIndexedMetadata = function (key, value) {\n this.indexedMetadata[key] = value;\n };\n /**\n * Get searchable metadata\n *\n * @returns Array\n */\n Item.prototype.getSearchableMetadata = function () {\n return this.searchableMetadata;\n };\n /**\n * Set searchable metadata\n *\n * @param searchableMetadata\n */\n Item.prototype.setSearchableMetadata = function (searchableMetadata) {\n this.searchableMetadata = searchableMetadata;\n };\n /**\n * Add searchable metadata\n *\n * @param key\n * @param value\n */\n Item.prototype.addSearchableMetadata = function (key, value) {\n this.searchableMetadata[key] = value;\n };\n /**\n * Get exactMatching metadata\n *\n * @returns Array\n */\n Item.prototype.getExactMatchingMetadata = function () {\n return this.exactMatchingMetadata;\n };\n /**\n * Set exactMatching metadata\n *\n * @param exactMatchingMetadata\n */\n Item.prototype.setExactMatchingMetadata = function (exactMatchingMetadata) {\n this.exactMatchingMetadata = exactMatchingMetadata;\n };\n /**\n * Add exactMatching metadata\n *\n * @param value\n */\n Item.prototype.addExactMatchingMetadata = function (value) {\n this.exactMatchingMetadata.push(value);\n };\n /**\n * Get all metadata\n *\n * @returns {{}}\n */\n Item.prototype.getAllMetadata = function () {\n return __assign({}, this.metadata, this.indexedMetadata);\n };\n /**\n * Get\n *\n * @param key\n *\n * @returns mixed|null\n */\n Item.prototype.get = function (key) {\n var allMetadata = this.getAllMetadata();\n return (typeof allMetadata[key] != \"undefined\")\n ? allMetadata[key]\n : null;\n };\n /**\n * Get suggest\n *\n * @returns Array\n */\n Item.prototype.getSuggest = function () {\n return this.suggest;\n };\n /**\n * Get highlights\n *\n * @returns Array\n */\n Item.prototype.getHighlights = function () {\n return this.highlights;\n };\n /**\n * Get highlight\n *\n * @param key\n *\n * @return string|null\n */\n Item.prototype.getHighlight = function (key) {\n return (typeof this.highlights[key] != \"undefined\")\n ? this.highlights[key]\n : null;\n };\n /**\n * Is promoted\n *\n * @returns boolean\n */\n Item.prototype.isPromoted = function () {\n return this.promoted;\n };\n /**\n * To array\n */\n Item.prototype.toArray = function () {\n var itemAsArray = {\n uuid: this.uuid.toArray()\n };\n if (this.coordinate instanceof Coordinate_1.Coordinate) {\n itemAsArray.coordinate = this.coordinate.toArray();\n }\n if (Object.keys(this.metadata).length > 0) {\n itemAsArray.metadata = this.metadata;\n }\n if (Object.keys(this.indexedMetadata).length > 0) {\n itemAsArray.indexed_metadata = this.indexedMetadata;\n }\n if (Object.keys(this.searchableMetadata).length > 0) {\n itemAsArray.searchable_metadata = this.searchableMetadata;\n }\n if (this.exactMatchingMetadata.length > 0) {\n itemAsArray.exact_matching_metadata = this.exactMatchingMetadata;\n }\n if (this.suggest.length > 0) {\n itemAsArray.suggest = this.suggest;\n }\n if (Object.keys(this.highlights).length > 0) {\n itemAsArray.highlights = this.highlights;\n }\n if (this.isPromoted()) {\n itemAsArray.is_promoted = true;\n }\n if (typeof this.distance != \"undefined\") {\n itemAsArray.distance = this.distance;\n }\n return itemAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n */\n Item.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.uuid != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.itemUUIDRepresentationNotValid();\n }\n if (typeof array.coordinate != \"undefined\" &&\n typeof array.coordinate != \"object\") {\n throw InvalidFormatError_1.InvalidFormatError.coordinateFormatNotValid();\n }\n var item = (typeof array.coordinate == \"object\" &&\n array.coordinate != null)\n ? Item.createLocated(ItemUUID_1.ItemUUID.createFromArray(array.uuid), Coordinate_1.Coordinate.createFromArray(array.coordinate), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest))\n : Item.create(ItemUUID_1.ItemUUID.createFromArray(array.uuid), ((typeof array.metadata == \"undefined\") ? {} : array.metadata), ((typeof array.indexed_metadata == \"undefined\") ? {} : array.indexed_metadata), ((typeof array.searchable_metadata == \"undefined\") ? {} : array.searchable_metadata), ((typeof array.exact_matching_metadata == \"undefined\") ? [] : array.exact_matching_metadata), ((typeof array.suggest == \"undefined\") ? [] : array.suggest));\n if (typeof array.distance != \"undefined\" &&\n array.distance != null) {\n item.distance = array.distance;\n }\n if (typeof array.highlights == \"object\" &&\n array.distance != null) {\n item.highlights = array.highlights;\n }\n if (array.is_promoted) {\n item.promoted = true;\n }\n return item;\n };\n /**\n * Compose uuid\n *\n * @returns string\n */\n Item.prototype.composeUUID = function () {\n return this.uuid.composedUUID();\n };\n return Item;\n}());\nexports.Item = Item;\n","\"use strict\";\nexports.__esModule = true;\nvar ResultAggregation_1 = require(\"./ResultAggregation\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregations = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param totalElements\n */\n function ResultAggregations(totalElements) {\n this.aggregations = {};\n this.totalElements = totalElements;\n }\n /**\n * Add aggregation\n *\n * @param name\n * @param aggregation\n */\n ResultAggregations.prototype.addAggregation = function (name, aggregation) {\n this.aggregations[name] = aggregation;\n };\n /**\n * Get aggregations\n *\n * @returns {{}}\n */\n ResultAggregations.prototype.getAggregations = function () {\n return this.aggregations;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @returns {Aggregation|null}\n */\n ResultAggregations.prototype.getAggregation = function (name) {\n return this.aggregations[name] instanceof ResultAggregation_1.ResultAggregation\n ? this.aggregations[name]\n : null;\n };\n /**\n * Has not empty aggregation\n *\n * @param name\n *\n * @returns {boolean}\n */\n ResultAggregations.prototype.hasNotEmptyAggregation = function (name) {\n var aggregation = this.getAggregation(name);\n return (aggregation instanceof ResultAggregation_1.ResultAggregation) &&\n (!aggregation.isEmpty());\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregations.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * To array\n *\n * @return {{total_elements?: number, aggregations?: {}}}\n */\n ResultAggregations.prototype.toArray = function () {\n var aggregationCollection = {};\n for (var i in this.aggregations) {\n aggregationCollection[i] = this.aggregations[i].toArray();\n }\n var array = {};\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n if (Object.keys(aggregationCollection).length > 0) {\n array.aggregations = aggregationCollection;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ResultAggregations}\n */\n ResultAggregations.createFromArray = function (array) {\n var aggregations = new ResultAggregations(typeof array.total_elements === \"number\"\n ? array.total_elements\n : 0);\n if (typeof array.aggregations === typeof {}) {\n for (var i in array.aggregations) {\n aggregations.addAggregation(i, ResultAggregation_1.ResultAggregation.createFromArray(array.aggregations[i]));\n }\n }\n return aggregations;\n };\n return ResultAggregations;\n}());\nexports.ResultAggregations = ResultAggregations;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar Query_1 = require(\"../Query/Query\");\nvar ResultAggregations_1 = require(\"./ResultAggregations\");\n/**\n * Result class\n */\nvar Result = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param query\n * @param totalItems\n * @param totalHits\n */\n function Result(query, totalItems, totalHits) {\n this.items = [];\n this.suggests = [];\n this.query = query;\n this.totalItems = totalItems;\n this.totalHits = totalHits;\n }\n /**\n * Create\n *\n * @param query\n * @param totalItems\n * @param totalHits\n * @param aggregations\n * @param suggests\n * @param items\n *\n * @returns {Result}\n */\n Result.create = function (query, totalItems, totalHits, aggregations, suggests, items) {\n var result = new Result(query, totalItems, totalHits);\n result.aggregations = aggregations;\n result.suggests = suggests;\n result.items = items;\n return result;\n };\n /**\n * Add item\n *\n * @param item\n */\n Result.prototype.addItem = function (item) {\n this.items.push(item);\n };\n /**\n * Get items\n *\n * @return {Item[]}\n */\n Result.prototype.getItems = function () {\n return this.items;\n };\n /**\n * Get items grouped by types\n *\n * @return {any[]}\n */\n Result.prototype.getItemsGroupedByTypes = function () {\n if (this.itemsGroupedByTypeCache instanceof Object &&\n Object.keys(this.itemsGroupedByTypeCache).length > 0) {\n return this.itemsGroupedByTypeCache;\n }\n var itemsGroupedByTypes = {};\n for (var i in this.items) {\n var item = this.items[i];\n if (!(itemsGroupedByTypes[item.getType()] instanceof Array)) {\n itemsGroupedByTypes[item.getType()] = [];\n }\n itemsGroupedByTypes[item.getType()].push(item);\n }\n this.itemsGroupedByTypeCache = itemsGroupedByTypes;\n return itemsGroupedByTypes;\n };\n /**\n * Get items by type\n *\n * @param type\n *\n * @return {Array}\n */\n Result.prototype.getItemsByType = function (type) {\n var itemsGroupedByTypes = this.getItemsGroupedByTypes();\n return itemsGroupedByTypes[type] == null\n ? []\n : itemsGroupedByTypes[type];\n };\n /**\n * Get items by types\n *\n * @param types\n */\n Result.prototype.getItemsByTypes = function (types) {\n return this.items.filter(function (item) { return types.indexOf(item.getType()) >= 0; });\n };\n /**\n * Get first item\n *\n * @return {Item}\n */\n Result.prototype.getFirstItem = function () {\n return this.items.length > 0\n ? this.items[0]\n : null;\n };\n /**\n * Set aggregations\n *\n * @param aggregations\n */\n Result.prototype.setAggregations = function (aggregations) {\n this.aggregations = aggregations;\n };\n /**\n * Get aggregations\n *\n * @return {ResultAggregations}\n */\n Result.prototype.getAggregations = function () {\n return this.aggregations instanceof ResultAggregations_1.ResultAggregations\n ? this.aggregations\n : null;\n };\n /**\n * Get aggregation\n *\n * @param name\n *\n * @return {null}\n */\n Result.prototype.getAggregation = function (name) {\n return this.aggregations == null\n ? null\n : this.aggregations.getAggregation(name);\n };\n /**\n * Has no empty aggregation\n *\n * @param name\n *\n * @return {boolean}\n */\n Result.prototype.hasNotEmptyAggregation = function (name) {\n return this.aggregations == null\n ? false\n : this.aggregations.hasNotEmptyAggregation(name);\n };\n /**\n * Add suggest\n *\n * @param suggest\n */\n Result.prototype.addSuggest = function (suggest) {\n this.suggests.push(suggest);\n };\n /**\n * Get suggests\n *\n * @return {string[]}\n */\n Result.prototype.getSuggests = function () {\n return this.suggests;\n };\n /**\n * Get query\n *\n * @return {Query}\n */\n Result.prototype.getQuery = function () {\n return this.query;\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n Result.prototype.getTotalItems = function () {\n return this.totalItems;\n };\n /**\n * Get total hits\n *\n * @return {number}\n */\n Result.prototype.getTotalHits = function () {\n return this.totalHits;\n };\n /**\n * to array\n *\n * @return {{query: any, total_items: number, total_hits: number, items:any[], aggregations: any, suggests: string[]}}\n */\n Result.prototype.toArray = function () {\n return {\n query: this.query.toArray(),\n total_items: this.totalItems,\n total_hits: this.totalHits,\n items: this.items.map(function (item) { return item.toArray(); }),\n aggregations: this.aggregations == null\n ? null\n : this.aggregations.toArray(),\n suggests: this.suggests\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Result}\n */\n Result.createFromArray = function (array) {\n return Result.create(Query_1.Query.createFromArray(array.query), array.total_items\n ? array.total_items\n : 0, array.total_hits\n ? array.total_hits\n : 0, array.aggregations instanceof Object\n ? ResultAggregations_1.ResultAggregations.createFromArray(array.aggregations)\n : null, array.suggests\n ? array.suggests\n : null, array.items instanceof Array\n ? array.items.map(function (itemAsArray) { return Item_1.Item.createFromArray(itemAsArray); })\n : []);\n };\n return Result;\n}());\nexports.Result = Result;\n","\"use strict\";\nexports.__esModule = true;\n/**\n export * Sort by constants\n */\nexports.SORT_BY_TYPE_FIELD = 1;\nexports.SORT_BY_TYPE_NESTED = 2;\nexports.SORT_BY_ASC = \"asc\";\nexports.SORT_BY_DESC = \"desc\";\nexports.SORT_BY_MODE_AVG = \"avg\";\nexports.SORT_BY_MODE_SUM = \"sum\";\nexports.SORT_BY_MODE_MIN = \"min\";\nexports.SORT_BY_MODE_MAX = \"max\";\nexports.SORT_BY_MODE_MEDIAN = \"median\";\nexports.SORT_BY_SCORE = {\n _score: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_RANDOM = {\n random: {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_AL_TUN_TUN = exports.SORT_BY_RANDOM;\nexports.SORT_BY_ID_ASC = {\n \"uuid.id\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_ID_DESC = {\n \"uuid.id\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_TYPE_ASC = {\n \"uuid.type\": {\n order: exports.SORT_BY_ASC\n }\n};\nexports.SORT_BY_TYPE_DESC = {\n \"uuid.type\": {\n order: exports.SORT_BY_DESC\n }\n};\nexports.SORT_BY_LOCATION_KM_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_ASC,\n unit: \"km\"\n }\n};\nexports.SORT_BY_LOCATION_MI_ASC = {\n _geo_distance: {\n order: exports.SORT_BY_DESC,\n unit: \"mi\"\n }\n};\nvar Coordinate_1 = require(\"../Model/Coordinate\");\nvar Filter_1 = require(\"./Filter\");\n/**\n * ScoreStrategy\n */\nvar SortBy = /** @class */ (function () {\n function SortBy() {\n this.sortsBy = [];\n }\n /**\n * Create\n *\n * @return {SortBy}\n */\n SortBy.create = function () {\n return new SortBy;\n };\n /**\n * Sort By fields values\n *\n * @param shortSortByElements\n *\n * @return {SortBy}\n */\n SortBy.byFieldsValues = function (shortSortByElements) {\n var sortBy = SortBy.create();\n for (var key in shortSortByElements) {\n sortBy.byFieldValue(key, shortSortByElements[key]);\n }\n return sortBy;\n };\n /**\n * All\n *\n * @return {Array}\n */\n SortBy.prototype.all = function () {\n return this.sortsBy.length > 0\n ? this.sortsBy\n : [exports.SORT_BY_SCORE];\n };\n /**\n * Sort by value\n *\n * @param value\n *\n * @return {SortBy}\n */\n SortBy.prototype.byValue = function (value) {\n if (exports.SORT_BY_SCORE != value &&\n exports.SORT_BY_RANDOM != value) {\n if (typeof value.type == \"undefined\") {\n value.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (exports.SORT_BY_SCORE != value) {\n this.sortsBy.push(value);\n }\n return this;\n };\n /**\n * Sort by field value\n *\n * @param field\n * @param order\n *\n * @return {SortBy}\n */\n SortBy.prototype.byFieldValue = function (field, order) {\n var object = {\n type: exports.SORT_BY_TYPE_FIELD\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field\n *\n * @param field\n * @param order\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedField = function (field, order, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Sort by nested field and filter\n *\n * @param field\n * @param order\n * @param filter\n * @param mode\n *\n * @return {SortBy}\n */\n SortBy.prototype.byNestedFieldAndFilter = function (field, order, filter, mode) {\n if (mode === void 0) { mode = exports.SORT_BY_MODE_AVG; }\n var fieldPath = Filter_1.Filter.getFilterPathByField(filter.getField());\n var filterAsArray = filter.toArray();\n filterAsArray.field = fieldPath;\n filter = Filter_1.Filter.createFromArray(filterAsArray);\n var object = {\n type: exports.SORT_BY_TYPE_NESTED,\n mode: mode,\n filter: filter\n };\n object[\"indexed_metadata.\" + field] = {\n order: order\n };\n this.sortsBy.push(object);\n return this;\n };\n /**\n * Is sorted by geo distance\n *\n * @return {boolean}\n */\n SortBy.prototype.isSortedByGeoDistance = function () {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n return true;\n }\n }\n return false;\n };\n /**\n * Set coordinate\n *\n * @param coordinate\n *\n * @return {SortBy}\n */\n SortBy.prototype.setCoordinate = function (coordinate) {\n for (var i in this.sortsBy) {\n if (typeof this.sortsBy[i]._geo_distance === typeof {}) {\n this.sortsBy[i]._geo_distance.coordinate = coordinate;\n }\n }\n return this;\n };\n /**\n * Has random sort\n *\n * @return {boolean}\n */\n SortBy.prototype.hasRandomSort = function () {\n for (var i in this.sortsBy) {\n if (JSON.stringify(this.sortsBy[i]) === JSON.stringify(exports.SORT_BY_RANDOM)) {\n return true;\n }\n }\n return false;\n };\n /**\n * To array\n *\n * @return {[]}\n */\n SortBy.prototype.toArray = function () {\n var copySortBy = this.copy();\n var sortsByAsArray = copySortBy.sortsBy;\n for (var i in sortsByAsArray) {\n if (sortsByAsArray[i].type == exports.SORT_BY_TYPE_FIELD) {\n delete sortsByAsArray[i].type;\n }\n if (typeof sortsByAsArray[i].filter === typeof {} &&\n sortsByAsArray[i].filter != null) {\n sortsByAsArray[i].filter = sortsByAsArray[i].filter.toArray();\n }\n if (typeof sortsByAsArray[i]._geo_distance === typeof {} &&\n sortsByAsArray[i]._geo_distance !== null &&\n sortsByAsArray[i]._geo_distance.coordinate instanceof Coordinate_1.Coordinate) {\n sortsByAsArray[i]._geo_distance.coordinate = sortsByAsArray[i]._geo_distance.coordinate.toArray();\n }\n }\n return sortsByAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {SortBy}\n */\n SortBy.createFromArray = function (array) {\n var innerArray = JSON.parse(JSON.stringify(array));\n var sortBy = SortBy.create();\n for (var i in innerArray) {\n var element = innerArray[i];\n if (JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_RANDOM) &&\n JSON.stringify(element) !== JSON.stringify(exports.SORT_BY_SCORE)) {\n if (typeof element.type == \"undefined\") {\n element.type = exports.SORT_BY_TYPE_FIELD;\n }\n }\n if (typeof element.filter === typeof {} &&\n element.filter != null) {\n element.filter = Filter_1.Filter.createFromArray(element.filter);\n }\n if (typeof element._geo_distance === typeof {} &&\n element._geo_distance != null &&\n typeof element._geo_distance.coordinate === typeof {}) {\n element._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(element._geo_distance.coordinate);\n }\n sortBy.sortsBy.push(element);\n }\n return sortBy;\n };\n /**\n * Make a copy of this\n *\n * @returns {SortBy}\n */\n SortBy.prototype.copy = function () {\n var newSortBy = SortBy.create();\n for (var i in this.sortsBy) {\n var sortBy = this.sortsBy[i];\n var sortByAsArray = JSON.parse(JSON.stringify(sortBy));\n if (typeof sortBy.filter === typeof {} &&\n sortBy.filter != null) {\n sortByAsArray.filter = Filter_1.Filter.createFromArray(sortBy.filter.toArray());\n }\n if (typeof sortBy._geo_distance === typeof {} &&\n sortBy._geo_distance != null &&\n typeof sortBy._geo_distance.coordinate == typeof {}) {\n sortByAsArray._geo_distance.coordinate = Coordinate_1.Coordinate.createFromArray(sortBy._geo_distance.coordinate.toArray());\n }\n newSortBy.sortsBy.push(sortByAsArray);\n }\n return newSortBy;\n };\n return SortBy;\n}());\nexports.SortBy = SortBy;\n","\"use strict\";\nexports.__esModule = true;\nvar Filter_1 = require(\"./Filter\");\n/**\n * Aggregation constants\n */\nexports.AGGREGATION_SORT_BY_COUNT_ASC = [\"_count\", \"asc\"];\nexports.AGGREGATION_SORT_BY_COUNT_DESC = [\"_count\", \"desc\"];\nexports.AGGREGATION_SORT_BY_NAME_ASC = [\"_term\", \"asc\"];\nexports.AGGREGATION_SORT_BY_NAME_DESC = [\"_term\", \"desc\"];\nexports.AGGREGATION_NO_LIMIT = 0;\n/**\n * Aggregation class\n */\nvar Aggregation = /** @class */ (function () {\n /**\n * Construct\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n */\n function Aggregation(name, field, applicationType, filterType, subgroup, sort, limit) {\n this.subgroup = [];\n this.name = name;\n this.field = field;\n this.applicationType = applicationType;\n this.filterType = filterType;\n this.subgroup = subgroup;\n this.sort = sort;\n this.limit = limit;\n }\n /**\n * Get name\n *\n * @returns {string}\n */\n Aggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get field\n *\n * @returns {string}\n */\n Aggregation.prototype.getField = function () {\n return this.field;\n };\n /**\n * getApplicationType\n *\n * @returns {number}\n */\n Aggregation.prototype.getApplicationType = function () {\n return this.applicationType;\n };\n /**\n * Get filter type\n *\n * @return {string}\n */\n Aggregation.prototype.getFilterType = function () {\n return this.filterType;\n };\n /**\n * Get subgroup\n *\n * @return {[]}\n */\n Aggregation.prototype.getSubgroup = function () {\n return this.subgroup;\n };\n /**\n * Get sort\n *\n * @return {[]}\n */\n Aggregation.prototype.getSort = function () {\n return this.sort;\n };\n /**\n * Get limit\n *\n * @return {number}\n */\n Aggregation.prototype.getLimit = function () {\n return this.limit;\n };\n /**\n * Create\n *\n * @param name\n * @param field\n * @param applicationType\n * @param filterType\n * @param subgroup\n * @param sort\n * @param limit\n *\n * @returns {Aggregation}\n */\n Aggregation.create = function (name, field, applicationType, filterType, subgroup, sort, limit) {\n if (subgroup === void 0) { subgroup = []; }\n if (sort === void 0) { sort = exports.AGGREGATION_SORT_BY_COUNT_DESC; }\n if (limit === void 0) { limit = exports.AGGREGATION_NO_LIMIT; }\n return new Aggregation(name, field, applicationType, filterType, subgroup, sort, limit);\n };\n /**\n * To array\n *\n * @returns {Array}\n */\n Aggregation.prototype.toArray = function () {\n var aggregationAsArray = {\n name: this.name\n };\n if (this.field != \"uuid.type\") {\n aggregationAsArray.field = this.field;\n }\n if (this.applicationType != Filter_1.FILTER_AT_LEAST_ONE) {\n aggregationAsArray.application_type = this.applicationType;\n }\n if (this.filterType != Filter_1.FILTER_TYPE_FIELD) {\n aggregationAsArray.filter_type = this.filterType;\n }\n if (this.subgroup.length > 0) {\n aggregationAsArray.subgroup = this.subgroup;\n }\n if (JSON.stringify(this.sort) !== JSON.stringify(exports.AGGREGATION_SORT_BY_COUNT_DESC)) {\n aggregationAsArray.sort = this.sort;\n }\n if (this.limit != exports.AGGREGATION_NO_LIMIT) {\n aggregationAsArray.limit = this.limit;\n }\n return aggregationAsArray;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Aggregation}\n */\n Aggregation.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n if (typeof array.field == \"undefined\") {\n array.field = \"uuid.type\";\n }\n if (typeof array.application_type == \"undefined\") {\n array.application_type = Filter_1.FILTER_AT_LEAST_ONE;\n }\n if (typeof array.filter_type == \"undefined\") {\n array.filter_type = Filter_1.FILTER_TYPE_FIELD;\n }\n if (typeof array.subgroup == \"undefined\") {\n array.subgroup = [];\n }\n if (typeof array.sort == \"undefined\") {\n array.sort = exports.AGGREGATION_SORT_BY_COUNT_DESC;\n }\n if (typeof array.limit == \"undefined\") {\n array.limit = exports.AGGREGATION_NO_LIMIT;\n }\n return Aggregation.create(array.name, array.field, array.application_type, array.filter_type, array.subgroup, array.sort, array.limit);\n };\n return Aggregation;\n}());\nexports.Aggregation = Aggregation;\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Synonym = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param words\n */\n function Synonym(words) {\n this.words = words;\n }\n /**\n * get words\n *\n * @return {string[]}\n */\n Synonym.prototype.getWords = function () {\n return this.words;\n };\n /**\n * Create by words\n *\n * @param words\n *\n * @return {Synonym}\n */\n Synonym.createbyWords = function (words) {\n return new Synonym(words);\n };\n /**\n * To array\n *\n * @return {{words: string[]}}\n */\n Synonym.prototype.toArray = function () {\n return {\n words: this.words\n };\n };\n /**\n * create from array\n *\n * @param array\n *\n * @returns {Synonym}\n */\n Synonym.createFromArray = function (array) {\n return new Synonym(array.words instanceof Object\n ? array.words\n : []);\n };\n /**\n * Expand\n *\n * @returns {string}\n */\n Synonym.prototype.expand = function () {\n return this.words.join(\",\");\n };\n return Synonym;\n}());\nexports.Synonym = Synonym;\n","\"use strict\";\nexports.__esModule = true;\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\n/**\n * Transformer\n */\nvar Transformer = /** @class */ (function () {\n function Transformer() {\n this.readTransformers = [];\n this.writeTransformers = [];\n }\n /**\n * Add read transformer\n *\n * @param readTransformer\n */\n Transformer.prototype.addReadTransformer = function (readTransformer) {\n this\n .readTransformers\n .push(readTransformer);\n };\n /**\n * Add write transformer\n *\n * @param writeTransformer\n */\n Transformer.prototype.addWriteTransformer = function (writeTransformer) {\n this\n .writeTransformers\n .push(writeTransformer);\n };\n /**\n * Items to objects\n *\n * @param items\n *\n * @returns {any[]}\n */\n Transformer.prototype.fromItems = function (items) {\n var objects = [];\n for (var i in items) {\n objects.push(this.fromItem(items[i]));\n }\n return objects;\n };\n /**\n * Item to object\n *\n * @param item\n *\n * @returns {any}\n */\n Transformer.prototype.fromItem = function (item) {\n for (var i in this.readTransformers) {\n var transformer = this.readTransformers[i];\n if (transformer.isValidItem(item)) {\n return transformer.fromItem(item);\n }\n }\n return item;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {Item[]}\n */\n Transformer.prototype.toItems = function (objects) {\n var items = [];\n for (var i in objects) {\n var item = this.toItem(objects[i]);\n if (item instanceof Item_1.Item) {\n items.push(item);\n }\n }\n return items;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItem = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItem(object);\n }\n }\n return object;\n };\n /**\n * Objects to items\n *\n * @param objects\n *\n * @returns {ItemUUID[]}\n */\n Transformer.prototype.toItemUUIDs = function (objects) {\n var itemUUIDs = [];\n for (var i in objects) {\n var itemUUID = this.toItemUUID(objects[i]);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n itemUUIDs.push(itemUUID);\n }\n }\n return itemUUIDs;\n };\n /**\n * Object to item\n *\n * @param object\n *\n * @returns {any}\n */\n Transformer.prototype.toItemUUID = function (object) {\n for (var i in this.writeTransformers) {\n var transformer = this.writeTransformers[i];\n if (transformer.isValidObject(object)) {\n return transformer.toItemUUID(object);\n }\n }\n return object;\n };\n return Transformer;\n}());\nexports.Transformer = Transformer;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\n/**\n * Aggregation class\n */\nvar Repository = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param appId\n * @param indexId\n * @param token\n */\n function Repository(appId, indexId, token) {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n this.appId = appId;\n this.indexId = indexId;\n this.token = token;\n }\n /**\n * Reset cached elements\n */\n Repository.prototype.resetCachedElements = function () {\n this.itemsToUpdate = [];\n this.itemsToDelete = [];\n };\n /**\n * Add element\n *\n * @param item\n */\n Repository.prototype.addItem = function (item) {\n this.itemsToUpdate.push(item);\n };\n /**\n * Add elements\n *\n * @param items\n */\n Repository.prototype.addItems = function (items) {\n for (var i in items) {\n this.addItem(items[i]);\n }\n };\n /**\n * Delete item\n *\n * @param itemUUID\n */\n Repository.prototype.deleteItem = function (itemUUID) {\n this.itemsToDelete.push(itemUUID);\n };\n /**\n * Delete items\n *\n * @param itemsUUID\n */\n Repository.prototype.deleteItems = function (itemsUUID) {\n for (var i in itemsUUID) {\n this.deleteItem(itemsUUID[i]);\n }\n };\n /**\n * flush\n *\n * @param bulkNumber\n * @param skipIfLess\n *\n * @return {Promise}\n */\n Repository.prototype.flush = function (bulkNumber, skipIfLess) {\n return __awaiter(this, void 0, void 0, function () {\n var offset, items, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!bulkNumber) {\n bulkNumber = 500;\n }\n if (!skipIfLess) {\n skipIfLess = false;\n }\n if (skipIfLess &&\n this.itemsToUpdate.length < bulkNumber) {\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n offset = 0;\n items = [];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, , 7]);\n _a.label = 2;\n case 2:\n if (!true) return [3 /*break*/, 4];\n items = this\n .itemsToUpdate\n .slice(offset, offset + bulkNumber);\n if (items.length === 0) {\n return [3 /*break*/, 4];\n }\n return [4 /*yield*/, this.flushItems(items, [])];\n case 3:\n _a.sent();\n offset += bulkNumber;\n return [3 /*break*/, 2];\n case 4: return [4 /*yield*/, this.flushItems([], this.itemsToDelete)];\n case 5:\n _a.sent();\n return [3 /*break*/, 7];\n case 6:\n error_1 = _a.sent();\n this.resetCachedElements();\n throw error_1;\n case 7:\n this.resetCachedElements();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n return Repository;\n}());\nexports.Repository = Repository;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * User class\n */\nvar Metadata = /** @class */ (function () {\n function Metadata() {\n }\n /**\n * To metadata\n *\n * @param array:{}\n *\n * @returns {string}\n */\n Metadata.toMetadata = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var parts = [];\n for (var key in array) {\n parts.push(key + \"##\" + array[key]);\n }\n return parts.join(\"~~\");\n };\n /**\n * From metadata\n *\n * @param metadata\n *\n * @return {{}}\n */\n Metadata.fromMetadata = function (metadata) {\n var values = {};\n var splittedParts = metadata.split(\"~~\");\n var iterator = 0;\n var size = 0;\n var lastElement = null;\n for (var key in splittedParts) {\n var part = splittedParts[key];\n var parts = part.split(\"##\");\n if (parts.length > 1) {\n lastElement = parts[1];\n values[parts[0]] = lastElement;\n }\n else {\n lastElement = part;\n values[iterator++] = lastElement;\n }\n size++;\n }\n if (size == 1) {\n values = {\n id: lastElement,\n name: lastElement\n };\n }\n if (typeof values.id == \"undefined\") {\n return null;\n }\n return values;\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n","\"use strict\";\nexports.__esModule = true;\nvar Metadata_1 = require(\"../Model/Metadata\");\n/**\n * Aggregation class\n */\nvar Counter = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param values\n * @param used\n * @param n\n */\n function Counter(values, used, n) {\n this.values = values;\n this.used = used;\n this.n = n;\n }\n /**\n * Get id\n *\n * @return {string|null}\n */\n Counter.prototype.getId = function () {\n return typeof this.values.id == \"string\"\n ? this.values.id\n : null;\n };\n /**\n * Get name\n *\n * @return {string|null}\n */\n Counter.prototype.getName = function () {\n return typeof this.values.name == \"string\"\n ? this.values.name\n : null;\n };\n /**\n * Get slug\n *\n * @return {string|null}\n */\n Counter.prototype.getSlug = function () {\n return typeof this.values.slug == \"string\"\n ? this.values.slug\n : null;\n };\n /**\n * Get level\n *\n * @return {number}\n */\n Counter.prototype.getLevel = function () {\n return typeof this.values.level == \"number\"\n ? this.values.level\n : 0;\n };\n /**\n * Get values\n *\n * @returns {{}}\n */\n Counter.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Is used\n *\n * @returns {boolean}\n */\n Counter.prototype.isUsed = function () {\n return this.used;\n };\n /**\n * Get N\n *\n * @returns {number}\n */\n Counter.prototype.getN = function () {\n return this.n;\n };\n /**\n * Create by active elements\n *\n * @param name\n * @param n\n * @param activeElements\n */\n Counter.createByActiveElements = function (name, n, activeElements) {\n var values = Metadata_1.Metadata.fromMetadata(name);\n if (values == null) {\n return null;\n }\n var i = activeElements.length;\n var inActiveElements = false;\n while (i--) {\n if (activeElements[i] == values.id) {\n inActiveElements = true;\n }\n }\n return new Counter(values, inActiveElements, n);\n };\n /**\n * To array\n *\n * @return {{}}\n */\n Counter.prototype.toArray = function () {\n var values = {\n values: this.values,\n n: this.n\n };\n if (this.used === true) {\n values.used = true;\n }\n return values;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Counter}\n */\n Counter.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n return new Counter(array.values, (typeof array.used == \"boolean\")\n ? array.used\n : false, array.n);\n };\n return Counter;\n}());\nexports.Counter = Counter;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar Filter_1 = require(\"../Query/Filter\");\nvar Counter_1 = require(\"./Counter\");\n/**\n * ResultAggregation class\n */\nvar ResultAggregation = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param name\n * @param applicationType\n * @param totalElements\n * @param activeElements\n */\n function ResultAggregation(name, applicationType, totalElements, activeElements) {\n this.counters = {};\n this.highestActiveElement = 0;\n this.name = name;\n this.applicationType = applicationType;\n this.totalElements = totalElements;\n this.activeElements = {};\n for (var i in activeElements) {\n var activeElement = activeElements[i];\n this.activeElements[activeElement] = activeElement;\n }\n }\n /**\n * Add counter\n *\n * @param name\n * @param counter\n */\n ResultAggregation.prototype.addCounter = function (name, counter) {\n if (counter == 0) {\n return;\n }\n var counterInstance = Counter_1.Counter.createByActiveElements(name, counter, Object.keys(this.activeElements));\n if (!(counterInstance instanceof Counter_1.Counter)) {\n return;\n }\n if ((this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) &&\n (this.applicationType & ~Filter_1.FILTER_MUST_ALL) &&\n counterInstance.isUsed()) {\n this.activeElements[counterInstance.getId()] = counterInstance;\n this.highestActiveElement = Math.max(counterInstance.getLevel(), this.highestActiveElement);\n return;\n }\n this.counters[counterInstance.getId()] = counterInstance;\n };\n /**\n * Get name\n *\n * @return {string}\n */\n ResultAggregation.prototype.getName = function () {\n return this.name;\n };\n /**\n * Get counter\n *\n * @return {any}\n */\n ResultAggregation.prototype.getCounters = function () {\n return this.counters;\n };\n /**\n * Return if the aggregation belongs to a filter.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.isFilter = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL) > 0;\n };\n /**\n * Aggregation has levels.\n *\n * @return {boolean}\n */\n ResultAggregation.prototype.hasLevels = function () {\n return (this.applicationType & Filter_1.FILTER_MUST_ALL_WITH_LEVELS) > 0;\n };\n /**\n * Get counter by name\n *\n * @param name\n *\n * @return {null}\n */\n ResultAggregation.prototype.getCounter = function (name) {\n return this.counters[name] instanceof Counter_1.Counter\n ? this.counters[name]\n : null;\n };\n /**\n * Get all elements\n *\n * @return {{}}\n */\n ResultAggregation.prototype.getAllElements = function () {\n return __assign({}, this.activeElements, this.counters);\n };\n /**\n * Get total elements\n *\n * @return {number}\n */\n ResultAggregation.prototype.getTotalElements = function () {\n return this.totalElements;\n };\n /**\n * Get active elements\n *\n * @return {any}\n */\n ResultAggregation.prototype.getActiveElements = function () {\n if (Object.keys(this.activeElements).length === 0) {\n return {};\n }\n if (this.applicationType === Filter_1.FILTER_MUST_ALL_WITH_LEVELS) {\n var value = null;\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n if (!(activeElement instanceof Counter_1.Counter)) {\n continue;\n }\n if (value == null) {\n value = activeElement;\n }\n value = value.getLevel() > activeElement.getLevel()\n ? value\n : activeElement;\n }\n return value instanceof Counter_1.Counter\n ? { 0: value }\n : null;\n }\n return this.activeElements;\n };\n /**\n * Clean results by level and remove all levels higher than the lowest.\n */\n ResultAggregation.prototype.cleanCountersByLevel = function () {\n for (var i in this.counters) {\n var counter = this.counters[i];\n if (counter.getLevel() !== this.highestActiveElement + 1) {\n delete this.counters[i];\n }\n }\n };\n /**\n * Is empty\n *\n * @returns {boolean}\n */\n ResultAggregation.prototype.isEmpty = function () {\n return Object.keys(this.activeElements).length == 0 &&\n Object.keys(this.counters).length == 0;\n };\n /**\n * To array\n *\n * @return {any}\n */\n ResultAggregation.prototype.toArray = function () {\n var array = {\n name: this.name,\n counters: [],\n active_elements: []\n };\n for (var i in this.counters) {\n array.counters.push(this.counters[i].toArray());\n }\n if (this.applicationType !== Filter_1.FILTER_AT_LEAST_ONE) {\n array.application_type = this.applicationType;\n }\n if (this.totalElements > 0) {\n array.total_elements = this.totalElements;\n }\n for (var i in this.activeElements) {\n var activeElement = this.activeElements[i];\n array.active_elements.push(activeElement instanceof Counter_1.Counter\n ? activeElement.toArray()\n : activeElement);\n }\n if (this.highestActiveElement > 0) {\n array.highest_active_level = this.highestActiveElement;\n }\n if (array.counters.length === 0) {\n delete array.counters;\n }\n if (array.active_elements.length === 0) {\n delete array.active_elements;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n */\n ResultAggregation.createFromArray = function (array) {\n var activeElements = [];\n var activeElementsAsArray = array.active_elements;\n activeElementsAsArray = typeof activeElementsAsArray === typeof []\n ? activeElementsAsArray\n : [];\n for (var i in activeElementsAsArray) {\n var activeElementAsArray = activeElementsAsArray[i];\n activeElements.push(typeof activeElementAsArray === typeof {}\n ? Counter_1.Counter.createFromArray(activeElementAsArray)\n : activeElementAsArray);\n }\n var aggregation = new ResultAggregation(array.name, parseInt(array.application_type ? array.application_type : Filter_1.FILTER_AT_LEAST_ONE), parseInt(array.total_elements ? array.total_elements : 0), []);\n aggregation.activeElements = activeElements;\n var countersAsArray = typeof array.counters === typeof []\n ? array.counters\n : [];\n for (var i in countersAsArray) {\n var counterAsArray = countersAsArray[i];\n var counter = Counter_1.Counter.createFromArray(counterAsArray);\n aggregation.counters[counter.getId()] = counter;\n }\n aggregation.highestActiveElement = typeof array.highest_active_level === \"number\"\n ? array.highest_active_level\n : 0;\n return aggregation;\n };\n return ResultAggregation;\n}());\nexports.ResultAggregation = ResultAggregation;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource not available error\n */\nvar ResourceNotAvailableError = /** @class */ (function (_super) {\n __extends(ResourceNotAvailableError, _super);\n function ResourceNotAvailableError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceNotAvailableError.getTransportableHTTPError = function () {\n return 404;\n };\n /**\n * Index not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.indexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Index not available - \" + resourceId);\n };\n /**\n * Events not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.eventsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Events not available - \" + resourceId);\n };\n /**\n * Logs not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.logsIndexNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Logs not available - \" + resourceId);\n };\n /**\n * Engine not available\n *\n * @param resourceId\n *\n * @return {InvalidFormatError}\n */\n ResourceNotAvailableError.engineNotAvailable = function (resourceId) {\n return new ResourceNotAvailableError(\"Engine not available - \" + resourceId);\n };\n return ResourceNotAvailableError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceNotAvailableError = ResourceNotAvailableError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Resource exists error\n */\nvar ResourceExistsError = /** @class */ (function (_super) {\n __extends(ResourceExistsError, _super);\n function ResourceExistsError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ResourceExistsError.getTransportableHTTPError = function () {\n return 409;\n };\n /**\n * Index not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.indexAvailable = function () {\n return new ResourceExistsError(\"Index exists and cannot be created again\");\n };\n /**\n * Events not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.eventsIndexAvailable = function () {\n return new ResourceExistsError(\"Events index exists and cannot be created again\");\n };\n /**\n * Logs not available\n *\n * @return {InvalidFormatError}\n */\n ResourceExistsError.logsIndexAvailable = function () {\n return new ResourceExistsError(\"Logs index exists and cannot be created again\");\n };\n return ResourceExistsError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ResourceExistsError = ResourceExistsError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Invalid token error\n */\nvar InvalidTokenError = /** @class */ (function (_super) {\n __extends(InvalidTokenError, _super);\n function InvalidTokenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n InvalidTokenError.getTransportableHTTPError = function () {\n return 401;\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenPermissions = function (tokenReference) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid\");\n };\n /**\n * Invalid token permissions\n *\n * @param tokenReference\n * @param maxHitsPerQuery\n *\n * @return {InvalidTokenError}\n */\n InvalidTokenError.createInvalidTokenMaxHitsPerQuery = function (tokenReference, maxHitsPerQuery) {\n return new InvalidTokenError(\"Token \" + tokenReference + \"not valid. Max \" + maxHitsPerQuery + \" hits allowed\");\n };\n return InvalidTokenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.InvalidTokenError = InvalidTokenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Connection error\n */\nvar ConnectionError = /** @class */ (function (_super) {\n __extends(ConnectionError, _super);\n function ConnectionError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ConnectionError.getTransportableHTTPError = function () {\n return 500;\n };\n return ConnectionError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ConnectionError = ConnectionError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar ConnectionError_1 = require(\"../Error/ConnectionError\");\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\nvar InvalidTokenError_1 = require(\"../Error/InvalidTokenError\");\nvar ResourceExistsError_1 = require(\"../Error/ResourceExistsError\");\nvar ResourceNotAvailableError_1 = require(\"../Error/ResourceNotAvailableError\");\nvar Item_1 = require(\"../Model/Item\");\nvar ItemUUID_1 = require(\"../Model/ItemUUID\");\nvar Result_1 = require(\"../Result/Result\");\nvar Repository_1 = require(\"./Repository\");\n/**\n * Aggregation class\n */\nvar HttpRepository = /** @class */ (function (_super) {\n __extends(HttpRepository, _super);\n /**\n * Constructor\n *\n * @param httpClient\n * @param appId\n * @param indexId\n * @param token\n * @param transformer\n */\n function HttpRepository(httpClient, appId, indexId, token, transformer) {\n var _this = _super.call(this, appId, indexId, token) || this;\n _this.httpClient = httpClient;\n _this.transformer = transformer;\n return _this;\n }\n /**\n * Get transformer\n *\n * @return {Transformer}\n */\n HttpRepository.prototype.getTransformer = function () {\n return this.transformer;\n };\n /**\n * Generate item document by a simple object.\n *\n * @param object\n */\n HttpRepository.prototype.addObject = function (object) {\n var item = this\n .transformer\n .toItem(object);\n if (item instanceof Item_1.Item) {\n this.addItem(item);\n }\n };\n /**\n * Delete item document by uuid.\n *\n * @param object\n */\n HttpRepository.prototype.deleteObject = function (object) {\n var itemUUID = this\n .transformer\n .toItemUUID(object);\n if (itemUUID instanceof ItemUUID_1.ItemUUID) {\n this.deleteItem(itemUUID);\n }\n };\n /**\n * flush items\n *\n * @param itemsToUpdate\n * @param itemsToDelete\n *\n * @Returns {Promise}\n */\n HttpRepository.prototype.flushItems = function (itemsToUpdate, itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, _b, _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n _b = (_a = Promise).all;\n return [4 /*yield*/, this.flushUpdateItems(itemsToUpdate)];\n case 1:\n _c = [\n _d.sent()\n ];\n return [4 /*yield*/, this.flushDeleteItems(itemsToDelete)];\n case 2: return [4 /*yield*/, _b.apply(_a, [_c.concat([\n _d.sent()\n ])]).then(function (_) {\n return;\n })];\n case 3:\n _d.sent();\n return [2 /*return*/, new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush update items\n *\n * @param itemsToUpdate\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushUpdateItems = function (itemsToUpdate) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToUpdate.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"post\", this.getCredentials(), {}, {\n items: itemsToUpdate.map(function (item) {\n return item.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Flush delete items\n *\n * @param itemsToDelete\n *\n * @return {Promise}\n */\n HttpRepository.prototype.flushDeleteItems = function (itemsToDelete) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, (itemsToDelete.length > 0)];\n case 1: return [2 /*return*/, (_a.sent())\n ? this\n .httpClient\n .get(\"/items\", \"delete\", this.getCredentials(), {}, {\n items: itemsToDelete.map(function (itemUUID) {\n return itemUUID.toArray();\n })\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n })\n : new Promise(function (resolve) { return resolve(); })];\n }\n });\n });\n };\n /**\n * Query\n *\n * @param query\n *\n * @return {Promise}\n */\n HttpRepository.prototype.query = function (query) {\n return __awaiter(this, void 0, void 0, function () {\n var that;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n that = this;\n return [4 /*yield*/, this\n .httpClient\n .get(\"/\", \"get\", this.getCredentials(), {\n query: JSON.stringify(query.toArray())\n }, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n var result = Result_1.Result.createFromArray(response.getBody());\n return Result_1.Result.create(result.getQuery(), result.getTotalItems(), result.getTotalHits(), result.getAggregations(), result.getSuggests(), that\n .transformer\n .fromItems(result.getItems()));\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update items\n *\n * @param query\n * @param changes\n *\n * @return {Promise}\n */\n HttpRepository.prototype.updateItems = function (query, changes) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/items\", \"put\", this.getCredentials(), {}, {\n query: query.toArray(),\n changes: changes.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create index\n *\n * @param immutableConfig\n *\n * @return {Promise}\n */\n HttpRepository.prototype.createIndex = function (immutableConfig) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"post\", this.getCredentials(), {}, {\n config: immutableConfig.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.deleteIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"delete\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.resetIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/reset\", \"post\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Check index\n *\n * @return {Promise}\n */\n HttpRepository.prototype.checkIndex = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index\", \"head\", this.getCredentials(), {}, {})\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return response.getCode() === 200;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Configure index\n *\n * @param config\n *\n * @return {Promise}\n */\n HttpRepository.prototype.configureIndex = function (config) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this\n .httpClient\n .get(\"/index/config\", \"post\", this.getCredentials(), {}, {\n config: config.toArray()\n })\n .then(function (response) {\n HttpRepository.throwTransportableExceptionIfNeeded(response);\n return;\n })];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get query values\n *\n * @returns any\n */\n HttpRepository.prototype.getCredentials = function () {\n return {\n app_id: this.appId,\n index: this.indexId,\n token: this.token\n };\n };\n /**\n * throw error if needed\n *\n * @param response\n */\n HttpRepository.throwTransportableExceptionIfNeeded = function (response) {\n if (typeof response.getCode() == \"undefined\") {\n return;\n }\n switch (response.getCode()) {\n case ResourceNotAvailableError_1.ResourceNotAvailableError.getTransportableHTTPError():\n throw new ResourceNotAvailableError_1.ResourceNotAvailableError(response.getBody().message);\n case InvalidTokenError_1.InvalidTokenError.getTransportableHTTPError():\n throw new InvalidTokenError_1.InvalidTokenError(response.getBody().message);\n case InvalidFormatError_1.InvalidFormatError.getTransportableHTTPError():\n throw new InvalidFormatError_1.InvalidFormatError(response.getBody().message);\n case ResourceExistsError_1.ResourceExistsError.getTransportableHTTPError():\n throw new ResourceExistsError_1.ResourceExistsError(response.getBody().message);\n case ConnectionError_1.ConnectionError.getTransportableHTTPError():\n throw new ConnectionError_1.ConnectionError(response.getBody().message);\n }\n };\n return HttpRepository;\n}(Repository_1.Repository));\nexports.HttpRepository = HttpRepository;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.SCORE_STRATEGY_DEFAULT = 0;\nexports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD = 1;\nexports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION = 2;\n/**\n * ScoreStrategy\n */\nvar ScoreStrategy = /** @class */ (function () {\n function ScoreStrategy() {\n this.type = exports.SCORE_STRATEGY_DEFAULT;\n this.innerFunction = null;\n }\n /**\n * Get type\n *\n * @returns {number}\n */\n ScoreStrategy.prototype.getType = function () {\n return this.type;\n };\n /**\n * Get function\n *\n * @returns {string}\n */\n ScoreStrategy.prototype.getFunction = function () {\n return this.innerFunction;\n };\n /**\n * Create default\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createDefault = function () {\n return new ScoreStrategy();\n };\n /**\n * Create relevance boosting\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createRelevanceBoosting = function () {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_RELEVANCE_FIELD;\n return scoreStrategy;\n };\n /**\n * Create relevance boosting\n *\n * @param innerFunction\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createCustomFunction = function (innerFunction) {\n var scoreStrategy = ScoreStrategy.createDefault();\n scoreStrategy.type = exports.SCORE_STRATEGY_BOOSTING_CUSTOM_FUNCTION;\n scoreStrategy.innerFunction = innerFunction;\n return scoreStrategy;\n };\n /**\n *\n * @return {{type: number, function: string}}\n */\n ScoreStrategy.prototype.toArray = function () {\n return {\n type: this.type,\n \"function\": this.innerFunction\n };\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return {ScoreStrategy}\n */\n ScoreStrategy.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var scoreStrategy = ScoreStrategy.createDefault();\n if (typeof array.type == \"undefined\") {\n array.type = exports.SCORE_STRATEGY_DEFAULT;\n }\n if (typeof array[\"function\"] == \"undefined\") {\n array.innerFunction = null;\n }\n scoreStrategy.type = array.type;\n scoreStrategy.innerFunction = array[\"function\"];\n return scoreStrategy;\n };\n return ScoreStrategy;\n}());\nexports.ScoreStrategy = ScoreStrategy;\n","\"use strict\";\nexports.__esModule = true;\nvar InvalidFormatError_1 = require(\"../Error/InvalidFormatError\");\n/**\n * User class\n */\nvar User = /** @class */ (function () {\n /**\n * Construct\n *\n * @param id string\n * @param attributes Array\n */\n function User(id, attributes) {\n if (attributes === void 0) { attributes = {}; }\n this.id = id;\n this.attributes = attributes;\n }\n /**\n * Return the user id\n *\n * @return {string}\n */\n User.prototype.getId = function () {\n return this.id;\n };\n /**\n * Return array\n *\n * @returns {{}}\n */\n User.prototype.getAttributes = function () {\n return this.attributes;\n };\n /**\n * To array\n *\n * @returns {{id: string, attributes: {}}}\n */\n User.prototype.toArray = function () {\n var array = {\n id: this.id\n };\n if (Object.keys(this.attributes).length > 0) {\n array.attributes = this.attributes;\n }\n return array;\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @return User\n */\n User.createFromArray = function (array) {\n if (array == null ||\n typeof array.id == \"undefined\" ||\n array.id == null) {\n throw InvalidFormatError_1.InvalidFormatError.userFormatNotValid();\n }\n var attributes = typeof array.attributes === typeof {}\n ? array.attributes\n : {};\n return new User(array.id, attributes);\n };\n return User;\n}());\nexports.User = User;\n","\"use strict\";\nexports.__esModule = true;\nexports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES = 1000;\n/**\n * Http class\n */\nvar Retry = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param url\n * @param method\n * @param retries\n * @param microsecondsBetweenRetries\n */\n function Retry(url, method, retries, microsecondsBetweenRetries) {\n this.url = url;\n this.method = method;\n this.retries = retries;\n this.microsecondsBetweenRetries = microsecondsBetweenRetries;\n }\n /**\n * Create from array\n *\n * @param array\n *\n * @return {Retry}\n */\n Retry.createFromArray = function (array) {\n return new Retry(array.url ? array.url : \"*\", array.method ? array.method : \"*\", array.retries ? array.retries : 0, array.microseconds_between_retries\n ? array.microseconds_between_retries\n : exports.DEFAULT_MICROSECONDS_BETWEEN_RETRIES);\n };\n /**\n * Get url\n *\n * @return {string}\n */\n Retry.prototype.getUrl = function () {\n return this.url;\n };\n /**\n * Get method\n *\n * @return {string}\n */\n Retry.prototype.getMethod = function () {\n return this.method;\n };\n /**\n * Ge retries\n *\n * @return {number}\n */\n Retry.prototype.getRetries = function () {\n return this.retries;\n };\n /**\n * Get microseconds between retries\n *\n * @return {number}\n */\n Retry.prototype.getMicrosecondsBetweenRetries = function () {\n return this.microsecondsBetweenRetries;\n };\n return Retry;\n}());\nexports.Retry = Retry;\n","\"use strict\";\nexports.__esModule = true;\nvar Retry_1 = require(\"./Retry\");\n/**\n * Http class\n */\nvar RetryMap = /** @class */ (function () {\n function RetryMap() {\n this.retries = {};\n }\n /**\n * Add retry\n *\n * @param retry\n */\n RetryMap.prototype.addRetry = function (retry) {\n this.retries[retry.getUrl() + \"~~\" + retry.getMethod()] = retry;\n };\n /**\n * Create from array\n */\n RetryMap.createFromArray = function (array) {\n var retryMap = new RetryMap();\n retryMap.retries = array.map(function (retry) { return Retry_1.Retry.createFromArray(retry); });\n return retryMap;\n };\n /**\n * Get retry\n *\n * @param url\n * @param method\n *\n * @returns {Retry}\n */\n RetryMap.prototype.getRetry = function (url, method) {\n if (this.retries[url + \"~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~\" + method];\n }\n if (this.retries[\"*~~\" + method] instanceof Retry_1.Retry) {\n return this.retries[\"*~~\" + method];\n }\n if (this.retries[url + \"~~*\"] instanceof Retry_1.Retry) {\n return this.retries[url + \"~~*\"];\n }\n if (this.retries[\"*~~*\"] instanceof Retry_1.Retry) {\n return this.retries[\"*~~*\"];\n }\n return null;\n };\n return RetryMap;\n}());\nexports.RetryMap = RetryMap;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Response\n */\nvar Response = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param code\n * @param body\n */\n function Response(code, body) {\n this.code = code;\n this.body = body;\n }\n /**\n * Get code\n *\n * @return {number}\n */\n Response.prototype.getCode = function () {\n return this.code;\n };\n /**\n * Get body\n *\n * @return {any}\n */\n Response.prototype.getBody = function () {\n return this.body;\n };\n return Response;\n}());\nexports.Response = Response;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Client\n */\nvar Client = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param version\n * @param retryMap\n */\n function Client(version, retryMap) {\n this.retryMap = retryMap;\n this.version = version.replace(/^\\/*|\\/*$/g, \"\");\n }\n /**\n * Build an url parameters array by an object\n *\n * @param params\n *\n * @returns {string}\n */\n Client.objectToUrlParameters = function (params) {\n var builtParams = [];\n for (var i in params) {\n builtParams.push(i + \"=\" + params[i]);\n }\n return builtParams.join(\"&\");\n };\n return Client;\n}());\nexports.Client = Client;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nexports.__esModule = true;\nvar axios_1 = require(\"axios\");\nvar Client_1 = require(\"./Client\");\nvar Response_1 = require(\"./Response\");\n/**\n * AxiosClient\n */\nvar AxiosClient = /** @class */ (function (_super) {\n __extends(AxiosClient, _super);\n /**\n * Constructor\n *\n * @param host\n * @param version\n * @param timeout\n * @param retryMap\n * @param overrideQueries\n * @param cache\n */\n function AxiosClient(host, version, timeout, retryMap, overrideQueries, cache) {\n var _this = _super.call(this, version, retryMap) || this;\n _this.host = host;\n _this.timeout = timeout;\n _this.cache = cache;\n _this.overrideQueries = overrideQueries;\n _this.cancelToken = axios_1[\"default\"].CancelToken.source();\n return _this;\n }\n /**\n * Get\n *\n * @param url\n * @param method\n * @param credentials\n * @param parameters\n * @param data\n *\n * @return {Promise}\n */\n AxiosClient.prototype.get = function (url, method, credentials, parameters, data) {\n if (parameters === void 0) { parameters = {}; }\n if (data === void 0) { data = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var that;\n var _this = this;\n return __generator(this, function (_a) {\n that = this;\n url = url.replace(/^\\/*|\\/*$/g, \"\");\n url = \"/\" + (this.version + \"/\" + url).replace(/^\\/*|\\/*$/g, \"\");\n method = method.toLowerCase();\n if (\"get\" === method &&\n this.overrideQueries) {\n this.abort();\n }\n return [2 /*return*/, new Promise(function (resolve, reject) {\n var headers = \"get\" == method\n ? {}\n : {\n \"Content-Encoding\": \"gzip\",\n \"Content-Type\": \"application/json\"\n };\n //noinspection TypeScriptValidateTypes\n axios_1[\"default\"]\n .request({\n url: url + \"?\" + Client_1.Client.objectToUrlParameters(__assign({}, credentials, parameters)),\n data: data,\n headers: headers,\n method: method,\n baseURL: that.host.replace(/\\/*$/g, \"\"),\n timeout: that.timeout,\n cancelToken: _this.cancelToken.token,\n transformRequest: [function (data) { return JSON.stringify(data); }]\n })\n .then(function (axiosResponse) {\n var response = new Response_1.Response(axiosResponse.status, axiosResponse.data);\n return resolve(response);\n })[\"catch\"](function (thrown) { return reject(thrown); });\n })];\n });\n });\n };\n /**\n * Abort current request\n * And regenerate the cancellation token\n */\n AxiosClient.prototype.abort = function () {\n this.cancelToken.cancel();\n this.cancelToken = axios_1[\"default\"].CancelToken.source();\n };\n return AxiosClient;\n}(Client_1.Client));\nexports.AxiosClient = AxiosClient;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Aggregation constants\n */\nexports.RANGE_ZERO = 0;\nexports.RANGE_INFINITE = -1;\nexports.RANGE_SEPARATOR = \"..\";\n/**\n * Filter class\n */\nvar Range = /** @class */ (function () {\n function Range() {\n }\n /**\n * Strong to array\n *\n * @param string\n *\n * @returns {[number, number]}\n */\n Range.stringToArray = function (string) {\n var parts = string.split(exports.RANGE_SEPARATOR);\n var from = parts[0];\n var to = parts[1];\n var finalFrom = exports.RANGE_ZERO;\n var finalTo = exports.RANGE_INFINITE;\n if (from != \"\") {\n finalFrom = parseInt(from);\n }\n if (to != \"\") {\n finalTo = parseInt(to);\n }\n return [finalFrom, finalTo];\n };\n /**\n * Array to string\n *\n * @param values\n *\n * @return {string}\n */\n Range.arrayToString = function (values) {\n var finalValues = [\"\", \"\"];\n if (values[0] != exports.RANGE_ZERO) {\n finalValues[0] = String(values[0]);\n }\n if (values[1] != exports.RANGE_INFINITE) {\n finalValues[1] = String(values[1]);\n }\n return finalValues.join(exports.RANGE_SEPARATOR);\n };\n /**\n * Create ranges\n *\n * @param from\n * @param to\n * @param incremental\n */\n Range.createRanges = function (from, to, incremental) {\n var ranges = [];\n var nextTo;\n while (from < to) {\n nextTo = from + incremental;\n ranges.push(from + exports.RANGE_SEPARATOR + nextTo);\n from = nextTo;\n }\n return ranges;\n };\n return Range;\n}());\nexports.Range = Range;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * filter constants\n */\nexports.TYPE_VALUE = 1;\nexports.TYPE_LITERAL = 4;\nexports.TYPE_ARRAY_ELEMENT_UPDATE = 8;\nexports.TYPE_ARRAY_ELEMENT_ADD = 16;\nexports.TYPE_ARRAY_ELEMENT_DELETE = 32;\nexports.TYPE_ARRAY_EXPECTS_ELEMENT = 24;\nexports.TYPE_ARRAY = 56;\n/**\n * Changes Type cast\n * @param Changes\n */\nvar Changes = /** @class */ (function () {\n function Changes() {\n /**\n * Changes\n *\n * @type {Array}\n */\n this.changes = [];\n }\n /**\n * Add new change\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addChange = function (field, value, type) {\n if (type === void 0) { type = exports.TYPE_VALUE; }\n this.changes.push({\n field: field,\n type: type,\n value: value\n });\n };\n /**\n * Update element from list\n *\n * @param field\n * @param condition\n * @param value\n * @param type\n */\n Changes.prototype.updateElementFromList = function (field, condition, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_UPDATE,\n condition: condition,\n value: value\n });\n };\n /**\n * Add element in list\n *\n * @param field\n * @param value\n * @param type\n */\n Changes.prototype.addElementInList = function (field, value, type) {\n this.changes.push({\n field: field,\n type: type | exports.TYPE_ARRAY_ELEMENT_ADD,\n value: value\n });\n };\n /**\n * Delete element from list\n *\n * @param field\n * @param condition\n */\n Changes.prototype.deleteElementFromList = function (field, condition) {\n this.changes.push({\n field: field,\n type: exports.TYPE_ARRAY_ELEMENT_DELETE,\n condition: condition\n });\n };\n /**\n * Get changes\n *\n * @returns {[]}\n */\n Changes.prototype.getChanges = function () {\n return this.changes;\n };\n /**\n * Create\n *\n * @returns {Changes}\n */\n Changes.create = function () {\n return new Changes();\n };\n /**\n * To array\n *\n * @returns {[]}\n */\n Changes.prototype.toArray = function () {\n return JSON.parse(JSON.stringify(this.changes));\n };\n /**\n * Create from array\n *\n * @param array\n *\n * @returns {Changes}\n */\n Changes.createFromArray = function (array) {\n array = JSON.parse(JSON.stringify(array));\n var changes = Changes.create();\n changes.changes = array;\n return changes;\n };\n return Changes;\n}());\nexports.Changes = Changes;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Http class\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient() {\n }\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar Coordinate_1 = require(\"../Model/Coordinate\");\n/**\n * Abstract Location Range class\n */\nvar LocationRange = /** @class */ (function () {\n function LocationRange() {\n }\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n LocationRange.fromFilterObject = function (object) {\n throw TypeError(\"Method not valid\");\n };\n /**\n * to array\n */\n LocationRange.prototype.toArray = function () {\n return {\n type: this.getName(),\n data: this.toFilterObject()\n };\n };\n /**\n * Create from array\n *\n * @param array\n */\n LocationRange.createFromArray = function (array) {\n if (array.type == \"CoordinateAndDistance\") {\n return CoordinateAndDistance.fromFilterObject(array.data);\n }\n if (array.type == \"Polygon\") {\n return Polygon.fromFilterObject(array.data);\n }\n if (array.type == \"Square\") {\n return Square.fromFilterObject(array.data);\n }\n };\n return LocationRange;\n}());\nexports.LocationRange = LocationRange;\n/**\n * CoordinateAndDistance\n */\nvar CoordinateAndDistance = /** @class */ (function (_super) {\n __extends(CoordinateAndDistance, _super);\n /**\n * Constructor\n *\n * @param coordinate\n * @param distance\n */\n function CoordinateAndDistance(coordinate, distance) {\n var _this = _super.call(this) || this;\n _this.coordinate = coordinate;\n _this.distance = distance;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n CoordinateAndDistance.prototype.toFilterObject = function () {\n return {\n coordinate: this.coordinate.toArray(),\n distance: this.distance\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n CoordinateAndDistance.prototype.getName = function () {\n return \"CoordinateAndDistance\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n CoordinateAndDistance.fromFilterObject = function (object) {\n return new CoordinateAndDistance(Coordinate_1.Coordinate.createFromArray(object.coordinate), object.distance);\n };\n return CoordinateAndDistance;\n}(LocationRange));\nexports.CoordinateAndDistance = CoordinateAndDistance;\n/**\n * Polygon\n */\nvar Polygon = /** @class */ (function (_super) {\n __extends(Polygon, _super);\n /**\n * Constructor\n *\n * @param coordinates\n */\n function Polygon(coordinates) {\n var _this = _super.call(this) || this;\n if (coordinates.length < 3) {\n throw new Error(\"A polygon needs more than two coordinates.\");\n }\n _this.coordinates = coordinates;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{coordinates: {lat:number, lon:number}[]}}\n */\n Polygon.prototype.toFilterObject = function () {\n var coordinates = [];\n for (var i in this.coordinates) {\n coordinates.push(this.coordinates[i].toArray());\n }\n return {\n coordinates: coordinates\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Polygon.prototype.getName = function () {\n return \"Polygon\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {Polygon}\n */\n Polygon.fromFilterObject = function (object) {\n var coordinates = [];\n for (var i in object.coordinates) {\n coordinates.push(Coordinate_1.Coordinate.createFromArray(object.coordinates[i]));\n }\n return new Polygon(coordinates);\n };\n return Polygon;\n}(LocationRange));\nexports.Polygon = Polygon;\n/**\n * Square\n */\nvar Square = /** @class */ (function (_super) {\n __extends(Square, _super);\n /**\n * Constructor\n *\n * @param topLeftCoordinate\n * @param bottomRightCoordinate\n */\n function Square(topLeftCoordinate, bottomRightCoordinate) {\n var _this = _super.call(this) || this;\n _this.topLeftCoordinate = topLeftCoordinate;\n _this.bottomRightCoordinate = bottomRightCoordinate;\n return _this;\n }\n /**\n * To filter object\n *\n * @return {{}}}\n */\n Square.prototype.toFilterObject = function () {\n return {\n top_left: this.topLeftCoordinate.toArray(),\n bottom_right: this.bottomRightCoordinate.toArray()\n };\n };\n /**\n * Get name\n *\n * @return {string}\n */\n Square.prototype.getName = function () {\n return \"Square\";\n };\n /**\n * From filter object\n *\n * @param object\n *\n * @return {LocationRange}\n */\n Square.fromFilterObject = function (object) {\n return new Square(Coordinate_1.Coordinate.createFromArray(object.top_left), Coordinate_1.Coordinate.createFromArray(object.bottom_right));\n };\n return Square;\n}(LocationRange));\nexports.Square = Square;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Unsupported content type error\n */\nvar UnsupportedContentTypeError = /** @class */ (function (_super) {\n __extends(UnsupportedContentTypeError, _super);\n function UnsupportedContentTypeError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n UnsupportedContentTypeError.getTransportableHTTPError = function () {\n return 415;\n };\n /**\n * Unsupported content type\n *\n * @return {InvalidFormatError}\n */\n UnsupportedContentTypeError.createUnsupportedContentTypeException = function () {\n return new UnsupportedContentTypeError(\"This content type is not accepted. Please use application/json\");\n };\n return UnsupportedContentTypeError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.UnsupportedContentTypeError = UnsupportedContentTypeError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * Forbidden Error\n */\nvar ForbiddenError = /** @class */ (function (_super) {\n __extends(ForbiddenError, _super);\n function ForbiddenError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n ForbiddenError.getTransportableHTTPError = function () {\n return 403;\n };\n /**\n * App id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createAppIdIsRequiredException = function () {\n return new ForbiddenError(\"AppId query parameter MUST be defined with a valid value\");\n };\n /**\n * Index id is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createIndexIsRequiredException = function () {\n return new ForbiddenError(\"Index query parameter MUST be defined with a valid value\");\n };\n /**\n * Token is required\n *\n * @return {ForbiddenError}\n */\n ForbiddenError.createTokenIsRequiredException = function () {\n return new ForbiddenError(\"Token query parameter MUST be defined with a valid value\");\n };\n return ForbiddenError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.ForbiddenError = ForbiddenError;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nexports.__esModule = true;\nvar ErrorWithMessage_1 = require(\"./ErrorWithMessage\");\n/**\n * EventError\n */\nvar EventError = /** @class */ (function (_super) {\n __extends(EventError, _super);\n function EventError() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get transportable http error\n *\n * @return {number}\n */\n EventError.throwEndpointNotAvailable = function () {\n return new EventError(\"Endpoint not available\");\n };\n return EventError;\n}(ErrorWithMessage_1.ErrorWithMessage));\nexports.EventError = EventError;\n","\"use strict\";\nexports.__esModule = true;\nvar Synonym_1 = require(\"./Synonym\");\n/**\n * Result class\n */\nvar ImmutableConfig = /** @class */ (function () {\n /**\n * Constructor\n *\n * @param language\n * @param storeSearchableMetadata\n */\n function ImmutableConfig(language, storeSearchableMetadata) {\n if (language === void 0) { language = null; }\n if (storeSearchableMetadata === void 0) { storeSearchableMetadata = true; }\n this.synonyms = [];\n this.language = language;\n this.storeSearchableMetadata = storeSearchableMetadata;\n }\n /**\n * Get language\n *\n * @return {string}\n */\n ImmutableConfig.prototype.getLanguage = function () {\n return this.language;\n };\n /**\n * Should searchable metadata be stored\n *\n * @return {boolean}\n */\n ImmutableConfig.prototype.shouldSearchableMetadataBeStored = function () {\n return this.storeSearchableMetadata;\n };\n /**\n * Add synonym\n *\n * @param synonym\n */\n ImmutableConfig.prototype.addSynonym = function (synonym) {\n this.synonyms.push(synonym);\n };\n /**\n * Get synonyms\n *\n * @return {Synonym[]}\n */\n ImmutableConfig.prototype.getSynonyms = function () {\n return this.synonyms;\n };\n /**\n * to array\n */\n ImmutableConfig.prototype.toArray = function () {\n return {\n language: this.language,\n store_searchable_metadata: this.storeSearchableMetadata,\n synonyms: this.synonyms.map(function (synonym) { return synonym.toArray(); })\n };\n };\n /**\n * Create from array\n */\n ImmutableConfig.createFromArray = function (array) {\n var immutableConfig = new ImmutableConfig(array.language ? array.language : null, typeof array.store_searchable_metadata == \"boolean\"\n ? array.store_searchable_metadata\n : true);\n if (array.synonyms instanceof Array &&\n array.synonyms.length > 0) {\n immutableConfig.synonyms = array.synonyms.map(function (synonym) { return Synonym_1.Synonym.createFromArray(synonym); });\n }\n return immutableConfig;\n };\n return ImmutableConfig;\n}());\nexports.ImmutableConfig = ImmutableConfig;\n","\"use strict\";\nexports.__esModule = true;\n/**\n * Result class\n */\nvar Config = /** @class */ (function () {\n function Config() {\n }\n /**\n * To array\n *\n * @returns {any}\n */\n Config.prototype.toArray = function () {\n return {};\n };\n return Config;\n}());\nexports.Config = Config;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar InMemoryCache = /** @class */ (function () {\n /**\n * Constructor\n */\n function InMemoryCache() {\n this.cache = {};\n this.size = 0;\n this.cache = {};\n this.size = 0;\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n InMemoryCache.prototype.set = function (key, value) {\n var _a;\n this.cache = __assign({}, this.cache, (_a = {}, _a[key] = value, _a));\n this.size = this.size + 1;\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n InMemoryCache.prototype.get = function (key) {\n return this.cache[key];\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n InMemoryCache.prototype.del = function (key) {\n delete this.cache[key];\n };\n /**\n * Clear cache\n */\n InMemoryCache.prototype.clear = function () {\n this.cache = {};\n this.size = 0;\n };\n return InMemoryCache;\n}());\nexports.InMemoryCache = InMemoryCache;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","\"use strict\";\nexports.__esModule = true;\n/**\n * Cache class\n */\nvar NoCache = /** @class */ (function () {\n function NoCache() {\n }\n /**\n * Set cache element\n *\n * @param key\n * @param value\n *\n * @returns {void}\n */\n NoCache.prototype.set = function (key, value) {\n // Empty\n };\n /**\n * Get element from cache\n *\n * @param key\n *\n * @returns {any}\n */\n NoCache.prototype.get = function (key) {\n return undefined;\n };\n /**\n * Deletes element from cache\n *\n * @param key\n */\n NoCache.prototype.del = function (key) {\n // Empty\n };\n /**\n * Clear cache\n */\n NoCache.prototype.clear = function () {\n // Empty\n };\n return NoCache;\n}());\nexports.NoCache = NoCache;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nexports.__esModule = true;\nvar NoCache_1 = require(\"./Cache/NoCache\");\nvar AxiosClient_1 = require(\"./Http/AxiosClient\");\nvar RetryMap_1 = require(\"./Http/RetryMap\");\nvar Query_1 = require(\"./Query/Query\");\nvar Query_2 = require(\"./Query/Query\");\nvar Query_3 = require(\"./Query/Query\");\nvar SortBy_1 = require(\"./Query/SortBy\");\nvar HttpRepository_1 = require(\"./Repository/HttpRepository\");\nvar Result_1 = require(\"./Result/Result\");\nvar ResultAggregations_1 = require(\"./Result/ResultAggregations\");\nvar Transformer_1 = require(\"./Transformer/Transformer\");\n/**\n * Apisearch class\n */\nvar Apisearch = /** @class */ (function () {\n function Apisearch() {\n }\n /**\n * Constructor\n *\n * @param config\n *\n * @return {HttpRepository}\n */\n Apisearch.createRepository = function (config) {\n Apisearch.ensureIsDefined(config.app_id, \"app_id\");\n Apisearch.ensureIsDefined(config.index_id, \"index_id\");\n Apisearch.ensureIsDefined(config.token, \"token\");\n Apisearch.ensureIsDefined(config.options.endpoint, \"options.endpoint\");\n config.options = __assign({ api_version: \"v1\", cache: new NoCache_1.NoCache(), timeout: 5000, override_queries: true }, config.options);\n /**\n * Client\n */\n var httpClient = typeof config.options.http_client !== \"undefined\"\n ? config.options.http_client\n : new AxiosClient_1.AxiosClient(config.options.endpoint, config.options.api_version, config.options.timeout, new RetryMap_1.RetryMap(), config.options.override_queries, config.options.cache);\n return new HttpRepository_1.HttpRepository(httpClient, config.app_id, config.index_id, config.token, new Transformer_1.Transformer());\n };\n /**\n * Ensure the value is not undefined\n *\n * @param param\n * @param name\n */\n Apisearch.ensureIsDefined = function (param, name) {\n if (typeof param === \"undefined\") {\n throw new TypeError(name + \" parameter must be defined.\");\n }\n };\n /**\n * Created located\n *\n * @param coordinate\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQueryLocated = function (coordinate, queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.createLocated(coordinate, queryText, page, size);\n };\n /**\n * Create\n *\n * @param queryText\n * @param page\n * @param size\n *\n * @returns {Query}\n */\n Apisearch.createQuery = function (queryText, page, size) {\n if (page === void 0) { page = Query_1.QUERY_DEFAULT_PAGE; }\n if (size === void 0) { size = Query_2.QUERY_DEFAULT_SIZE; }\n return Query_3.Query.create(queryText, page, size);\n };\n /**\n * Create match all\n *\n * @return {Query}\n */\n Apisearch.createQueryMatchAll = function () {\n return Query_3.Query.createMatchAll();\n };\n /**\n * Create by UUID\n *\n * @param uuid\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUID = function (uuid) {\n return Query_3.Query.createByUUID(uuid);\n };\n /**\n * Create by UUIDs\n *\n * @param uuids\n *\n * @return {Query}\n */\n Apisearch.createQueryByUUIDs = function () {\n var uuids = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n uuids[_i] = arguments[_i];\n }\n return Query_3.Query.createByUUIDs.apply(Query_3.Query, uuids);\n };\n /**\n * Create empty result\n *\n * @return {Result}\n */\n Apisearch.createEmptyResult = function () {\n return Result_1.Result.create(Apisearch.createQueryMatchAll(), 0, 0, new ResultAggregations_1.ResultAggregations(0), [], []);\n };\n /**\n * Create empty sortby\n *\n * @return {SortBy}\n */\n Apisearch.createEmptySortBy = function () {\n return SortBy_1.SortBy.create();\n };\n return Apisearch;\n}());\nexports[\"default\"] = Apisearch;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nexports.__esModule = true;\nvar Apisearch_1 = require(\"./Apisearch\");\nexports[\"default\"] = Apisearch_1[\"default\"];\n__export(require(\"./Cache/InMemoryCache\"));\n__export(require(\"./Config/Config\"));\n__export(require(\"./Config/ImmutableConfig\"));\n__export(require(\"./Config/Synonym\"));\n__export(require(\"./Error/ConnectionError\"));\n__export(require(\"./Error/ErrorWithMessage\"));\n__export(require(\"./Error/EventError\"));\n__export(require(\"./Error/ForbiddenError\"));\n__export(require(\"./Error/InvalidFormatError\"));\n__export(require(\"./Error/InvalidTokenError\"));\n__export(require(\"./Error/ResourceExistsError\"));\n__export(require(\"./Error/ResourceNotAvailableError\"));\n__export(require(\"./Error/UnsupportedContentTypeError\"));\n__export(require(\"./Geo/LocationRange\"));\n__export(require(\"./Http/AxiosClient\"));\n__export(require(\"./Http/Client\"));\n__export(require(\"./Http/HttpClient\"));\n__export(require(\"./Http/Response\"));\n__export(require(\"./Http/Retry\"));\n__export(require(\"./Http/RetryMap\"));\n__export(require(\"./Model/Changes\"));\n__export(require(\"./Model/Coordinate\"));\n__export(require(\"./Model/Item\"));\n__export(require(\"./Model/ItemUUID\"));\n__export(require(\"./Model/Metadata\"));\n__export(require(\"./Model/User\"));\n__export(require(\"./Query/Aggregation\"));\n__export(require(\"./Query/Filter\"));\n__export(require(\"./Query/Query\"));\n__export(require(\"./Query/Range\"));\n__export(require(\"./Query/ScoreStrategy\"));\n__export(require(\"./Query/SortBy\"));\n__export(require(\"./Repository/HttpRepository\"));\n__export(require(\"./Repository/Repository\"));\n__export(require(\"./Result/ResultAggregation\"));\n__export(require(\"./Result/ResultAggregations\"));\n__export(require(\"./Result/Counter\"));\n__export(require(\"./Result/Result\"));\n__export(require(\"./Transformer/Transformer\"));\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index f725690..1e9234e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "apisearch", - "version": "0.2.4", + "version": "0.2.5", "description": "Javascript client for Apisearch.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -9,7 +9,7 @@ "build:dev": "webpack --config ./webpack.dev.js --display-error-details", "build:min": "webpack --config ./webpack.min.js --display-error-details", "dist": "npm t; rm -rf ./dist/*; npm run build:dev && npm run build:min", - "test": "mocha --recursive --require ts-node/register test/*/*.ts", + "test": "mocha --recursive --require ts-node/register test/**/*.ts test/*.ts", "fix": "tslint -c tslint.json --fix 'src/**/*.ts'", "test:functional": "mocha --recursive --require ts-node/register test/Functional/*/*.ts" }, diff --git a/src/Apisearch.ts b/src/Apisearch.ts index 06ef5d5..02262f4 100644 --- a/src/Apisearch.ts +++ b/src/Apisearch.ts @@ -1,17 +1,17 @@ import {KeyValueCache} from "./Cache/KeyValueCache"; import {NoCache} from "./Cache/NoCache"; import {AxiosClient} from "./Http/AxiosClient"; +import {HttpClient} from "./Http/HttpClient"; import {RetryMap} from "./Http/RetryMap"; import {Coordinate} from "./Model/Coordinate"; import {ItemUUID} from "./Model/ItemUUID"; -import {Query} from "./Query/Query"; import {QUERY_DEFAULT_PAGE} from "./Query/Query"; import {QUERY_DEFAULT_SIZE} from "./Query/Query"; +import {Query} from "./Query/Query"; import {SortBy} from "./Query/SortBy"; import {HttpRepository} from "./Repository/HttpRepository"; -import {Repository} from "./Repository/Repository"; -import {ResultAggregations} from "./Result/ResultAggregations"; import {Result} from "./Result/Result"; +import {ResultAggregations} from "./Result/ResultAggregations"; import {Transformer} from "./Transformer/Transformer"; /** @@ -24,26 +24,31 @@ export default class Apisearch { * * @param config * - * @returns {Repository} + * @return {HttpRepository} */ - public static createRepository( - config: { - app_id: string, - index_id: string, - token: string, - options: { - endpoint?: string, - api_version?: string, - timeout?: number, - override_queries?: boolean, - cache?: KeyValueCache, - }, - } - ): Repository { + public static createRepository(config: { + app_id: string, + index_id: string, + token: string, + options: { + endpoint: string, + api_version?: string, + timeout?: number, + override_queries?: boolean, + cache?: KeyValueCache, + http_client?: HttpClient, + }, + }): HttpRepository { + + Apisearch.ensureIsDefined(config.app_id, "app_id"); + Apisearch.ensureIsDefined(config.index_id, "index_id"); + Apisearch.ensureIsDefined(config.token, "token"); + Apisearch.ensureIsDefined(config.options.endpoint, "options.endpoint"); + config.options = { api_version: "v1", cache: new NoCache(), - timeout: 10000, + timeout: 5000, override_queries: true, ...config.options, }; @@ -51,14 +56,16 @@ export default class Apisearch { /** * Client */ - const httpClient = new AxiosClient( - config.options.endpoint, - config.options.api_version, - config.options.timeout, - new RetryMap(), - config.options.override_queries, - config.options.cache, - ); + const httpClient = typeof config.options.http_client !== "undefined" + ? config.options.http_client + : new AxiosClient( + config.options.endpoint, + config.options.api_version, + config.options.timeout, + new RetryMap(), + config.options.override_queries, + config.options.cache, + ); return new HttpRepository( httpClient, @@ -69,6 +76,18 @@ export default class Apisearch { ); } + /** + * Ensure the value is not undefined + * + * @param param + * @param name + */ + public static ensureIsDefined(param, name) { + if (typeof param === "undefined") { + throw new TypeError(`${name} parameter must be defined.`); + } + } + /** * Created located * diff --git a/src/Result/Result.ts b/src/Result/Result.ts index 5c257f9..513ee6f 100644 --- a/src/Result/Result.ts +++ b/src/Result/Result.ts @@ -1,6 +1,6 @@ import {Item} from "../Model/Item"; -import {ResultAggregation} from "../Result/ResultAggregation"; import {Query} from "../Query/Query"; +import {ResultAggregation} from "../Result/ResultAggregation"; import {ResultAggregations} from "./ResultAggregations"; /** * Result class diff --git a/src/index.ts b/src/index.ts index adc8569..54db66c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,4 +50,4 @@ export * from "./Result/Result"; export * from "./Transformer/ReadTransformer"; export * from "./Transformer/Transformer"; -export * from "./Transformer/WriteTransformer"; \ No newline at end of file +export * from "./Transformer/WriteTransformer"; diff --git a/test/Apisearch.test.ts b/test/Apisearch.test.ts new file mode 100644 index 0000000..850d8bc --- /dev/null +++ b/test/Apisearch.test.ts @@ -0,0 +1,65 @@ +import { expect } from 'chai'; +import Apisearch from "../src/Apisearch"; +import {Product} from "./Transformer/Product"; +import {Item} from "../src/Model/Item"; +import {ItemUUID} from "../src/Model/ItemUUID"; +import {Changes} from "../src/Model/Changes"; +import {Query} from "../src/Query/Query"; +import {ImmutableConfig} from "../src/Config/ImmutableConfig"; +import {Config} from "../src/Config/Config"; +import {TestClient} from "../src/Http/TestClient"; +import {ProductReadTransformer} from "./Transformer/ProductReadTransformer"; + +describe('Apisearch', () => { + + const client = new TestClient(); + const repository = Apisearch.createRepository({ + "app_id": "aaaa", + "index_id": 'bbbb', + "token": 'cccc', + "options": { + "endpoint": 'http://blabla', + "http_client": client, + } + }); + repository.getTransformer().addReadTransformer(new ProductReadTransformer()); + + describe('Initial build', () => { + it('Should create properly', () => { + expect(typeof repository.getTransformer()).to.be.equal("object"); + }); + }); + + describe('Calls will work properly', () => { + repository.addObject(new Product('1', '1', 'name')); + repository.addObject(new Product('2', '2', 'name')); + repository.addItem(Item.create(ItemUUID.createByComposedUUID('3~product'))); + repository.addItems([ + Item.create(ItemUUID.createByComposedUUID('4~product')), + Item.create(ItemUUID.createByComposedUUID('5~product')) + ]); + repository.deleteItem(ItemUUID.createByComposedUUID('6~product')); + repository.deleteItems([ + ItemUUID.createByComposedUUID('7~product'), + ItemUUID.createByComposedUUID('8~product') + ]); + repository.deleteObject(new Product('9', 'lalala', 'prod4')); + repository.deleteObject(new Product('10', 'lalala', 'prod5')); + + it('Should take properly all available repository calls', () => { + return Promise.all([ + repository.flush(100, true), + repository.flush(3), + repository.query(Query.createMatchAll()), + repository.updateItems(Query.createMatchAll(), Changes.create()), + repository.createIndex(new ImmutableConfig()), + repository.deleteIndex(), + repository.resetIndex(), + repository.checkIndex(), + repository.configureIndex(new Config()) + ]).then(() => { + expect(client.calls.length).to.be.equal(9); + }) + }); + }); +}); diff --git a/test/Repository/HttpRepository.test.ts b/test/Repository/HttpRepository.test.ts index fef4d22..074a8e9 100644 --- a/test/Repository/HttpRepository.test.ts +++ b/test/Repository/HttpRepository.test.ts @@ -92,6 +92,12 @@ describe('Repository/', () => { Item.create(ItemUUID.createByComposedUUID('6~product')), ]); + await repository + .flush(20, true) + .then(_ => { + expect(client.calls.length).to.be.equal(0); + }); + await repository .flush(2) .then(_ => {