vviinn-widgets 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/cjs/Handler-d1a8a86a.js +329 -0
  2. package/dist/cjs/{app-globals-d999d944.js → app-globals-474864e0.js} +1 -1
  3. package/dist/cjs/cropper-handler.cjs.entry.js +27 -0
  4. package/dist/cjs/{customized-slots-90e8e849.js → customized-slots-0aa6c3d6.js} +1 -1
  5. package/dist/cjs/{cropper-handler_27.cjs.entry.js → highlight-box_22.cjs.entry.js} +85 -469
  6. package/dist/cjs/{index-c0d08aca.js → imageSearch.store-076370bf.js} +10575 -14822
  7. package/dist/cjs/index-34d20028.js +3222 -0
  8. package/dist/cjs/{index-e8cf5dc5.js → index-61403ab1.js} +1 -1
  9. package/dist/cjs/{index-53400160.js → index-a87f1a44.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +3 -3
  11. package/dist/cjs/{vviinn-carousel_2.cjs.entry.js → vviinn-carousel_3.cjs.entry.js} +212 -25
  12. package/dist/cjs/vviinn-error.cjs.entry.js +19 -0
  13. package/dist/cjs/vviinn-preloader.cjs.entry.js +26 -0
  14. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -2
  15. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +2 -2
  16. package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
  17. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +162 -0
  18. package/dist/cjs/vviinn-widgets.cjs.js +3 -3
  19. package/dist/collection/components/image-search/search-filters/search-filters.js +1 -1
  20. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +3 -0
  21. package/dist/collection/openApi/index.js +1 -1
  22. package/dist/esm/Handler-639a4cb3.js +308 -0
  23. package/dist/esm/{app-globals-f91c6f94.js → app-globals-3888cd41.js} +1 -1
  24. package/dist/esm/cropper-handler.entry.js +23 -0
  25. package/dist/esm/{customized-slots-7be7f3b8.js → customized-slots-863113e2.js} +1 -1
  26. package/dist/esm/{cropper-handler_27.entry.js → highlight-box_22.entry.js} +21 -400
  27. package/dist/esm/{index-840ec915.js → imageSearch.store-b516d12e.js} +10749 -14986
  28. package/dist/esm/index-2f8fb0fe.js +3213 -0
  29. package/dist/esm/{index-00c7b7c2.js → index-36978848.js} +2 -2
  30. package/dist/esm/{index-d7147986.js → index-56c062df.js} +1 -1
  31. package/dist/esm/loader.js +3 -3
  32. package/dist/esm/{vviinn-carousel_2.entry.js → vviinn-carousel_3.entry.js} +190 -4
  33. package/dist/esm/vviinn-error.entry.js +15 -0
  34. package/dist/esm/vviinn-preloader.entry.js +22 -0
  35. package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -2
  36. package/dist/esm/vviinn-vpr-button.entry.js +2 -2
  37. package/dist/esm/vviinn-vps-button.entry.js +3 -3
  38. package/dist/esm/vviinn-vps-widget.entry.js +158 -0
  39. package/dist/esm/vviinn-widgets.js +3 -3
  40. package/dist/types/components/image-search/search-filters/search-filters.d.ts +1 -1
  41. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +1 -1
  42. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +2 -1
  43. package/dist/types/components.d.ts +1 -1
  44. package/dist/types/openApi/index.d.ts +2 -2
  45. package/dist/types/tracking/event.d.ts +1 -1
  46. package/dist/types/tracking/index.d.ts +8 -8
  47. package/dist/types/tracking/models.d.ts +1 -1
  48. package/dist/vviinn-widgets/{p-2d4cb17f.entry.js → p-0a9cee09.entry.js} +1 -1
  49. package/dist/vviinn-widgets/p-28678772.js +1 -0
  50. package/dist/vviinn-widgets/{p-07d8ba79.entry.js → p-2e6ecda7.entry.js} +1 -1
  51. package/dist/vviinn-widgets/{p-dc2da207.js → p-47183c9a.js} +1 -1
  52. package/dist/vviinn-widgets/p-535611cd.entry.js +1 -0
  53. package/dist/vviinn-widgets/p-606ff863.js +1 -0
  54. package/dist/vviinn-widgets/p-9cc6f0dd.entry.js +1 -0
  55. package/{www/build/p-ce96f232.js → dist/vviinn-widgets/p-ac0a2989.js} +1 -1
  56. package/dist/vviinn-widgets/p-ad29e9c5.entry.js +1 -0
  57. package/{www/build/p-a66512b2.js → dist/vviinn-widgets/p-b4caf042.js} +1 -1
  58. package/dist/vviinn-widgets/p-b547a6d0.entry.js +1 -0
  59. package/dist/vviinn-widgets/{p-7d5af04d.js → p-c853cba8.js} +1 -1
  60. package/dist/vviinn-widgets/p-d2097302.entry.js +1 -0
  61. package/dist/vviinn-widgets/p-d8d49616.entry.js +1 -0
  62. package/dist/vviinn-widgets/p-f582db5c.js +1 -0
  63. package/dist/vviinn-widgets/{p-9c7297c8.entry.js → p-f9410382.entry.js} +1 -1
  64. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  65. package/package.json +3 -3
  66. package/www/build/{p-2d4cb17f.entry.js → p-0a9cee09.entry.js} +1 -1
  67. package/www/build/p-28678772.js +1 -0
  68. package/www/build/{p-07d8ba79.entry.js → p-2e6ecda7.entry.js} +1 -1
  69. package/www/build/{p-dc2da207.js → p-47183c9a.js} +1 -1
  70. package/www/build/p-535611cd.entry.js +1 -0
  71. package/www/build/p-606ff863.js +1 -0
  72. package/www/build/p-7c313f33.js +125 -0
  73. package/www/build/p-9cc6f0dd.entry.js +1 -0
  74. package/{dist/vviinn-widgets/p-ce96f232.js → www/build/p-ac0a2989.js} +1 -1
  75. package/www/build/p-ad29e9c5.entry.js +1 -0
  76. package/{dist/vviinn-widgets/p-a66512b2.js → www/build/p-b4caf042.js} +1 -1
  77. package/www/build/p-b547a6d0.entry.js +1 -0
  78. package/www/build/{p-7d5af04d.js → p-c853cba8.js} +1 -1
  79. package/www/build/p-d2097302.entry.js +1 -0
  80. package/www/build/p-d8d49616.entry.js +1 -0
  81. package/www/build/p-e0153ae2.css +6 -0
  82. package/www/build/p-f582db5c.js +1 -0
  83. package/www/build/{p-9c7297c8.entry.js → p-f9410382.entry.js} +1 -1
  84. package/www/build/vviinn-widgets.esm.js +1 -1
  85. package/www/index.html +1 -1
  86. package/dist/vviinn-widgets/p-196479f9.js +0 -1
  87. package/dist/vviinn-widgets/p-ae524f97.entry.js +0 -1
  88. package/dist/vviinn-widgets/p-fce4183d.entry.js +0 -1
  89. package/www/build/p-196479f9.js +0 -1
  90. package/www/build/p-32bb0615.js +0 -1
  91. package/www/build/p-a67898be.css +0 -1
  92. package/www/build/p-ae524f97.entry.js +0 -1
  93. package/www/build/p-fce4183d.entry.js +0 -1
@@ -0,0 +1,3213 @@
1
+ import { e as commonjsGlobal, h as createCommonjsModule } from './imageSearch.store-b516d12e.js';
2
+
3
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
4
+ // require the crypto API and do not support built-in fallback to lower quality random number
5
+ // generators (like Math.random()).
6
+ var getRandomValues;
7
+ var rnds8 = new Uint8Array(16);
8
+ function rng() {
9
+ // lazy load so that environments that need to polyfill have a chance to do so
10
+ if (!getRandomValues) {
11
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
12
+ // find the complete implementation of crypto (msCrypto) on IE11.
13
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
14
+
15
+ if (!getRandomValues) {
16
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
17
+ }
18
+ }
19
+
20
+ return getRandomValues(rnds8);
21
+ }
22
+
23
+ const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
24
+
25
+ function validate(uuid) {
26
+ return typeof uuid === 'string' && REGEX.test(uuid);
27
+ }
28
+
29
+ /**
30
+ * Convert array of 16 byte values to UUID string format of the form:
31
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
32
+ */
33
+
34
+ var byteToHex = [];
35
+
36
+ for (var i = 0; i < 256; ++i) {
37
+ byteToHex.push((i + 0x100).toString(16).substr(1));
38
+ }
39
+
40
+ function stringify$1(arr) {
41
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
42
+ // Note: Be careful editing this code! It's been tuned for performance
43
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
44
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
45
+ // of the following:
46
+ // - One or more input array values don't map to a hex octet (leading to
47
+ // "undefined" in the uuid)
48
+ // - Invalid input values for the RFC `version` or `variant` fields
49
+
50
+ if (!validate(uuid)) {
51
+ throw TypeError('Stringified UUID is invalid');
52
+ }
53
+
54
+ return uuid;
55
+ }
56
+
57
+ function v4(options, buf, offset) {
58
+ options = options || {};
59
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
60
+
61
+ rnds[6] = rnds[6] & 0x0f | 0x40;
62
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
63
+
64
+ if (buf) {
65
+ offset = offset || 0;
66
+
67
+ for (var i = 0; i < 16; ++i) {
68
+ buf[offset + i] = rnds[i];
69
+ }
70
+
71
+ return buf;
72
+ }
73
+
74
+ return stringify$1(rnds);
75
+ }
76
+
77
+ /**
78
+ * Check if we're required to add a port number.
79
+ *
80
+ * @see https://url.spec.whatwg.org/#default-port
81
+ * @param {Number|String} port Port number we need to check
82
+ * @param {String} protocol Protocol we need to check against.
83
+ * @returns {Boolean} Is it a default port for the given protocol
84
+ * @api private
85
+ */
86
+ var requiresPort = function required(port, protocol) {
87
+ protocol = protocol.split(':')[0];
88
+ port = +port;
89
+
90
+ if (!port) return false;
91
+
92
+ switch (protocol) {
93
+ case 'http':
94
+ case 'ws':
95
+ return port !== 80;
96
+
97
+ case 'https':
98
+ case 'wss':
99
+ return port !== 443;
100
+
101
+ case 'ftp':
102
+ return port !== 21;
103
+
104
+ case 'gopher':
105
+ return port !== 70;
106
+
107
+ case 'file':
108
+ return false;
109
+ }
110
+
111
+ return port !== 0;
112
+ };
113
+
114
+ var has = Object.prototype.hasOwnProperty
115
+ , undef;
116
+
117
+ /**
118
+ * Decode a URI encoded string.
119
+ *
120
+ * @param {String} input The URI encoded string.
121
+ * @returns {String|Null} The decoded string.
122
+ * @api private
123
+ */
124
+ function decode$1(input) {
125
+ try {
126
+ return decodeURIComponent(input.replace(/\+/g, ' '));
127
+ } catch (e) {
128
+ return null;
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Attempts to encode a given input.
134
+ *
135
+ * @param {String} input The string that needs to be encoded.
136
+ * @returns {String|Null} The encoded string.
137
+ * @api private
138
+ */
139
+ function encode(input) {
140
+ try {
141
+ return encodeURIComponent(input);
142
+ } catch (e) {
143
+ return null;
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Simple query string parser.
149
+ *
150
+ * @param {String} query The query string that needs to be parsed.
151
+ * @returns {Object}
152
+ * @api public
153
+ */
154
+ function querystring(query) {
155
+ var parser = /([^=?#&]+)=?([^&]*)/g
156
+ , result = {}
157
+ , part;
158
+
159
+ while (part = parser.exec(query)) {
160
+ var key = decode$1(part[1])
161
+ , value = decode$1(part[2]);
162
+
163
+ //
164
+ // Prevent overriding of existing properties. This ensures that build-in
165
+ // methods like `toString` or __proto__ are not overriden by malicious
166
+ // querystrings.
167
+ //
168
+ // In the case if failed decoding, we want to omit the key/value pairs
169
+ // from the result.
170
+ //
171
+ if (key === null || value === null || key in result) continue;
172
+ result[key] = value;
173
+ }
174
+
175
+ return result;
176
+ }
177
+
178
+ /**
179
+ * Transform a query string to an object.
180
+ *
181
+ * @param {Object} obj Object that should be transformed.
182
+ * @param {String} prefix Optional prefix.
183
+ * @returns {String}
184
+ * @api public
185
+ */
186
+ function querystringify(obj, prefix) {
187
+ prefix = prefix || '';
188
+
189
+ var pairs = []
190
+ , value
191
+ , key;
192
+
193
+ //
194
+ // Optionally prefix with a '?' if needed
195
+ //
196
+ if ('string' !== typeof prefix) prefix = '?';
197
+
198
+ for (key in obj) {
199
+ if (has.call(obj, key)) {
200
+ value = obj[key];
201
+
202
+ //
203
+ // Edge cases where we actually want to encode the value to an empty
204
+ // string instead of the stringified value.
205
+ //
206
+ if (!value && (value === null || value === undef || isNaN(value))) {
207
+ value = '';
208
+ }
209
+
210
+ key = encode(key);
211
+ value = encode(value);
212
+
213
+ //
214
+ // If we failed to encode the strings, we should bail out as we don't
215
+ // want to add invalid strings to the query.
216
+ //
217
+ if (key === null || value === null) continue;
218
+ pairs.push(key +'='+ value);
219
+ }
220
+ }
221
+
222
+ return pairs.length ? prefix + pairs.join('&') : '';
223
+ }
224
+
225
+ //
226
+ // Expose the module.
227
+ //
228
+ var stringify = querystringify;
229
+ var parse = querystring;
230
+
231
+ var querystringify_1 = {
232
+ stringify: stringify,
233
+ parse: parse
234
+ };
235
+
236
+ var controlOrWhitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/
237
+ , CRHTLF = /[\n\r\t]/g
238
+ , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//
239
+ , port = /:\d+$/
240
+ , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i
241
+ , windowsDriveLetter = /^[a-zA-Z]:/;
242
+
243
+ /**
244
+ * Remove control characters and whitespace from the beginning of a string.
245
+ *
246
+ * @param {Object|String} str String to trim.
247
+ * @returns {String} A new string representing `str` stripped of control
248
+ * characters and whitespace from its beginning.
249
+ * @public
250
+ */
251
+ function trimLeft(str) {
252
+ return (str ? str : '').toString().replace(controlOrWhitespace, '');
253
+ }
254
+
255
+ /**
256
+ * These are the parse rules for the URL parser, it informs the parser
257
+ * about:
258
+ *
259
+ * 0. The char it Needs to parse, if it's a string it should be done using
260
+ * indexOf, RegExp using exec and NaN means set as current value.
261
+ * 1. The property we should set when parsing this value.
262
+ * 2. Indication if it's backwards or forward parsing, when set as number it's
263
+ * the value of extra chars that should be split off.
264
+ * 3. Inherit from location if non existing in the parser.
265
+ * 4. `toLowerCase` the resulting value.
266
+ */
267
+ var rules = [
268
+ ['#', 'hash'], // Extract from the back.
269
+ ['?', 'query'], // Extract from the back.
270
+ function sanitize(address, url) { // Sanitize what is left of the address
271
+ return isSpecial(url.protocol) ? address.replace(/\\/g, '/') : address;
272
+ },
273
+ ['/', 'pathname'], // Extract from the back.
274
+ ['@', 'auth', 1], // Extract from the front.
275
+ [NaN, 'host', undefined, 1, 1], // Set left over value.
276
+ [/:(\d*)$/, 'port', undefined, 1], // RegExp the back.
277
+ [NaN, 'hostname', undefined, 1, 1] // Set left over.
278
+ ];
279
+
280
+ /**
281
+ * These properties should not be copied or inherited from. This is only needed
282
+ * for all non blob URL's as a blob URL does not include a hash, only the
283
+ * origin.
284
+ *
285
+ * @type {Object}
286
+ * @private
287
+ */
288
+ var ignore = { hash: 1, query: 1 };
289
+
290
+ /**
291
+ * The location object differs when your code is loaded through a normal page,
292
+ * Worker or through a worker using a blob. And with the blobble begins the
293
+ * trouble as the location object will contain the URL of the blob, not the
294
+ * location of the page where our code is loaded in. The actual origin is
295
+ * encoded in the `pathname` so we can thankfully generate a good "default"
296
+ * location from it so we can generate proper relative URL's again.
297
+ *
298
+ * @param {Object|String} loc Optional default location object.
299
+ * @returns {Object} lolcation object.
300
+ * @public
301
+ */
302
+ function lolcation(loc) {
303
+ var globalVar;
304
+
305
+ if (typeof window !== 'undefined') globalVar = window;
306
+ else if (typeof commonjsGlobal !== 'undefined') globalVar = commonjsGlobal;
307
+ else if (typeof self !== 'undefined') globalVar = self;
308
+ else globalVar = {};
309
+
310
+ var location = globalVar.location || {};
311
+ loc = loc || location;
312
+
313
+ var finaldestination = {}
314
+ , type = typeof loc
315
+ , key;
316
+
317
+ if ('blob:' === loc.protocol) {
318
+ finaldestination = new Url(unescape(loc.pathname), {});
319
+ } else if ('string' === type) {
320
+ finaldestination = new Url(loc, {});
321
+ for (key in ignore) delete finaldestination[key];
322
+ } else if ('object' === type) {
323
+ for (key in loc) {
324
+ if (key in ignore) continue;
325
+ finaldestination[key] = loc[key];
326
+ }
327
+
328
+ if (finaldestination.slashes === undefined) {
329
+ finaldestination.slashes = slashes.test(loc.href);
330
+ }
331
+ }
332
+
333
+ return finaldestination;
334
+ }
335
+
336
+ /**
337
+ * Check whether a protocol scheme is special.
338
+ *
339
+ * @param {String} The protocol scheme of the URL
340
+ * @return {Boolean} `true` if the protocol scheme is special, else `false`
341
+ * @private
342
+ */
343
+ function isSpecial(scheme) {
344
+ return (
345
+ scheme === 'file:' ||
346
+ scheme === 'ftp:' ||
347
+ scheme === 'http:' ||
348
+ scheme === 'https:' ||
349
+ scheme === 'ws:' ||
350
+ scheme === 'wss:'
351
+ );
352
+ }
353
+
354
+ /**
355
+ * @typedef ProtocolExtract
356
+ * @type Object
357
+ * @property {String} protocol Protocol matched in the URL, in lowercase.
358
+ * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
359
+ * @property {String} rest Rest of the URL that is not part of the protocol.
360
+ */
361
+
362
+ /**
363
+ * Extract protocol information from a URL with/without double slash ("//").
364
+ *
365
+ * @param {String} address URL we want to extract from.
366
+ * @param {Object} location
367
+ * @return {ProtocolExtract} Extracted information.
368
+ * @private
369
+ */
370
+ function extractProtocol(address, location) {
371
+ address = trimLeft(address);
372
+ address = address.replace(CRHTLF, '');
373
+ location = location || {};
374
+
375
+ var match = protocolre.exec(address);
376
+ var protocol = match[1] ? match[1].toLowerCase() : '';
377
+ var forwardSlashes = !!match[2];
378
+ var otherSlashes = !!match[3];
379
+ var slashesCount = 0;
380
+ var rest;
381
+
382
+ if (forwardSlashes) {
383
+ if (otherSlashes) {
384
+ rest = match[2] + match[3] + match[4];
385
+ slashesCount = match[2].length + match[3].length;
386
+ } else {
387
+ rest = match[2] + match[4];
388
+ slashesCount = match[2].length;
389
+ }
390
+ } else {
391
+ if (otherSlashes) {
392
+ rest = match[3] + match[4];
393
+ slashesCount = match[3].length;
394
+ } else {
395
+ rest = match[4];
396
+ }
397
+ }
398
+
399
+ if (protocol === 'file:') {
400
+ if (slashesCount >= 2) {
401
+ rest = rest.slice(2);
402
+ }
403
+ } else if (isSpecial(protocol)) {
404
+ rest = match[4];
405
+ } else if (protocol) {
406
+ if (forwardSlashes) {
407
+ rest = rest.slice(2);
408
+ }
409
+ } else if (slashesCount >= 2 && isSpecial(location.protocol)) {
410
+ rest = match[4];
411
+ }
412
+
413
+ return {
414
+ protocol: protocol,
415
+ slashes: forwardSlashes || isSpecial(protocol),
416
+ slashesCount: slashesCount,
417
+ rest: rest
418
+ };
419
+ }
420
+
421
+ /**
422
+ * Resolve a relative URL pathname against a base URL pathname.
423
+ *
424
+ * @param {String} relative Pathname of the relative URL.
425
+ * @param {String} base Pathname of the base URL.
426
+ * @return {String} Resolved pathname.
427
+ * @private
428
+ */
429
+ function resolve(relative, base) {
430
+ if (relative === '') return base;
431
+
432
+ var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
433
+ , i = path.length
434
+ , last = path[i - 1]
435
+ , unshift = false
436
+ , up = 0;
437
+
438
+ while (i--) {
439
+ if (path[i] === '.') {
440
+ path.splice(i, 1);
441
+ } else if (path[i] === '..') {
442
+ path.splice(i, 1);
443
+ up++;
444
+ } else if (up) {
445
+ if (i === 0) unshift = true;
446
+ path.splice(i, 1);
447
+ up--;
448
+ }
449
+ }
450
+
451
+ if (unshift) path.unshift('');
452
+ if (last === '.' || last === '..') path.push('');
453
+
454
+ return path.join('/');
455
+ }
456
+
457
+ /**
458
+ * The actual URL instance. Instead of returning an object we've opted-in to
459
+ * create an actual constructor as it's much more memory efficient and
460
+ * faster and it pleases my OCD.
461
+ *
462
+ * It is worth noting that we should not use `URL` as class name to prevent
463
+ * clashes with the global URL instance that got introduced in browsers.
464
+ *
465
+ * @constructor
466
+ * @param {String} address URL we want to parse.
467
+ * @param {Object|String} [location] Location defaults for relative paths.
468
+ * @param {Boolean|Function} [parser] Parser for the query string.
469
+ * @private
470
+ */
471
+ function Url(address, location, parser) {
472
+ address = trimLeft(address);
473
+ address = address.replace(CRHTLF, '');
474
+
475
+ if (!(this instanceof Url)) {
476
+ return new Url(address, location, parser);
477
+ }
478
+
479
+ var relative, extracted, parse, instruction, index, key
480
+ , instructions = rules.slice()
481
+ , type = typeof location
482
+ , url = this
483
+ , i = 0;
484
+
485
+ //
486
+ // The following if statements allows this module two have compatibility with
487
+ // 2 different API:
488
+ //
489
+ // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
490
+ // where the boolean indicates that the query string should also be parsed.
491
+ //
492
+ // 2. The `URL` interface of the browser which accepts a URL, object as
493
+ // arguments. The supplied object will be used as default values / fall-back
494
+ // for relative paths.
495
+ //
496
+ if ('object' !== type && 'string' !== type) {
497
+ parser = location;
498
+ location = null;
499
+ }
500
+
501
+ if (parser && 'function' !== typeof parser) parser = querystringify_1.parse;
502
+
503
+ location = lolcation(location);
504
+
505
+ //
506
+ // Extract protocol information before running the instructions.
507
+ //
508
+ extracted = extractProtocol(address || '', location);
509
+ relative = !extracted.protocol && !extracted.slashes;
510
+ url.slashes = extracted.slashes || relative && location.slashes;
511
+ url.protocol = extracted.protocol || location.protocol || '';
512
+ address = extracted.rest;
513
+
514
+ //
515
+ // When the authority component is absent the URL starts with a path
516
+ // component.
517
+ //
518
+ if (
519
+ extracted.protocol === 'file:' && (
520
+ extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||
521
+ (!extracted.slashes &&
522
+ (extracted.protocol ||
523
+ extracted.slashesCount < 2 ||
524
+ !isSpecial(url.protocol)))
525
+ ) {
526
+ instructions[3] = [/(.*)/, 'pathname'];
527
+ }
528
+
529
+ for (; i < instructions.length; i++) {
530
+ instruction = instructions[i];
531
+
532
+ if (typeof instruction === 'function') {
533
+ address = instruction(address, url);
534
+ continue;
535
+ }
536
+
537
+ parse = instruction[0];
538
+ key = instruction[1];
539
+
540
+ if (parse !== parse) {
541
+ url[key] = address;
542
+ } else if ('string' === typeof parse) {
543
+ index = parse === '@'
544
+ ? address.lastIndexOf(parse)
545
+ : address.indexOf(parse);
546
+
547
+ if (~index) {
548
+ if ('number' === typeof instruction[2]) {
549
+ url[key] = address.slice(0, index);
550
+ address = address.slice(index + instruction[2]);
551
+ } else {
552
+ url[key] = address.slice(index);
553
+ address = address.slice(0, index);
554
+ }
555
+ }
556
+ } else if ((index = parse.exec(address))) {
557
+ url[key] = index[1];
558
+ address = address.slice(0, index.index);
559
+ }
560
+
561
+ url[key] = url[key] || (
562
+ relative && instruction[3] ? location[key] || '' : ''
563
+ );
564
+
565
+ //
566
+ // Hostname, host and protocol should be lowercased so they can be used to
567
+ // create a proper `origin`.
568
+ //
569
+ if (instruction[4]) url[key] = url[key].toLowerCase();
570
+ }
571
+
572
+ //
573
+ // Also parse the supplied query string in to an object. If we're supplied
574
+ // with a custom parser as function use that instead of the default build-in
575
+ // parser.
576
+ //
577
+ if (parser) url.query = parser(url.query);
578
+
579
+ //
580
+ // If the URL is relative, resolve the pathname against the base URL.
581
+ //
582
+ if (
583
+ relative
584
+ && location.slashes
585
+ && url.pathname.charAt(0) !== '/'
586
+ && (url.pathname !== '' || location.pathname !== '')
587
+ ) {
588
+ url.pathname = resolve(url.pathname, location.pathname);
589
+ }
590
+
591
+ //
592
+ // Default to a / for pathname if none exists. This normalizes the URL
593
+ // to always have a /
594
+ //
595
+ if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {
596
+ url.pathname = '/' + url.pathname;
597
+ }
598
+
599
+ //
600
+ // We should not add port numbers if they are already the default port number
601
+ // for a given protocol. As the host also contains the port number we're going
602
+ // override it with the hostname which contains no port number.
603
+ //
604
+ if (!requiresPort(url.port, url.protocol)) {
605
+ url.host = url.hostname;
606
+ url.port = '';
607
+ }
608
+
609
+ //
610
+ // Parse down the `auth` for the username and password.
611
+ //
612
+ url.username = url.password = '';
613
+
614
+ if (url.auth) {
615
+ index = url.auth.indexOf(':');
616
+
617
+ if (~index) {
618
+ url.username = url.auth.slice(0, index);
619
+ url.username = encodeURIComponent(decodeURIComponent(url.username));
620
+
621
+ url.password = url.auth.slice(index + 1);
622
+ url.password = encodeURIComponent(decodeURIComponent(url.password));
623
+ } else {
624
+ url.username = encodeURIComponent(decodeURIComponent(url.auth));
625
+ }
626
+
627
+ url.auth = url.password ? url.username +':'+ url.password : url.username;
628
+ }
629
+
630
+ url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host
631
+ ? url.protocol +'//'+ url.host
632
+ : 'null';
633
+
634
+ //
635
+ // The href is just the compiled result.
636
+ //
637
+ url.href = url.toString();
638
+ }
639
+
640
+ /**
641
+ * This is convenience method for changing properties in the URL instance to
642
+ * insure that they all propagate correctly.
643
+ *
644
+ * @param {String} part Property we need to adjust.
645
+ * @param {Mixed} value The newly assigned value.
646
+ * @param {Boolean|Function} fn When setting the query, it will be the function
647
+ * used to parse the query.
648
+ * When setting the protocol, double slash will be
649
+ * removed from the final url if it is true.
650
+ * @returns {URL} URL instance for chaining.
651
+ * @public
652
+ */
653
+ function set(part, value, fn) {
654
+ var url = this;
655
+
656
+ switch (part) {
657
+ case 'query':
658
+ if ('string' === typeof value && value.length) {
659
+ value = (fn || querystringify_1.parse)(value);
660
+ }
661
+
662
+ url[part] = value;
663
+ break;
664
+
665
+ case 'port':
666
+ url[part] = value;
667
+
668
+ if (!requiresPort(value, url.protocol)) {
669
+ url.host = url.hostname;
670
+ url[part] = '';
671
+ } else if (value) {
672
+ url.host = url.hostname +':'+ value;
673
+ }
674
+
675
+ break;
676
+
677
+ case 'hostname':
678
+ url[part] = value;
679
+
680
+ if (url.port) value += ':'+ url.port;
681
+ url.host = value;
682
+ break;
683
+
684
+ case 'host':
685
+ url[part] = value;
686
+
687
+ if (port.test(value)) {
688
+ value = value.split(':');
689
+ url.port = value.pop();
690
+ url.hostname = value.join(':');
691
+ } else {
692
+ url.hostname = value;
693
+ url.port = '';
694
+ }
695
+
696
+ break;
697
+
698
+ case 'protocol':
699
+ url.protocol = value.toLowerCase();
700
+ url.slashes = !fn;
701
+ break;
702
+
703
+ case 'pathname':
704
+ case 'hash':
705
+ if (value) {
706
+ var char = part === 'pathname' ? '/' : '#';
707
+ url[part] = value.charAt(0) !== char ? char + value : value;
708
+ } else {
709
+ url[part] = value;
710
+ }
711
+ break;
712
+
713
+ case 'username':
714
+ case 'password':
715
+ url[part] = encodeURIComponent(value);
716
+ break;
717
+
718
+ case 'auth':
719
+ var index = value.indexOf(':');
720
+
721
+ if (~index) {
722
+ url.username = value.slice(0, index);
723
+ url.username = encodeURIComponent(decodeURIComponent(url.username));
724
+
725
+ url.password = value.slice(index + 1);
726
+ url.password = encodeURIComponent(decodeURIComponent(url.password));
727
+ } else {
728
+ url.username = encodeURIComponent(decodeURIComponent(value));
729
+ }
730
+ }
731
+
732
+ for (var i = 0; i < rules.length; i++) {
733
+ var ins = rules[i];
734
+
735
+ if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
736
+ }
737
+
738
+ url.auth = url.password ? url.username +':'+ url.password : url.username;
739
+
740
+ url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host
741
+ ? url.protocol +'//'+ url.host
742
+ : 'null';
743
+
744
+ url.href = url.toString();
745
+
746
+ return url;
747
+ }
748
+
749
+ /**
750
+ * Transform the properties back in to a valid and full URL string.
751
+ *
752
+ * @param {Function} stringify Optional query stringify function.
753
+ * @returns {String} Compiled version of the URL.
754
+ * @public
755
+ */
756
+ function toString(stringify) {
757
+ if (!stringify || 'function' !== typeof stringify) stringify = querystringify_1.stringify;
758
+
759
+ var query
760
+ , url = this
761
+ , host = url.host
762
+ , protocol = url.protocol;
763
+
764
+ if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
765
+
766
+ var result =
767
+ protocol +
768
+ ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');
769
+
770
+ if (url.username) {
771
+ result += url.username;
772
+ if (url.password) result += ':'+ url.password;
773
+ result += '@';
774
+ } else if (url.password) {
775
+ result += ':'+ url.password;
776
+ result += '@';
777
+ } else if (
778
+ url.protocol !== 'file:' &&
779
+ isSpecial(url.protocol) &&
780
+ !host &&
781
+ url.pathname !== '/'
782
+ ) {
783
+ //
784
+ // Add back the empty userinfo, otherwise the original invalid URL
785
+ // might be transformed into a valid one with `url.pathname` as host.
786
+ //
787
+ result += '@';
788
+ }
789
+
790
+ //
791
+ // Trailing colon is removed from `url.host` when it is parsed. If it still
792
+ // ends with a colon, then add back the trailing colon that was removed. This
793
+ // prevents an invalid URL from being transformed into a valid one.
794
+ //
795
+ if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {
796
+ host += ':';
797
+ }
798
+
799
+ result += host + url.pathname;
800
+
801
+ query = 'object' === typeof url.query ? stringify(url.query) : url.query;
802
+ if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;
803
+
804
+ if (url.hash) result += url.hash;
805
+
806
+ return result;
807
+ }
808
+
809
+ Url.prototype = { set: set, toString: toString };
810
+
811
+ //
812
+ // Expose the URL parser and some additional properties that might be useful for
813
+ // others or testing.
814
+ //
815
+ Url.extractProtocol = extractProtocol;
816
+ Url.location = lolcation;
817
+ Url.trimLeft = trimLeft;
818
+ Url.qs = querystringify_1;
819
+
820
+ var urlParse = Url;
821
+
822
+ var rxjsStub = createCommonjsModule(function (module, exports) {
823
+ Object.defineProperty(exports, "__esModule", { value: true });
824
+ exports.map = exports.mergeMap = exports.of = exports.from = exports.Observable = void 0;
825
+ var Observable = (function () {
826
+ function Observable(promise) {
827
+ this.promise = promise;
828
+ }
829
+ Observable.prototype.toPromise = function () {
830
+ return this.promise;
831
+ };
832
+ Observable.prototype.pipe = function (callback) {
833
+ return new Observable(this.promise.then(callback));
834
+ };
835
+ return Observable;
836
+ }());
837
+ exports.Observable = Observable;
838
+ function from(promise) {
839
+ return new Observable(promise);
840
+ }
841
+ exports.from = from;
842
+ function of(value) {
843
+ return new Observable(Promise.resolve(value));
844
+ }
845
+ exports.of = of;
846
+ function mergeMap(callback) {
847
+ return function (value) { return callback(value).toPromise(); };
848
+ }
849
+ exports.mergeMap = mergeMap;
850
+ function map(callback) {
851
+ return callback;
852
+ }
853
+ exports.map = map;
854
+ //# sourceMappingURL=rxjsStub.js.map
855
+ });
856
+
857
+ var global =
858
+ (typeof globalThis !== 'undefined' && globalThis) ||
859
+ (typeof self !== 'undefined' && self) ||
860
+ (typeof global !== 'undefined' && global);
861
+
862
+ var support = {
863
+ searchParams: 'URLSearchParams' in global,
864
+ iterable: 'Symbol' in global && 'iterator' in Symbol,
865
+ blob:
866
+ 'FileReader' in global &&
867
+ 'Blob' in global &&
868
+ (function() {
869
+ try {
870
+ new Blob();
871
+ return true
872
+ } catch (e) {
873
+ return false
874
+ }
875
+ })(),
876
+ formData: 'FormData' in global,
877
+ arrayBuffer: 'ArrayBuffer' in global
878
+ };
879
+
880
+ function isDataView(obj) {
881
+ return obj && DataView.prototype.isPrototypeOf(obj)
882
+ }
883
+
884
+ if (support.arrayBuffer) {
885
+ var viewClasses = [
886
+ '[object Int8Array]',
887
+ '[object Uint8Array]',
888
+ '[object Uint8ClampedArray]',
889
+ '[object Int16Array]',
890
+ '[object Uint16Array]',
891
+ '[object Int32Array]',
892
+ '[object Uint32Array]',
893
+ '[object Float32Array]',
894
+ '[object Float64Array]'
895
+ ];
896
+
897
+ var isArrayBufferView =
898
+ ArrayBuffer.isView ||
899
+ function(obj) {
900
+ return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
901
+ };
902
+ }
903
+
904
+ function normalizeName(name) {
905
+ if (typeof name !== 'string') {
906
+ name = String(name);
907
+ }
908
+ if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
909
+ throw new TypeError('Invalid character in header field name: "' + name + '"')
910
+ }
911
+ return name.toLowerCase()
912
+ }
913
+
914
+ function normalizeValue(value) {
915
+ if (typeof value !== 'string') {
916
+ value = String(value);
917
+ }
918
+ return value
919
+ }
920
+
921
+ // Build a destructive iterator for the value list
922
+ function iteratorFor(items) {
923
+ var iterator = {
924
+ next: function() {
925
+ var value = items.shift();
926
+ return {done: value === undefined, value: value}
927
+ }
928
+ };
929
+
930
+ if (support.iterable) {
931
+ iterator[Symbol.iterator] = function() {
932
+ return iterator
933
+ };
934
+ }
935
+
936
+ return iterator
937
+ }
938
+
939
+ function Headers(headers) {
940
+ this.map = {};
941
+
942
+ if (headers instanceof Headers) {
943
+ headers.forEach(function(value, name) {
944
+ this.append(name, value);
945
+ }, this);
946
+ } else if (Array.isArray(headers)) {
947
+ headers.forEach(function(header) {
948
+ this.append(header[0], header[1]);
949
+ }, this);
950
+ } else if (headers) {
951
+ Object.getOwnPropertyNames(headers).forEach(function(name) {
952
+ this.append(name, headers[name]);
953
+ }, this);
954
+ }
955
+ }
956
+
957
+ Headers.prototype.append = function(name, value) {
958
+ name = normalizeName(name);
959
+ value = normalizeValue(value);
960
+ var oldValue = this.map[name];
961
+ this.map[name] = oldValue ? oldValue + ', ' + value : value;
962
+ };
963
+
964
+ Headers.prototype['delete'] = function(name) {
965
+ delete this.map[normalizeName(name)];
966
+ };
967
+
968
+ Headers.prototype.get = function(name) {
969
+ name = normalizeName(name);
970
+ return this.has(name) ? this.map[name] : null
971
+ };
972
+
973
+ Headers.prototype.has = function(name) {
974
+ return this.map.hasOwnProperty(normalizeName(name))
975
+ };
976
+
977
+ Headers.prototype.set = function(name, value) {
978
+ this.map[normalizeName(name)] = normalizeValue(value);
979
+ };
980
+
981
+ Headers.prototype.forEach = function(callback, thisArg) {
982
+ for (var name in this.map) {
983
+ if (this.map.hasOwnProperty(name)) {
984
+ callback.call(thisArg, this.map[name], name, this);
985
+ }
986
+ }
987
+ };
988
+
989
+ Headers.prototype.keys = function() {
990
+ var items = [];
991
+ this.forEach(function(value, name) {
992
+ items.push(name);
993
+ });
994
+ return iteratorFor(items)
995
+ };
996
+
997
+ Headers.prototype.values = function() {
998
+ var items = [];
999
+ this.forEach(function(value) {
1000
+ items.push(value);
1001
+ });
1002
+ return iteratorFor(items)
1003
+ };
1004
+
1005
+ Headers.prototype.entries = function() {
1006
+ var items = [];
1007
+ this.forEach(function(value, name) {
1008
+ items.push([name, value]);
1009
+ });
1010
+ return iteratorFor(items)
1011
+ };
1012
+
1013
+ if (support.iterable) {
1014
+ Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
1015
+ }
1016
+
1017
+ function consumed(body) {
1018
+ if (body.bodyUsed) {
1019
+ return Promise.reject(new TypeError('Already read'))
1020
+ }
1021
+ body.bodyUsed = true;
1022
+ }
1023
+
1024
+ function fileReaderReady(reader) {
1025
+ return new Promise(function(resolve, reject) {
1026
+ reader.onload = function() {
1027
+ resolve(reader.result);
1028
+ };
1029
+ reader.onerror = function() {
1030
+ reject(reader.error);
1031
+ };
1032
+ })
1033
+ }
1034
+
1035
+ function readBlobAsArrayBuffer(blob) {
1036
+ var reader = new FileReader();
1037
+ var promise = fileReaderReady(reader);
1038
+ reader.readAsArrayBuffer(blob);
1039
+ return promise
1040
+ }
1041
+
1042
+ function readBlobAsText(blob) {
1043
+ var reader = new FileReader();
1044
+ var promise = fileReaderReady(reader);
1045
+ reader.readAsText(blob);
1046
+ return promise
1047
+ }
1048
+
1049
+ function readArrayBufferAsText(buf) {
1050
+ var view = new Uint8Array(buf);
1051
+ var chars = new Array(view.length);
1052
+
1053
+ for (var i = 0; i < view.length; i++) {
1054
+ chars[i] = String.fromCharCode(view[i]);
1055
+ }
1056
+ return chars.join('')
1057
+ }
1058
+
1059
+ function bufferClone(buf) {
1060
+ if (buf.slice) {
1061
+ return buf.slice(0)
1062
+ } else {
1063
+ var view = new Uint8Array(buf.byteLength);
1064
+ view.set(new Uint8Array(buf));
1065
+ return view.buffer
1066
+ }
1067
+ }
1068
+
1069
+ function Body() {
1070
+ this.bodyUsed = false;
1071
+
1072
+ this._initBody = function(body) {
1073
+ /*
1074
+ fetch-mock wraps the Response object in an ES6 Proxy to
1075
+ provide useful test harness features such as flush. However, on
1076
+ ES5 browsers without fetch or Proxy support pollyfills must be used;
1077
+ the proxy-pollyfill is unable to proxy an attribute unless it exists
1078
+ on the object before the Proxy is created. This change ensures
1079
+ Response.bodyUsed exists on the instance, while maintaining the
1080
+ semantic of setting Request.bodyUsed in the constructor before
1081
+ _initBody is called.
1082
+ */
1083
+ this.bodyUsed = this.bodyUsed;
1084
+ this._bodyInit = body;
1085
+ if (!body) {
1086
+ this._bodyText = '';
1087
+ } else if (typeof body === 'string') {
1088
+ this._bodyText = body;
1089
+ } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
1090
+ this._bodyBlob = body;
1091
+ } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
1092
+ this._bodyFormData = body;
1093
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
1094
+ this._bodyText = body.toString();
1095
+ } else if (support.arrayBuffer && support.blob && isDataView(body)) {
1096
+ this._bodyArrayBuffer = bufferClone(body.buffer);
1097
+ // IE 10-11 can't handle a DataView body.
1098
+ this._bodyInit = new Blob([this._bodyArrayBuffer]);
1099
+ } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
1100
+ this._bodyArrayBuffer = bufferClone(body);
1101
+ } else {
1102
+ this._bodyText = body = Object.prototype.toString.call(body);
1103
+ }
1104
+
1105
+ if (!this.headers.get('content-type')) {
1106
+ if (typeof body === 'string') {
1107
+ this.headers.set('content-type', 'text/plain;charset=UTF-8');
1108
+ } else if (this._bodyBlob && this._bodyBlob.type) {
1109
+ this.headers.set('content-type', this._bodyBlob.type);
1110
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
1111
+ this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
1112
+ }
1113
+ }
1114
+ };
1115
+
1116
+ if (support.blob) {
1117
+ this.blob = function() {
1118
+ var rejected = consumed(this);
1119
+ if (rejected) {
1120
+ return rejected
1121
+ }
1122
+
1123
+ if (this._bodyBlob) {
1124
+ return Promise.resolve(this._bodyBlob)
1125
+ } else if (this._bodyArrayBuffer) {
1126
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]))
1127
+ } else if (this._bodyFormData) {
1128
+ throw new Error('could not read FormData body as blob')
1129
+ } else {
1130
+ return Promise.resolve(new Blob([this._bodyText]))
1131
+ }
1132
+ };
1133
+
1134
+ this.arrayBuffer = function() {
1135
+ if (this._bodyArrayBuffer) {
1136
+ var isConsumed = consumed(this);
1137
+ if (isConsumed) {
1138
+ return isConsumed
1139
+ }
1140
+ if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
1141
+ return Promise.resolve(
1142
+ this._bodyArrayBuffer.buffer.slice(
1143
+ this._bodyArrayBuffer.byteOffset,
1144
+ this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
1145
+ )
1146
+ )
1147
+ } else {
1148
+ return Promise.resolve(this._bodyArrayBuffer)
1149
+ }
1150
+ } else {
1151
+ return this.blob().then(readBlobAsArrayBuffer)
1152
+ }
1153
+ };
1154
+ }
1155
+
1156
+ this.text = function() {
1157
+ var rejected = consumed(this);
1158
+ if (rejected) {
1159
+ return rejected
1160
+ }
1161
+
1162
+ if (this._bodyBlob) {
1163
+ return readBlobAsText(this._bodyBlob)
1164
+ } else if (this._bodyArrayBuffer) {
1165
+ return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
1166
+ } else if (this._bodyFormData) {
1167
+ throw new Error('could not read FormData body as text')
1168
+ } else {
1169
+ return Promise.resolve(this._bodyText)
1170
+ }
1171
+ };
1172
+
1173
+ if (support.formData) {
1174
+ this.formData = function() {
1175
+ return this.text().then(decode)
1176
+ };
1177
+ }
1178
+
1179
+ this.json = function() {
1180
+ return this.text().then(JSON.parse)
1181
+ };
1182
+
1183
+ return this
1184
+ }
1185
+
1186
+ // HTTP methods whose capitalization should be normalized
1187
+ var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
1188
+
1189
+ function normalizeMethod(method) {
1190
+ var upcased = method.toUpperCase();
1191
+ return methods.indexOf(upcased) > -1 ? upcased : method
1192
+ }
1193
+
1194
+ function Request(input, options) {
1195
+ if (!(this instanceof Request)) {
1196
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
1197
+ }
1198
+
1199
+ options = options || {};
1200
+ var body = options.body;
1201
+
1202
+ if (input instanceof Request) {
1203
+ if (input.bodyUsed) {
1204
+ throw new TypeError('Already read')
1205
+ }
1206
+ this.url = input.url;
1207
+ this.credentials = input.credentials;
1208
+ if (!options.headers) {
1209
+ this.headers = new Headers(input.headers);
1210
+ }
1211
+ this.method = input.method;
1212
+ this.mode = input.mode;
1213
+ this.signal = input.signal;
1214
+ if (!body && input._bodyInit != null) {
1215
+ body = input._bodyInit;
1216
+ input.bodyUsed = true;
1217
+ }
1218
+ } else {
1219
+ this.url = String(input);
1220
+ }
1221
+
1222
+ this.credentials = options.credentials || this.credentials || 'same-origin';
1223
+ if (options.headers || !this.headers) {
1224
+ this.headers = new Headers(options.headers);
1225
+ }
1226
+ this.method = normalizeMethod(options.method || this.method || 'GET');
1227
+ this.mode = options.mode || this.mode || null;
1228
+ this.signal = options.signal || this.signal;
1229
+ this.referrer = null;
1230
+
1231
+ if ((this.method === 'GET' || this.method === 'HEAD') && body) {
1232
+ throw new TypeError('Body not allowed for GET or HEAD requests')
1233
+ }
1234
+ this._initBody(body);
1235
+
1236
+ if (this.method === 'GET' || this.method === 'HEAD') {
1237
+ if (options.cache === 'no-store' || options.cache === 'no-cache') {
1238
+ // Search for a '_' parameter in the query string
1239
+ var reParamSearch = /([?&])_=[^&]*/;
1240
+ if (reParamSearch.test(this.url)) {
1241
+ // If it already exists then set the value with the current time
1242
+ this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
1243
+ } else {
1244
+ // Otherwise add a new '_' parameter to the end with the current time
1245
+ var reQueryString = /\?/;
1246
+ this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
1247
+ }
1248
+ }
1249
+ }
1250
+ }
1251
+
1252
+ Request.prototype.clone = function() {
1253
+ return new Request(this, {body: this._bodyInit})
1254
+ };
1255
+
1256
+ function decode(body) {
1257
+ var form = new FormData();
1258
+ body
1259
+ .trim()
1260
+ .split('&')
1261
+ .forEach(function(bytes) {
1262
+ if (bytes) {
1263
+ var split = bytes.split('=');
1264
+ var name = split.shift().replace(/\+/g, ' ');
1265
+ var value = split.join('=').replace(/\+/g, ' ');
1266
+ form.append(decodeURIComponent(name), decodeURIComponent(value));
1267
+ }
1268
+ });
1269
+ return form
1270
+ }
1271
+
1272
+ function parseHeaders(rawHeaders) {
1273
+ var headers = new Headers();
1274
+ // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
1275
+ // https://tools.ietf.org/html/rfc7230#section-3.2
1276
+ var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
1277
+ // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
1278
+ // https://github.com/github/fetch/issues/748
1279
+ // https://github.com/zloirock/core-js/issues/751
1280
+ preProcessedHeaders
1281
+ .split('\r')
1282
+ .map(function(header) {
1283
+ return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
1284
+ })
1285
+ .forEach(function(line) {
1286
+ var parts = line.split(':');
1287
+ var key = parts.shift().trim();
1288
+ if (key) {
1289
+ var value = parts.join(':').trim();
1290
+ headers.append(key, value);
1291
+ }
1292
+ });
1293
+ return headers
1294
+ }
1295
+
1296
+ Body.call(Request.prototype);
1297
+
1298
+ function Response(bodyInit, options) {
1299
+ if (!(this instanceof Response)) {
1300
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
1301
+ }
1302
+ if (!options) {
1303
+ options = {};
1304
+ }
1305
+
1306
+ this.type = 'default';
1307
+ this.status = options.status === undefined ? 200 : options.status;
1308
+ this.ok = this.status >= 200 && this.status < 300;
1309
+ this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
1310
+ this.headers = new Headers(options.headers);
1311
+ this.url = options.url || '';
1312
+ this._initBody(bodyInit);
1313
+ }
1314
+
1315
+ Body.call(Response.prototype);
1316
+
1317
+ Response.prototype.clone = function() {
1318
+ return new Response(this._bodyInit, {
1319
+ status: this.status,
1320
+ statusText: this.statusText,
1321
+ headers: new Headers(this.headers),
1322
+ url: this.url
1323
+ })
1324
+ };
1325
+
1326
+ Response.error = function() {
1327
+ var response = new Response(null, {status: 0, statusText: ''});
1328
+ response.type = 'error';
1329
+ return response
1330
+ };
1331
+
1332
+ var redirectStatuses = [301, 302, 303, 307, 308];
1333
+
1334
+ Response.redirect = function(url, status) {
1335
+ if (redirectStatuses.indexOf(status) === -1) {
1336
+ throw new RangeError('Invalid status code')
1337
+ }
1338
+
1339
+ return new Response(null, {status: status, headers: {location: url}})
1340
+ };
1341
+
1342
+ var DOMException = global.DOMException;
1343
+ try {
1344
+ new DOMException();
1345
+ } catch (err) {
1346
+ DOMException = function(message, name) {
1347
+ this.message = message;
1348
+ this.name = name;
1349
+ var error = Error(message);
1350
+ this.stack = error.stack;
1351
+ };
1352
+ DOMException.prototype = Object.create(Error.prototype);
1353
+ DOMException.prototype.constructor = DOMException;
1354
+ }
1355
+
1356
+ function fetch$1(input, init) {
1357
+ return new Promise(function(resolve, reject) {
1358
+ var request = new Request(input, init);
1359
+
1360
+ if (request.signal && request.signal.aborted) {
1361
+ return reject(new DOMException('Aborted', 'AbortError'))
1362
+ }
1363
+
1364
+ var xhr = new XMLHttpRequest();
1365
+
1366
+ function abortXhr() {
1367
+ xhr.abort();
1368
+ }
1369
+
1370
+ xhr.onload = function() {
1371
+ var options = {
1372
+ status: xhr.status,
1373
+ statusText: xhr.statusText,
1374
+ headers: parseHeaders(xhr.getAllResponseHeaders() || '')
1375
+ };
1376
+ options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
1377
+ var body = 'response' in xhr ? xhr.response : xhr.responseText;
1378
+ setTimeout(function() {
1379
+ resolve(new Response(body, options));
1380
+ }, 0);
1381
+ };
1382
+
1383
+ xhr.onerror = function() {
1384
+ setTimeout(function() {
1385
+ reject(new TypeError('Network request failed'));
1386
+ }, 0);
1387
+ };
1388
+
1389
+ xhr.ontimeout = function() {
1390
+ setTimeout(function() {
1391
+ reject(new TypeError('Network request failed'));
1392
+ }, 0);
1393
+ };
1394
+
1395
+ xhr.onabort = function() {
1396
+ setTimeout(function() {
1397
+ reject(new DOMException('Aborted', 'AbortError'));
1398
+ }, 0);
1399
+ };
1400
+
1401
+ function fixUrl(url) {
1402
+ try {
1403
+ return url === '' && global.location.href ? global.location.href : url
1404
+ } catch (e) {
1405
+ return url
1406
+ }
1407
+ }
1408
+
1409
+ xhr.open(request.method, fixUrl(request.url), true);
1410
+
1411
+ if (request.credentials === 'include') {
1412
+ xhr.withCredentials = true;
1413
+ } else if (request.credentials === 'omit') {
1414
+ xhr.withCredentials = false;
1415
+ }
1416
+
1417
+ if ('responseType' in xhr) {
1418
+ if (support.blob) {
1419
+ xhr.responseType = 'blob';
1420
+ } else if (
1421
+ support.arrayBuffer &&
1422
+ request.headers.get('Content-Type') &&
1423
+ request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1
1424
+ ) {
1425
+ xhr.responseType = 'arraybuffer';
1426
+ }
1427
+ }
1428
+
1429
+ if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {
1430
+ Object.getOwnPropertyNames(init.headers).forEach(function(name) {
1431
+ xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
1432
+ });
1433
+ } else {
1434
+ request.headers.forEach(function(value, name) {
1435
+ xhr.setRequestHeader(name, value);
1436
+ });
1437
+ }
1438
+
1439
+ if (request.signal) {
1440
+ request.signal.addEventListener('abort', abortXhr);
1441
+
1442
+ xhr.onreadystatechange = function() {
1443
+ // DONE (success or failure)
1444
+ if (xhr.readyState === 4) {
1445
+ request.signal.removeEventListener('abort', abortXhr);
1446
+ }
1447
+ };
1448
+ }
1449
+
1450
+ xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
1451
+ })
1452
+ }
1453
+
1454
+ fetch$1.polyfill = true;
1455
+
1456
+ if (!global.fetch) {
1457
+ global.fetch = fetch$1;
1458
+ global.Headers = Headers;
1459
+ global.Request = Request;
1460
+ global.Response = Response;
1461
+ }
1462
+
1463
+ var isomorphicFetch = createCommonjsModule(function (module, exports) {
1464
+ Object.defineProperty(exports, "__esModule", { value: true });
1465
+ exports.IsomorphicFetchHttpLibrary = void 0;
1466
+
1467
+
1468
+
1469
+ var IsomorphicFetchHttpLibrary = (function () {
1470
+ function IsomorphicFetchHttpLibrary() {
1471
+ }
1472
+ IsomorphicFetchHttpLibrary.prototype.send = function (request) {
1473
+ var method = request.getHttpMethod().toString();
1474
+ var body = request.getBody();
1475
+ var resultPromise = fetch(request.getUrl(), {
1476
+ method: method,
1477
+ body: body,
1478
+ headers: request.getHeaders(),
1479
+ credentials: "same-origin"
1480
+ }).then(function (resp) {
1481
+ var headers = {};
1482
+ resp.headers.forEach(function (value, name) {
1483
+ headers[name] = value;
1484
+ });
1485
+ var body = {
1486
+ text: function () { return resp.text(); },
1487
+ binary: function () { return resp.blob(); }
1488
+ };
1489
+ return new http.ResponseContext(resp.status, headers, body);
1490
+ });
1491
+ return (0, rxjsStub.from)(resultPromise);
1492
+ };
1493
+ return IsomorphicFetchHttpLibrary;
1494
+ }());
1495
+ exports.IsomorphicFetchHttpLibrary = IsomorphicFetchHttpLibrary;
1496
+ //# sourceMappingURL=isomorphic-fetch.js.map
1497
+ });
1498
+
1499
+ var http = createCommonjsModule(function (module, exports) {
1500
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
1501
+ var extendStatics = function (d, b) {
1502
+ extendStatics = Object.setPrototypeOf ||
1503
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1504
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
1505
+ return extendStatics(d, b);
1506
+ };
1507
+ return function (d, b) {
1508
+ if (typeof b !== "function" && b !== null)
1509
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1510
+ extendStatics(d, b);
1511
+ function __() { this.constructor = d; }
1512
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1513
+ };
1514
+ })();
1515
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1516
+ if (k2 === undefined) k2 = k;
1517
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1518
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1519
+ desc = { enumerable: true, get: function() { return m[k]; } };
1520
+ }
1521
+ Object.defineProperty(o, k2, desc);
1522
+ }) : (function(o, m, k, k2) {
1523
+ if (k2 === undefined) k2 = k;
1524
+ o[k2] = m[k];
1525
+ }));
1526
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
1527
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1528
+ };
1529
+ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
1530
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1531
+ return new (P || (P = Promise))(function (resolve, reject) {
1532
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1533
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1534
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1535
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1536
+ });
1537
+ };
1538
+ var __generator = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
1539
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1540
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1541
+ function verb(n) { return function (v) { return step([n, v]); }; }
1542
+ function step(op) {
1543
+ if (f) throw new TypeError("Generator is already executing.");
1544
+ while (_) try {
1545
+ 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;
1546
+ if (y = 0, t) op = [op[0] & 2, t.value];
1547
+ switch (op[0]) {
1548
+ case 0: case 1: t = op; break;
1549
+ case 4: _.label++; return { value: op[1], done: false };
1550
+ case 5: _.label++; y = op[1]; op = [0]; continue;
1551
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
1552
+ default:
1553
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1554
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1555
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1556
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1557
+ if (t[2]) _.ops.pop();
1558
+ _.trys.pop(); continue;
1559
+ }
1560
+ op = body.call(thisArg, _);
1561
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1562
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1563
+ }
1564
+ };
1565
+ Object.defineProperty(exports, "__esModule", { value: true });
1566
+ exports.wrapHttpLibrary = exports.ResponseContext = exports.SelfDecodingBody = exports.RequestContext = exports.HttpException = exports.HttpMethod = void 0;
1567
+
1568
+
1569
+ __exportStar(isomorphicFetch, exports);
1570
+ (function (HttpMethod) {
1571
+ HttpMethod["GET"] = "GET";
1572
+ HttpMethod["HEAD"] = "HEAD";
1573
+ HttpMethod["POST"] = "POST";
1574
+ HttpMethod["PUT"] = "PUT";
1575
+ HttpMethod["DELETE"] = "DELETE";
1576
+ HttpMethod["CONNECT"] = "CONNECT";
1577
+ HttpMethod["OPTIONS"] = "OPTIONS";
1578
+ HttpMethod["TRACE"] = "TRACE";
1579
+ HttpMethod["PATCH"] = "PATCH";
1580
+ })(exports.HttpMethod || (exports.HttpMethod = {}));
1581
+ var HttpException = (function (_super) {
1582
+ __extends(HttpException, _super);
1583
+ function HttpException(msg) {
1584
+ return _super.call(this, msg) || this;
1585
+ }
1586
+ return HttpException;
1587
+ }(Error));
1588
+ exports.HttpException = HttpException;
1589
+ var RequestContext = (function () {
1590
+ function RequestContext(url, httpMethod) {
1591
+ this.httpMethod = httpMethod;
1592
+ this.headers = {};
1593
+ this.body = undefined;
1594
+ this.url = new urlParse(url, true);
1595
+ }
1596
+ RequestContext.prototype.getUrl = function () {
1597
+ return this.url.toString();
1598
+ };
1599
+ RequestContext.prototype.setUrl = function (url) {
1600
+ this.url = new urlParse(url, true);
1601
+ };
1602
+ RequestContext.prototype.setBody = function (body) {
1603
+ this.body = body;
1604
+ };
1605
+ RequestContext.prototype.getHttpMethod = function () {
1606
+ return this.httpMethod;
1607
+ };
1608
+ RequestContext.prototype.getHeaders = function () {
1609
+ return this.headers;
1610
+ };
1611
+ RequestContext.prototype.getBody = function () {
1612
+ return this.body;
1613
+ };
1614
+ RequestContext.prototype.setQueryParam = function (name, value) {
1615
+ var queryObj = this.url.query;
1616
+ queryObj[name] = value;
1617
+ this.url.set("query", queryObj);
1618
+ };
1619
+ RequestContext.prototype.addCookie = function (name, value) {
1620
+ if (!this.headers["Cookie"]) {
1621
+ this.headers["Cookie"] = "";
1622
+ }
1623
+ this.headers["Cookie"] += name + "=" + value + "; ";
1624
+ };
1625
+ RequestContext.prototype.setHeaderParam = function (key, value) {
1626
+ this.headers[key] = value;
1627
+ };
1628
+ return RequestContext;
1629
+ }());
1630
+ exports.RequestContext = RequestContext;
1631
+ var SelfDecodingBody = (function () {
1632
+ function SelfDecodingBody(dataSource) {
1633
+ this.dataSource = dataSource;
1634
+ }
1635
+ SelfDecodingBody.prototype.binary = function () {
1636
+ return this.dataSource;
1637
+ };
1638
+ SelfDecodingBody.prototype.text = function () {
1639
+ return __awaiter(this, void 0, void 0, function () {
1640
+ var data;
1641
+ return __generator(this, function (_a) {
1642
+ switch (_a.label) {
1643
+ case 0: return [4, this.dataSource];
1644
+ case 1:
1645
+ data = _a.sent();
1646
+ if (data.text) {
1647
+ return [2, data.text()];
1648
+ }
1649
+ return [2, new Promise(function (resolve, reject) {
1650
+ var reader = new FileReader();
1651
+ reader.addEventListener("load", function () { return resolve(reader.result); });
1652
+ reader.addEventListener("error", function () { return reject(reader.error); });
1653
+ reader.readAsText(data);
1654
+ })];
1655
+ }
1656
+ });
1657
+ });
1658
+ };
1659
+ return SelfDecodingBody;
1660
+ }());
1661
+ exports.SelfDecodingBody = SelfDecodingBody;
1662
+ var ResponseContext = (function () {
1663
+ function ResponseContext(httpStatusCode, headers, body) {
1664
+ this.httpStatusCode = httpStatusCode;
1665
+ this.headers = headers;
1666
+ this.body = body;
1667
+ }
1668
+ ResponseContext.prototype.getParsedHeader = function (headerName) {
1669
+ var result = {};
1670
+ if (!this.headers[headerName]) {
1671
+ return result;
1672
+ }
1673
+ var parameters = this.headers[headerName].split(";");
1674
+ for (var _i = 0, parameters_1 = parameters; _i < parameters_1.length; _i++) {
1675
+ var parameter = parameters_1[_i];
1676
+ var _a = parameter.split("=", 2), key = _a[0], value = _a[1];
1677
+ key = key.toLowerCase().trim();
1678
+ if (value === undefined) {
1679
+ result[""] = key;
1680
+ }
1681
+ else {
1682
+ value = value.trim();
1683
+ if (value.startsWith('"') && value.endsWith('"')) {
1684
+ value = value.substring(1, value.length - 1);
1685
+ }
1686
+ result[key] = value;
1687
+ }
1688
+ }
1689
+ return result;
1690
+ };
1691
+ ResponseContext.prototype.getBodyAsFile = function () {
1692
+ return __awaiter(this, void 0, void 0, function () {
1693
+ var data, fileName, contentType;
1694
+ return __generator(this, function (_a) {
1695
+ switch (_a.label) {
1696
+ case 0: return [4, this.body.binary()];
1697
+ case 1:
1698
+ data = _a.sent();
1699
+ fileName = this.getParsedHeader("content-disposition")["filename"] || "";
1700
+ contentType = this.headers["content-type"] || "";
1701
+ try {
1702
+ return [2, new File([data], fileName, { type: contentType })];
1703
+ }
1704
+ catch (error) {
1705
+ return [2, Object.assign(data, {
1706
+ name: fileName,
1707
+ type: contentType
1708
+ })];
1709
+ }
1710
+ return [2];
1711
+ }
1712
+ });
1713
+ });
1714
+ };
1715
+ ResponseContext.prototype.getBodyAsAny = function () {
1716
+ try {
1717
+ return this.body.text();
1718
+ }
1719
+ catch (_a) { }
1720
+ try {
1721
+ return this.body.binary();
1722
+ }
1723
+ catch (_b) { }
1724
+ return Promise.resolve(undefined);
1725
+ };
1726
+ return ResponseContext;
1727
+ }());
1728
+ exports.ResponseContext = ResponseContext;
1729
+ function wrapHttpLibrary(promiseHttpLibrary) {
1730
+ return {
1731
+ send: function (request) {
1732
+ return (0, rxjsStub.from)(promiseHttpLibrary.send(request));
1733
+ }
1734
+ };
1735
+ }
1736
+ exports.wrapHttpLibrary = wrapHttpLibrary;
1737
+ //# sourceMappingURL=http.js.map
1738
+ });
1739
+
1740
+ var auth = createCommonjsModule(function (module, exports) {
1741
+ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
1742
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1743
+ return new (P || (P = Promise))(function (resolve, reject) {
1744
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1745
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1746
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1747
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1748
+ });
1749
+ };
1750
+ var __generator = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
1751
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1752
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1753
+ function verb(n) { return function (v) { return step([n, v]); }; }
1754
+ function step(op) {
1755
+ if (f) throw new TypeError("Generator is already executing.");
1756
+ while (_) try {
1757
+ 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;
1758
+ if (y = 0, t) op = [op[0] & 2, t.value];
1759
+ switch (op[0]) {
1760
+ case 0: case 1: t = op; break;
1761
+ case 4: _.label++; return { value: op[1], done: false };
1762
+ case 5: _.label++; y = op[1]; op = [0]; continue;
1763
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
1764
+ default:
1765
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1766
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1767
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1768
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1769
+ if (t[2]) _.ops.pop();
1770
+ _.trys.pop(); continue;
1771
+ }
1772
+ op = body.call(thisArg, _);
1773
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1774
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1775
+ }
1776
+ };
1777
+ Object.defineProperty(exports, "__esModule", { value: true });
1778
+ exports.configureAuthMethods = exports.BearerAuthAuthentication = void 0;
1779
+ var BearerAuthAuthentication = (function () {
1780
+ function BearerAuthAuthentication(tokenProvider) {
1781
+ this.tokenProvider = tokenProvider;
1782
+ }
1783
+ BearerAuthAuthentication.prototype.getName = function () {
1784
+ return "bearerAuth";
1785
+ };
1786
+ BearerAuthAuthentication.prototype.applySecurityAuthentication = function (context) {
1787
+ return __awaiter(this, void 0, void 0, function () {
1788
+ var _a, _b, _c, _d;
1789
+ return __generator(this, function (_e) {
1790
+ switch (_e.label) {
1791
+ case 0:
1792
+ _b = (_a = context).setHeaderParam;
1793
+ _c = ["Authorization"];
1794
+ _d = "Bearer ";
1795
+ return [4, this.tokenProvider.getToken()];
1796
+ case 1:
1797
+ _b.apply(_a, _c.concat([_d + (_e.sent())]));
1798
+ return [2];
1799
+ }
1800
+ });
1801
+ });
1802
+ };
1803
+ return BearerAuthAuthentication;
1804
+ }());
1805
+ exports.BearerAuthAuthentication = BearerAuthAuthentication;
1806
+ function configureAuthMethods(config) {
1807
+ var authMethods = {};
1808
+ if (!config) {
1809
+ return authMethods;
1810
+ }
1811
+ authMethods["default"] = config["default"];
1812
+ if (config["bearerAuth"]) {
1813
+ authMethods["bearerAuth"] = new BearerAuthAuthentication(config["bearerAuth"]["tokenProvider"]);
1814
+ }
1815
+ return authMethods;
1816
+ }
1817
+ exports.configureAuthMethods = configureAuthMethods;
1818
+ //# sourceMappingURL=auth.js.map
1819
+ });
1820
+
1821
+ var ErrorObject_1 = createCommonjsModule(function (module, exports) {
1822
+ Object.defineProperty(exports, "__esModule", { value: true });
1823
+ exports.ErrorObject = void 0;
1824
+ var ErrorObject = (function () {
1825
+ function ErrorObject() {
1826
+ }
1827
+ ErrorObject.getAttributeTypeMap = function () {
1828
+ return ErrorObject.attributeTypeMap;
1829
+ };
1830
+ ErrorObject.discriminator = undefined;
1831
+ ErrorObject.attributeTypeMap = [
1832
+ {
1833
+ "name": "domain",
1834
+ "baseName": "domain",
1835
+ "type": "string",
1836
+ "format": ""
1837
+ },
1838
+ {
1839
+ "name": "reason",
1840
+ "baseName": "reason",
1841
+ "type": "string",
1842
+ "format": ""
1843
+ },
1844
+ {
1845
+ "name": "message",
1846
+ "baseName": "message",
1847
+ "type": "string",
1848
+ "format": ""
1849
+ },
1850
+ {
1851
+ "name": "location",
1852
+ "baseName": "location",
1853
+ "type": "string",
1854
+ "format": ""
1855
+ },
1856
+ {
1857
+ "name": "location_type",
1858
+ "baseName": "location_type",
1859
+ "type": "string",
1860
+ "format": ""
1861
+ },
1862
+ {
1863
+ "name": "extended_help",
1864
+ "baseName": "extended_help",
1865
+ "type": "string",
1866
+ "format": ""
1867
+ },
1868
+ {
1869
+ "name": "send_report",
1870
+ "baseName": "send_report",
1871
+ "type": "string",
1872
+ "format": ""
1873
+ }
1874
+ ];
1875
+ return ErrorObject;
1876
+ }());
1877
+ exports.ErrorObject = ErrorObject;
1878
+ //# sourceMappingURL=ErrorObject.js.map
1879
+ });
1880
+
1881
+ var ErrorResponse_1 = createCommonjsModule(function (module, exports) {
1882
+ Object.defineProperty(exports, "__esModule", { value: true });
1883
+ exports.ErrorResponse = void 0;
1884
+ var ErrorResponse = (function () {
1885
+ function ErrorResponse() {
1886
+ }
1887
+ ErrorResponse.getAttributeTypeMap = function () {
1888
+ return ErrorResponse.attributeTypeMap;
1889
+ };
1890
+ ErrorResponse.discriminator = undefined;
1891
+ ErrorResponse.attributeTypeMap = [
1892
+ {
1893
+ "name": "code",
1894
+ "baseName": "code",
1895
+ "type": "number",
1896
+ "format": ""
1897
+ },
1898
+ {
1899
+ "name": "message",
1900
+ "baseName": "message",
1901
+ "type": "string",
1902
+ "format": ""
1903
+ },
1904
+ {
1905
+ "name": "errors",
1906
+ "baseName": "errors",
1907
+ "type": "Array<ErrorObject>",
1908
+ "format": ""
1909
+ }
1910
+ ];
1911
+ return ErrorResponse;
1912
+ }());
1913
+ exports.ErrorResponse = ErrorResponse;
1914
+ //# sourceMappingURL=ErrorResponse.js.map
1915
+ });
1916
+
1917
+ var Event_1 = createCommonjsModule(function (module, exports) {
1918
+ Object.defineProperty(exports, "__esModule", { value: true });
1919
+ exports.Event = void 0;
1920
+ var Event = (function () {
1921
+ function Event() {
1922
+ this.typ = "Event";
1923
+ }
1924
+ Event.getAttributeTypeMap = function () {
1925
+ return Event.attributeTypeMap;
1926
+ };
1927
+ Event.discriminator = "typ";
1928
+ Event.attributeTypeMap = [
1929
+ {
1930
+ "name": "session_id",
1931
+ "baseName": "session_id",
1932
+ "type": "string",
1933
+ "format": ""
1934
+ },
1935
+ {
1936
+ "name": "typ",
1937
+ "baseName": "typ",
1938
+ "type": "string",
1939
+ "format": ""
1940
+ }
1941
+ ];
1942
+ return Event;
1943
+ }());
1944
+ exports.Event = Event;
1945
+ //# sourceMappingURL=Event.js.map
1946
+ });
1947
+
1948
+ var EventConfirmation_1 = createCommonjsModule(function (module, exports) {
1949
+ Object.defineProperty(exports, "__esModule", { value: true });
1950
+ exports.EventConfirmation = void 0;
1951
+ var EventConfirmation = (function () {
1952
+ function EventConfirmation() {
1953
+ }
1954
+ EventConfirmation.getAttributeTypeMap = function () {
1955
+ return EventConfirmation.attributeTypeMap;
1956
+ };
1957
+ EventConfirmation.discriminator = undefined;
1958
+ EventConfirmation.attributeTypeMap = [
1959
+ {
1960
+ "name": "status",
1961
+ "baseName": "status",
1962
+ "type": "EventConfirmationStatusEnum",
1963
+ "format": ""
1964
+ }
1965
+ ];
1966
+ return EventConfirmation;
1967
+ }());
1968
+ exports.EventConfirmation = EventConfirmation;
1969
+ //# sourceMappingURL=EventConfirmation.js.map
1970
+ });
1971
+
1972
+ var FilterAction = createCommonjsModule(function (module, exports) {
1973
+ Object.defineProperty(exports, "__esModule", { value: true });
1974
+ //# sourceMappingURL=FilterAction.js.map
1975
+ });
1976
+
1977
+ var FilterEvent_1 = createCommonjsModule(function (module, exports) {
1978
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
1979
+ var extendStatics = function (d, b) {
1980
+ extendStatics = Object.setPrototypeOf ||
1981
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1982
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
1983
+ return extendStatics(d, b);
1984
+ };
1985
+ return function (d, b) {
1986
+ if (typeof b !== "function" && b !== null)
1987
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1988
+ extendStatics(d, b);
1989
+ function __() { this.constructor = d; }
1990
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1991
+ };
1992
+ })();
1993
+ Object.defineProperty(exports, "__esModule", { value: true });
1994
+ exports.FilterEvent = void 0;
1995
+
1996
+ var FilterEvent = (function (_super) {
1997
+ __extends(FilterEvent, _super);
1998
+ function FilterEvent() {
1999
+ var _this = _super.call(this) || this;
2000
+ _this.typ = "FilterEvent";
2001
+ return _this;
2002
+ }
2003
+ FilterEvent.getAttributeTypeMap = function () {
2004
+ return _super.getAttributeTypeMap.call(this).concat(FilterEvent.attributeTypeMap);
2005
+ };
2006
+ FilterEvent.discriminator = undefined;
2007
+ FilterEvent.attributeTypeMap = [
2008
+ {
2009
+ "name": "widget",
2010
+ "baseName": "widget",
2011
+ "type": "Widget",
2012
+ "format": ""
2013
+ },
2014
+ {
2015
+ "name": "action",
2016
+ "baseName": "action",
2017
+ "type": "FilterAction",
2018
+ "format": ""
2019
+ },
2020
+ {
2021
+ "name": "kind",
2022
+ "baseName": "kind",
2023
+ "type": "FilterKind",
2024
+ "format": ""
2025
+ }
2026
+ ];
2027
+ return FilterEvent;
2028
+ }(Event_1.Event));
2029
+ exports.FilterEvent = FilterEvent;
2030
+ //# sourceMappingURL=FilterEvent.js.map
2031
+ });
2032
+
2033
+ var FilterEventAllOf_1 = createCommonjsModule(function (module, exports) {
2034
+ Object.defineProperty(exports, "__esModule", { value: true });
2035
+ exports.FilterEventAllOf = void 0;
2036
+ var FilterEventAllOf = (function () {
2037
+ function FilterEventAllOf() {
2038
+ }
2039
+ FilterEventAllOf.getAttributeTypeMap = function () {
2040
+ return FilterEventAllOf.attributeTypeMap;
2041
+ };
2042
+ FilterEventAllOf.discriminator = undefined;
2043
+ FilterEventAllOf.attributeTypeMap = [
2044
+ {
2045
+ "name": "widget",
2046
+ "baseName": "widget",
2047
+ "type": "Widget",
2048
+ "format": ""
2049
+ },
2050
+ {
2051
+ "name": "action",
2052
+ "baseName": "action",
2053
+ "type": "FilterAction",
2054
+ "format": ""
2055
+ },
2056
+ {
2057
+ "name": "kind",
2058
+ "baseName": "kind",
2059
+ "type": "FilterKind",
2060
+ "format": ""
2061
+ }
2062
+ ];
2063
+ return FilterEventAllOf;
2064
+ }());
2065
+ exports.FilterEventAllOf = FilterEventAllOf;
2066
+ //# sourceMappingURL=FilterEventAllOf.js.map
2067
+ });
2068
+
2069
+ var FilterKind = createCommonjsModule(function (module, exports) {
2070
+ Object.defineProperty(exports, "__esModule", { value: true });
2071
+ //# sourceMappingURL=FilterKind.js.map
2072
+ });
2073
+
2074
+ var ProductClickEvent_1 = createCommonjsModule(function (module, exports) {
2075
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
2076
+ var extendStatics = function (d, b) {
2077
+ extendStatics = Object.setPrototypeOf ||
2078
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2079
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2080
+ return extendStatics(d, b);
2081
+ };
2082
+ return function (d, b) {
2083
+ if (typeof b !== "function" && b !== null)
2084
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2085
+ extendStatics(d, b);
2086
+ function __() { this.constructor = d; }
2087
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2088
+ };
2089
+ })();
2090
+ Object.defineProperty(exports, "__esModule", { value: true });
2091
+ exports.ProductClickEvent = void 0;
2092
+
2093
+ var ProductClickEvent = (function (_super) {
2094
+ __extends(ProductClickEvent, _super);
2095
+ function ProductClickEvent() {
2096
+ var _this = _super.call(this) || this;
2097
+ _this.typ = "ProductClickEvent";
2098
+ return _this;
2099
+ }
2100
+ ProductClickEvent.getAttributeTypeMap = function () {
2101
+ return _super.getAttributeTypeMap.call(this).concat(ProductClickEvent.attributeTypeMap);
2102
+ };
2103
+ ProductClickEvent.discriminator = undefined;
2104
+ ProductClickEvent.attributeTypeMap = [
2105
+ {
2106
+ "name": "widget",
2107
+ "baseName": "widget",
2108
+ "type": "Widget",
2109
+ "format": ""
2110
+ },
2111
+ {
2112
+ "name": "product",
2113
+ "baseName": "product",
2114
+ "type": "string",
2115
+ "format": ""
2116
+ },
2117
+ {
2118
+ "name": "rank",
2119
+ "baseName": "rank",
2120
+ "type": "number",
2121
+ "format": ""
2122
+ }
2123
+ ];
2124
+ return ProductClickEvent;
2125
+ }(Event_1.Event));
2126
+ exports.ProductClickEvent = ProductClickEvent;
2127
+ //# sourceMappingURL=ProductClickEvent.js.map
2128
+ });
2129
+
2130
+ var ProductViewEvent_1 = createCommonjsModule(function (module, exports) {
2131
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
2132
+ var extendStatics = function (d, b) {
2133
+ extendStatics = Object.setPrototypeOf ||
2134
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2135
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2136
+ return extendStatics(d, b);
2137
+ };
2138
+ return function (d, b) {
2139
+ if (typeof b !== "function" && b !== null)
2140
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2141
+ extendStatics(d, b);
2142
+ function __() { this.constructor = d; }
2143
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2144
+ };
2145
+ })();
2146
+ Object.defineProperty(exports, "__esModule", { value: true });
2147
+ exports.ProductViewEvent = void 0;
2148
+
2149
+ var ProductViewEvent = (function (_super) {
2150
+ __extends(ProductViewEvent, _super);
2151
+ function ProductViewEvent() {
2152
+ var _this = _super.call(this) || this;
2153
+ _this.typ = "ProductViewEvent";
2154
+ return _this;
2155
+ }
2156
+ ProductViewEvent.getAttributeTypeMap = function () {
2157
+ return _super.getAttributeTypeMap.call(this).concat(ProductViewEvent.attributeTypeMap);
2158
+ };
2159
+ ProductViewEvent.discriminator = undefined;
2160
+ ProductViewEvent.attributeTypeMap = [
2161
+ {
2162
+ "name": "widget",
2163
+ "baseName": "widget",
2164
+ "type": "Widget",
2165
+ "format": ""
2166
+ },
2167
+ {
2168
+ "name": "product",
2169
+ "baseName": "product",
2170
+ "type": "string",
2171
+ "format": ""
2172
+ },
2173
+ {
2174
+ "name": "rank",
2175
+ "baseName": "rank",
2176
+ "type": "number",
2177
+ "format": ""
2178
+ }
2179
+ ];
2180
+ return ProductViewEvent;
2181
+ }(Event_1.Event));
2182
+ exports.ProductViewEvent = ProductViewEvent;
2183
+ //# sourceMappingURL=ProductViewEvent.js.map
2184
+ });
2185
+
2186
+ var ProductViewEventAllOf_1 = createCommonjsModule(function (module, exports) {
2187
+ Object.defineProperty(exports, "__esModule", { value: true });
2188
+ exports.ProductViewEventAllOf = void 0;
2189
+ var ProductViewEventAllOf = (function () {
2190
+ function ProductViewEventAllOf() {
2191
+ }
2192
+ ProductViewEventAllOf.getAttributeTypeMap = function () {
2193
+ return ProductViewEventAllOf.attributeTypeMap;
2194
+ };
2195
+ ProductViewEventAllOf.discriminator = undefined;
2196
+ ProductViewEventAllOf.attributeTypeMap = [
2197
+ {
2198
+ "name": "widget",
2199
+ "baseName": "widget",
2200
+ "type": "Widget",
2201
+ "format": ""
2202
+ },
2203
+ {
2204
+ "name": "product",
2205
+ "baseName": "product",
2206
+ "type": "string",
2207
+ "format": ""
2208
+ },
2209
+ {
2210
+ "name": "rank",
2211
+ "baseName": "rank",
2212
+ "type": "number",
2213
+ "format": ""
2214
+ }
2215
+ ];
2216
+ return ProductViewEventAllOf;
2217
+ }());
2218
+ exports.ProductViewEventAllOf = ProductViewEventAllOf;
2219
+ //# sourceMappingURL=ProductViewEventAllOf.js.map
2220
+ });
2221
+
2222
+ var SearchArea = createCommonjsModule(function (module, exports) {
2223
+ Object.defineProperty(exports, "__esModule", { value: true });
2224
+ //# sourceMappingURL=SearchArea.js.map
2225
+ });
2226
+
2227
+ var SearchEvent_1 = createCommonjsModule(function (module, exports) {
2228
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
2229
+ var extendStatics = function (d, b) {
2230
+ extendStatics = Object.setPrototypeOf ||
2231
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2232
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2233
+ return extendStatics(d, b);
2234
+ };
2235
+ return function (d, b) {
2236
+ if (typeof b !== "function" && b !== null)
2237
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2238
+ extendStatics(d, b);
2239
+ function __() { this.constructor = d; }
2240
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2241
+ };
2242
+ })();
2243
+ Object.defineProperty(exports, "__esModule", { value: true });
2244
+ exports.SearchEvent = void 0;
2245
+
2246
+ var SearchEvent = (function (_super) {
2247
+ __extends(SearchEvent, _super);
2248
+ function SearchEvent() {
2249
+ var _this = _super.call(this) || this;
2250
+ _this.typ = "SearchEvent";
2251
+ return _this;
2252
+ }
2253
+ SearchEvent.getAttributeTypeMap = function () {
2254
+ return _super.getAttributeTypeMap.call(this).concat(SearchEvent.attributeTypeMap);
2255
+ };
2256
+ SearchEvent.discriminator = undefined;
2257
+ SearchEvent.attributeTypeMap = [
2258
+ {
2259
+ "name": "widget",
2260
+ "baseName": "widget",
2261
+ "type": "Widget",
2262
+ "format": ""
2263
+ },
2264
+ {
2265
+ "name": "source",
2266
+ "baseName": "source",
2267
+ "type": "SearchImageSource",
2268
+ "format": ""
2269
+ },
2270
+ {
2271
+ "name": "search_area",
2272
+ "baseName": "search_area",
2273
+ "type": "SearchArea",
2274
+ "format": ""
2275
+ }
2276
+ ];
2277
+ return SearchEvent;
2278
+ }(Event_1.Event));
2279
+ exports.SearchEvent = SearchEvent;
2280
+ //# sourceMappingURL=SearchEvent.js.map
2281
+ });
2282
+
2283
+ var SearchEventAllOf_1 = createCommonjsModule(function (module, exports) {
2284
+ Object.defineProperty(exports, "__esModule", { value: true });
2285
+ exports.SearchEventAllOf = void 0;
2286
+ var SearchEventAllOf = (function () {
2287
+ function SearchEventAllOf() {
2288
+ }
2289
+ SearchEventAllOf.getAttributeTypeMap = function () {
2290
+ return SearchEventAllOf.attributeTypeMap;
2291
+ };
2292
+ SearchEventAllOf.discriminator = undefined;
2293
+ SearchEventAllOf.attributeTypeMap = [
2294
+ {
2295
+ "name": "widget",
2296
+ "baseName": "widget",
2297
+ "type": "Widget",
2298
+ "format": ""
2299
+ },
2300
+ {
2301
+ "name": "source",
2302
+ "baseName": "source",
2303
+ "type": "SearchImageSource",
2304
+ "format": ""
2305
+ },
2306
+ {
2307
+ "name": "search_area",
2308
+ "baseName": "search_area",
2309
+ "type": "SearchArea",
2310
+ "format": ""
2311
+ }
2312
+ ];
2313
+ return SearchEventAllOf;
2314
+ }());
2315
+ exports.SearchEventAllOf = SearchEventAllOf;
2316
+ //# sourceMappingURL=SearchEventAllOf.js.map
2317
+ });
2318
+
2319
+ var SearchImageSource = createCommonjsModule(function (module, exports) {
2320
+ Object.defineProperty(exports, "__esModule", { value: true });
2321
+ //# sourceMappingURL=SearchImageSource.js.map
2322
+ });
2323
+
2324
+ var Widget = createCommonjsModule(function (module, exports) {
2325
+ Object.defineProperty(exports, "__esModule", { value: true });
2326
+ //# sourceMappingURL=Widget.js.map
2327
+ });
2328
+
2329
+ var WidgetAction = createCommonjsModule(function (module, exports) {
2330
+ Object.defineProperty(exports, "__esModule", { value: true });
2331
+ //# sourceMappingURL=WidgetAction.js.map
2332
+ });
2333
+
2334
+ var WidgetEvent_1 = createCommonjsModule(function (module, exports) {
2335
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
2336
+ var extendStatics = function (d, b) {
2337
+ extendStatics = Object.setPrototypeOf ||
2338
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2339
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2340
+ return extendStatics(d, b);
2341
+ };
2342
+ return function (d, b) {
2343
+ if (typeof b !== "function" && b !== null)
2344
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2345
+ extendStatics(d, b);
2346
+ function __() { this.constructor = d; }
2347
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2348
+ };
2349
+ })();
2350
+ Object.defineProperty(exports, "__esModule", { value: true });
2351
+ exports.WidgetEvent = void 0;
2352
+
2353
+ var WidgetEvent = (function (_super) {
2354
+ __extends(WidgetEvent, _super);
2355
+ function WidgetEvent() {
2356
+ var _this = _super.call(this) || this;
2357
+ _this.typ = "WidgetEvent";
2358
+ return _this;
2359
+ }
2360
+ WidgetEvent.getAttributeTypeMap = function () {
2361
+ return _super.getAttributeTypeMap.call(this).concat(WidgetEvent.attributeTypeMap);
2362
+ };
2363
+ WidgetEvent.discriminator = undefined;
2364
+ WidgetEvent.attributeTypeMap = [
2365
+ {
2366
+ "name": "widget",
2367
+ "baseName": "widget",
2368
+ "type": "Widget",
2369
+ "format": ""
2370
+ },
2371
+ {
2372
+ "name": "action",
2373
+ "baseName": "action",
2374
+ "type": "WidgetAction",
2375
+ "format": ""
2376
+ }
2377
+ ];
2378
+ return WidgetEvent;
2379
+ }(Event_1.Event));
2380
+ exports.WidgetEvent = WidgetEvent;
2381
+ //# sourceMappingURL=WidgetEvent.js.map
2382
+ });
2383
+
2384
+ var WidgetEventAllOf_1 = createCommonjsModule(function (module, exports) {
2385
+ Object.defineProperty(exports, "__esModule", { value: true });
2386
+ exports.WidgetEventAllOf = void 0;
2387
+ var WidgetEventAllOf = (function () {
2388
+ function WidgetEventAllOf() {
2389
+ }
2390
+ WidgetEventAllOf.getAttributeTypeMap = function () {
2391
+ return WidgetEventAllOf.attributeTypeMap;
2392
+ };
2393
+ WidgetEventAllOf.discriminator = undefined;
2394
+ WidgetEventAllOf.attributeTypeMap = [
2395
+ {
2396
+ "name": "widget",
2397
+ "baseName": "widget",
2398
+ "type": "Widget",
2399
+ "format": ""
2400
+ },
2401
+ {
2402
+ "name": "action",
2403
+ "baseName": "action",
2404
+ "type": "WidgetAction",
2405
+ "format": ""
2406
+ }
2407
+ ];
2408
+ return WidgetEventAllOf;
2409
+ }());
2410
+ exports.WidgetEventAllOf = WidgetEventAllOf;
2411
+ //# sourceMappingURL=WidgetEventAllOf.js.map
2412
+ });
2413
+
2414
+ var all = createCommonjsModule(function (module, exports) {
2415
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2416
+ if (k2 === undefined) k2 = k;
2417
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2418
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2419
+ desc = { enumerable: true, get: function() { return m[k]; } };
2420
+ }
2421
+ Object.defineProperty(o, k2, desc);
2422
+ }) : (function(o, m, k, k2) {
2423
+ if (k2 === undefined) k2 = k;
2424
+ o[k2] = m[k];
2425
+ }));
2426
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2427
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2428
+ };
2429
+ Object.defineProperty(exports, "__esModule", { value: true });
2430
+ __exportStar(ErrorObject_1, exports);
2431
+ __exportStar(ErrorResponse_1, exports);
2432
+ __exportStar(Event_1, exports);
2433
+ __exportStar(EventConfirmation_1, exports);
2434
+ __exportStar(FilterAction, exports);
2435
+ __exportStar(FilterEvent_1, exports);
2436
+ __exportStar(FilterEventAllOf_1, exports);
2437
+ __exportStar(FilterKind, exports);
2438
+ __exportStar(ProductClickEvent_1, exports);
2439
+ __exportStar(ProductViewEvent_1, exports);
2440
+ __exportStar(ProductViewEventAllOf_1, exports);
2441
+ __exportStar(SearchArea, exports);
2442
+ __exportStar(SearchEvent_1, exports);
2443
+ __exportStar(SearchEventAllOf_1, exports);
2444
+ __exportStar(SearchImageSource, exports);
2445
+ __exportStar(Widget, exports);
2446
+ __exportStar(WidgetAction, exports);
2447
+ __exportStar(WidgetEvent_1, exports);
2448
+ __exportStar(WidgetEventAllOf_1, exports);
2449
+ //# sourceMappingURL=all.js.map
2450
+ });
2451
+
2452
+ var middleware = createCommonjsModule(function (module, exports) {
2453
+ Object.defineProperty(exports, "__esModule", { value: true });
2454
+ exports.PromiseMiddlewareWrapper = void 0;
2455
+
2456
+ var PromiseMiddlewareWrapper = (function () {
2457
+ function PromiseMiddlewareWrapper(middleware) {
2458
+ this.middleware = middleware;
2459
+ }
2460
+ PromiseMiddlewareWrapper.prototype.pre = function (context) {
2461
+ return (0, rxjsStub.from)(this.middleware.pre(context));
2462
+ };
2463
+ PromiseMiddlewareWrapper.prototype.post = function (context) {
2464
+ return (0, rxjsStub.from)(this.middleware.post(context));
2465
+ };
2466
+ return PromiseMiddlewareWrapper;
2467
+ }());
2468
+ exports.PromiseMiddlewareWrapper = PromiseMiddlewareWrapper;
2469
+ //# sourceMappingURL=middleware.js.map
2470
+ });
2471
+
2472
+ var servers = createCommonjsModule(function (module, exports) {
2473
+ Object.defineProperty(exports, "__esModule", { value: true });
2474
+ exports.servers = exports.server2 = exports.server1 = exports.ServerConfiguration = void 0;
2475
+
2476
+ var ServerConfiguration = (function () {
2477
+ function ServerConfiguration(url, variableConfiguration) {
2478
+ this.url = url;
2479
+ this.variableConfiguration = variableConfiguration;
2480
+ }
2481
+ ServerConfiguration.prototype.setVariables = function (variableConfiguration) {
2482
+ Object.assign(this.variableConfiguration, variableConfiguration);
2483
+ };
2484
+ ServerConfiguration.prototype.getConfiguration = function () {
2485
+ return this.variableConfiguration;
2486
+ };
2487
+ ServerConfiguration.prototype.getUrl = function () {
2488
+ var replacedUrl = this.url;
2489
+ for (var key in this.variableConfiguration) {
2490
+ var re = new RegExp("{" + key + "}", "g");
2491
+ replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
2492
+ }
2493
+ return replacedUrl;
2494
+ };
2495
+ ServerConfiguration.prototype.makeRequestContext = function (endpoint, httpMethod) {
2496
+ return new http.RequestContext(this.getUrl() + endpoint, httpMethod);
2497
+ };
2498
+ return ServerConfiguration;
2499
+ }());
2500
+ exports.ServerConfiguration = ServerConfiguration;
2501
+ exports.server1 = new ServerConfiguration("https://tracking.vviinn.com", {});
2502
+ exports.server2 = new ServerConfiguration("https://tracking.stage.vviinn.com", {});
2503
+ exports.servers = [exports.server1, exports.server2];
2504
+ //# sourceMappingURL=servers.js.map
2505
+ });
2506
+
2507
+ var configuration = createCommonjsModule(function (module, exports) {
2508
+ Object.defineProperty(exports, "__esModule", { value: true });
2509
+ exports.createConfiguration = void 0;
2510
+
2511
+
2512
+
2513
+
2514
+ function createConfiguration(conf) {
2515
+ if (conf === void 0) { conf = {}; }
2516
+ var configuration = {
2517
+ baseServer: conf.baseServer !== undefined ? conf.baseServer : servers.server1,
2518
+ httpApi: conf.httpApi || new isomorphicFetch.IsomorphicFetchHttpLibrary(),
2519
+ middleware: conf.middleware || [],
2520
+ authMethods: (0, auth.configureAuthMethods)(conf.authMethods)
2521
+ };
2522
+ if (conf.promiseMiddleware) {
2523
+ conf.promiseMiddleware.forEach(function (m) { return configuration.middleware.push(new middleware.PromiseMiddlewareWrapper(m)); });
2524
+ }
2525
+ return configuration;
2526
+ }
2527
+ exports.createConfiguration = createConfiguration;
2528
+ //# sourceMappingURL=configuration.js.map
2529
+ });
2530
+
2531
+ var exception = createCommonjsModule(function (module, exports) {
2532
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
2533
+ var extendStatics = function (d, b) {
2534
+ extendStatics = Object.setPrototypeOf ||
2535
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2536
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2537
+ return extendStatics(d, b);
2538
+ };
2539
+ return function (d, b) {
2540
+ if (typeof b !== "function" && b !== null)
2541
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2542
+ extendStatics(d, b);
2543
+ function __() { this.constructor = d; }
2544
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2545
+ };
2546
+ })();
2547
+ Object.defineProperty(exports, "__esModule", { value: true });
2548
+ exports.ApiException = void 0;
2549
+ var ApiException = (function (_super) {
2550
+ __extends(ApiException, _super);
2551
+ function ApiException(code, message, body, headers) {
2552
+ var _this = _super.call(this, "HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " +
2553
+ JSON.stringify(headers)) || this;
2554
+ _this.code = code;
2555
+ _this.body = body;
2556
+ _this.headers = headers;
2557
+ return _this;
2558
+ }
2559
+ return ApiException;
2560
+ }(Error));
2561
+ exports.ApiException = ApiException;
2562
+ //# sourceMappingURL=exception.js.map
2563
+ });
2564
+
2565
+ var baseapi = createCommonjsModule(function (module, exports) {
2566
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
2567
+ var extendStatics = function (d, b) {
2568
+ extendStatics = Object.setPrototypeOf ||
2569
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2570
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2571
+ return extendStatics(d, b);
2572
+ };
2573
+ return function (d, b) {
2574
+ if (typeof b !== "function" && b !== null)
2575
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2576
+ extendStatics(d, b);
2577
+ function __() { this.constructor = d; }
2578
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2579
+ };
2580
+ })();
2581
+ Object.defineProperty(exports, "__esModule", { value: true });
2582
+ exports.RequiredError = exports.BaseAPIRequestFactory = exports.COLLECTION_FORMATS = void 0;
2583
+ exports.COLLECTION_FORMATS = {
2584
+ csv: ",",
2585
+ ssv: " ",
2586
+ tsv: "\t",
2587
+ pipes: "|",
2588
+ };
2589
+ var BaseAPIRequestFactory = (function () {
2590
+ function BaseAPIRequestFactory(configuration) {
2591
+ this.configuration = configuration;
2592
+ }
2593
+ return BaseAPIRequestFactory;
2594
+ }());
2595
+ exports.BaseAPIRequestFactory = BaseAPIRequestFactory;
2596
+ var RequiredError = (function (_super) {
2597
+ __extends(RequiredError, _super);
2598
+ function RequiredError(api, method, field) {
2599
+ var _this = _super.call(this, "Required parameter " + field + " was null or undefined when calling " + api + "." + method + ".") || this;
2600
+ _this.api = api;
2601
+ _this.method = method;
2602
+ _this.field = field;
2603
+ _this.name = "RequiredError";
2604
+ return _this;
2605
+ }
2606
+ return RequiredError;
2607
+ }(Error));
2608
+ exports.RequiredError = RequiredError;
2609
+ //# sourceMappingURL=baseapi.js.map
2610
+ });
2611
+
2612
+ var ObjectSerializer_1 = createCommonjsModule(function (module, exports) {
2613
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2614
+ if (k2 === undefined) k2 = k;
2615
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2616
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2617
+ desc = { enumerable: true, get: function() { return m[k]; } };
2618
+ }
2619
+ Object.defineProperty(o, k2, desc);
2620
+ }) : (function(o, m, k, k2) {
2621
+ if (k2 === undefined) k2 = k;
2622
+ o[k2] = m[k];
2623
+ }));
2624
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2625
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2626
+ };
2627
+ Object.defineProperty(exports, "__esModule", { value: true });
2628
+ exports.ObjectSerializer = void 0;
2629
+ __exportStar(ErrorObject_1, exports);
2630
+ __exportStar(ErrorResponse_1, exports);
2631
+ __exportStar(Event_1, exports);
2632
+ __exportStar(EventConfirmation_1, exports);
2633
+ __exportStar(FilterAction, exports);
2634
+ __exportStar(FilterEvent_1, exports);
2635
+ __exportStar(FilterEventAllOf_1, exports);
2636
+ __exportStar(FilterKind, exports);
2637
+ __exportStar(ProductClickEvent_1, exports);
2638
+ __exportStar(ProductViewEvent_1, exports);
2639
+ __exportStar(ProductViewEventAllOf_1, exports);
2640
+ __exportStar(SearchArea, exports);
2641
+ __exportStar(SearchEvent_1, exports);
2642
+ __exportStar(SearchEventAllOf_1, exports);
2643
+ __exportStar(SearchImageSource, exports);
2644
+ __exportStar(Widget, exports);
2645
+ __exportStar(WidgetAction, exports);
2646
+ __exportStar(WidgetEvent_1, exports);
2647
+ __exportStar(WidgetEventAllOf_1, exports);
2648
+ var ErrorObject_1$1 = ErrorObject_1;
2649
+ var ErrorResponse_1$1 = ErrorResponse_1;
2650
+ var Event_1$1 = Event_1;
2651
+ var EventConfirmation_1$1 = EventConfirmation_1;
2652
+ var FilterEvent_1$1 = FilterEvent_1;
2653
+ var FilterEventAllOf_1$1 = FilterEventAllOf_1;
2654
+ var ProductClickEvent_1$1 = ProductClickEvent_1;
2655
+ var ProductViewEvent_1$1 = ProductViewEvent_1;
2656
+ var ProductViewEventAllOf_1$1 = ProductViewEventAllOf_1;
2657
+ var SearchEvent_1$1 = SearchEvent_1;
2658
+ var SearchEventAllOf_1$1 = SearchEventAllOf_1;
2659
+ var WidgetEvent_1$1 = WidgetEvent_1;
2660
+ var WidgetEventAllOf_1$1 = WidgetEventAllOf_1;
2661
+ var primitives = [
2662
+ "string",
2663
+ "boolean",
2664
+ "double",
2665
+ "integer",
2666
+ "long",
2667
+ "float",
2668
+ "number",
2669
+ "any"
2670
+ ];
2671
+ var supportedMediaTypes = {
2672
+ "application/json": Infinity,
2673
+ "application/octet-stream": 0,
2674
+ "application/x-www-form-urlencoded": 0
2675
+ };
2676
+ var enumsMap = new Set([
2677
+ "EventConfirmationStatusEnum",
2678
+ "FilterAction",
2679
+ "FilterKind",
2680
+ "SearchArea",
2681
+ "SearchImageSource",
2682
+ "Widget",
2683
+ "WidgetAction",
2684
+ ]);
2685
+ var typeMap = {
2686
+ "ErrorObject": ErrorObject_1$1.ErrorObject,
2687
+ "ErrorResponse": ErrorResponse_1$1.ErrorResponse,
2688
+ "Event": Event_1$1.Event,
2689
+ "EventConfirmation": EventConfirmation_1$1.EventConfirmation,
2690
+ "FilterEvent": FilterEvent_1$1.FilterEvent,
2691
+ "FilterEventAllOf": FilterEventAllOf_1$1.FilterEventAllOf,
2692
+ "ProductClickEvent": ProductClickEvent_1$1.ProductClickEvent,
2693
+ "ProductViewEvent": ProductViewEvent_1$1.ProductViewEvent,
2694
+ "ProductViewEventAllOf": ProductViewEventAllOf_1$1.ProductViewEventAllOf,
2695
+ "SearchEvent": SearchEvent_1$1.SearchEvent,
2696
+ "SearchEventAllOf": SearchEventAllOf_1$1.SearchEventAllOf,
2697
+ "WidgetEvent": WidgetEvent_1$1.WidgetEvent,
2698
+ "WidgetEventAllOf": WidgetEventAllOf_1$1.WidgetEventAllOf,
2699
+ };
2700
+ var ObjectSerializer = (function () {
2701
+ function ObjectSerializer() {
2702
+ }
2703
+ ObjectSerializer.findCorrectType = function (data, expectedType) {
2704
+ if (data == undefined) {
2705
+ return expectedType;
2706
+ }
2707
+ else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
2708
+ return expectedType;
2709
+ }
2710
+ else if (expectedType === "Date") {
2711
+ return expectedType;
2712
+ }
2713
+ else {
2714
+ if (enumsMap.has(expectedType)) {
2715
+ return expectedType;
2716
+ }
2717
+ if (!typeMap[expectedType]) {
2718
+ return expectedType;
2719
+ }
2720
+ var discriminatorProperty = typeMap[expectedType].discriminator;
2721
+ if (discriminatorProperty == null) {
2722
+ return expectedType;
2723
+ }
2724
+ else {
2725
+ if (data[discriminatorProperty]) {
2726
+ var discriminatorType = data[discriminatorProperty];
2727
+ if (typeMap[discriminatorType]) {
2728
+ return discriminatorType;
2729
+ }
2730
+ else {
2731
+ return expectedType;
2732
+ }
2733
+ }
2734
+ else {
2735
+ return expectedType;
2736
+ }
2737
+ }
2738
+ }
2739
+ };
2740
+ ObjectSerializer.serialize = function (data, type, format) {
2741
+ if (data == undefined) {
2742
+ return data;
2743
+ }
2744
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
2745
+ return data;
2746
+ }
2747
+ else if (type.lastIndexOf("Array<", 0) === 0) {
2748
+ var subType = type.replace("Array<", "");
2749
+ subType = subType.substring(0, subType.length - 1);
2750
+ var transformedData = [];
2751
+ for (var index in data) {
2752
+ var date = data[index];
2753
+ transformedData.push(ObjectSerializer.serialize(date, subType, format));
2754
+ }
2755
+ return transformedData;
2756
+ }
2757
+ else if (type === "Date") {
2758
+ if (format == "date") {
2759
+ var month = data.getMonth() + 1;
2760
+ month = month < 10 ? "0" + month.toString() : month.toString();
2761
+ var day = data.getDate();
2762
+ day = day < 10 ? "0" + day.toString() : day.toString();
2763
+ return data.getFullYear() + "-" + month + "-" + day;
2764
+ }
2765
+ else {
2766
+ return data.toISOString();
2767
+ }
2768
+ }
2769
+ else {
2770
+ if (enumsMap.has(type)) {
2771
+ return data;
2772
+ }
2773
+ if (!typeMap[type]) {
2774
+ return data;
2775
+ }
2776
+ type = this.findCorrectType(data, type);
2777
+ var attributeTypes = typeMap[type].getAttributeTypeMap();
2778
+ var instance = {};
2779
+ for (var index in attributeTypes) {
2780
+ var attributeType = attributeTypes[index];
2781
+ instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type, attributeType.format);
2782
+ }
2783
+ return instance;
2784
+ }
2785
+ };
2786
+ ObjectSerializer.deserialize = function (data, type, format) {
2787
+ type = ObjectSerializer.findCorrectType(data, type);
2788
+ if (data == undefined) {
2789
+ return data;
2790
+ }
2791
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
2792
+ return data;
2793
+ }
2794
+ else if (type.lastIndexOf("Array<", 0) === 0) {
2795
+ var subType = type.replace("Array<", "");
2796
+ subType = subType.substring(0, subType.length - 1);
2797
+ var transformedData = [];
2798
+ for (var index in data) {
2799
+ var date = data[index];
2800
+ transformedData.push(ObjectSerializer.deserialize(date, subType, format));
2801
+ }
2802
+ return transformedData;
2803
+ }
2804
+ else if (type === "Date") {
2805
+ return new Date(data);
2806
+ }
2807
+ else {
2808
+ if (enumsMap.has(type)) {
2809
+ return data;
2810
+ }
2811
+ if (!typeMap[type]) {
2812
+ return data;
2813
+ }
2814
+ var instance = new typeMap[type]();
2815
+ var attributeTypes = typeMap[type].getAttributeTypeMap();
2816
+ for (var index in attributeTypes) {
2817
+ var attributeType = attributeTypes[index];
2818
+ instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type, attributeType.format);
2819
+ }
2820
+ return instance;
2821
+ }
2822
+ };
2823
+ ObjectSerializer.normalizeMediaType = function (mediaType) {
2824
+ if (mediaType === undefined) {
2825
+ return undefined;
2826
+ }
2827
+ return mediaType.split(";")[0].trim().toLowerCase();
2828
+ };
2829
+ ObjectSerializer.getPreferredMediaType = function (mediaTypes) {
2830
+ if (!mediaTypes) {
2831
+ return "application/json";
2832
+ }
2833
+ var normalMediaTypes = mediaTypes.map(this.normalizeMediaType);
2834
+ var selectedMediaType = undefined;
2835
+ var selectedRank = -Infinity;
2836
+ for (var _i = 0, normalMediaTypes_1 = normalMediaTypes; _i < normalMediaTypes_1.length; _i++) {
2837
+ var mediaType = normalMediaTypes_1[_i];
2838
+ if (supportedMediaTypes[mediaType] > selectedRank) {
2839
+ selectedMediaType = mediaType;
2840
+ selectedRank = supportedMediaTypes[mediaType];
2841
+ }
2842
+ }
2843
+ if (selectedMediaType === undefined) {
2844
+ throw new Error("None of the given media types are supported: " + mediaTypes.join(", "));
2845
+ }
2846
+ return selectedMediaType;
2847
+ };
2848
+ ObjectSerializer.stringify = function (data, mediaType) {
2849
+ if (mediaType === "application/json") {
2850
+ return JSON.stringify(data);
2851
+ }
2852
+ throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.stringify.");
2853
+ };
2854
+ ObjectSerializer.parse = function (rawData, mediaType) {
2855
+ if (mediaType === undefined) {
2856
+ throw new Error("Cannot parse content. No Content-Type defined.");
2857
+ }
2858
+ if (mediaType === "application/json") {
2859
+ return JSON.parse(rawData);
2860
+ }
2861
+ throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.parse.");
2862
+ };
2863
+ return ObjectSerializer;
2864
+ }());
2865
+ exports.ObjectSerializer = ObjectSerializer;
2866
+ //# sourceMappingURL=ObjectSerializer.js.map
2867
+ });
2868
+
2869
+ var util = createCommonjsModule(function (module, exports) {
2870
+ Object.defineProperty(exports, "__esModule", { value: true });
2871
+ exports.canConsumeForm = exports.isCodeInRange = void 0;
2872
+ function isCodeInRange(codeRange, code) {
2873
+ if (codeRange === "0") {
2874
+ return true;
2875
+ }
2876
+ if (codeRange == code.toString()) {
2877
+ return true;
2878
+ }
2879
+ else {
2880
+ var codeString = code.toString();
2881
+ if (codeString.length != codeRange.length) {
2882
+ return false;
2883
+ }
2884
+ for (var i = 0; i < codeString.length; i++) {
2885
+ if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
2886
+ return false;
2887
+ }
2888
+ }
2889
+ return true;
2890
+ }
2891
+ }
2892
+ exports.isCodeInRange = isCodeInRange;
2893
+ function canConsumeForm(contentTypes) {
2894
+ return contentTypes.indexOf('multipart/form-data') !== -1;
2895
+ }
2896
+ exports.canConsumeForm = canConsumeForm;
2897
+ //# sourceMappingURL=util.js.map
2898
+ });
2899
+
2900
+ var DefaultApi = createCommonjsModule(function (module, exports) {
2901
+ var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
2902
+ var extendStatics = function (d, b) {
2903
+ extendStatics = Object.setPrototypeOf ||
2904
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2905
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2906
+ return extendStatics(d, b);
2907
+ };
2908
+ return function (d, b) {
2909
+ if (typeof b !== "function" && b !== null)
2910
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2911
+ extendStatics(d, b);
2912
+ function __() { this.constructor = d; }
2913
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2914
+ };
2915
+ })();
2916
+ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
2917
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2918
+ return new (P || (P = Promise))(function (resolve, reject) {
2919
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2920
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2921
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2922
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2923
+ });
2924
+ };
2925
+ var __generator = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
2926
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
2927
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
2928
+ function verb(n) { return function (v) { return step([n, v]); }; }
2929
+ function step(op) {
2930
+ if (f) throw new TypeError("Generator is already executing.");
2931
+ while (_) try {
2932
+ 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;
2933
+ if (y = 0, t) op = [op[0] & 2, t.value];
2934
+ switch (op[0]) {
2935
+ case 0: case 1: t = op; break;
2936
+ case 4: _.label++; return { value: op[1], done: false };
2937
+ case 5: _.label++; y = op[1]; op = [0]; continue;
2938
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
2939
+ default:
2940
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
2941
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
2942
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
2943
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
2944
+ if (t[2]) _.ops.pop();
2945
+ _.trys.pop(); continue;
2946
+ }
2947
+ op = body.call(thisArg, _);
2948
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
2949
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2950
+ }
2951
+ };
2952
+ Object.defineProperty(exports, "__esModule", { value: true });
2953
+ exports.DefaultApiResponseProcessor = exports.DefaultApiRequestFactory = void 0;
2954
+
2955
+
2956
+
2957
+
2958
+
2959
+ var DefaultApiRequestFactory = (function (_super) {
2960
+ __extends(DefaultApiRequestFactory, _super);
2961
+ function DefaultApiRequestFactory() {
2962
+ return _super !== null && _super.apply(this, arguments) || this;
2963
+ }
2964
+ DefaultApiRequestFactory.prototype.trackEvent = function (product_view_event___product_click_event___widget_event___filter_event___search_event, _options) {
2965
+ var _a, _b, _c;
2966
+ return __awaiter(this, void 0, void 0, function () {
2967
+ var _config, localVarPath, requestContext, contentType, serializedBody, authMethod, defaultAuth;
2968
+ return __generator(this, function (_d) {
2969
+ switch (_d.label) {
2970
+ case 0:
2971
+ _config = _options || this.configuration;
2972
+ localVarPath = '/event';
2973
+ requestContext = _config.baseServer.makeRequestContext(localVarPath, http.HttpMethod.POST);
2974
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
2975
+ contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
2976
+ "application/json"
2977
+ ]);
2978
+ requestContext.setHeaderParam("Content-Type", contentType);
2979
+ serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(product_view_event___product_click_event___widget_event___filter_event___search_event, "ProductViewEvent | ProductClickEvent | WidgetEvent | FilterEvent | SearchEvent", ""), contentType);
2980
+ requestContext.setBody(serializedBody);
2981
+ authMethod = _config.authMethods["bearerAuth"];
2982
+ if (!(authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication)) return [3, 2];
2983
+ return [4, (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext))];
2984
+ case 1:
2985
+ _d.sent();
2986
+ _d.label = 2;
2987
+ case 2:
2988
+ defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default);
2989
+ if (!(defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication)) return [3, 4];
2990
+ return [4, (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext))];
2991
+ case 3:
2992
+ _d.sent();
2993
+ _d.label = 4;
2994
+ case 4: return [2, requestContext];
2995
+ }
2996
+ });
2997
+ });
2998
+ };
2999
+ return DefaultApiRequestFactory;
3000
+ }(baseapi.BaseAPIRequestFactory));
3001
+ exports.DefaultApiRequestFactory = DefaultApiRequestFactory;
3002
+ var DefaultApiResponseProcessor = (function () {
3003
+ function DefaultApiResponseProcessor() {
3004
+ }
3005
+ DefaultApiResponseProcessor.prototype.trackEvent = function (response) {
3006
+ return __awaiter(this, void 0, void 0, function () {
3007
+ var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, _o, _p;
3008
+ return __generator(this, function (_q) {
3009
+ switch (_q.label) {
3010
+ case 0:
3011
+ contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
3012
+ if (!(0, util.isCodeInRange)("200", response.httpStatusCode)) return [3, 2];
3013
+ _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize;
3014
+ _d = (_c = ObjectSerializer_1.ObjectSerializer).parse;
3015
+ return [4, response.body.text()];
3016
+ case 1:
3017
+ body = _b.apply(_a, [_d.apply(_c, [_q.sent(), contentType]),
3018
+ "EventConfirmation", ""]);
3019
+ return [2, body];
3020
+ case 2:
3021
+ if (!(0, util.isCodeInRange)("502", response.httpStatusCode)) return [3, 4];
3022
+ _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize;
3023
+ _h = (_g = ObjectSerializer_1.ObjectSerializer).parse;
3024
+ return [4, response.body.text()];
3025
+ case 3:
3026
+ body = _f.apply(_e, [_h.apply(_g, [_q.sent(), contentType]),
3027
+ "ErrorResponse", ""]);
3028
+ throw new exception.ApiException(502, "an error occurred", body, response.headers);
3029
+ case 4:
3030
+ if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 6];
3031
+ _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize;
3032
+ _m = (_l = ObjectSerializer_1.ObjectSerializer).parse;
3033
+ return [4, response.body.text()];
3034
+ case 5:
3035
+ body = _k.apply(_j, [_m.apply(_l, [_q.sent(), contentType]),
3036
+ "EventConfirmation", ""]);
3037
+ return [2, body];
3038
+ case 6:
3039
+ _o = exception.ApiException.bind;
3040
+ _p = [void 0, response.httpStatusCode, "Unknown API Status Code!"];
3041
+ return [4, response.getBodyAsAny()];
3042
+ case 7: throw new (_o.apply(exception.ApiException, _p.concat([_q.sent(), response.headers])))();
3043
+ }
3044
+ });
3045
+ });
3046
+ };
3047
+ return DefaultApiResponseProcessor;
3048
+ }());
3049
+ exports.DefaultApiResponseProcessor = DefaultApiResponseProcessor;
3050
+ //# sourceMappingURL=DefaultApi.js.map
3051
+ });
3052
+
3053
+ var ObservableAPI = createCommonjsModule(function (module, exports) {
3054
+ Object.defineProperty(exports, "__esModule", { value: true });
3055
+ exports.ObservableDefaultApi = void 0;
3056
+
3057
+ var rxjsStub_2 = rxjsStub;
3058
+
3059
+ var ObservableDefaultApi = (function () {
3060
+ function ObservableDefaultApi(configuration, requestFactory, responseProcessor) {
3061
+ this.configuration = configuration;
3062
+ this.requestFactory = requestFactory || new DefaultApi.DefaultApiRequestFactory(configuration);
3063
+ this.responseProcessor = responseProcessor || new DefaultApi.DefaultApiResponseProcessor();
3064
+ }
3065
+ ObservableDefaultApi.prototype.trackEvent = function (product_view_event___product_click_event___widget_event___filter_event___search_event, _options) {
3066
+ var _this = this;
3067
+ var requestContextPromise = this.requestFactory.trackEvent(product_view_event___product_click_event___widget_event___filter_event___search_event, _options);
3068
+ var middlewarePreObservable = (0, rxjsStub.from)(requestContextPromise);
3069
+ var _loop_1 = function (middleware) {
3070
+ middlewarePreObservable = middlewarePreObservable.pipe((0, rxjsStub_2.mergeMap)(function (ctx) { return middleware.pre(ctx); }));
3071
+ };
3072
+ for (var _i = 0, _a = this.configuration.middleware; _i < _a.length; _i++) {
3073
+ var middleware = _a[_i];
3074
+ _loop_1(middleware);
3075
+ }
3076
+ return middlewarePreObservable.pipe((0, rxjsStub_2.mergeMap)(function (ctx) { return _this.configuration.httpApi.send(ctx); })).
3077
+ pipe((0, rxjsStub_2.mergeMap)(function (response) {
3078
+ var middlewarePostObservable = (0, rxjsStub.of)(response);
3079
+ var _loop_2 = function (middleware) {
3080
+ middlewarePostObservable = middlewarePostObservable.pipe((0, rxjsStub_2.mergeMap)(function (rsp) { return middleware.post(rsp); }));
3081
+ };
3082
+ for (var _i = 0, _a = _this.configuration.middleware; _i < _a.length; _i++) {
3083
+ var middleware = _a[_i];
3084
+ _loop_2(middleware);
3085
+ }
3086
+ return middlewarePostObservable.pipe((0, rxjsStub_2.map)(function (rsp) { return _this.responseProcessor.trackEvent(rsp); }));
3087
+ }));
3088
+ };
3089
+ return ObservableDefaultApi;
3090
+ }());
3091
+ exports.ObservableDefaultApi = ObservableDefaultApi;
3092
+ //# sourceMappingURL=ObservableAPI.js.map
3093
+ });
3094
+
3095
+ var PromiseAPI = createCommonjsModule(function (module, exports) {
3096
+ Object.defineProperty(exports, "__esModule", { value: true });
3097
+ exports.PromiseDefaultApi = void 0;
3098
+
3099
+ var PromiseDefaultApi = (function () {
3100
+ function PromiseDefaultApi(configuration, requestFactory, responseProcessor) {
3101
+ this.api = new ObservableAPI.ObservableDefaultApi(configuration, requestFactory, responseProcessor);
3102
+ }
3103
+ PromiseDefaultApi.prototype.trackEvent = function (product_view_event___product_click_event___widget_event___filter_event___search_event, _options) {
3104
+ var result = this.api.trackEvent(product_view_event___product_click_event___widget_event___filter_event___search_event, _options);
3105
+ return result.toPromise();
3106
+ };
3107
+ return PromiseDefaultApi;
3108
+ }());
3109
+ exports.PromiseDefaultApi = PromiseDefaultApi;
3110
+ //# sourceMappingURL=PromiseAPI.js.map
3111
+ });
3112
+
3113
+ var dist = createCommonjsModule(function (module, exports) {
3114
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3115
+ if (k2 === undefined) k2 = k;
3116
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3117
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3118
+ desc = { enumerable: true, get: function() { return m[k]; } };
3119
+ }
3120
+ Object.defineProperty(o, k2, desc);
3121
+ }) : (function(o, m, k, k2) {
3122
+ if (k2 === undefined) k2 = k;
3123
+ o[k2] = m[k];
3124
+ }));
3125
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
3126
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
3127
+ };
3128
+ Object.defineProperty(exports, "__esModule", { value: true });
3129
+ exports.DefaultApi = exports.createConfiguration = void 0;
3130
+ __exportStar(http, exports);
3131
+ __exportStar(auth, exports);
3132
+ __exportStar(all, exports);
3133
+
3134
+ Object.defineProperty(exports, "createConfiguration", { enumerable: true, get: function () { return configuration.createConfiguration; } });
3135
+ __exportStar(exception, exports);
3136
+ __exportStar(servers, exports);
3137
+
3138
+ Object.defineProperty(exports, "DefaultApi", { enumerable: true, get: function () { return PromiseAPI.PromiseDefaultApi; } });
3139
+ //# sourceMappingURL=index.js.map
3140
+ });
3141
+
3142
+ const STAGE_SERVER_IDENTIFIER = "stage";
3143
+ const getTrackingServerByApiPath = (apiPath) => isProductionPath(apiPath) ? dist.servers[0] : dist.servers[1];
3144
+ const isProductionPath = (apiPath) => !apiPath.includes(STAGE_SERVER_IDENTIFIER);
3145
+ // TODO find way to utilize this function when we will use several openApi clients
3146
+ const createBearerAuth = (token) => {
3147
+ const provider = {
3148
+ getToken: () => {
3149
+ return new Promise((resolve) => resolve(token));
3150
+ },
3151
+ };
3152
+ const bearerConf = {
3153
+ tokenProvider: provider,
3154
+ };
3155
+ return {
3156
+ bearerAuth: bearerConf,
3157
+ };
3158
+ };
3159
+ const createTrackingApi = (apiPath, token) => {
3160
+ const baseServer = getTrackingServerByApiPath(apiPath);
3161
+ const authMethods = createBearerAuth(token);
3162
+ const configuration = {
3163
+ baseServer,
3164
+ authMethods,
3165
+ };
3166
+ return new dist.DefaultApi(dist.createConfiguration(configuration));
3167
+ };
3168
+
3169
+ const createTrackingEvent = (widget) => (eventData) => {
3170
+ return Object.assign(Object.assign({}, eventData), widget);
3171
+ };
3172
+
3173
+ const PRODUCT_VIEW_EVENT_TYPE = "product_view_event";
3174
+ const FILTER_EVENT_EVENT_TYPE = "filter_event";
3175
+ const SEARCH_EVENT_EVENT_TYPE = "search_event";
3176
+ const WIDGET_EVENT_EVENT_TYPE = "widget_event";
3177
+
3178
+ const filterEvent = {
3179
+ widget: "VPS",
3180
+ typ: FILTER_EVENT_EVENT_TYPE,
3181
+ };
3182
+
3183
+ const vprProductView = {
3184
+ widget: "VPR",
3185
+ typ: PRODUCT_VIEW_EVENT_TYPE,
3186
+ };
3187
+ const vpsProductView = {
3188
+ widget: "VPS",
3189
+ typ: PRODUCT_VIEW_EVENT_TYPE,
3190
+ };
3191
+
3192
+ const searchEvent = {
3193
+ widget: "VPS",
3194
+ typ: SEARCH_EVENT_EVENT_TYPE,
3195
+ };
3196
+
3197
+ const vprWidget = {
3198
+ widget: "VPR",
3199
+ typ: WIDGET_EVENT_EVENT_TYPE,
3200
+ };
3201
+ const vpsWidget = {
3202
+ widget: "VPS",
3203
+ typ: WIDGET_EVENT_EVENT_TYPE,
3204
+ };
3205
+
3206
+ const createProductViewVprEvent = createTrackingEvent(vprProductView);
3207
+ const createProductViewVpsEvent = createTrackingEvent(vpsProductView);
3208
+ const createWidgetVprEvent = createTrackingEvent(vprWidget);
3209
+ const createWidgetVpsEvent = createTrackingEvent(vpsWidget);
3210
+ const createSearchEvent = createTrackingEvent(searchEvent);
3211
+ const createFilterEvent = createTrackingEvent(filterEvent);
3212
+
3213
+ export { createTrackingApi as a, createWidgetVprEvent as b, createProductViewVprEvent as c, createProductViewVpsEvent as d, createSearchEvent as e, createFilterEvent as f, createWidgetVpsEvent as g, v4 as v };