@bigbinary/neeto-message-templates-frontend 1.0.2 → 1.2.0

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 (43) hide show
  1. package/dist/ApiTemplates.js +439 -0
  2. package/dist/ApiTemplates.js.map +1 -0
  3. package/dist/MessageTemplates.js +1248 -0
  4. package/dist/MessageTemplates.js.map +1 -0
  5. package/dist/NoDataPage-00b22095.js +58 -0
  6. package/dist/NoDataPage-00b22095.js.map +1 -0
  7. package/dist/NoDataPage-4ba91a9f.js +51 -0
  8. package/dist/NoDataPage-4ba91a9f.js.map +1 -0
  9. package/dist/SendMessagePane.js +356 -0
  10. package/dist/SendMessagePane.js.map +1 -0
  11. package/dist/SendToApiPane.js +151 -0
  12. package/dist/SendToApiPane.js.map +1 -0
  13. package/dist/cjs/ApiTemplates.js +459 -0
  14. package/dist/cjs/ApiTemplates.js.map +1 -0
  15. package/dist/cjs/MessageTemplates.js +1289 -0
  16. package/dist/cjs/MessageTemplates.js.map +1 -0
  17. package/dist/cjs/SendMessagePane.js +390 -0
  18. package/dist/cjs/SendMessagePane.js.map +1 -0
  19. package/dist/cjs/SendToApiPane.js +181 -0
  20. package/dist/cjs/SendToApiPane.js.map +1 -0
  21. package/dist/cjs/index.js +61 -0
  22. package/dist/cjs/index.js.map +1 -0
  23. package/dist/index.js +49 -4587
  24. package/dist/index.js.map +1 -1
  25. package/dist/slicedToArray-b4278ecd.js +57 -0
  26. package/dist/slicedToArray-b4278ecd.js.map +1 -0
  27. package/dist/slicedToArray-f320d9e7.js +61 -0
  28. package/dist/slicedToArray-f320d9e7.js.map +1 -0
  29. package/dist/toConsumableArray-1cc38429.js +20 -0
  30. package/dist/toConsumableArray-1cc38429.js.map +1 -0
  31. package/dist/toConsumableArray-9abb3858.js +22 -0
  32. package/dist/toConsumableArray-9abb3858.js.map +1 -0
  33. package/dist/useTemplatesApi-45d43d41.js +2240 -0
  34. package/dist/useTemplatesApi-45d43d41.js.map +1 -0
  35. package/dist/useTemplatesApi-943ef380.js +2256 -0
  36. package/dist/useTemplatesApi-943ef380.js.map +1 -0
  37. package/dist/utils-90248b52.js +188 -0
  38. package/dist/utils-90248b52.js.map +1 -0
  39. package/dist/utils-b93467c8.js +151 -0
  40. package/dist/utils-b93467c8.js.map +1 -0
  41. package/package.json +24 -12
  42. package/dist/index.cjs.js +0 -4642
  43. package/dist/index.cjs.js.map +0 -1
@@ -0,0 +1,2240 @@
1
+ import { t } from 'i18next';
2
+ import { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from '@bigbinary/neeto-commons-frontend/constants';
3
+ import { useQuery } from '@tanstack/react-query';
4
+ import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
5
+ import { isEmpty } from 'ramda';
6
+ import axios from 'axios';
7
+ import require$$0 from 'util';
8
+
9
+ function _typeof(o) {
10
+ "@babel/helpers - typeof";
11
+
12
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
13
+ return typeof o;
14
+ } : function (o) {
15
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
16
+ }, _typeof(o);
17
+ }
18
+
19
+ function _toPrimitive(input, hint) {
20
+ if (_typeof(input) !== "object" || input === null) return input;
21
+ var prim = input[Symbol.toPrimitive];
22
+ if (prim !== undefined) {
23
+ var res = prim.call(input, hint || "default");
24
+ if (_typeof(res) !== "object") return res;
25
+ throw new TypeError("@@toPrimitive must return a primitive value.");
26
+ }
27
+ return (hint === "string" ? String : Number)(input);
28
+ }
29
+
30
+ function _toPropertyKey(arg) {
31
+ var key = _toPrimitive(arg, "string");
32
+ return _typeof(key) === "symbol" ? key : String(key);
33
+ }
34
+
35
+ function _defineProperty(obj, key, value) {
36
+ key = _toPropertyKey(key);
37
+ if (key in obj) {
38
+ Object.defineProperty(obj, key, {
39
+ value: value,
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true
43
+ });
44
+ } else {
45
+ obj[key] = value;
46
+ }
47
+ return obj;
48
+ }
49
+
50
+ var MESSAGE_TEMPLATES = {
51
+ email: {
52
+ label: t("neetoMessageTemplate.template.emailTemplates"),
53
+ value: "email_template",
54
+ addText: t("neetoMessageTemplate.template.addEmailTemplate"),
55
+ labelSingular: t("neetoMessageTemplate.template.emailTemplate"),
56
+ editText: t("neetoMessageTemplate.template.editEmailTemplate")
57
+ },
58
+ sms: {
59
+ label: t("neetoMessageTemplate.template.smsTemplates"),
60
+ value: "sms_template",
61
+ addText: t("neetoMessageTemplate.template.addSmsTemplate"),
62
+ labelSingular: t("neetoMessageTemplate.template.smsTemplate"),
63
+ editText: t("neetoMessageTemplate.template.editSmsTemplate")
64
+ },
65
+ whatsapp: {
66
+ label: t("neetoMessageTemplate.template.whatsappTemplates"),
67
+ value: "whatsapp_template",
68
+ addText: t("neetoMessageTemplate.template.addWhatsappTemplate"),
69
+ labelSingular: t("neetoMessageTemplate.template.whatsappTemplate"),
70
+ editText: t("neetoMessageTemplate.template.editWhatsappTemplate")
71
+ },
72
+ api: {
73
+ label: t("neetoMessageTemplate.template.apiTemplates"),
74
+ value: "api_template",
75
+ addText: t("neetoMessageTemplate.api.addApiTemplate")
76
+ }
77
+ };
78
+ var MESSAGE_TYPES = {
79
+ sms: t("messageType.sms"),
80
+ email: t("messageType.email"),
81
+ whatsapp: t("messageType.whatsapp")
82
+ };
83
+ var DEFAULT_EDITOR_ROW_COUNT = 15;
84
+ var DEFAULT_PAGE_PROPERTIES = {
85
+ size: DEFAULT_PAGE_SIZE,
86
+ index: DEFAULT_PAGE_INDEX
87
+ };
88
+
89
+ function getDefaultExportFromCjs (x) {
90
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
91
+ }
92
+
93
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
94
+ var shams = function hasSymbols() {
95
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
96
+ if (typeof Symbol.iterator === 'symbol') { return true; }
97
+
98
+ var obj = {};
99
+ var sym = Symbol('test');
100
+ var symObj = Object(sym);
101
+ if (typeof sym === 'string') { return false; }
102
+
103
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
104
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
105
+
106
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
107
+ // if (sym instanceof Symbol) { return false; }
108
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
109
+ // if (!(symObj instanceof Symbol)) { return false; }
110
+
111
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
112
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
113
+
114
+ var symVal = 42;
115
+ obj[sym] = symVal;
116
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
117
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
118
+
119
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
120
+
121
+ var syms = Object.getOwnPropertySymbols(obj);
122
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
123
+
124
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
125
+
126
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
127
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
128
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
129
+ }
130
+
131
+ return true;
132
+ };
133
+
134
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
135
+ var hasSymbolSham = shams;
136
+
137
+ var hasSymbols$1 = function hasNativeSymbols() {
138
+ if (typeof origSymbol !== 'function') { return false; }
139
+ if (typeof Symbol !== 'function') { return false; }
140
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
141
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
142
+
143
+ return hasSymbolSham();
144
+ };
145
+
146
+ var test = {
147
+ foo: {}
148
+ };
149
+
150
+ var $Object = Object;
151
+
152
+ var hasProto$1 = function hasProto() {
153
+ return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
154
+ };
155
+
156
+ /* eslint no-invalid-this: 1 */
157
+
158
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
159
+ var slice = Array.prototype.slice;
160
+ var toStr$1 = Object.prototype.toString;
161
+ var funcType = '[object Function]';
162
+
163
+ var implementation$1 = function bind(that) {
164
+ var target = this;
165
+ if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
166
+ throw new TypeError(ERROR_MESSAGE + target);
167
+ }
168
+ var args = slice.call(arguments, 1);
169
+
170
+ var bound;
171
+ var binder = function () {
172
+ if (this instanceof bound) {
173
+ var result = target.apply(
174
+ this,
175
+ args.concat(slice.call(arguments))
176
+ );
177
+ if (Object(result) === result) {
178
+ return result;
179
+ }
180
+ return this;
181
+ } else {
182
+ return target.apply(
183
+ that,
184
+ args.concat(slice.call(arguments))
185
+ );
186
+ }
187
+ };
188
+
189
+ var boundLength = Math.max(0, target.length - args.length);
190
+ var boundArgs = [];
191
+ for (var i = 0; i < boundLength; i++) {
192
+ boundArgs.push('$' + i);
193
+ }
194
+
195
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
196
+
197
+ if (target.prototype) {
198
+ var Empty = function Empty() {};
199
+ Empty.prototype = target.prototype;
200
+ bound.prototype = new Empty();
201
+ Empty.prototype = null;
202
+ }
203
+
204
+ return bound;
205
+ };
206
+
207
+ var implementation = implementation$1;
208
+
209
+ var functionBind = Function.prototype.bind || implementation;
210
+
211
+ var bind$1 = functionBind;
212
+
213
+ var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
214
+
215
+ var undefined$1;
216
+
217
+ var $SyntaxError = SyntaxError;
218
+ var $Function = Function;
219
+ var $TypeError$1 = TypeError;
220
+
221
+ // eslint-disable-next-line consistent-return
222
+ var getEvalledConstructor = function (expressionSyntax) {
223
+ try {
224
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
225
+ } catch (e) {}
226
+ };
227
+
228
+ var $gOPD = Object.getOwnPropertyDescriptor;
229
+ if ($gOPD) {
230
+ try {
231
+ $gOPD({}, '');
232
+ } catch (e) {
233
+ $gOPD = null; // this is IE 8, which has a broken gOPD
234
+ }
235
+ }
236
+
237
+ var throwTypeError = function () {
238
+ throw new $TypeError$1();
239
+ };
240
+ var ThrowTypeError = $gOPD
241
+ ? (function () {
242
+ try {
243
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
244
+ arguments.callee; // IE 8 does not throw here
245
+ return throwTypeError;
246
+ } catch (calleeThrows) {
247
+ try {
248
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
249
+ return $gOPD(arguments, 'callee').get;
250
+ } catch (gOPDthrows) {
251
+ return throwTypeError;
252
+ }
253
+ }
254
+ }())
255
+ : throwTypeError;
256
+
257
+ var hasSymbols = hasSymbols$1();
258
+ var hasProto = hasProto$1();
259
+
260
+ var getProto = Object.getPrototypeOf || (
261
+ hasProto
262
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
263
+ : null
264
+ );
265
+
266
+ var needsEval = {};
267
+
268
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
269
+
270
+ var INTRINSICS = {
271
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
272
+ '%Array%': Array,
273
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
274
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
275
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
276
+ '%AsyncFunction%': needsEval,
277
+ '%AsyncGenerator%': needsEval,
278
+ '%AsyncGeneratorFunction%': needsEval,
279
+ '%AsyncIteratorPrototype%': needsEval,
280
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
281
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
282
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
283
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
284
+ '%Boolean%': Boolean,
285
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
286
+ '%Date%': Date,
287
+ '%decodeURI%': decodeURI,
288
+ '%decodeURIComponent%': decodeURIComponent,
289
+ '%encodeURI%': encodeURI,
290
+ '%encodeURIComponent%': encodeURIComponent,
291
+ '%Error%': Error,
292
+ '%eval%': eval, // eslint-disable-line no-eval
293
+ '%EvalError%': EvalError,
294
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
295
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
296
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
297
+ '%Function%': $Function,
298
+ '%GeneratorFunction%': needsEval,
299
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
300
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
301
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
302
+ '%isFinite%': isFinite,
303
+ '%isNaN%': isNaN,
304
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
305
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
306
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
307
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
308
+ '%Math%': Math,
309
+ '%Number%': Number,
310
+ '%Object%': Object,
311
+ '%parseFloat%': parseFloat,
312
+ '%parseInt%': parseInt,
313
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
314
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
315
+ '%RangeError%': RangeError,
316
+ '%ReferenceError%': ReferenceError,
317
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
318
+ '%RegExp%': RegExp,
319
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
320
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
321
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
322
+ '%String%': String,
323
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
324
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
325
+ '%SyntaxError%': $SyntaxError,
326
+ '%ThrowTypeError%': ThrowTypeError,
327
+ '%TypedArray%': TypedArray,
328
+ '%TypeError%': $TypeError$1,
329
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
330
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
331
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
332
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
333
+ '%URIError%': URIError,
334
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
335
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
336
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
337
+ };
338
+
339
+ if (getProto) {
340
+ try {
341
+ null.error; // eslint-disable-line no-unused-expressions
342
+ } catch (e) {
343
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
344
+ var errorProto = getProto(getProto(e));
345
+ INTRINSICS['%Error.prototype%'] = errorProto;
346
+ }
347
+ }
348
+
349
+ var doEval = function doEval(name) {
350
+ var value;
351
+ if (name === '%AsyncFunction%') {
352
+ value = getEvalledConstructor('async function () {}');
353
+ } else if (name === '%GeneratorFunction%') {
354
+ value = getEvalledConstructor('function* () {}');
355
+ } else if (name === '%AsyncGeneratorFunction%') {
356
+ value = getEvalledConstructor('async function* () {}');
357
+ } else if (name === '%AsyncGenerator%') {
358
+ var fn = doEval('%AsyncGeneratorFunction%');
359
+ if (fn) {
360
+ value = fn.prototype;
361
+ }
362
+ } else if (name === '%AsyncIteratorPrototype%') {
363
+ var gen = doEval('%AsyncGenerator%');
364
+ if (gen && getProto) {
365
+ value = getProto(gen.prototype);
366
+ }
367
+ }
368
+
369
+ INTRINSICS[name] = value;
370
+
371
+ return value;
372
+ };
373
+
374
+ var LEGACY_ALIASES = {
375
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
376
+ '%ArrayPrototype%': ['Array', 'prototype'],
377
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
378
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
379
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
380
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
381
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
382
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
383
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
384
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
385
+ '%DataViewPrototype%': ['DataView', 'prototype'],
386
+ '%DatePrototype%': ['Date', 'prototype'],
387
+ '%ErrorPrototype%': ['Error', 'prototype'],
388
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
389
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
390
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
391
+ '%FunctionPrototype%': ['Function', 'prototype'],
392
+ '%Generator%': ['GeneratorFunction', 'prototype'],
393
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
394
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
395
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
396
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
397
+ '%JSONParse%': ['JSON', 'parse'],
398
+ '%JSONStringify%': ['JSON', 'stringify'],
399
+ '%MapPrototype%': ['Map', 'prototype'],
400
+ '%NumberPrototype%': ['Number', 'prototype'],
401
+ '%ObjectPrototype%': ['Object', 'prototype'],
402
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
403
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
404
+ '%PromisePrototype%': ['Promise', 'prototype'],
405
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
406
+ '%Promise_all%': ['Promise', 'all'],
407
+ '%Promise_reject%': ['Promise', 'reject'],
408
+ '%Promise_resolve%': ['Promise', 'resolve'],
409
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
410
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
411
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
412
+ '%SetPrototype%': ['Set', 'prototype'],
413
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
414
+ '%StringPrototype%': ['String', 'prototype'],
415
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
416
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
417
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
418
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
419
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
420
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
421
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
422
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
423
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
424
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
425
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
426
+ };
427
+
428
+ var bind = functionBind;
429
+ var hasOwn$1 = src;
430
+ var $concat$1 = bind.call(Function.call, Array.prototype.concat);
431
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
432
+ var $replace$1 = bind.call(Function.call, String.prototype.replace);
433
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
434
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
435
+
436
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
437
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
438
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
439
+ var stringToPath = function stringToPath(string) {
440
+ var first = $strSlice(string, 0, 1);
441
+ var last = $strSlice(string, -1);
442
+ if (first === '%' && last !== '%') {
443
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
444
+ } else if (last === '%' && first !== '%') {
445
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
446
+ }
447
+ var result = [];
448
+ $replace$1(string, rePropName, function (match, number, quote, subString) {
449
+ result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
450
+ });
451
+ return result;
452
+ };
453
+ /* end adaptation */
454
+
455
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
456
+ var intrinsicName = name;
457
+ var alias;
458
+ if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
459
+ alias = LEGACY_ALIASES[intrinsicName];
460
+ intrinsicName = '%' + alias[0] + '%';
461
+ }
462
+
463
+ if (hasOwn$1(INTRINSICS, intrinsicName)) {
464
+ var value = INTRINSICS[intrinsicName];
465
+ if (value === needsEval) {
466
+ value = doEval(intrinsicName);
467
+ }
468
+ if (typeof value === 'undefined' && !allowMissing) {
469
+ throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
470
+ }
471
+
472
+ return {
473
+ alias: alias,
474
+ name: intrinsicName,
475
+ value: value
476
+ };
477
+ }
478
+
479
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
480
+ };
481
+
482
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
483
+ if (typeof name !== 'string' || name.length === 0) {
484
+ throw new $TypeError$1('intrinsic name must be a non-empty string');
485
+ }
486
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
487
+ throw new $TypeError$1('"allowMissing" argument must be a boolean');
488
+ }
489
+
490
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
491
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
492
+ }
493
+ var parts = stringToPath(name);
494
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
495
+
496
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
497
+ var intrinsicRealName = intrinsic.name;
498
+ var value = intrinsic.value;
499
+ var skipFurtherCaching = false;
500
+
501
+ var alias = intrinsic.alias;
502
+ if (alias) {
503
+ intrinsicBaseName = alias[0];
504
+ $spliceApply(parts, $concat$1([0, 1], alias));
505
+ }
506
+
507
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
508
+ var part = parts[i];
509
+ var first = $strSlice(part, 0, 1);
510
+ var last = $strSlice(part, -1);
511
+ if (
512
+ (
513
+ (first === '"' || first === "'" || first === '`')
514
+ || (last === '"' || last === "'" || last === '`')
515
+ )
516
+ && first !== last
517
+ ) {
518
+ throw new $SyntaxError('property names with quotes must have matching quotes');
519
+ }
520
+ if (part === 'constructor' || !isOwn) {
521
+ skipFurtherCaching = true;
522
+ }
523
+
524
+ intrinsicBaseName += '.' + part;
525
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
526
+
527
+ if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
528
+ value = INTRINSICS[intrinsicRealName];
529
+ } else if (value != null) {
530
+ if (!(part in value)) {
531
+ if (!allowMissing) {
532
+ throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
533
+ }
534
+ return void undefined$1;
535
+ }
536
+ if ($gOPD && (i + 1) >= parts.length) {
537
+ var desc = $gOPD(value, part);
538
+ isOwn = !!desc;
539
+
540
+ // By convention, when a data property is converted to an accessor
541
+ // property to emulate a data property that does not suffer from
542
+ // the override mistake, that accessor's getter is marked with
543
+ // an `originalValue` property. Here, when we detect this, we
544
+ // uphold the illusion by pretending to see that original data
545
+ // property, i.e., returning the value rather than the getter
546
+ // itself.
547
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
548
+ value = desc.get;
549
+ } else {
550
+ value = value[part];
551
+ }
552
+ } else {
553
+ isOwn = hasOwn$1(value, part);
554
+ value = value[part];
555
+ }
556
+
557
+ if (isOwn && !skipFurtherCaching) {
558
+ INTRINSICS[intrinsicRealName] = value;
559
+ }
560
+ }
561
+ }
562
+ return value;
563
+ };
564
+
565
+ var callBind$1 = {exports: {}};
566
+
567
+ callBind$1.exports;
568
+
569
+ (function (module) {
570
+
571
+ var bind = functionBind;
572
+ var GetIntrinsic = getIntrinsic;
573
+
574
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
575
+ var $call = GetIntrinsic('%Function.prototype.call%');
576
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
577
+
578
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
579
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
580
+ var $max = GetIntrinsic('%Math.max%');
581
+
582
+ if ($defineProperty) {
583
+ try {
584
+ $defineProperty({}, 'a', { value: 1 });
585
+ } catch (e) {
586
+ // IE 8 has a broken defineProperty
587
+ $defineProperty = null;
588
+ }
589
+ }
590
+
591
+ module.exports = function callBind(originalFunction) {
592
+ var func = $reflectApply(bind, $call, arguments);
593
+ if ($gOPD && $defineProperty) {
594
+ var desc = $gOPD(func, 'length');
595
+ if (desc.configurable) {
596
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
597
+ $defineProperty(
598
+ func,
599
+ 'length',
600
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
601
+ );
602
+ }
603
+ }
604
+ return func;
605
+ };
606
+
607
+ var applyBind = function applyBind() {
608
+ return $reflectApply(bind, $apply, arguments);
609
+ };
610
+
611
+ if ($defineProperty) {
612
+ $defineProperty(module.exports, 'apply', { value: applyBind });
613
+ } else {
614
+ module.exports.apply = applyBind;
615
+ }
616
+ } (callBind$1));
617
+
618
+ var callBindExports = callBind$1.exports;
619
+
620
+ var GetIntrinsic$1 = getIntrinsic;
621
+
622
+ var callBind = callBindExports;
623
+
624
+ var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
625
+
626
+ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
627
+ var intrinsic = GetIntrinsic$1(name, !!allowMissing);
628
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
629
+ return callBind(intrinsic);
630
+ }
631
+ return intrinsic;
632
+ };
633
+
634
+ var util_inspect = require$$0.inspect;
635
+
636
+ var hasMap = typeof Map === 'function' && Map.prototype;
637
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
638
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
639
+ var mapForEach = hasMap && Map.prototype.forEach;
640
+ var hasSet = typeof Set === 'function' && Set.prototype;
641
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
642
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
643
+ var setForEach = hasSet && Set.prototype.forEach;
644
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
645
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
646
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
647
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
648
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
649
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
650
+ var booleanValueOf = Boolean.prototype.valueOf;
651
+ var objectToString = Object.prototype.toString;
652
+ var functionToString = Function.prototype.toString;
653
+ var $match = String.prototype.match;
654
+ var $slice = String.prototype.slice;
655
+ var $replace = String.prototype.replace;
656
+ var $toUpperCase = String.prototype.toUpperCase;
657
+ var $toLowerCase = String.prototype.toLowerCase;
658
+ var $test = RegExp.prototype.test;
659
+ var $concat = Array.prototype.concat;
660
+ var $join = Array.prototype.join;
661
+ var $arrSlice = Array.prototype.slice;
662
+ var $floor = Math.floor;
663
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
664
+ var gOPS = Object.getOwnPropertySymbols;
665
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
666
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
667
+ // ie, `has-tostringtag/shams
668
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
669
+ ? Symbol.toStringTag
670
+ : null;
671
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
672
+
673
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
674
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
675
+ ? function (O) {
676
+ return O.__proto__; // eslint-disable-line no-proto
677
+ }
678
+ : null
679
+ );
680
+
681
+ function addNumericSeparator(num, str) {
682
+ if (
683
+ num === Infinity
684
+ || num === -Infinity
685
+ || num !== num
686
+ || (num && num > -1000 && num < 1000)
687
+ || $test.call(/e/, str)
688
+ ) {
689
+ return str;
690
+ }
691
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
692
+ if (typeof num === 'number') {
693
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
694
+ if (int !== num) {
695
+ var intStr = String(int);
696
+ var dec = $slice.call(str, intStr.length + 1);
697
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
698
+ }
699
+ }
700
+ return $replace.call(str, sepRegex, '$&_');
701
+ }
702
+
703
+ var utilInspect = util_inspect;
704
+ var inspectCustom = utilInspect.custom;
705
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
706
+
707
+ var objectInspect = function inspect_(obj, options, depth, seen) {
708
+ var opts = options || {};
709
+
710
+ if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
711
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
712
+ }
713
+ if (
714
+ has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
715
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
716
+ : opts.maxStringLength !== null
717
+ )
718
+ ) {
719
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
720
+ }
721
+ var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
722
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
723
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
724
+ }
725
+
726
+ if (
727
+ has$3(opts, 'indent')
728
+ && opts.indent !== null
729
+ && opts.indent !== '\t'
730
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
731
+ ) {
732
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
733
+ }
734
+ if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
735
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
736
+ }
737
+ var numericSeparator = opts.numericSeparator;
738
+
739
+ if (typeof obj === 'undefined') {
740
+ return 'undefined';
741
+ }
742
+ if (obj === null) {
743
+ return 'null';
744
+ }
745
+ if (typeof obj === 'boolean') {
746
+ return obj ? 'true' : 'false';
747
+ }
748
+
749
+ if (typeof obj === 'string') {
750
+ return inspectString(obj, opts);
751
+ }
752
+ if (typeof obj === 'number') {
753
+ if (obj === 0) {
754
+ return Infinity / obj > 0 ? '0' : '-0';
755
+ }
756
+ var str = String(obj);
757
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
758
+ }
759
+ if (typeof obj === 'bigint') {
760
+ var bigIntStr = String(obj) + 'n';
761
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
762
+ }
763
+
764
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
765
+ if (typeof depth === 'undefined') { depth = 0; }
766
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
767
+ return isArray$3(obj) ? '[Array]' : '[Object]';
768
+ }
769
+
770
+ var indent = getIndent(opts, depth);
771
+
772
+ if (typeof seen === 'undefined') {
773
+ seen = [];
774
+ } else if (indexOf(seen, obj) >= 0) {
775
+ return '[Circular]';
776
+ }
777
+
778
+ function inspect(value, from, noIndent) {
779
+ if (from) {
780
+ seen = $arrSlice.call(seen);
781
+ seen.push(from);
782
+ }
783
+ if (noIndent) {
784
+ var newOpts = {
785
+ depth: opts.depth
786
+ };
787
+ if (has$3(opts, 'quoteStyle')) {
788
+ newOpts.quoteStyle = opts.quoteStyle;
789
+ }
790
+ return inspect_(value, newOpts, depth + 1, seen);
791
+ }
792
+ return inspect_(value, opts, depth + 1, seen);
793
+ }
794
+
795
+ if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
796
+ var name = nameOf(obj);
797
+ var keys = arrObjKeys(obj, inspect);
798
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
799
+ }
800
+ if (isSymbol(obj)) {
801
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
802
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
803
+ }
804
+ if (isElement(obj)) {
805
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
806
+ var attrs = obj.attributes || [];
807
+ for (var i = 0; i < attrs.length; i++) {
808
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
809
+ }
810
+ s += '>';
811
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
812
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
813
+ return s;
814
+ }
815
+ if (isArray$3(obj)) {
816
+ if (obj.length === 0) { return '[]'; }
817
+ var xs = arrObjKeys(obj, inspect);
818
+ if (indent && !singleLineValues(xs)) {
819
+ return '[' + indentedJoin(xs, indent) + ']';
820
+ }
821
+ return '[ ' + $join.call(xs, ', ') + ' ]';
822
+ }
823
+ if (isError(obj)) {
824
+ var parts = arrObjKeys(obj, inspect);
825
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
826
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
827
+ }
828
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
829
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
830
+ }
831
+ if (typeof obj === 'object' && customInspect) {
832
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
833
+ return utilInspect(obj, { depth: maxDepth - depth });
834
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
835
+ return obj.inspect();
836
+ }
837
+ }
838
+ if (isMap(obj)) {
839
+ var mapParts = [];
840
+ if (mapForEach) {
841
+ mapForEach.call(obj, function (value, key) {
842
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
843
+ });
844
+ }
845
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
846
+ }
847
+ if (isSet(obj)) {
848
+ var setParts = [];
849
+ if (setForEach) {
850
+ setForEach.call(obj, function (value) {
851
+ setParts.push(inspect(value, obj));
852
+ });
853
+ }
854
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
855
+ }
856
+ if (isWeakMap(obj)) {
857
+ return weakCollectionOf('WeakMap');
858
+ }
859
+ if (isWeakSet(obj)) {
860
+ return weakCollectionOf('WeakSet');
861
+ }
862
+ if (isWeakRef(obj)) {
863
+ return weakCollectionOf('WeakRef');
864
+ }
865
+ if (isNumber(obj)) {
866
+ return markBoxed(inspect(Number(obj)));
867
+ }
868
+ if (isBigInt(obj)) {
869
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
870
+ }
871
+ if (isBoolean(obj)) {
872
+ return markBoxed(booleanValueOf.call(obj));
873
+ }
874
+ if (isString(obj)) {
875
+ return markBoxed(inspect(String(obj)));
876
+ }
877
+ if (!isDate(obj) && !isRegExp$1(obj)) {
878
+ var ys = arrObjKeys(obj, inspect);
879
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
880
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
881
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
882
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
883
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
884
+ if (ys.length === 0) { return tag + '{}'; }
885
+ if (indent) {
886
+ return tag + '{' + indentedJoin(ys, indent) + '}';
887
+ }
888
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
889
+ }
890
+ return String(obj);
891
+ };
892
+
893
+ function wrapQuotes(s, defaultStyle, opts) {
894
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
895
+ return quoteChar + s + quoteChar;
896
+ }
897
+
898
+ function quote(s) {
899
+ return $replace.call(String(s), /"/g, '&quot;');
900
+ }
901
+
902
+ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
903
+ function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
904
+ function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
905
+ function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
906
+ function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
907
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
908
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
909
+
910
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
911
+ function isSymbol(obj) {
912
+ if (hasShammedSymbols) {
913
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
914
+ }
915
+ if (typeof obj === 'symbol') {
916
+ return true;
917
+ }
918
+ if (!obj || typeof obj !== 'object' || !symToString) {
919
+ return false;
920
+ }
921
+ try {
922
+ symToString.call(obj);
923
+ return true;
924
+ } catch (e) {}
925
+ return false;
926
+ }
927
+
928
+ function isBigInt(obj) {
929
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
930
+ return false;
931
+ }
932
+ try {
933
+ bigIntValueOf.call(obj);
934
+ return true;
935
+ } catch (e) {}
936
+ return false;
937
+ }
938
+
939
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
940
+ function has$3(obj, key) {
941
+ return hasOwn.call(obj, key);
942
+ }
943
+
944
+ function toStr(obj) {
945
+ return objectToString.call(obj);
946
+ }
947
+
948
+ function nameOf(f) {
949
+ if (f.name) { return f.name; }
950
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
951
+ if (m) { return m[1]; }
952
+ return null;
953
+ }
954
+
955
+ function indexOf(xs, x) {
956
+ if (xs.indexOf) { return xs.indexOf(x); }
957
+ for (var i = 0, l = xs.length; i < l; i++) {
958
+ if (xs[i] === x) { return i; }
959
+ }
960
+ return -1;
961
+ }
962
+
963
+ function isMap(x) {
964
+ if (!mapSize || !x || typeof x !== 'object') {
965
+ return false;
966
+ }
967
+ try {
968
+ mapSize.call(x);
969
+ try {
970
+ setSize.call(x);
971
+ } catch (s) {
972
+ return true;
973
+ }
974
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
975
+ } catch (e) {}
976
+ return false;
977
+ }
978
+
979
+ function isWeakMap(x) {
980
+ if (!weakMapHas || !x || typeof x !== 'object') {
981
+ return false;
982
+ }
983
+ try {
984
+ weakMapHas.call(x, weakMapHas);
985
+ try {
986
+ weakSetHas.call(x, weakSetHas);
987
+ } catch (s) {
988
+ return true;
989
+ }
990
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
991
+ } catch (e) {}
992
+ return false;
993
+ }
994
+
995
+ function isWeakRef(x) {
996
+ if (!weakRefDeref || !x || typeof x !== 'object') {
997
+ return false;
998
+ }
999
+ try {
1000
+ weakRefDeref.call(x);
1001
+ return true;
1002
+ } catch (e) {}
1003
+ return false;
1004
+ }
1005
+
1006
+ function isSet(x) {
1007
+ if (!setSize || !x || typeof x !== 'object') {
1008
+ return false;
1009
+ }
1010
+ try {
1011
+ setSize.call(x);
1012
+ try {
1013
+ mapSize.call(x);
1014
+ } catch (m) {
1015
+ return true;
1016
+ }
1017
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
1018
+ } catch (e) {}
1019
+ return false;
1020
+ }
1021
+
1022
+ function isWeakSet(x) {
1023
+ if (!weakSetHas || !x || typeof x !== 'object') {
1024
+ return false;
1025
+ }
1026
+ try {
1027
+ weakSetHas.call(x, weakSetHas);
1028
+ try {
1029
+ weakMapHas.call(x, weakMapHas);
1030
+ } catch (s) {
1031
+ return true;
1032
+ }
1033
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
1034
+ } catch (e) {}
1035
+ return false;
1036
+ }
1037
+
1038
+ function isElement(x) {
1039
+ if (!x || typeof x !== 'object') { return false; }
1040
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
1041
+ return true;
1042
+ }
1043
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
1044
+ }
1045
+
1046
+ function inspectString(str, opts) {
1047
+ if (str.length > opts.maxStringLength) {
1048
+ var remaining = str.length - opts.maxStringLength;
1049
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1050
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
1051
+ }
1052
+ // eslint-disable-next-line no-control-regex
1053
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1054
+ return wrapQuotes(s, 'single', opts);
1055
+ }
1056
+
1057
+ function lowbyte(c) {
1058
+ var n = c.charCodeAt(0);
1059
+ var x = {
1060
+ 8: 'b',
1061
+ 9: 't',
1062
+ 10: 'n',
1063
+ 12: 'f',
1064
+ 13: 'r'
1065
+ }[n];
1066
+ if (x) { return '\\' + x; }
1067
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
1068
+ }
1069
+
1070
+ function markBoxed(str) {
1071
+ return 'Object(' + str + ')';
1072
+ }
1073
+
1074
+ function weakCollectionOf(type) {
1075
+ return type + ' { ? }';
1076
+ }
1077
+
1078
+ function collectionOf(type, size, entries, indent) {
1079
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
1080
+ return type + ' (' + size + ') {' + joinedEntries + '}';
1081
+ }
1082
+
1083
+ function singleLineValues(xs) {
1084
+ for (var i = 0; i < xs.length; i++) {
1085
+ if (indexOf(xs[i], '\n') >= 0) {
1086
+ return false;
1087
+ }
1088
+ }
1089
+ return true;
1090
+ }
1091
+
1092
+ function getIndent(opts, depth) {
1093
+ var baseIndent;
1094
+ if (opts.indent === '\t') {
1095
+ baseIndent = '\t';
1096
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
1097
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
1098
+ } else {
1099
+ return null;
1100
+ }
1101
+ return {
1102
+ base: baseIndent,
1103
+ prev: $join.call(Array(depth + 1), baseIndent)
1104
+ };
1105
+ }
1106
+
1107
+ function indentedJoin(xs, indent) {
1108
+ if (xs.length === 0) { return ''; }
1109
+ var lineJoiner = '\n' + indent.prev + indent.base;
1110
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
1111
+ }
1112
+
1113
+ function arrObjKeys(obj, inspect) {
1114
+ var isArr = isArray$3(obj);
1115
+ var xs = [];
1116
+ if (isArr) {
1117
+ xs.length = obj.length;
1118
+ for (var i = 0; i < obj.length; i++) {
1119
+ xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
1120
+ }
1121
+ }
1122
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
1123
+ var symMap;
1124
+ if (hasShammedSymbols) {
1125
+ symMap = {};
1126
+ for (var k = 0; k < syms.length; k++) {
1127
+ symMap['$' + syms[k]] = syms[k];
1128
+ }
1129
+ }
1130
+
1131
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
1132
+ if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1133
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1134
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
1135
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
1136
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
1137
+ } else if ($test.call(/[^\w$]/, key)) {
1138
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
1139
+ } else {
1140
+ xs.push(key + ': ' + inspect(obj[key], obj));
1141
+ }
1142
+ }
1143
+ if (typeof gOPS === 'function') {
1144
+ for (var j = 0; j < syms.length; j++) {
1145
+ if (isEnumerable.call(obj, syms[j])) {
1146
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
1147
+ }
1148
+ }
1149
+ }
1150
+ return xs;
1151
+ }
1152
+
1153
+ var GetIntrinsic = getIntrinsic;
1154
+ var callBound = callBound$1;
1155
+ var inspect = objectInspect;
1156
+
1157
+ var $TypeError = GetIntrinsic('%TypeError%');
1158
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
1159
+ var $Map = GetIntrinsic('%Map%', true);
1160
+
1161
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
1162
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
1163
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
1164
+ var $mapGet = callBound('Map.prototype.get', true);
1165
+ var $mapSet = callBound('Map.prototype.set', true);
1166
+ var $mapHas = callBound('Map.prototype.has', true);
1167
+
1168
+ /*
1169
+ * This function traverses the list returning the node corresponding to the
1170
+ * given key.
1171
+ *
1172
+ * That node is also moved to the head of the list, so that if it's accessed
1173
+ * again we don't need to traverse the whole list. By doing so, all the recently
1174
+ * used nodes can be accessed relatively quickly.
1175
+ */
1176
+ var listGetNode = function (list, key) { // eslint-disable-line consistent-return
1177
+ for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
1178
+ if (curr.key === key) {
1179
+ prev.next = curr.next;
1180
+ curr.next = list.next;
1181
+ list.next = curr; // eslint-disable-line no-param-reassign
1182
+ return curr;
1183
+ }
1184
+ }
1185
+ };
1186
+
1187
+ var listGet = function (objects, key) {
1188
+ var node = listGetNode(objects, key);
1189
+ return node && node.value;
1190
+ };
1191
+ var listSet = function (objects, key, value) {
1192
+ var node = listGetNode(objects, key);
1193
+ if (node) {
1194
+ node.value = value;
1195
+ } else {
1196
+ // Prepend the new node to the beginning of the list
1197
+ objects.next = { // eslint-disable-line no-param-reassign
1198
+ key: key,
1199
+ next: objects.next,
1200
+ value: value
1201
+ };
1202
+ }
1203
+ };
1204
+ var listHas = function (objects, key) {
1205
+ return !!listGetNode(objects, key);
1206
+ };
1207
+
1208
+ var sideChannel = function getSideChannel() {
1209
+ var $wm;
1210
+ var $m;
1211
+ var $o;
1212
+ var channel = {
1213
+ assert: function (key) {
1214
+ if (!channel.has(key)) {
1215
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
1216
+ }
1217
+ },
1218
+ get: function (key) { // eslint-disable-line consistent-return
1219
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1220
+ if ($wm) {
1221
+ return $weakMapGet($wm, key);
1222
+ }
1223
+ } else if ($Map) {
1224
+ if ($m) {
1225
+ return $mapGet($m, key);
1226
+ }
1227
+ } else {
1228
+ if ($o) { // eslint-disable-line no-lonely-if
1229
+ return listGet($o, key);
1230
+ }
1231
+ }
1232
+ },
1233
+ has: function (key) {
1234
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1235
+ if ($wm) {
1236
+ return $weakMapHas($wm, key);
1237
+ }
1238
+ } else if ($Map) {
1239
+ if ($m) {
1240
+ return $mapHas($m, key);
1241
+ }
1242
+ } else {
1243
+ if ($o) { // eslint-disable-line no-lonely-if
1244
+ return listHas($o, key);
1245
+ }
1246
+ }
1247
+ return false;
1248
+ },
1249
+ set: function (key, value) {
1250
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1251
+ if (!$wm) {
1252
+ $wm = new $WeakMap();
1253
+ }
1254
+ $weakMapSet($wm, key, value);
1255
+ } else if ($Map) {
1256
+ if (!$m) {
1257
+ $m = new $Map();
1258
+ }
1259
+ $mapSet($m, key, value);
1260
+ } else {
1261
+ if (!$o) {
1262
+ /*
1263
+ * Initialize the linked list as an empty node, so that we don't have
1264
+ * to special-case handling of the first node: we can always refer to
1265
+ * it as (previous node).next, instead of something like (list).head
1266
+ */
1267
+ $o = { key: {}, next: null };
1268
+ }
1269
+ listSet($o, key, value);
1270
+ }
1271
+ }
1272
+ };
1273
+ return channel;
1274
+ };
1275
+
1276
+ var replace = String.prototype.replace;
1277
+ var percentTwenties = /%20/g;
1278
+
1279
+ var Format = {
1280
+ RFC1738: 'RFC1738',
1281
+ RFC3986: 'RFC3986'
1282
+ };
1283
+
1284
+ var formats$3 = {
1285
+ 'default': Format.RFC3986,
1286
+ formatters: {
1287
+ RFC1738: function (value) {
1288
+ return replace.call(value, percentTwenties, '+');
1289
+ },
1290
+ RFC3986: function (value) {
1291
+ return String(value);
1292
+ }
1293
+ },
1294
+ RFC1738: Format.RFC1738,
1295
+ RFC3986: Format.RFC3986
1296
+ };
1297
+
1298
+ var formats$2 = formats$3;
1299
+
1300
+ var has$2 = Object.prototype.hasOwnProperty;
1301
+ var isArray$2 = Array.isArray;
1302
+
1303
+ var hexTable = (function () {
1304
+ var array = [];
1305
+ for (var i = 0; i < 256; ++i) {
1306
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
1307
+ }
1308
+
1309
+ return array;
1310
+ }());
1311
+
1312
+ var compactQueue = function compactQueue(queue) {
1313
+ while (queue.length > 1) {
1314
+ var item = queue.pop();
1315
+ var obj = item.obj[item.prop];
1316
+
1317
+ if (isArray$2(obj)) {
1318
+ var compacted = [];
1319
+
1320
+ for (var j = 0; j < obj.length; ++j) {
1321
+ if (typeof obj[j] !== 'undefined') {
1322
+ compacted.push(obj[j]);
1323
+ }
1324
+ }
1325
+
1326
+ item.obj[item.prop] = compacted;
1327
+ }
1328
+ }
1329
+ };
1330
+
1331
+ var arrayToObject = function arrayToObject(source, options) {
1332
+ var obj = options && options.plainObjects ? Object.create(null) : {};
1333
+ for (var i = 0; i < source.length; ++i) {
1334
+ if (typeof source[i] !== 'undefined') {
1335
+ obj[i] = source[i];
1336
+ }
1337
+ }
1338
+
1339
+ return obj;
1340
+ };
1341
+
1342
+ var merge = function merge(target, source, options) {
1343
+ /* eslint no-param-reassign: 0 */
1344
+ if (!source) {
1345
+ return target;
1346
+ }
1347
+
1348
+ if (typeof source !== 'object') {
1349
+ if (isArray$2(target)) {
1350
+ target.push(source);
1351
+ } else if (target && typeof target === 'object') {
1352
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
1353
+ target[source] = true;
1354
+ }
1355
+ } else {
1356
+ return [target, source];
1357
+ }
1358
+
1359
+ return target;
1360
+ }
1361
+
1362
+ if (!target || typeof target !== 'object') {
1363
+ return [target].concat(source);
1364
+ }
1365
+
1366
+ var mergeTarget = target;
1367
+ if (isArray$2(target) && !isArray$2(source)) {
1368
+ mergeTarget = arrayToObject(target, options);
1369
+ }
1370
+
1371
+ if (isArray$2(target) && isArray$2(source)) {
1372
+ source.forEach(function (item, i) {
1373
+ if (has$2.call(target, i)) {
1374
+ var targetItem = target[i];
1375
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
1376
+ target[i] = merge(targetItem, item, options);
1377
+ } else {
1378
+ target.push(item);
1379
+ }
1380
+ } else {
1381
+ target[i] = item;
1382
+ }
1383
+ });
1384
+ return target;
1385
+ }
1386
+
1387
+ return Object.keys(source).reduce(function (acc, key) {
1388
+ var value = source[key];
1389
+
1390
+ if (has$2.call(acc, key)) {
1391
+ acc[key] = merge(acc[key], value, options);
1392
+ } else {
1393
+ acc[key] = value;
1394
+ }
1395
+ return acc;
1396
+ }, mergeTarget);
1397
+ };
1398
+
1399
+ var assign = function assignSingleSource(target, source) {
1400
+ return Object.keys(source).reduce(function (acc, key) {
1401
+ acc[key] = source[key];
1402
+ return acc;
1403
+ }, target);
1404
+ };
1405
+
1406
+ var decode = function (str, decoder, charset) {
1407
+ var strWithoutPlus = str.replace(/\+/g, ' ');
1408
+ if (charset === 'iso-8859-1') {
1409
+ // unescape never throws, no try...catch needed:
1410
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
1411
+ }
1412
+ // utf-8
1413
+ try {
1414
+ return decodeURIComponent(strWithoutPlus);
1415
+ } catch (e) {
1416
+ return strWithoutPlus;
1417
+ }
1418
+ };
1419
+
1420
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
1421
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
1422
+ // It has been adapted here for stricter adherence to RFC 3986
1423
+ if (str.length === 0) {
1424
+ return str;
1425
+ }
1426
+
1427
+ var string = str;
1428
+ if (typeof str === 'symbol') {
1429
+ string = Symbol.prototype.toString.call(str);
1430
+ } else if (typeof str !== 'string') {
1431
+ string = String(str);
1432
+ }
1433
+
1434
+ if (charset === 'iso-8859-1') {
1435
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
1436
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
1437
+ });
1438
+ }
1439
+
1440
+ var out = '';
1441
+ for (var i = 0; i < string.length; ++i) {
1442
+ var c = string.charCodeAt(i);
1443
+
1444
+ if (
1445
+ c === 0x2D // -
1446
+ || c === 0x2E // .
1447
+ || c === 0x5F // _
1448
+ || c === 0x7E // ~
1449
+ || (c >= 0x30 && c <= 0x39) // 0-9
1450
+ || (c >= 0x41 && c <= 0x5A) // a-z
1451
+ || (c >= 0x61 && c <= 0x7A) // A-Z
1452
+ || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
1453
+ ) {
1454
+ out += string.charAt(i);
1455
+ continue;
1456
+ }
1457
+
1458
+ if (c < 0x80) {
1459
+ out = out + hexTable[c];
1460
+ continue;
1461
+ }
1462
+
1463
+ if (c < 0x800) {
1464
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
1465
+ continue;
1466
+ }
1467
+
1468
+ if (c < 0xD800 || c >= 0xE000) {
1469
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
1470
+ continue;
1471
+ }
1472
+
1473
+ i += 1;
1474
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
1475
+ /* eslint operator-linebreak: [2, "before"] */
1476
+ out += hexTable[0xF0 | (c >> 18)]
1477
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
1478
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
1479
+ + hexTable[0x80 | (c & 0x3F)];
1480
+ }
1481
+
1482
+ return out;
1483
+ };
1484
+
1485
+ var compact = function compact(value) {
1486
+ var queue = [{ obj: { o: value }, prop: 'o' }];
1487
+ var refs = [];
1488
+
1489
+ for (var i = 0; i < queue.length; ++i) {
1490
+ var item = queue[i];
1491
+ var obj = item.obj[item.prop];
1492
+
1493
+ var keys = Object.keys(obj);
1494
+ for (var j = 0; j < keys.length; ++j) {
1495
+ var key = keys[j];
1496
+ var val = obj[key];
1497
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
1498
+ queue.push({ obj: obj, prop: key });
1499
+ refs.push(val);
1500
+ }
1501
+ }
1502
+ }
1503
+
1504
+ compactQueue(queue);
1505
+
1506
+ return value;
1507
+ };
1508
+
1509
+ var isRegExp = function isRegExp(obj) {
1510
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
1511
+ };
1512
+
1513
+ var isBuffer = function isBuffer(obj) {
1514
+ if (!obj || typeof obj !== 'object') {
1515
+ return false;
1516
+ }
1517
+
1518
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
1519
+ };
1520
+
1521
+ var combine = function combine(a, b) {
1522
+ return [].concat(a, b);
1523
+ };
1524
+
1525
+ var maybeMap = function maybeMap(val, fn) {
1526
+ if (isArray$2(val)) {
1527
+ var mapped = [];
1528
+ for (var i = 0; i < val.length; i += 1) {
1529
+ mapped.push(fn(val[i]));
1530
+ }
1531
+ return mapped;
1532
+ }
1533
+ return fn(val);
1534
+ };
1535
+
1536
+ var utils$2 = {
1537
+ arrayToObject: arrayToObject,
1538
+ assign: assign,
1539
+ combine: combine,
1540
+ compact: compact,
1541
+ decode: decode,
1542
+ encode: encode,
1543
+ isBuffer: isBuffer,
1544
+ isRegExp: isRegExp,
1545
+ maybeMap: maybeMap,
1546
+ merge: merge
1547
+ };
1548
+
1549
+ var getSideChannel = sideChannel;
1550
+ var utils$1 = utils$2;
1551
+ var formats$1 = formats$3;
1552
+ var has$1 = Object.prototype.hasOwnProperty;
1553
+
1554
+ var arrayPrefixGenerators = {
1555
+ brackets: function brackets(prefix) {
1556
+ return prefix + '[]';
1557
+ },
1558
+ comma: 'comma',
1559
+ indices: function indices(prefix, key) {
1560
+ return prefix + '[' + key + ']';
1561
+ },
1562
+ repeat: function repeat(prefix) {
1563
+ return prefix;
1564
+ }
1565
+ };
1566
+
1567
+ var isArray$1 = Array.isArray;
1568
+ var push = Array.prototype.push;
1569
+ var pushToArray = function (arr, valueOrArray) {
1570
+ push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
1571
+ };
1572
+
1573
+ var toISO = Date.prototype.toISOString;
1574
+
1575
+ var defaultFormat = formats$1['default'];
1576
+ var defaults$1 = {
1577
+ addQueryPrefix: false,
1578
+ allowDots: false,
1579
+ charset: 'utf-8',
1580
+ charsetSentinel: false,
1581
+ delimiter: '&',
1582
+ encode: true,
1583
+ encoder: utils$1.encode,
1584
+ encodeValuesOnly: false,
1585
+ format: defaultFormat,
1586
+ formatter: formats$1.formatters[defaultFormat],
1587
+ // deprecated
1588
+ indices: false,
1589
+ serializeDate: function serializeDate(date) {
1590
+ return toISO.call(date);
1591
+ },
1592
+ skipNulls: false,
1593
+ strictNullHandling: false
1594
+ };
1595
+
1596
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
1597
+ return typeof v === 'string'
1598
+ || typeof v === 'number'
1599
+ || typeof v === 'boolean'
1600
+ || typeof v === 'symbol'
1601
+ || typeof v === 'bigint';
1602
+ };
1603
+
1604
+ var sentinel = {};
1605
+
1606
+ var stringify$1 = function stringify(
1607
+ object,
1608
+ prefix,
1609
+ generateArrayPrefix,
1610
+ commaRoundTrip,
1611
+ strictNullHandling,
1612
+ skipNulls,
1613
+ encoder,
1614
+ filter,
1615
+ sort,
1616
+ allowDots,
1617
+ serializeDate,
1618
+ format,
1619
+ formatter,
1620
+ encodeValuesOnly,
1621
+ charset,
1622
+ sideChannel
1623
+ ) {
1624
+ var obj = object;
1625
+
1626
+ var tmpSc = sideChannel;
1627
+ var step = 0;
1628
+ var findFlag = false;
1629
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
1630
+ // Where object last appeared in the ref tree
1631
+ var pos = tmpSc.get(object);
1632
+ step += 1;
1633
+ if (typeof pos !== 'undefined') {
1634
+ if (pos === step) {
1635
+ throw new RangeError('Cyclic object value');
1636
+ } else {
1637
+ findFlag = true; // Break while
1638
+ }
1639
+ }
1640
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
1641
+ step = 0;
1642
+ }
1643
+ }
1644
+
1645
+ if (typeof filter === 'function') {
1646
+ obj = filter(prefix, obj);
1647
+ } else if (obj instanceof Date) {
1648
+ obj = serializeDate(obj);
1649
+ } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
1650
+ obj = utils$1.maybeMap(obj, function (value) {
1651
+ if (value instanceof Date) {
1652
+ return serializeDate(value);
1653
+ }
1654
+ return value;
1655
+ });
1656
+ }
1657
+
1658
+ if (obj === null) {
1659
+ if (strictNullHandling) {
1660
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
1661
+ }
1662
+
1663
+ obj = '';
1664
+ }
1665
+
1666
+ if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
1667
+ if (encoder) {
1668
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
1669
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
1670
+ }
1671
+ return [formatter(prefix) + '=' + formatter(String(obj))];
1672
+ }
1673
+
1674
+ var values = [];
1675
+
1676
+ if (typeof obj === 'undefined') {
1677
+ return values;
1678
+ }
1679
+
1680
+ var objKeys;
1681
+ if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
1682
+ // we need to join elements in
1683
+ if (encodeValuesOnly && encoder) {
1684
+ obj = utils$1.maybeMap(obj, encoder);
1685
+ }
1686
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
1687
+ } else if (isArray$1(filter)) {
1688
+ objKeys = filter;
1689
+ } else {
1690
+ var keys = Object.keys(obj);
1691
+ objKeys = sort ? keys.sort(sort) : keys;
1692
+ }
1693
+
1694
+ var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
1695
+
1696
+ for (var j = 0; j < objKeys.length; ++j) {
1697
+ var key = objKeys[j];
1698
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
1699
+
1700
+ if (skipNulls && value === null) {
1701
+ continue;
1702
+ }
1703
+
1704
+ var keyPrefix = isArray$1(obj)
1705
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
1706
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
1707
+
1708
+ sideChannel.set(object, step);
1709
+ var valueSideChannel = getSideChannel();
1710
+ valueSideChannel.set(sentinel, sideChannel);
1711
+ pushToArray(values, stringify(
1712
+ value,
1713
+ keyPrefix,
1714
+ generateArrayPrefix,
1715
+ commaRoundTrip,
1716
+ strictNullHandling,
1717
+ skipNulls,
1718
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
1719
+ filter,
1720
+ sort,
1721
+ allowDots,
1722
+ serializeDate,
1723
+ format,
1724
+ formatter,
1725
+ encodeValuesOnly,
1726
+ charset,
1727
+ valueSideChannel
1728
+ ));
1729
+ }
1730
+
1731
+ return values;
1732
+ };
1733
+
1734
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
1735
+ if (!opts) {
1736
+ return defaults$1;
1737
+ }
1738
+
1739
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
1740
+ throw new TypeError('Encoder has to be a function.');
1741
+ }
1742
+
1743
+ var charset = opts.charset || defaults$1.charset;
1744
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
1745
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
1746
+ }
1747
+
1748
+ var format = formats$1['default'];
1749
+ if (typeof opts.format !== 'undefined') {
1750
+ if (!has$1.call(formats$1.formatters, opts.format)) {
1751
+ throw new TypeError('Unknown format option provided.');
1752
+ }
1753
+ format = opts.format;
1754
+ }
1755
+ var formatter = formats$1.formatters[format];
1756
+
1757
+ var filter = defaults$1.filter;
1758
+ if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
1759
+ filter = opts.filter;
1760
+ }
1761
+
1762
+ return {
1763
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
1764
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
1765
+ charset: charset,
1766
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
1767
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
1768
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
1769
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
1770
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
1771
+ filter: filter,
1772
+ format: format,
1773
+ formatter: formatter,
1774
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
1775
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
1776
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
1777
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
1778
+ };
1779
+ };
1780
+
1781
+ var stringify_1 = function (object, opts) {
1782
+ var obj = object;
1783
+ var options = normalizeStringifyOptions(opts);
1784
+
1785
+ var objKeys;
1786
+ var filter;
1787
+
1788
+ if (typeof options.filter === 'function') {
1789
+ filter = options.filter;
1790
+ obj = filter('', obj);
1791
+ } else if (isArray$1(options.filter)) {
1792
+ filter = options.filter;
1793
+ objKeys = filter;
1794
+ }
1795
+
1796
+ var keys = [];
1797
+
1798
+ if (typeof obj !== 'object' || obj === null) {
1799
+ return '';
1800
+ }
1801
+
1802
+ var arrayFormat;
1803
+ if (opts && opts.arrayFormat in arrayPrefixGenerators) {
1804
+ arrayFormat = opts.arrayFormat;
1805
+ } else if (opts && 'indices' in opts) {
1806
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
1807
+ } else {
1808
+ arrayFormat = 'indices';
1809
+ }
1810
+
1811
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
1812
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
1813
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
1814
+ }
1815
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
1816
+
1817
+ if (!objKeys) {
1818
+ objKeys = Object.keys(obj);
1819
+ }
1820
+
1821
+ if (options.sort) {
1822
+ objKeys.sort(options.sort);
1823
+ }
1824
+
1825
+ var sideChannel = getSideChannel();
1826
+ for (var i = 0; i < objKeys.length; ++i) {
1827
+ var key = objKeys[i];
1828
+
1829
+ if (options.skipNulls && obj[key] === null) {
1830
+ continue;
1831
+ }
1832
+ pushToArray(keys, stringify$1(
1833
+ obj[key],
1834
+ key,
1835
+ generateArrayPrefix,
1836
+ commaRoundTrip,
1837
+ options.strictNullHandling,
1838
+ options.skipNulls,
1839
+ options.encode ? options.encoder : null,
1840
+ options.filter,
1841
+ options.sort,
1842
+ options.allowDots,
1843
+ options.serializeDate,
1844
+ options.format,
1845
+ options.formatter,
1846
+ options.encodeValuesOnly,
1847
+ options.charset,
1848
+ sideChannel
1849
+ ));
1850
+ }
1851
+
1852
+ var joined = keys.join(options.delimiter);
1853
+ var prefix = options.addQueryPrefix === true ? '?' : '';
1854
+
1855
+ if (options.charsetSentinel) {
1856
+ if (options.charset === 'iso-8859-1') {
1857
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
1858
+ prefix += 'utf8=%26%2310003%3B&';
1859
+ } else {
1860
+ // encodeURIComponent('✓')
1861
+ prefix += 'utf8=%E2%9C%93&';
1862
+ }
1863
+ }
1864
+
1865
+ return joined.length > 0 ? prefix + joined : '';
1866
+ };
1867
+
1868
+ var utils = utils$2;
1869
+
1870
+ var has = Object.prototype.hasOwnProperty;
1871
+ var isArray = Array.isArray;
1872
+
1873
+ var defaults = {
1874
+ allowDots: false,
1875
+ allowPrototypes: false,
1876
+ allowSparse: false,
1877
+ arrayLimit: 20,
1878
+ charset: 'utf-8',
1879
+ charsetSentinel: false,
1880
+ comma: false,
1881
+ decoder: utils.decode,
1882
+ delimiter: '&',
1883
+ depth: 5,
1884
+ ignoreQueryPrefix: false,
1885
+ interpretNumericEntities: false,
1886
+ parameterLimit: 1000,
1887
+ parseArrays: true,
1888
+ plainObjects: false,
1889
+ strictNullHandling: false
1890
+ };
1891
+
1892
+ var interpretNumericEntities = function (str) {
1893
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
1894
+ return String.fromCharCode(parseInt(numberStr, 10));
1895
+ });
1896
+ };
1897
+
1898
+ var parseArrayValue = function (val, options) {
1899
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
1900
+ return val.split(',');
1901
+ }
1902
+
1903
+ return val;
1904
+ };
1905
+
1906
+ // This is what browsers will submit when the ✓ character occurs in an
1907
+ // application/x-www-form-urlencoded body and the encoding of the page containing
1908
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
1909
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
1910
+ // the ✓ character, such as us-ascii.
1911
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
1912
+
1913
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
1914
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
1915
+
1916
+ var parseValues = function parseQueryStringValues(str, options) {
1917
+ var obj = { __proto__: null };
1918
+
1919
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
1920
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
1921
+ var parts = cleanStr.split(options.delimiter, limit);
1922
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
1923
+ var i;
1924
+
1925
+ var charset = options.charset;
1926
+ if (options.charsetSentinel) {
1927
+ for (i = 0; i < parts.length; ++i) {
1928
+ if (parts[i].indexOf('utf8=') === 0) {
1929
+ if (parts[i] === charsetSentinel) {
1930
+ charset = 'utf-8';
1931
+ } else if (parts[i] === isoSentinel) {
1932
+ charset = 'iso-8859-1';
1933
+ }
1934
+ skipIndex = i;
1935
+ i = parts.length; // The eslint settings do not allow break;
1936
+ }
1937
+ }
1938
+ }
1939
+
1940
+ for (i = 0; i < parts.length; ++i) {
1941
+ if (i === skipIndex) {
1942
+ continue;
1943
+ }
1944
+ var part = parts[i];
1945
+
1946
+ var bracketEqualsPos = part.indexOf(']=');
1947
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
1948
+
1949
+ var key, val;
1950
+ if (pos === -1) {
1951
+ key = options.decoder(part, defaults.decoder, charset, 'key');
1952
+ val = options.strictNullHandling ? null : '';
1953
+ } else {
1954
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
1955
+ val = utils.maybeMap(
1956
+ parseArrayValue(part.slice(pos + 1), options),
1957
+ function (encodedVal) {
1958
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
1959
+ }
1960
+ );
1961
+ }
1962
+
1963
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
1964
+ val = interpretNumericEntities(val);
1965
+ }
1966
+
1967
+ if (part.indexOf('[]=') > -1) {
1968
+ val = isArray(val) ? [val] : val;
1969
+ }
1970
+
1971
+ if (has.call(obj, key)) {
1972
+ obj[key] = utils.combine(obj[key], val);
1973
+ } else {
1974
+ obj[key] = val;
1975
+ }
1976
+ }
1977
+
1978
+ return obj;
1979
+ };
1980
+
1981
+ var parseObject = function (chain, val, options, valuesParsed) {
1982
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
1983
+
1984
+ for (var i = chain.length - 1; i >= 0; --i) {
1985
+ var obj;
1986
+ var root = chain[i];
1987
+
1988
+ if (root === '[]' && options.parseArrays) {
1989
+ obj = [].concat(leaf);
1990
+ } else {
1991
+ obj = options.plainObjects ? Object.create(null) : {};
1992
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
1993
+ var index = parseInt(cleanRoot, 10);
1994
+ if (!options.parseArrays && cleanRoot === '') {
1995
+ obj = { 0: leaf };
1996
+ } else if (
1997
+ !isNaN(index)
1998
+ && root !== cleanRoot
1999
+ && String(index) === cleanRoot
2000
+ && index >= 0
2001
+ && (options.parseArrays && index <= options.arrayLimit)
2002
+ ) {
2003
+ obj = [];
2004
+ obj[index] = leaf;
2005
+ } else if (cleanRoot !== '__proto__') {
2006
+ obj[cleanRoot] = leaf;
2007
+ }
2008
+ }
2009
+
2010
+ leaf = obj;
2011
+ }
2012
+
2013
+ return leaf;
2014
+ };
2015
+
2016
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
2017
+ if (!givenKey) {
2018
+ return;
2019
+ }
2020
+
2021
+ // Transform dot notation to bracket notation
2022
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2023
+
2024
+ // The regex chunks
2025
+
2026
+ var brackets = /(\[[^[\]]*])/;
2027
+ var child = /(\[[^[\]]*])/g;
2028
+
2029
+ // Get the parent
2030
+
2031
+ var segment = options.depth > 0 && brackets.exec(key);
2032
+ var parent = segment ? key.slice(0, segment.index) : key;
2033
+
2034
+ // Stash the parent if it exists
2035
+
2036
+ var keys = [];
2037
+ if (parent) {
2038
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2039
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
2040
+ if (!options.allowPrototypes) {
2041
+ return;
2042
+ }
2043
+ }
2044
+
2045
+ keys.push(parent);
2046
+ }
2047
+
2048
+ // Loop through children appending to the array until we hit depth
2049
+
2050
+ var i = 0;
2051
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2052
+ i += 1;
2053
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2054
+ if (!options.allowPrototypes) {
2055
+ return;
2056
+ }
2057
+ }
2058
+ keys.push(segment[1]);
2059
+ }
2060
+
2061
+ // If there's a remainder, just add whatever is left
2062
+
2063
+ if (segment) {
2064
+ keys.push('[' + key.slice(segment.index) + ']');
2065
+ }
2066
+
2067
+ return parseObject(keys, val, options, valuesParsed);
2068
+ };
2069
+
2070
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
2071
+ if (!opts) {
2072
+ return defaults;
2073
+ }
2074
+
2075
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2076
+ throw new TypeError('Decoder has to be a function.');
2077
+ }
2078
+
2079
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2080
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2081
+ }
2082
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2083
+
2084
+ return {
2085
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2086
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2087
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2088
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2089
+ charset: charset,
2090
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2091
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2092
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2093
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2094
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2095
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2096
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2097
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2098
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2099
+ parseArrays: opts.parseArrays !== false,
2100
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2101
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2102
+ };
2103
+ };
2104
+
2105
+ var parse$1 = function (str, opts) {
2106
+ var options = normalizeParseOptions(opts);
2107
+
2108
+ if (str === '' || str === null || typeof str === 'undefined') {
2109
+ return options.plainObjects ? Object.create(null) : {};
2110
+ }
2111
+
2112
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2113
+ var obj = options.plainObjects ? Object.create(null) : {};
2114
+
2115
+ // Iterate over the keys and setup the new object
2116
+
2117
+ var keys = Object.keys(tempObj);
2118
+ for (var i = 0; i < keys.length; ++i) {
2119
+ var key = keys[i];
2120
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2121
+ obj = utils.merge(obj, newObj, options);
2122
+ }
2123
+
2124
+ if (options.allowSparse === true) {
2125
+ return obj;
2126
+ }
2127
+
2128
+ return utils.compact(obj);
2129
+ };
2130
+
2131
+ var stringify = stringify_1;
2132
+ var parse = parse$1;
2133
+ var formats = formats$3;
2134
+
2135
+ var lib = {
2136
+ formats: formats,
2137
+ parse: parse,
2138
+ stringify: stringify
2139
+ };
2140
+
2141
+ var qs = /*@__PURE__*/getDefaultExportFromCjs(lib);
2142
+
2143
+ var MESSAGE_TEMPLATE_BASE_URL = "/neeto_message_templates_engine/api/v1/message_templates";
2144
+
2145
+ var fetchMessageTemplates = function fetchMessageTemplates(params) {
2146
+ return axios.get(MESSAGE_TEMPLATE_BASE_URL, {
2147
+ params: params,
2148
+ paramsSerializer: function paramsSerializer(params) {
2149
+ return qs.stringify(params, {
2150
+ arrayFormat: "brackets"
2151
+ });
2152
+ }
2153
+ });
2154
+ };
2155
+ var createMessageTemplate = function createMessageTemplate(_ref) {
2156
+ var messageTemplate = _ref.messageTemplate,
2157
+ ownerId = _ref.ownerId;
2158
+ return axios.post(MESSAGE_TEMPLATE_BASE_URL, {
2159
+ messageTemplate: messageTemplate,
2160
+ ownerId: ownerId
2161
+ });
2162
+ };
2163
+ var updateMessageTemplate = function updateMessageTemplate(_ref2) {
2164
+ var id = _ref2.id,
2165
+ messageTemplate = _ref2.messageTemplate,
2166
+ ownerId = _ref2.ownerId;
2167
+ return axios.patch("".concat(MESSAGE_TEMPLATE_BASE_URL, "/").concat(id), {
2168
+ messageTemplate: messageTemplate,
2169
+ ownerId: ownerId
2170
+ });
2171
+ };
2172
+ var deleteMessageTemplate = function deleteMessageTemplate(_ref3) {
2173
+ var id = _ref3.id,
2174
+ ownerId = _ref3.ownerId;
2175
+ return axios["delete"]("".concat(MESSAGE_TEMPLATE_BASE_URL, "/").concat(id), {
2176
+ data: {
2177
+ ownerId: ownerId
2178
+ }
2179
+ });
2180
+ };
2181
+ var messageTemplatesApi = {
2182
+ fetchAll: fetchMessageTemplates,
2183
+ create: createMessageTemplate,
2184
+ update: updateMessageTemplate,
2185
+ "delete": deleteMessageTemplate
2186
+ };
2187
+
2188
+ var QUERY_KEYS = {
2189
+ NEETO_MESSAGE_TEMPLATES: "neeto-message-templates"
2190
+ };
2191
+
2192
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2193
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2194
+ var ownerIdValue = function ownerIdValue(ownerId) {
2195
+ return isEmpty(ownerId) ? undefined : ownerId;
2196
+ };
2197
+ var useFetchTemplates = function useFetchTemplates(params, options) {
2198
+ return useQuery(_objectSpread({
2199
+ queryKey: [QUERY_KEYS.NEETO_MESSAGE_TEMPLATES, params],
2200
+ queryFn: function queryFn() {
2201
+ return messageTemplatesApi.fetchAll(params);
2202
+ }
2203
+ }, options));
2204
+ };
2205
+ var useCreateTemplate = function useCreateTemplate(ownerId, options) {
2206
+ return useMutationWithInvalidation(function (messageTemplate) {
2207
+ return messageTemplatesApi.create({
2208
+ messageTemplate: messageTemplate,
2209
+ ownerId: ownerIdValue(ownerId)
2210
+ });
2211
+ }, _objectSpread({
2212
+ keysToInvalidate: [[QUERY_KEYS.NEETO_MESSAGE_TEMPLATES]]
2213
+ }, options));
2214
+ };
2215
+ var useUpdateTemplate = function useUpdateTemplate(ownerId) {
2216
+ return useMutationWithInvalidation(function (_ref) {
2217
+ var id = _ref.id,
2218
+ payload = _ref.payload;
2219
+ return messageTemplatesApi.update({
2220
+ id: id,
2221
+ messageTemplate: payload,
2222
+ ownerId: ownerIdValue(ownerId)
2223
+ });
2224
+ }, {
2225
+ keysToInvalidate: [[QUERY_KEYS.NEETO_MESSAGE_TEMPLATES]]
2226
+ });
2227
+ };
2228
+ var useDeleteTemplate = function useDeleteTemplate(ownerId) {
2229
+ return useMutationWithInvalidation(function (id) {
2230
+ return messageTemplatesApi["delete"]({
2231
+ id: id,
2232
+ ownerId: ownerIdValue(ownerId)
2233
+ });
2234
+ }, {
2235
+ keysToInvalidate: [[QUERY_KEYS.NEETO_MESSAGE_TEMPLATES]]
2236
+ });
2237
+ };
2238
+
2239
+ export { DEFAULT_EDITOR_ROW_COUNT as D, MESSAGE_TEMPLATES as M, _defineProperty as _, DEFAULT_PAGE_PROPERTIES as a, useFetchTemplates as b, useCreateTemplate as c, useDeleteTemplate as d, MESSAGE_TYPES as e, getDefaultExportFromCjs as g, useUpdateTemplate as u };
2240
+ //# sourceMappingURL=useTemplatesApi-45d43d41.js.map