@bigbinary/neeto-templates-frontend 1.2.0 → 2.0.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.
- package/README.md +30 -11
- package/app/javascript/src/translations/en.json +4 -0
- package/dist/index.cjs.js +681 -2563
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +544 -2433
- package/dist/index.js.map +1 -1
- package/package.json +17 -16
- package/types.d.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, createElement, memo } from 'react';
|
|
3
3
|
import { noop, removeBy, renameKeys } from '@bigbinary/neeto-cist';
|
|
4
|
-
import
|
|
4
|
+
import Modal from '@bigbinary/neetoui/Modal';
|
|
5
5
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
6
6
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
7
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
8
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
7
9
|
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { refetchTags, TagsComponent, NeetoTags } from '@bigbinary/neeto-tags-frontend';
|
|
11
|
+
import { useQuery, useInfiniteQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
12
|
+
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
8
13
|
import { prop, pluck } from 'ramda';
|
|
9
|
-
import { useQuery, useQueryClient, useMutation, useInfiniteQuery } from 'react-query';
|
|
10
14
|
import axios from 'axios';
|
|
11
|
-
import
|
|
15
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
12
16
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
13
17
|
import { t as t$1 } from 'i18next';
|
|
14
18
|
import classnames from 'classnames';
|
|
15
19
|
import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
20
|
+
import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
|
|
21
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
22
|
+
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
23
|
+
import Form from '@bigbinary/neetoui/formik/Form';
|
|
18
24
|
import { useParams } from 'react-router-dom';
|
|
19
|
-
import { refetchTags, TagsComponent } from '@bigbinary/neeto-tags-frontend';
|
|
20
25
|
import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
|
|
21
26
|
import { useField, useFormikContext } from 'formik';
|
|
22
27
|
import Header from '@bigbinary/neeto-molecules/Header';
|
|
23
28
|
import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
|
|
29
|
+
import Label from '@bigbinary/neetoui/Label';
|
|
24
30
|
|
|
25
31
|
function _arrayWithHoles(arr) {
|
|
26
32
|
if (Array.isArray(arr)) return arr;
|
|
@@ -380,2054 +386,6 @@ const SvgCustom = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
|
380
386
|
clipRule: "evenodd"
|
|
381
387
|
})));
|
|
382
388
|
|
|
383
|
-
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
384
|
-
var shams = function hasSymbols() {
|
|
385
|
-
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
386
|
-
if (typeof Symbol.iterator === 'symbol') { return true; }
|
|
387
|
-
|
|
388
|
-
var obj = {};
|
|
389
|
-
var sym = Symbol('test');
|
|
390
|
-
var symObj = Object(sym);
|
|
391
|
-
if (typeof sym === 'string') { return false; }
|
|
392
|
-
|
|
393
|
-
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
|
394
|
-
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
|
395
|
-
|
|
396
|
-
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
|
397
|
-
// if (sym instanceof Symbol) { return false; }
|
|
398
|
-
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
|
399
|
-
// if (!(symObj instanceof Symbol)) { return false; }
|
|
400
|
-
|
|
401
|
-
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
|
402
|
-
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
|
403
|
-
|
|
404
|
-
var symVal = 42;
|
|
405
|
-
obj[sym] = symVal;
|
|
406
|
-
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
407
|
-
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
|
408
|
-
|
|
409
|
-
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
|
410
|
-
|
|
411
|
-
var syms = Object.getOwnPropertySymbols(obj);
|
|
412
|
-
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
|
413
|
-
|
|
414
|
-
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
|
415
|
-
|
|
416
|
-
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
|
417
|
-
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
|
418
|
-
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return true;
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
425
|
-
var hasSymbolSham = shams;
|
|
426
|
-
|
|
427
|
-
var hasSymbols$1 = function hasNativeSymbols() {
|
|
428
|
-
if (typeof origSymbol !== 'function') { return false; }
|
|
429
|
-
if (typeof Symbol !== 'function') { return false; }
|
|
430
|
-
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
431
|
-
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
|
432
|
-
|
|
433
|
-
return hasSymbolSham();
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
var test = {
|
|
437
|
-
foo: {}
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
var $Object = Object;
|
|
441
|
-
|
|
442
|
-
var hasProto$1 = function hasProto() {
|
|
443
|
-
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
/* eslint no-invalid-this: 1 */
|
|
447
|
-
|
|
448
|
-
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
449
|
-
var slice = Array.prototype.slice;
|
|
450
|
-
var toStr$1 = Object.prototype.toString;
|
|
451
|
-
var funcType = '[object Function]';
|
|
452
|
-
|
|
453
|
-
var implementation$1 = function bind(that) {
|
|
454
|
-
var target = this;
|
|
455
|
-
if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
|
|
456
|
-
throw new TypeError(ERROR_MESSAGE + target);
|
|
457
|
-
}
|
|
458
|
-
var args = slice.call(arguments, 1);
|
|
459
|
-
|
|
460
|
-
var bound;
|
|
461
|
-
var binder = function () {
|
|
462
|
-
if (this instanceof bound) {
|
|
463
|
-
var result = target.apply(
|
|
464
|
-
this,
|
|
465
|
-
args.concat(slice.call(arguments))
|
|
466
|
-
);
|
|
467
|
-
if (Object(result) === result) {
|
|
468
|
-
return result;
|
|
469
|
-
}
|
|
470
|
-
return this;
|
|
471
|
-
} else {
|
|
472
|
-
return target.apply(
|
|
473
|
-
that,
|
|
474
|
-
args.concat(slice.call(arguments))
|
|
475
|
-
);
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
var boundLength = Math.max(0, target.length - args.length);
|
|
480
|
-
var boundArgs = [];
|
|
481
|
-
for (var i = 0; i < boundLength; i++) {
|
|
482
|
-
boundArgs.push('$' + i);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
486
|
-
|
|
487
|
-
if (target.prototype) {
|
|
488
|
-
var Empty = function Empty() {};
|
|
489
|
-
Empty.prototype = target.prototype;
|
|
490
|
-
bound.prototype = new Empty();
|
|
491
|
-
Empty.prototype = null;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
return bound;
|
|
495
|
-
};
|
|
496
|
-
|
|
497
|
-
var implementation = implementation$1;
|
|
498
|
-
|
|
499
|
-
var functionBind = Function.prototype.bind || implementation;
|
|
500
|
-
|
|
501
|
-
var bind$1 = functionBind;
|
|
502
|
-
|
|
503
|
-
var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
|
|
504
|
-
|
|
505
|
-
var undefined$1;
|
|
506
|
-
|
|
507
|
-
var $SyntaxError = SyntaxError;
|
|
508
|
-
var $Function = Function;
|
|
509
|
-
var $TypeError$1 = TypeError;
|
|
510
|
-
|
|
511
|
-
// eslint-disable-next-line consistent-return
|
|
512
|
-
var getEvalledConstructor = function (expressionSyntax) {
|
|
513
|
-
try {
|
|
514
|
-
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
515
|
-
} catch (e) {}
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
519
|
-
if ($gOPD) {
|
|
520
|
-
try {
|
|
521
|
-
$gOPD({}, '');
|
|
522
|
-
} catch (e) {
|
|
523
|
-
$gOPD = null; // this is IE 8, which has a broken gOPD
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
var throwTypeError = function () {
|
|
528
|
-
throw new $TypeError$1();
|
|
529
|
-
};
|
|
530
|
-
var ThrowTypeError = $gOPD
|
|
531
|
-
? (function () {
|
|
532
|
-
try {
|
|
533
|
-
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
534
|
-
arguments.callee; // IE 8 does not throw here
|
|
535
|
-
return throwTypeError;
|
|
536
|
-
} catch (calleeThrows) {
|
|
537
|
-
try {
|
|
538
|
-
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
539
|
-
return $gOPD(arguments, 'callee').get;
|
|
540
|
-
} catch (gOPDthrows) {
|
|
541
|
-
return throwTypeError;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
}())
|
|
545
|
-
: throwTypeError;
|
|
546
|
-
|
|
547
|
-
var hasSymbols = hasSymbols$1();
|
|
548
|
-
var hasProto = hasProto$1();
|
|
549
|
-
|
|
550
|
-
var getProto = Object.getPrototypeOf || (
|
|
551
|
-
hasProto
|
|
552
|
-
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
553
|
-
: null
|
|
554
|
-
);
|
|
555
|
-
|
|
556
|
-
var needsEval = {};
|
|
557
|
-
|
|
558
|
-
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
559
|
-
|
|
560
|
-
var INTRINSICS = {
|
|
561
|
-
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
562
|
-
'%Array%': Array,
|
|
563
|
-
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
564
|
-
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
565
|
-
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
566
|
-
'%AsyncFunction%': needsEval,
|
|
567
|
-
'%AsyncGenerator%': needsEval,
|
|
568
|
-
'%AsyncGeneratorFunction%': needsEval,
|
|
569
|
-
'%AsyncIteratorPrototype%': needsEval,
|
|
570
|
-
'%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
|
|
571
|
-
'%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
|
|
572
|
-
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
|
|
573
|
-
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
|
|
574
|
-
'%Boolean%': Boolean,
|
|
575
|
-
'%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
|
|
576
|
-
'%Date%': Date,
|
|
577
|
-
'%decodeURI%': decodeURI,
|
|
578
|
-
'%decodeURIComponent%': decodeURIComponent,
|
|
579
|
-
'%encodeURI%': encodeURI,
|
|
580
|
-
'%encodeURIComponent%': encodeURIComponent,
|
|
581
|
-
'%Error%': Error,
|
|
582
|
-
'%eval%': eval, // eslint-disable-line no-eval
|
|
583
|
-
'%EvalError%': EvalError,
|
|
584
|
-
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
585
|
-
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
586
|
-
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
587
|
-
'%Function%': $Function,
|
|
588
|
-
'%GeneratorFunction%': needsEval,
|
|
589
|
-
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
|
|
590
|
-
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
|
|
591
|
-
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
592
|
-
'%isFinite%': isFinite,
|
|
593
|
-
'%isNaN%': isNaN,
|
|
594
|
-
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
595
|
-
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
596
|
-
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
597
|
-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
598
|
-
'%Math%': Math,
|
|
599
|
-
'%Number%': Number,
|
|
600
|
-
'%Object%': Object,
|
|
601
|
-
'%parseFloat%': parseFloat,
|
|
602
|
-
'%parseInt%': parseInt,
|
|
603
|
-
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
604
|
-
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
605
|
-
'%RangeError%': RangeError,
|
|
606
|
-
'%ReferenceError%': ReferenceError,
|
|
607
|
-
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
608
|
-
'%RegExp%': RegExp,
|
|
609
|
-
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
610
|
-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
611
|
-
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
612
|
-
'%String%': String,
|
|
613
|
-
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
614
|
-
'%Symbol%': hasSymbols ? Symbol : undefined$1,
|
|
615
|
-
'%SyntaxError%': $SyntaxError,
|
|
616
|
-
'%ThrowTypeError%': ThrowTypeError,
|
|
617
|
-
'%TypedArray%': TypedArray,
|
|
618
|
-
'%TypeError%': $TypeError$1,
|
|
619
|
-
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
620
|
-
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
621
|
-
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
622
|
-
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
623
|
-
'%URIError%': URIError,
|
|
624
|
-
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
625
|
-
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
626
|
-
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
627
|
-
};
|
|
628
|
-
|
|
629
|
-
if (getProto) {
|
|
630
|
-
try {
|
|
631
|
-
null.error; // eslint-disable-line no-unused-expressions
|
|
632
|
-
} catch (e) {
|
|
633
|
-
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
634
|
-
var errorProto = getProto(getProto(e));
|
|
635
|
-
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
var doEval = function doEval(name) {
|
|
640
|
-
var value;
|
|
641
|
-
if (name === '%AsyncFunction%') {
|
|
642
|
-
value = getEvalledConstructor('async function () {}');
|
|
643
|
-
} else if (name === '%GeneratorFunction%') {
|
|
644
|
-
value = getEvalledConstructor('function* () {}');
|
|
645
|
-
} else if (name === '%AsyncGeneratorFunction%') {
|
|
646
|
-
value = getEvalledConstructor('async function* () {}');
|
|
647
|
-
} else if (name === '%AsyncGenerator%') {
|
|
648
|
-
var fn = doEval('%AsyncGeneratorFunction%');
|
|
649
|
-
if (fn) {
|
|
650
|
-
value = fn.prototype;
|
|
651
|
-
}
|
|
652
|
-
} else if (name === '%AsyncIteratorPrototype%') {
|
|
653
|
-
var gen = doEval('%AsyncGenerator%');
|
|
654
|
-
if (gen && getProto) {
|
|
655
|
-
value = getProto(gen.prototype);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
INTRINSICS[name] = value;
|
|
660
|
-
|
|
661
|
-
return value;
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
var LEGACY_ALIASES = {
|
|
665
|
-
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
666
|
-
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
667
|
-
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
668
|
-
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
669
|
-
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
670
|
-
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
671
|
-
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
672
|
-
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
673
|
-
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
674
|
-
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
675
|
-
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
676
|
-
'%DatePrototype%': ['Date', 'prototype'],
|
|
677
|
-
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
678
|
-
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
679
|
-
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
680
|
-
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
681
|
-
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
682
|
-
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
683
|
-
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
684
|
-
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
685
|
-
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
686
|
-
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
687
|
-
'%JSONParse%': ['JSON', 'parse'],
|
|
688
|
-
'%JSONStringify%': ['JSON', 'stringify'],
|
|
689
|
-
'%MapPrototype%': ['Map', 'prototype'],
|
|
690
|
-
'%NumberPrototype%': ['Number', 'prototype'],
|
|
691
|
-
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
692
|
-
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
693
|
-
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
694
|
-
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
695
|
-
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
696
|
-
'%Promise_all%': ['Promise', 'all'],
|
|
697
|
-
'%Promise_reject%': ['Promise', 'reject'],
|
|
698
|
-
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
699
|
-
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
700
|
-
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
701
|
-
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
702
|
-
'%SetPrototype%': ['Set', 'prototype'],
|
|
703
|
-
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
704
|
-
'%StringPrototype%': ['String', 'prototype'],
|
|
705
|
-
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
706
|
-
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
707
|
-
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
708
|
-
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
709
|
-
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
710
|
-
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
711
|
-
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
712
|
-
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
713
|
-
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
714
|
-
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
715
|
-
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
var bind = functionBind;
|
|
719
|
-
var hasOwn$1 = src;
|
|
720
|
-
var $concat$1 = bind.call(Function.call, Array.prototype.concat);
|
|
721
|
-
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
722
|
-
var $replace$1 = bind.call(Function.call, String.prototype.replace);
|
|
723
|
-
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
724
|
-
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
725
|
-
|
|
726
|
-
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
727
|
-
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
728
|
-
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
729
|
-
var stringToPath = function stringToPath(string) {
|
|
730
|
-
var first = $strSlice(string, 0, 1);
|
|
731
|
-
var last = $strSlice(string, -1);
|
|
732
|
-
if (first === '%' && last !== '%') {
|
|
733
|
-
throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
|
|
734
|
-
} else if (last === '%' && first !== '%') {
|
|
735
|
-
throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
|
|
736
|
-
}
|
|
737
|
-
var result = [];
|
|
738
|
-
$replace$1(string, rePropName, function (match, number, quote, subString) {
|
|
739
|
-
result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
|
|
740
|
-
});
|
|
741
|
-
return result;
|
|
742
|
-
};
|
|
743
|
-
/* end adaptation */
|
|
744
|
-
|
|
745
|
-
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
746
|
-
var intrinsicName = name;
|
|
747
|
-
var alias;
|
|
748
|
-
if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
|
|
749
|
-
alias = LEGACY_ALIASES[intrinsicName];
|
|
750
|
-
intrinsicName = '%' + alias[0] + '%';
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
if (hasOwn$1(INTRINSICS, intrinsicName)) {
|
|
754
|
-
var value = INTRINSICS[intrinsicName];
|
|
755
|
-
if (value === needsEval) {
|
|
756
|
-
value = doEval(intrinsicName);
|
|
757
|
-
}
|
|
758
|
-
if (typeof value === 'undefined' && !allowMissing) {
|
|
759
|
-
throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
return {
|
|
763
|
-
alias: alias,
|
|
764
|
-
name: intrinsicName,
|
|
765
|
-
value: value
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
|
|
770
|
-
};
|
|
771
|
-
|
|
772
|
-
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
773
|
-
if (typeof name !== 'string' || name.length === 0) {
|
|
774
|
-
throw new $TypeError$1('intrinsic name must be a non-empty string');
|
|
775
|
-
}
|
|
776
|
-
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
777
|
-
throw new $TypeError$1('"allowMissing" argument must be a boolean');
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
781
|
-
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
782
|
-
}
|
|
783
|
-
var parts = stringToPath(name);
|
|
784
|
-
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
785
|
-
|
|
786
|
-
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
787
|
-
var intrinsicRealName = intrinsic.name;
|
|
788
|
-
var value = intrinsic.value;
|
|
789
|
-
var skipFurtherCaching = false;
|
|
790
|
-
|
|
791
|
-
var alias = intrinsic.alias;
|
|
792
|
-
if (alias) {
|
|
793
|
-
intrinsicBaseName = alias[0];
|
|
794
|
-
$spliceApply(parts, $concat$1([0, 1], alias));
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
798
|
-
var part = parts[i];
|
|
799
|
-
var first = $strSlice(part, 0, 1);
|
|
800
|
-
var last = $strSlice(part, -1);
|
|
801
|
-
if (
|
|
802
|
-
(
|
|
803
|
-
(first === '"' || first === "'" || first === '`')
|
|
804
|
-
|| (last === '"' || last === "'" || last === '`')
|
|
805
|
-
)
|
|
806
|
-
&& first !== last
|
|
807
|
-
) {
|
|
808
|
-
throw new $SyntaxError('property names with quotes must have matching quotes');
|
|
809
|
-
}
|
|
810
|
-
if (part === 'constructor' || !isOwn) {
|
|
811
|
-
skipFurtherCaching = true;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
intrinsicBaseName += '.' + part;
|
|
815
|
-
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
816
|
-
|
|
817
|
-
if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
|
|
818
|
-
value = INTRINSICS[intrinsicRealName];
|
|
819
|
-
} else if (value != null) {
|
|
820
|
-
if (!(part in value)) {
|
|
821
|
-
if (!allowMissing) {
|
|
822
|
-
throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
823
|
-
}
|
|
824
|
-
return void undefined$1;
|
|
825
|
-
}
|
|
826
|
-
if ($gOPD && (i + 1) >= parts.length) {
|
|
827
|
-
var desc = $gOPD(value, part);
|
|
828
|
-
isOwn = !!desc;
|
|
829
|
-
|
|
830
|
-
// By convention, when a data property is converted to an accessor
|
|
831
|
-
// property to emulate a data property that does not suffer from
|
|
832
|
-
// the override mistake, that accessor's getter is marked with
|
|
833
|
-
// an `originalValue` property. Here, when we detect this, we
|
|
834
|
-
// uphold the illusion by pretending to see that original data
|
|
835
|
-
// property, i.e., returning the value rather than the getter
|
|
836
|
-
// itself.
|
|
837
|
-
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
838
|
-
value = desc.get;
|
|
839
|
-
} else {
|
|
840
|
-
value = value[part];
|
|
841
|
-
}
|
|
842
|
-
} else {
|
|
843
|
-
isOwn = hasOwn$1(value, part);
|
|
844
|
-
value = value[part];
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
if (isOwn && !skipFurtherCaching) {
|
|
848
|
-
INTRINSICS[intrinsicRealName] = value;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
return value;
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
var callBind$1 = {exports: {}};
|
|
856
|
-
|
|
857
|
-
callBind$1.exports;
|
|
858
|
-
|
|
859
|
-
(function (module) {
|
|
860
|
-
|
|
861
|
-
var bind = functionBind;
|
|
862
|
-
var GetIntrinsic = getIntrinsic;
|
|
863
|
-
|
|
864
|
-
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
865
|
-
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
866
|
-
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
867
|
-
|
|
868
|
-
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
869
|
-
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
870
|
-
var $max = GetIntrinsic('%Math.max%');
|
|
871
|
-
|
|
872
|
-
if ($defineProperty) {
|
|
873
|
-
try {
|
|
874
|
-
$defineProperty({}, 'a', { value: 1 });
|
|
875
|
-
} catch (e) {
|
|
876
|
-
// IE 8 has a broken defineProperty
|
|
877
|
-
$defineProperty = null;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
module.exports = function callBind(originalFunction) {
|
|
882
|
-
var func = $reflectApply(bind, $call, arguments);
|
|
883
|
-
if ($gOPD && $defineProperty) {
|
|
884
|
-
var desc = $gOPD(func, 'length');
|
|
885
|
-
if (desc.configurable) {
|
|
886
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
887
|
-
$defineProperty(
|
|
888
|
-
func,
|
|
889
|
-
'length',
|
|
890
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
891
|
-
);
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
return func;
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
var applyBind = function applyBind() {
|
|
898
|
-
return $reflectApply(bind, $apply, arguments);
|
|
899
|
-
};
|
|
900
|
-
|
|
901
|
-
if ($defineProperty) {
|
|
902
|
-
$defineProperty(module.exports, 'apply', { value: applyBind });
|
|
903
|
-
} else {
|
|
904
|
-
module.exports.apply = applyBind;
|
|
905
|
-
}
|
|
906
|
-
} (callBind$1));
|
|
907
|
-
|
|
908
|
-
var callBindExports = callBind$1.exports;
|
|
909
|
-
|
|
910
|
-
var GetIntrinsic$1 = getIntrinsic;
|
|
911
|
-
|
|
912
|
-
var callBind = callBindExports;
|
|
913
|
-
|
|
914
|
-
var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
|
|
915
|
-
|
|
916
|
-
var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
|
|
917
|
-
var intrinsic = GetIntrinsic$1(name, !!allowMissing);
|
|
918
|
-
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
919
|
-
return callBind(intrinsic);
|
|
920
|
-
}
|
|
921
|
-
return intrinsic;
|
|
922
|
-
};
|
|
923
|
-
|
|
924
|
-
var util_inspect = require$$0.inspect;
|
|
925
|
-
|
|
926
|
-
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
927
|
-
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
928
|
-
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
929
|
-
var mapForEach = hasMap && Map.prototype.forEach;
|
|
930
|
-
var hasSet = typeof Set === 'function' && Set.prototype;
|
|
931
|
-
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
|
932
|
-
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
|
933
|
-
var setForEach = hasSet && Set.prototype.forEach;
|
|
934
|
-
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
|
935
|
-
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
936
|
-
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
|
937
|
-
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
938
|
-
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
939
|
-
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
940
|
-
var booleanValueOf = Boolean.prototype.valueOf;
|
|
941
|
-
var objectToString = Object.prototype.toString;
|
|
942
|
-
var functionToString = Function.prototype.toString;
|
|
943
|
-
var $match = String.prototype.match;
|
|
944
|
-
var $slice = String.prototype.slice;
|
|
945
|
-
var $replace = String.prototype.replace;
|
|
946
|
-
var $toUpperCase = String.prototype.toUpperCase;
|
|
947
|
-
var $toLowerCase = String.prototype.toLowerCase;
|
|
948
|
-
var $test = RegExp.prototype.test;
|
|
949
|
-
var $concat = Array.prototype.concat;
|
|
950
|
-
var $join = Array.prototype.join;
|
|
951
|
-
var $arrSlice = Array.prototype.slice;
|
|
952
|
-
var $floor = Math.floor;
|
|
953
|
-
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
954
|
-
var gOPS = Object.getOwnPropertySymbols;
|
|
955
|
-
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
956
|
-
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
|
957
|
-
// ie, `has-tostringtag/shams
|
|
958
|
-
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
|
|
959
|
-
? Symbol.toStringTag
|
|
960
|
-
: null;
|
|
961
|
-
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
962
|
-
|
|
963
|
-
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
|
964
|
-
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
965
|
-
? function (O) {
|
|
966
|
-
return O.__proto__; // eslint-disable-line no-proto
|
|
967
|
-
}
|
|
968
|
-
: null
|
|
969
|
-
);
|
|
970
|
-
|
|
971
|
-
function addNumericSeparator(num, str) {
|
|
972
|
-
if (
|
|
973
|
-
num === Infinity
|
|
974
|
-
|| num === -Infinity
|
|
975
|
-
|| num !== num
|
|
976
|
-
|| (num && num > -1000 && num < 1000)
|
|
977
|
-
|| $test.call(/e/, str)
|
|
978
|
-
) {
|
|
979
|
-
return str;
|
|
980
|
-
}
|
|
981
|
-
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
982
|
-
if (typeof num === 'number') {
|
|
983
|
-
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
|
984
|
-
if (int !== num) {
|
|
985
|
-
var intStr = String(int);
|
|
986
|
-
var dec = $slice.call(str, intStr.length + 1);
|
|
987
|
-
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
return $replace.call(str, sepRegex, '$&_');
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
var utilInspect = util_inspect;
|
|
994
|
-
var inspectCustom = utilInspect.custom;
|
|
995
|
-
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
996
|
-
|
|
997
|
-
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
998
|
-
var opts = options || {};
|
|
999
|
-
|
|
1000
|
-
if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
|
|
1001
|
-
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
1002
|
-
}
|
|
1003
|
-
if (
|
|
1004
|
-
has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
|
|
1005
|
-
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
|
1006
|
-
: opts.maxStringLength !== null
|
|
1007
|
-
)
|
|
1008
|
-
) {
|
|
1009
|
-
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
1010
|
-
}
|
|
1011
|
-
var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
|
|
1012
|
-
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
|
1013
|
-
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
if (
|
|
1017
|
-
has$3(opts, 'indent')
|
|
1018
|
-
&& opts.indent !== null
|
|
1019
|
-
&& opts.indent !== '\t'
|
|
1020
|
-
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
|
1021
|
-
) {
|
|
1022
|
-
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
1023
|
-
}
|
|
1024
|
-
if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
|
|
1025
|
-
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
1026
|
-
}
|
|
1027
|
-
var numericSeparator = opts.numericSeparator;
|
|
1028
|
-
|
|
1029
|
-
if (typeof obj === 'undefined') {
|
|
1030
|
-
return 'undefined';
|
|
1031
|
-
}
|
|
1032
|
-
if (obj === null) {
|
|
1033
|
-
return 'null';
|
|
1034
|
-
}
|
|
1035
|
-
if (typeof obj === 'boolean') {
|
|
1036
|
-
return obj ? 'true' : 'false';
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
if (typeof obj === 'string') {
|
|
1040
|
-
return inspectString(obj, opts);
|
|
1041
|
-
}
|
|
1042
|
-
if (typeof obj === 'number') {
|
|
1043
|
-
if (obj === 0) {
|
|
1044
|
-
return Infinity / obj > 0 ? '0' : '-0';
|
|
1045
|
-
}
|
|
1046
|
-
var str = String(obj);
|
|
1047
|
-
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
1048
|
-
}
|
|
1049
|
-
if (typeof obj === 'bigint') {
|
|
1050
|
-
var bigIntStr = String(obj) + 'n';
|
|
1051
|
-
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
|
1055
|
-
if (typeof depth === 'undefined') { depth = 0; }
|
|
1056
|
-
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
|
1057
|
-
return isArray$3(obj) ? '[Array]' : '[Object]';
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
var indent = getIndent(opts, depth);
|
|
1061
|
-
|
|
1062
|
-
if (typeof seen === 'undefined') {
|
|
1063
|
-
seen = [];
|
|
1064
|
-
} else if (indexOf(seen, obj) >= 0) {
|
|
1065
|
-
return '[Circular]';
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
function inspect(value, from, noIndent) {
|
|
1069
|
-
if (from) {
|
|
1070
|
-
seen = $arrSlice.call(seen);
|
|
1071
|
-
seen.push(from);
|
|
1072
|
-
}
|
|
1073
|
-
if (noIndent) {
|
|
1074
|
-
var newOpts = {
|
|
1075
|
-
depth: opts.depth
|
|
1076
|
-
};
|
|
1077
|
-
if (has$3(opts, 'quoteStyle')) {
|
|
1078
|
-
newOpts.quoteStyle = opts.quoteStyle;
|
|
1079
|
-
}
|
|
1080
|
-
return inspect_(value, newOpts, depth + 1, seen);
|
|
1081
|
-
}
|
|
1082
|
-
return inspect_(value, opts, depth + 1, seen);
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
|
|
1086
|
-
var name = nameOf(obj);
|
|
1087
|
-
var keys = arrObjKeys(obj, inspect);
|
|
1088
|
-
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
1089
|
-
}
|
|
1090
|
-
if (isSymbol(obj)) {
|
|
1091
|
-
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
1092
|
-
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
1093
|
-
}
|
|
1094
|
-
if (isElement(obj)) {
|
|
1095
|
-
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
|
1096
|
-
var attrs = obj.attributes || [];
|
|
1097
|
-
for (var i = 0; i < attrs.length; i++) {
|
|
1098
|
-
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
|
1099
|
-
}
|
|
1100
|
-
s += '>';
|
|
1101
|
-
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
|
1102
|
-
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
|
1103
|
-
return s;
|
|
1104
|
-
}
|
|
1105
|
-
if (isArray$3(obj)) {
|
|
1106
|
-
if (obj.length === 0) { return '[]'; }
|
|
1107
|
-
var xs = arrObjKeys(obj, inspect);
|
|
1108
|
-
if (indent && !singleLineValues(xs)) {
|
|
1109
|
-
return '[' + indentedJoin(xs, indent) + ']';
|
|
1110
|
-
}
|
|
1111
|
-
return '[ ' + $join.call(xs, ', ') + ' ]';
|
|
1112
|
-
}
|
|
1113
|
-
if (isError(obj)) {
|
|
1114
|
-
var parts = arrObjKeys(obj, inspect);
|
|
1115
|
-
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1116
|
-
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
1117
|
-
}
|
|
1118
|
-
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
1119
|
-
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
1120
|
-
}
|
|
1121
|
-
if (typeof obj === 'object' && customInspect) {
|
|
1122
|
-
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
1123
|
-
return utilInspect(obj, { depth: maxDepth - depth });
|
|
1124
|
-
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
1125
|
-
return obj.inspect();
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
if (isMap(obj)) {
|
|
1129
|
-
var mapParts = [];
|
|
1130
|
-
if (mapForEach) {
|
|
1131
|
-
mapForEach.call(obj, function (value, key) {
|
|
1132
|
-
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
|
1136
|
-
}
|
|
1137
|
-
if (isSet(obj)) {
|
|
1138
|
-
var setParts = [];
|
|
1139
|
-
if (setForEach) {
|
|
1140
|
-
setForEach.call(obj, function (value) {
|
|
1141
|
-
setParts.push(inspect(value, obj));
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
|
1145
|
-
}
|
|
1146
|
-
if (isWeakMap(obj)) {
|
|
1147
|
-
return weakCollectionOf('WeakMap');
|
|
1148
|
-
}
|
|
1149
|
-
if (isWeakSet(obj)) {
|
|
1150
|
-
return weakCollectionOf('WeakSet');
|
|
1151
|
-
}
|
|
1152
|
-
if (isWeakRef(obj)) {
|
|
1153
|
-
return weakCollectionOf('WeakRef');
|
|
1154
|
-
}
|
|
1155
|
-
if (isNumber(obj)) {
|
|
1156
|
-
return markBoxed(inspect(Number(obj)));
|
|
1157
|
-
}
|
|
1158
|
-
if (isBigInt(obj)) {
|
|
1159
|
-
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
1160
|
-
}
|
|
1161
|
-
if (isBoolean(obj)) {
|
|
1162
|
-
return markBoxed(booleanValueOf.call(obj));
|
|
1163
|
-
}
|
|
1164
|
-
if (isString(obj)) {
|
|
1165
|
-
return markBoxed(inspect(String(obj)));
|
|
1166
|
-
}
|
|
1167
|
-
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
1168
|
-
var ys = arrObjKeys(obj, inspect);
|
|
1169
|
-
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
1170
|
-
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
|
1171
|
-
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
|
|
1172
|
-
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
|
1173
|
-
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
|
|
1174
|
-
if (ys.length === 0) { return tag + '{}'; }
|
|
1175
|
-
if (indent) {
|
|
1176
|
-
return tag + '{' + indentedJoin(ys, indent) + '}';
|
|
1177
|
-
}
|
|
1178
|
-
return tag + '{ ' + $join.call(ys, ', ') + ' }';
|
|
1179
|
-
}
|
|
1180
|
-
return String(obj);
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
function wrapQuotes(s, defaultStyle, opts) {
|
|
1184
|
-
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
|
|
1185
|
-
return quoteChar + s + quoteChar;
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
function quote(s) {
|
|
1189
|
-
return $replace.call(String(s), /"/g, '"');
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1193
|
-
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1194
|
-
function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1195
|
-
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1196
|
-
function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1197
|
-
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1198
|
-
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1199
|
-
|
|
1200
|
-
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
1201
|
-
function isSymbol(obj) {
|
|
1202
|
-
if (hasShammedSymbols) {
|
|
1203
|
-
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
|
1204
|
-
}
|
|
1205
|
-
if (typeof obj === 'symbol') {
|
|
1206
|
-
return true;
|
|
1207
|
-
}
|
|
1208
|
-
if (!obj || typeof obj !== 'object' || !symToString) {
|
|
1209
|
-
return false;
|
|
1210
|
-
}
|
|
1211
|
-
try {
|
|
1212
|
-
symToString.call(obj);
|
|
1213
|
-
return true;
|
|
1214
|
-
} catch (e) {}
|
|
1215
|
-
return false;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
function isBigInt(obj) {
|
|
1219
|
-
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
|
1220
|
-
return false;
|
|
1221
|
-
}
|
|
1222
|
-
try {
|
|
1223
|
-
bigIntValueOf.call(obj);
|
|
1224
|
-
return true;
|
|
1225
|
-
} catch (e) {}
|
|
1226
|
-
return false;
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
|
1230
|
-
function has$3(obj, key) {
|
|
1231
|
-
return hasOwn.call(obj, key);
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
function toStr(obj) {
|
|
1235
|
-
return objectToString.call(obj);
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
function nameOf(f) {
|
|
1239
|
-
if (f.name) { return f.name; }
|
|
1240
|
-
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
1241
|
-
if (m) { return m[1]; }
|
|
1242
|
-
return null;
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
function indexOf(xs, x) {
|
|
1246
|
-
if (xs.indexOf) { return xs.indexOf(x); }
|
|
1247
|
-
for (var i = 0, l = xs.length; i < l; i++) {
|
|
1248
|
-
if (xs[i] === x) { return i; }
|
|
1249
|
-
}
|
|
1250
|
-
return -1;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
function isMap(x) {
|
|
1254
|
-
if (!mapSize || !x || typeof x !== 'object') {
|
|
1255
|
-
return false;
|
|
1256
|
-
}
|
|
1257
|
-
try {
|
|
1258
|
-
mapSize.call(x);
|
|
1259
|
-
try {
|
|
1260
|
-
setSize.call(x);
|
|
1261
|
-
} catch (s) {
|
|
1262
|
-
return true;
|
|
1263
|
-
}
|
|
1264
|
-
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
|
1265
|
-
} catch (e) {}
|
|
1266
|
-
return false;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
function isWeakMap(x) {
|
|
1270
|
-
if (!weakMapHas || !x || typeof x !== 'object') {
|
|
1271
|
-
return false;
|
|
1272
|
-
}
|
|
1273
|
-
try {
|
|
1274
|
-
weakMapHas.call(x, weakMapHas);
|
|
1275
|
-
try {
|
|
1276
|
-
weakSetHas.call(x, weakSetHas);
|
|
1277
|
-
} catch (s) {
|
|
1278
|
-
return true;
|
|
1279
|
-
}
|
|
1280
|
-
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
|
1281
|
-
} catch (e) {}
|
|
1282
|
-
return false;
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
function isWeakRef(x) {
|
|
1286
|
-
if (!weakRefDeref || !x || typeof x !== 'object') {
|
|
1287
|
-
return false;
|
|
1288
|
-
}
|
|
1289
|
-
try {
|
|
1290
|
-
weakRefDeref.call(x);
|
|
1291
|
-
return true;
|
|
1292
|
-
} catch (e) {}
|
|
1293
|
-
return false;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
function isSet(x) {
|
|
1297
|
-
if (!setSize || !x || typeof x !== 'object') {
|
|
1298
|
-
return false;
|
|
1299
|
-
}
|
|
1300
|
-
try {
|
|
1301
|
-
setSize.call(x);
|
|
1302
|
-
try {
|
|
1303
|
-
mapSize.call(x);
|
|
1304
|
-
} catch (m) {
|
|
1305
|
-
return true;
|
|
1306
|
-
}
|
|
1307
|
-
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
|
1308
|
-
} catch (e) {}
|
|
1309
|
-
return false;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
function isWeakSet(x) {
|
|
1313
|
-
if (!weakSetHas || !x || typeof x !== 'object') {
|
|
1314
|
-
return false;
|
|
1315
|
-
}
|
|
1316
|
-
try {
|
|
1317
|
-
weakSetHas.call(x, weakSetHas);
|
|
1318
|
-
try {
|
|
1319
|
-
weakMapHas.call(x, weakMapHas);
|
|
1320
|
-
} catch (s) {
|
|
1321
|
-
return true;
|
|
1322
|
-
}
|
|
1323
|
-
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
|
1324
|
-
} catch (e) {}
|
|
1325
|
-
return false;
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
function isElement(x) {
|
|
1329
|
-
if (!x || typeof x !== 'object') { return false; }
|
|
1330
|
-
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
|
1331
|
-
return true;
|
|
1332
|
-
}
|
|
1333
|
-
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
function inspectString(str, opts) {
|
|
1337
|
-
if (str.length > opts.maxStringLength) {
|
|
1338
|
-
var remaining = str.length - opts.maxStringLength;
|
|
1339
|
-
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
1340
|
-
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
1341
|
-
}
|
|
1342
|
-
// eslint-disable-next-line no-control-regex
|
|
1343
|
-
var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
1344
|
-
return wrapQuotes(s, 'single', opts);
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
function lowbyte(c) {
|
|
1348
|
-
var n = c.charCodeAt(0);
|
|
1349
|
-
var x = {
|
|
1350
|
-
8: 'b',
|
|
1351
|
-
9: 't',
|
|
1352
|
-
10: 'n',
|
|
1353
|
-
12: 'f',
|
|
1354
|
-
13: 'r'
|
|
1355
|
-
}[n];
|
|
1356
|
-
if (x) { return '\\' + x; }
|
|
1357
|
-
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
function markBoxed(str) {
|
|
1361
|
-
return 'Object(' + str + ')';
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
function weakCollectionOf(type) {
|
|
1365
|
-
return type + ' { ? }';
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
function collectionOf(type, size, entries, indent) {
|
|
1369
|
-
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
|
|
1370
|
-
return type + ' (' + size + ') {' + joinedEntries + '}';
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
function singleLineValues(xs) {
|
|
1374
|
-
for (var i = 0; i < xs.length; i++) {
|
|
1375
|
-
if (indexOf(xs[i], '\n') >= 0) {
|
|
1376
|
-
return false;
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
return true;
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
function getIndent(opts, depth) {
|
|
1383
|
-
var baseIndent;
|
|
1384
|
-
if (opts.indent === '\t') {
|
|
1385
|
-
baseIndent = '\t';
|
|
1386
|
-
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
|
1387
|
-
baseIndent = $join.call(Array(opts.indent + 1), ' ');
|
|
1388
|
-
} else {
|
|
1389
|
-
return null;
|
|
1390
|
-
}
|
|
1391
|
-
return {
|
|
1392
|
-
base: baseIndent,
|
|
1393
|
-
prev: $join.call(Array(depth + 1), baseIndent)
|
|
1394
|
-
};
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
function indentedJoin(xs, indent) {
|
|
1398
|
-
if (xs.length === 0) { return ''; }
|
|
1399
|
-
var lineJoiner = '\n' + indent.prev + indent.base;
|
|
1400
|
-
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
function arrObjKeys(obj, inspect) {
|
|
1404
|
-
var isArr = isArray$3(obj);
|
|
1405
|
-
var xs = [];
|
|
1406
|
-
if (isArr) {
|
|
1407
|
-
xs.length = obj.length;
|
|
1408
|
-
for (var i = 0; i < obj.length; i++) {
|
|
1409
|
-
xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
|
1413
|
-
var symMap;
|
|
1414
|
-
if (hasShammedSymbols) {
|
|
1415
|
-
symMap = {};
|
|
1416
|
-
for (var k = 0; k < syms.length; k++) {
|
|
1417
|
-
symMap['$' + syms[k]] = syms[k];
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
1422
|
-
if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
1423
|
-
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
1424
|
-
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
|
1425
|
-
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
1426
|
-
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
1427
|
-
} else if ($test.call(/[^\w$]/, key)) {
|
|
1428
|
-
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
1429
|
-
} else {
|
|
1430
|
-
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
if (typeof gOPS === 'function') {
|
|
1434
|
-
for (var j = 0; j < syms.length; j++) {
|
|
1435
|
-
if (isEnumerable.call(obj, syms[j])) {
|
|
1436
|
-
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
return xs;
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
var GetIntrinsic = getIntrinsic;
|
|
1444
|
-
var callBound = callBound$1;
|
|
1445
|
-
var inspect = objectInspect;
|
|
1446
|
-
|
|
1447
|
-
var $TypeError = GetIntrinsic('%TypeError%');
|
|
1448
|
-
var $WeakMap = GetIntrinsic('%WeakMap%', true);
|
|
1449
|
-
var $Map = GetIntrinsic('%Map%', true);
|
|
1450
|
-
|
|
1451
|
-
var $weakMapGet = callBound('WeakMap.prototype.get', true);
|
|
1452
|
-
var $weakMapSet = callBound('WeakMap.prototype.set', true);
|
|
1453
|
-
var $weakMapHas = callBound('WeakMap.prototype.has', true);
|
|
1454
|
-
var $mapGet = callBound('Map.prototype.get', true);
|
|
1455
|
-
var $mapSet = callBound('Map.prototype.set', true);
|
|
1456
|
-
var $mapHas = callBound('Map.prototype.has', true);
|
|
1457
|
-
|
|
1458
|
-
/*
|
|
1459
|
-
* This function traverses the list returning the node corresponding to the
|
|
1460
|
-
* given key.
|
|
1461
|
-
*
|
|
1462
|
-
* That node is also moved to the head of the list, so that if it's accessed
|
|
1463
|
-
* again we don't need to traverse the whole list. By doing so, all the recently
|
|
1464
|
-
* used nodes can be accessed relatively quickly.
|
|
1465
|
-
*/
|
|
1466
|
-
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
1467
|
-
for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
|
|
1468
|
-
if (curr.key === key) {
|
|
1469
|
-
prev.next = curr.next;
|
|
1470
|
-
curr.next = list.next;
|
|
1471
|
-
list.next = curr; // eslint-disable-line no-param-reassign
|
|
1472
|
-
return curr;
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
};
|
|
1476
|
-
|
|
1477
|
-
var listGet = function (objects, key) {
|
|
1478
|
-
var node = listGetNode(objects, key);
|
|
1479
|
-
return node && node.value;
|
|
1480
|
-
};
|
|
1481
|
-
var listSet = function (objects, key, value) {
|
|
1482
|
-
var node = listGetNode(objects, key);
|
|
1483
|
-
if (node) {
|
|
1484
|
-
node.value = value;
|
|
1485
|
-
} else {
|
|
1486
|
-
// Prepend the new node to the beginning of the list
|
|
1487
|
-
objects.next = { // eslint-disable-line no-param-reassign
|
|
1488
|
-
key: key,
|
|
1489
|
-
next: objects.next,
|
|
1490
|
-
value: value
|
|
1491
|
-
};
|
|
1492
|
-
}
|
|
1493
|
-
};
|
|
1494
|
-
var listHas = function (objects, key) {
|
|
1495
|
-
return !!listGetNode(objects, key);
|
|
1496
|
-
};
|
|
1497
|
-
|
|
1498
|
-
var sideChannel = function getSideChannel() {
|
|
1499
|
-
var $wm;
|
|
1500
|
-
var $m;
|
|
1501
|
-
var $o;
|
|
1502
|
-
var channel = {
|
|
1503
|
-
assert: function (key) {
|
|
1504
|
-
if (!channel.has(key)) {
|
|
1505
|
-
throw new $TypeError('Side channel does not contain ' + inspect(key));
|
|
1506
|
-
}
|
|
1507
|
-
},
|
|
1508
|
-
get: function (key) { // eslint-disable-line consistent-return
|
|
1509
|
-
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1510
|
-
if ($wm) {
|
|
1511
|
-
return $weakMapGet($wm, key);
|
|
1512
|
-
}
|
|
1513
|
-
} else if ($Map) {
|
|
1514
|
-
if ($m) {
|
|
1515
|
-
return $mapGet($m, key);
|
|
1516
|
-
}
|
|
1517
|
-
} else {
|
|
1518
|
-
if ($o) { // eslint-disable-line no-lonely-if
|
|
1519
|
-
return listGet($o, key);
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
},
|
|
1523
|
-
has: function (key) {
|
|
1524
|
-
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1525
|
-
if ($wm) {
|
|
1526
|
-
return $weakMapHas($wm, key);
|
|
1527
|
-
}
|
|
1528
|
-
} else if ($Map) {
|
|
1529
|
-
if ($m) {
|
|
1530
|
-
return $mapHas($m, key);
|
|
1531
|
-
}
|
|
1532
|
-
} else {
|
|
1533
|
-
if ($o) { // eslint-disable-line no-lonely-if
|
|
1534
|
-
return listHas($o, key);
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
return false;
|
|
1538
|
-
},
|
|
1539
|
-
set: function (key, value) {
|
|
1540
|
-
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1541
|
-
if (!$wm) {
|
|
1542
|
-
$wm = new $WeakMap();
|
|
1543
|
-
}
|
|
1544
|
-
$weakMapSet($wm, key, value);
|
|
1545
|
-
} else if ($Map) {
|
|
1546
|
-
if (!$m) {
|
|
1547
|
-
$m = new $Map();
|
|
1548
|
-
}
|
|
1549
|
-
$mapSet($m, key, value);
|
|
1550
|
-
} else {
|
|
1551
|
-
if (!$o) {
|
|
1552
|
-
/*
|
|
1553
|
-
* Initialize the linked list as an empty node, so that we don't have
|
|
1554
|
-
* to special-case handling of the first node: we can always refer to
|
|
1555
|
-
* it as (previous node).next, instead of something like (list).head
|
|
1556
|
-
*/
|
|
1557
|
-
$o = { key: {}, next: null };
|
|
1558
|
-
}
|
|
1559
|
-
listSet($o, key, value);
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
};
|
|
1563
|
-
return channel;
|
|
1564
|
-
};
|
|
1565
|
-
|
|
1566
|
-
var replace = String.prototype.replace;
|
|
1567
|
-
var percentTwenties = /%20/g;
|
|
1568
|
-
|
|
1569
|
-
var Format = {
|
|
1570
|
-
RFC1738: 'RFC1738',
|
|
1571
|
-
RFC3986: 'RFC3986'
|
|
1572
|
-
};
|
|
1573
|
-
|
|
1574
|
-
var formats$3 = {
|
|
1575
|
-
'default': Format.RFC3986,
|
|
1576
|
-
formatters: {
|
|
1577
|
-
RFC1738: function (value) {
|
|
1578
|
-
return replace.call(value, percentTwenties, '+');
|
|
1579
|
-
},
|
|
1580
|
-
RFC3986: function (value) {
|
|
1581
|
-
return String(value);
|
|
1582
|
-
}
|
|
1583
|
-
},
|
|
1584
|
-
RFC1738: Format.RFC1738,
|
|
1585
|
-
RFC3986: Format.RFC3986
|
|
1586
|
-
};
|
|
1587
|
-
|
|
1588
|
-
var formats$2 = formats$3;
|
|
1589
|
-
|
|
1590
|
-
var has$2 = Object.prototype.hasOwnProperty;
|
|
1591
|
-
var isArray$2 = Array.isArray;
|
|
1592
|
-
|
|
1593
|
-
var hexTable = (function () {
|
|
1594
|
-
var array = [];
|
|
1595
|
-
for (var i = 0; i < 256; ++i) {
|
|
1596
|
-
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
return array;
|
|
1600
|
-
}());
|
|
1601
|
-
|
|
1602
|
-
var compactQueue = function compactQueue(queue) {
|
|
1603
|
-
while (queue.length > 1) {
|
|
1604
|
-
var item = queue.pop();
|
|
1605
|
-
var obj = item.obj[item.prop];
|
|
1606
|
-
|
|
1607
|
-
if (isArray$2(obj)) {
|
|
1608
|
-
var compacted = [];
|
|
1609
|
-
|
|
1610
|
-
for (var j = 0; j < obj.length; ++j) {
|
|
1611
|
-
if (typeof obj[j] !== 'undefined') {
|
|
1612
|
-
compacted.push(obj[j]);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
item.obj[item.prop] = compacted;
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
};
|
|
1620
|
-
|
|
1621
|
-
var arrayToObject = function arrayToObject(source, options) {
|
|
1622
|
-
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
1623
|
-
for (var i = 0; i < source.length; ++i) {
|
|
1624
|
-
if (typeof source[i] !== 'undefined') {
|
|
1625
|
-
obj[i] = source[i];
|
|
1626
|
-
}
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
|
-
return obj;
|
|
1630
|
-
};
|
|
1631
|
-
|
|
1632
|
-
var merge = function merge(target, source, options) {
|
|
1633
|
-
/* eslint no-param-reassign: 0 */
|
|
1634
|
-
if (!source) {
|
|
1635
|
-
return target;
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
if (typeof source !== 'object') {
|
|
1639
|
-
if (isArray$2(target)) {
|
|
1640
|
-
target.push(source);
|
|
1641
|
-
} else if (target && typeof target === 'object') {
|
|
1642
|
-
if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
|
|
1643
|
-
target[source] = true;
|
|
1644
|
-
}
|
|
1645
|
-
} else {
|
|
1646
|
-
return [target, source];
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
return target;
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
if (!target || typeof target !== 'object') {
|
|
1653
|
-
return [target].concat(source);
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
var mergeTarget = target;
|
|
1657
|
-
if (isArray$2(target) && !isArray$2(source)) {
|
|
1658
|
-
mergeTarget = arrayToObject(target, options);
|
|
1659
|
-
}
|
|
1660
|
-
|
|
1661
|
-
if (isArray$2(target) && isArray$2(source)) {
|
|
1662
|
-
source.forEach(function (item, i) {
|
|
1663
|
-
if (has$2.call(target, i)) {
|
|
1664
|
-
var targetItem = target[i];
|
|
1665
|
-
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
1666
|
-
target[i] = merge(targetItem, item, options);
|
|
1667
|
-
} else {
|
|
1668
|
-
target.push(item);
|
|
1669
|
-
}
|
|
1670
|
-
} else {
|
|
1671
|
-
target[i] = item;
|
|
1672
|
-
}
|
|
1673
|
-
});
|
|
1674
|
-
return target;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
1678
|
-
var value = source[key];
|
|
1679
|
-
|
|
1680
|
-
if (has$2.call(acc, key)) {
|
|
1681
|
-
acc[key] = merge(acc[key], value, options);
|
|
1682
|
-
} else {
|
|
1683
|
-
acc[key] = value;
|
|
1684
|
-
}
|
|
1685
|
-
return acc;
|
|
1686
|
-
}, mergeTarget);
|
|
1687
|
-
};
|
|
1688
|
-
|
|
1689
|
-
var assign = function assignSingleSource(target, source) {
|
|
1690
|
-
return Object.keys(source).reduce(function (acc, key) {
|
|
1691
|
-
acc[key] = source[key];
|
|
1692
|
-
return acc;
|
|
1693
|
-
}, target);
|
|
1694
|
-
};
|
|
1695
|
-
|
|
1696
|
-
var decode = function (str, decoder, charset) {
|
|
1697
|
-
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
1698
|
-
if (charset === 'iso-8859-1') {
|
|
1699
|
-
// unescape never throws, no try...catch needed:
|
|
1700
|
-
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
1701
|
-
}
|
|
1702
|
-
// utf-8
|
|
1703
|
-
try {
|
|
1704
|
-
return decodeURIComponent(strWithoutPlus);
|
|
1705
|
-
} catch (e) {
|
|
1706
|
-
return strWithoutPlus;
|
|
1707
|
-
}
|
|
1708
|
-
};
|
|
1709
|
-
|
|
1710
|
-
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
1711
|
-
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
1712
|
-
// It has been adapted here for stricter adherence to RFC 3986
|
|
1713
|
-
if (str.length === 0) {
|
|
1714
|
-
return str;
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
var string = str;
|
|
1718
|
-
if (typeof str === 'symbol') {
|
|
1719
|
-
string = Symbol.prototype.toString.call(str);
|
|
1720
|
-
} else if (typeof str !== 'string') {
|
|
1721
|
-
string = String(str);
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
if (charset === 'iso-8859-1') {
|
|
1725
|
-
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
1726
|
-
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
|
1727
|
-
});
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
var out = '';
|
|
1731
|
-
for (var i = 0; i < string.length; ++i) {
|
|
1732
|
-
var c = string.charCodeAt(i);
|
|
1733
|
-
|
|
1734
|
-
if (
|
|
1735
|
-
c === 0x2D // -
|
|
1736
|
-
|| c === 0x2E // .
|
|
1737
|
-
|| c === 0x5F // _
|
|
1738
|
-
|| c === 0x7E // ~
|
|
1739
|
-
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
1740
|
-
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
1741
|
-
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
1742
|
-
|| (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
1743
|
-
) {
|
|
1744
|
-
out += string.charAt(i);
|
|
1745
|
-
continue;
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
|
-
if (c < 0x80) {
|
|
1749
|
-
out = out + hexTable[c];
|
|
1750
|
-
continue;
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
if (c < 0x800) {
|
|
1754
|
-
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
1755
|
-
continue;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
if (c < 0xD800 || c >= 0xE000) {
|
|
1759
|
-
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
1760
|
-
continue;
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
i += 1;
|
|
1764
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
1765
|
-
/* eslint operator-linebreak: [2, "before"] */
|
|
1766
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
1767
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
1768
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
1769
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
return out;
|
|
1773
|
-
};
|
|
1774
|
-
|
|
1775
|
-
var compact = function compact(value) {
|
|
1776
|
-
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
1777
|
-
var refs = [];
|
|
1778
|
-
|
|
1779
|
-
for (var i = 0; i < queue.length; ++i) {
|
|
1780
|
-
var item = queue[i];
|
|
1781
|
-
var obj = item.obj[item.prop];
|
|
1782
|
-
|
|
1783
|
-
var keys = Object.keys(obj);
|
|
1784
|
-
for (var j = 0; j < keys.length; ++j) {
|
|
1785
|
-
var key = keys[j];
|
|
1786
|
-
var val = obj[key];
|
|
1787
|
-
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
1788
|
-
queue.push({ obj: obj, prop: key });
|
|
1789
|
-
refs.push(val);
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1793
|
-
|
|
1794
|
-
compactQueue(queue);
|
|
1795
|
-
|
|
1796
|
-
return value;
|
|
1797
|
-
};
|
|
1798
|
-
|
|
1799
|
-
var isRegExp = function isRegExp(obj) {
|
|
1800
|
-
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
1801
|
-
};
|
|
1802
|
-
|
|
1803
|
-
var isBuffer = function isBuffer(obj) {
|
|
1804
|
-
if (!obj || typeof obj !== 'object') {
|
|
1805
|
-
return false;
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
1809
|
-
};
|
|
1810
|
-
|
|
1811
|
-
var combine = function combine(a, b) {
|
|
1812
|
-
return [].concat(a, b);
|
|
1813
|
-
};
|
|
1814
|
-
|
|
1815
|
-
var maybeMap = function maybeMap(val, fn) {
|
|
1816
|
-
if (isArray$2(val)) {
|
|
1817
|
-
var mapped = [];
|
|
1818
|
-
for (var i = 0; i < val.length; i += 1) {
|
|
1819
|
-
mapped.push(fn(val[i]));
|
|
1820
|
-
}
|
|
1821
|
-
return mapped;
|
|
1822
|
-
}
|
|
1823
|
-
return fn(val);
|
|
1824
|
-
};
|
|
1825
|
-
|
|
1826
|
-
var utils$2 = {
|
|
1827
|
-
arrayToObject: arrayToObject,
|
|
1828
|
-
assign: assign,
|
|
1829
|
-
combine: combine,
|
|
1830
|
-
compact: compact,
|
|
1831
|
-
decode: decode,
|
|
1832
|
-
encode: encode,
|
|
1833
|
-
isBuffer: isBuffer,
|
|
1834
|
-
isRegExp: isRegExp,
|
|
1835
|
-
maybeMap: maybeMap,
|
|
1836
|
-
merge: merge
|
|
1837
|
-
};
|
|
1838
|
-
|
|
1839
|
-
var getSideChannel = sideChannel;
|
|
1840
|
-
var utils$1 = utils$2;
|
|
1841
|
-
var formats$1 = formats$3;
|
|
1842
|
-
var has$1 = Object.prototype.hasOwnProperty;
|
|
1843
|
-
|
|
1844
|
-
var arrayPrefixGenerators = {
|
|
1845
|
-
brackets: function brackets(prefix) {
|
|
1846
|
-
return prefix + '[]';
|
|
1847
|
-
},
|
|
1848
|
-
comma: 'comma',
|
|
1849
|
-
indices: function indices(prefix, key) {
|
|
1850
|
-
return prefix + '[' + key + ']';
|
|
1851
|
-
},
|
|
1852
|
-
repeat: function repeat(prefix) {
|
|
1853
|
-
return prefix;
|
|
1854
|
-
}
|
|
1855
|
-
};
|
|
1856
|
-
|
|
1857
|
-
var isArray$1 = Array.isArray;
|
|
1858
|
-
var push = Array.prototype.push;
|
|
1859
|
-
var pushToArray = function (arr, valueOrArray) {
|
|
1860
|
-
push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
1861
|
-
};
|
|
1862
|
-
|
|
1863
|
-
var toISO = Date.prototype.toISOString;
|
|
1864
|
-
|
|
1865
|
-
var defaultFormat = formats$1['default'];
|
|
1866
|
-
var defaults$1 = {
|
|
1867
|
-
addQueryPrefix: false,
|
|
1868
|
-
allowDots: false,
|
|
1869
|
-
charset: 'utf-8',
|
|
1870
|
-
charsetSentinel: false,
|
|
1871
|
-
delimiter: '&',
|
|
1872
|
-
encode: true,
|
|
1873
|
-
encoder: utils$1.encode,
|
|
1874
|
-
encodeValuesOnly: false,
|
|
1875
|
-
format: defaultFormat,
|
|
1876
|
-
formatter: formats$1.formatters[defaultFormat],
|
|
1877
|
-
// deprecated
|
|
1878
|
-
indices: false,
|
|
1879
|
-
serializeDate: function serializeDate(date) {
|
|
1880
|
-
return toISO.call(date);
|
|
1881
|
-
},
|
|
1882
|
-
skipNulls: false,
|
|
1883
|
-
strictNullHandling: false
|
|
1884
|
-
};
|
|
1885
|
-
|
|
1886
|
-
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
1887
|
-
return typeof v === 'string'
|
|
1888
|
-
|| typeof v === 'number'
|
|
1889
|
-
|| typeof v === 'boolean'
|
|
1890
|
-
|| typeof v === 'symbol'
|
|
1891
|
-
|| typeof v === 'bigint';
|
|
1892
|
-
};
|
|
1893
|
-
|
|
1894
|
-
var sentinel = {};
|
|
1895
|
-
|
|
1896
|
-
var stringify$1 = function stringify(
|
|
1897
|
-
object,
|
|
1898
|
-
prefix,
|
|
1899
|
-
generateArrayPrefix,
|
|
1900
|
-
commaRoundTrip,
|
|
1901
|
-
strictNullHandling,
|
|
1902
|
-
skipNulls,
|
|
1903
|
-
encoder,
|
|
1904
|
-
filter,
|
|
1905
|
-
sort,
|
|
1906
|
-
allowDots,
|
|
1907
|
-
serializeDate,
|
|
1908
|
-
format,
|
|
1909
|
-
formatter,
|
|
1910
|
-
encodeValuesOnly,
|
|
1911
|
-
charset,
|
|
1912
|
-
sideChannel
|
|
1913
|
-
) {
|
|
1914
|
-
var obj = object;
|
|
1915
|
-
|
|
1916
|
-
var tmpSc = sideChannel;
|
|
1917
|
-
var step = 0;
|
|
1918
|
-
var findFlag = false;
|
|
1919
|
-
while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
|
|
1920
|
-
// Where object last appeared in the ref tree
|
|
1921
|
-
var pos = tmpSc.get(object);
|
|
1922
|
-
step += 1;
|
|
1923
|
-
if (typeof pos !== 'undefined') {
|
|
1924
|
-
if (pos === step) {
|
|
1925
|
-
throw new RangeError('Cyclic object value');
|
|
1926
|
-
} else {
|
|
1927
|
-
findFlag = true; // Break while
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
if (typeof tmpSc.get(sentinel) === 'undefined') {
|
|
1931
|
-
step = 0;
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
if (typeof filter === 'function') {
|
|
1936
|
-
obj = filter(prefix, obj);
|
|
1937
|
-
} else if (obj instanceof Date) {
|
|
1938
|
-
obj = serializeDate(obj);
|
|
1939
|
-
} else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
1940
|
-
obj = utils$1.maybeMap(obj, function (value) {
|
|
1941
|
-
if (value instanceof Date) {
|
|
1942
|
-
return serializeDate(value);
|
|
1943
|
-
}
|
|
1944
|
-
return value;
|
|
1945
|
-
});
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
if (obj === null) {
|
|
1949
|
-
if (strictNullHandling) {
|
|
1950
|
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
obj = '';
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
|
|
1957
|
-
if (encoder) {
|
|
1958
|
-
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
|
|
1959
|
-
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
|
|
1960
|
-
}
|
|
1961
|
-
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
var values = [];
|
|
1965
|
-
|
|
1966
|
-
if (typeof obj === 'undefined') {
|
|
1967
|
-
return values;
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
var objKeys;
|
|
1971
|
-
if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
1972
|
-
// we need to join elements in
|
|
1973
|
-
if (encodeValuesOnly && encoder) {
|
|
1974
|
-
obj = utils$1.maybeMap(obj, encoder);
|
|
1975
|
-
}
|
|
1976
|
-
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
1977
|
-
} else if (isArray$1(filter)) {
|
|
1978
|
-
objKeys = filter;
|
|
1979
|
-
} else {
|
|
1980
|
-
var keys = Object.keys(obj);
|
|
1981
|
-
objKeys = sort ? keys.sort(sort) : keys;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
|
|
1985
|
-
|
|
1986
|
-
for (var j = 0; j < objKeys.length; ++j) {
|
|
1987
|
-
var key = objKeys[j];
|
|
1988
|
-
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
1989
|
-
|
|
1990
|
-
if (skipNulls && value === null) {
|
|
1991
|
-
continue;
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
var keyPrefix = isArray$1(obj)
|
|
1995
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
|
|
1996
|
-
: adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
|
|
1997
|
-
|
|
1998
|
-
sideChannel.set(object, step);
|
|
1999
|
-
var valueSideChannel = getSideChannel();
|
|
2000
|
-
valueSideChannel.set(sentinel, sideChannel);
|
|
2001
|
-
pushToArray(values, stringify(
|
|
2002
|
-
value,
|
|
2003
|
-
keyPrefix,
|
|
2004
|
-
generateArrayPrefix,
|
|
2005
|
-
commaRoundTrip,
|
|
2006
|
-
strictNullHandling,
|
|
2007
|
-
skipNulls,
|
|
2008
|
-
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
|
|
2009
|
-
filter,
|
|
2010
|
-
sort,
|
|
2011
|
-
allowDots,
|
|
2012
|
-
serializeDate,
|
|
2013
|
-
format,
|
|
2014
|
-
formatter,
|
|
2015
|
-
encodeValuesOnly,
|
|
2016
|
-
charset,
|
|
2017
|
-
valueSideChannel
|
|
2018
|
-
));
|
|
2019
|
-
}
|
|
2020
|
-
|
|
2021
|
-
return values;
|
|
2022
|
-
};
|
|
2023
|
-
|
|
2024
|
-
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
2025
|
-
if (!opts) {
|
|
2026
|
-
return defaults$1;
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
|
-
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
2030
|
-
throw new TypeError('Encoder has to be a function.');
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
|
-
var charset = opts.charset || defaults$1.charset;
|
|
2034
|
-
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
2035
|
-
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
var format = formats$1['default'];
|
|
2039
|
-
if (typeof opts.format !== 'undefined') {
|
|
2040
|
-
if (!has$1.call(formats$1.formatters, opts.format)) {
|
|
2041
|
-
throw new TypeError('Unknown format option provided.');
|
|
2042
|
-
}
|
|
2043
|
-
format = opts.format;
|
|
2044
|
-
}
|
|
2045
|
-
var formatter = formats$1.formatters[format];
|
|
2046
|
-
|
|
2047
|
-
var filter = defaults$1.filter;
|
|
2048
|
-
if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
|
|
2049
|
-
filter = opts.filter;
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
|
-
return {
|
|
2053
|
-
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
|
|
2054
|
-
allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
|
|
2055
|
-
charset: charset,
|
|
2056
|
-
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
2057
|
-
delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
|
|
2058
|
-
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
|
|
2059
|
-
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
|
|
2060
|
-
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
|
|
2061
|
-
filter: filter,
|
|
2062
|
-
format: format,
|
|
2063
|
-
formatter: formatter,
|
|
2064
|
-
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
|
|
2065
|
-
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
|
|
2066
|
-
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
|
2067
|
-
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
|
|
2068
|
-
};
|
|
2069
|
-
};
|
|
2070
|
-
|
|
2071
|
-
var stringify_1 = function (object, opts) {
|
|
2072
|
-
var obj = object;
|
|
2073
|
-
var options = normalizeStringifyOptions(opts);
|
|
2074
|
-
|
|
2075
|
-
var objKeys;
|
|
2076
|
-
var filter;
|
|
2077
|
-
|
|
2078
|
-
if (typeof options.filter === 'function') {
|
|
2079
|
-
filter = options.filter;
|
|
2080
|
-
obj = filter('', obj);
|
|
2081
|
-
} else if (isArray$1(options.filter)) {
|
|
2082
|
-
filter = options.filter;
|
|
2083
|
-
objKeys = filter;
|
|
2084
|
-
}
|
|
2085
|
-
|
|
2086
|
-
var keys = [];
|
|
2087
|
-
|
|
2088
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
2089
|
-
return '';
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
var arrayFormat;
|
|
2093
|
-
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
|
2094
|
-
arrayFormat = opts.arrayFormat;
|
|
2095
|
-
} else if (opts && 'indices' in opts) {
|
|
2096
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
2097
|
-
} else {
|
|
2098
|
-
arrayFormat = 'indices';
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
2102
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
2103
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
2104
|
-
}
|
|
2105
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
2106
|
-
|
|
2107
|
-
if (!objKeys) {
|
|
2108
|
-
objKeys = Object.keys(obj);
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
if (options.sort) {
|
|
2112
|
-
objKeys.sort(options.sort);
|
|
2113
|
-
}
|
|
2114
|
-
|
|
2115
|
-
var sideChannel = getSideChannel();
|
|
2116
|
-
for (var i = 0; i < objKeys.length; ++i) {
|
|
2117
|
-
var key = objKeys[i];
|
|
2118
|
-
|
|
2119
|
-
if (options.skipNulls && obj[key] === null) {
|
|
2120
|
-
continue;
|
|
2121
|
-
}
|
|
2122
|
-
pushToArray(keys, stringify$1(
|
|
2123
|
-
obj[key],
|
|
2124
|
-
key,
|
|
2125
|
-
generateArrayPrefix,
|
|
2126
|
-
commaRoundTrip,
|
|
2127
|
-
options.strictNullHandling,
|
|
2128
|
-
options.skipNulls,
|
|
2129
|
-
options.encode ? options.encoder : null,
|
|
2130
|
-
options.filter,
|
|
2131
|
-
options.sort,
|
|
2132
|
-
options.allowDots,
|
|
2133
|
-
options.serializeDate,
|
|
2134
|
-
options.format,
|
|
2135
|
-
options.formatter,
|
|
2136
|
-
options.encodeValuesOnly,
|
|
2137
|
-
options.charset,
|
|
2138
|
-
sideChannel
|
|
2139
|
-
));
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
var joined = keys.join(options.delimiter);
|
|
2143
|
-
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
2144
|
-
|
|
2145
|
-
if (options.charsetSentinel) {
|
|
2146
|
-
if (options.charset === 'iso-8859-1') {
|
|
2147
|
-
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
2148
|
-
prefix += 'utf8=%26%2310003%3B&';
|
|
2149
|
-
} else {
|
|
2150
|
-
// encodeURIComponent('✓')
|
|
2151
|
-
prefix += 'utf8=%E2%9C%93&';
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
return joined.length > 0 ? prefix + joined : '';
|
|
2156
|
-
};
|
|
2157
|
-
|
|
2158
|
-
var utils = utils$2;
|
|
2159
|
-
|
|
2160
|
-
var has = Object.prototype.hasOwnProperty;
|
|
2161
|
-
var isArray = Array.isArray;
|
|
2162
|
-
|
|
2163
|
-
var defaults = {
|
|
2164
|
-
allowDots: false,
|
|
2165
|
-
allowPrototypes: false,
|
|
2166
|
-
allowSparse: false,
|
|
2167
|
-
arrayLimit: 20,
|
|
2168
|
-
charset: 'utf-8',
|
|
2169
|
-
charsetSentinel: false,
|
|
2170
|
-
comma: false,
|
|
2171
|
-
decoder: utils.decode,
|
|
2172
|
-
delimiter: '&',
|
|
2173
|
-
depth: 5,
|
|
2174
|
-
ignoreQueryPrefix: false,
|
|
2175
|
-
interpretNumericEntities: false,
|
|
2176
|
-
parameterLimit: 1000,
|
|
2177
|
-
parseArrays: true,
|
|
2178
|
-
plainObjects: false,
|
|
2179
|
-
strictNullHandling: false
|
|
2180
|
-
};
|
|
2181
|
-
|
|
2182
|
-
var interpretNumericEntities = function (str) {
|
|
2183
|
-
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
|
2184
|
-
return String.fromCharCode(parseInt(numberStr, 10));
|
|
2185
|
-
});
|
|
2186
|
-
};
|
|
2187
|
-
|
|
2188
|
-
var parseArrayValue = function (val, options) {
|
|
2189
|
-
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
2190
|
-
return val.split(',');
|
|
2191
|
-
}
|
|
2192
|
-
|
|
2193
|
-
return val;
|
|
2194
|
-
};
|
|
2195
|
-
|
|
2196
|
-
// This is what browsers will submit when the ✓ character occurs in an
|
|
2197
|
-
// application/x-www-form-urlencoded body and the encoding of the page containing
|
|
2198
|
-
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
|
2199
|
-
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
|
2200
|
-
// the ✓ character, such as us-ascii.
|
|
2201
|
-
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
2202
|
-
|
|
2203
|
-
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
|
2204
|
-
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
2205
|
-
|
|
2206
|
-
var parseValues = function parseQueryStringValues(str, options) {
|
|
2207
|
-
var obj = { __proto__: null };
|
|
2208
|
-
|
|
2209
|
-
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
2210
|
-
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
2211
|
-
var parts = cleanStr.split(options.delimiter, limit);
|
|
2212
|
-
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
2213
|
-
var i;
|
|
2214
|
-
|
|
2215
|
-
var charset = options.charset;
|
|
2216
|
-
if (options.charsetSentinel) {
|
|
2217
|
-
for (i = 0; i < parts.length; ++i) {
|
|
2218
|
-
if (parts[i].indexOf('utf8=') === 0) {
|
|
2219
|
-
if (parts[i] === charsetSentinel) {
|
|
2220
|
-
charset = 'utf-8';
|
|
2221
|
-
} else if (parts[i] === isoSentinel) {
|
|
2222
|
-
charset = 'iso-8859-1';
|
|
2223
|
-
}
|
|
2224
|
-
skipIndex = i;
|
|
2225
|
-
i = parts.length; // The eslint settings do not allow break;
|
|
2226
|
-
}
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
|
-
|
|
2230
|
-
for (i = 0; i < parts.length; ++i) {
|
|
2231
|
-
if (i === skipIndex) {
|
|
2232
|
-
continue;
|
|
2233
|
-
}
|
|
2234
|
-
var part = parts[i];
|
|
2235
|
-
|
|
2236
|
-
var bracketEqualsPos = part.indexOf(']=');
|
|
2237
|
-
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
2238
|
-
|
|
2239
|
-
var key, val;
|
|
2240
|
-
if (pos === -1) {
|
|
2241
|
-
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
2242
|
-
val = options.strictNullHandling ? null : '';
|
|
2243
|
-
} else {
|
|
2244
|
-
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
2245
|
-
val = utils.maybeMap(
|
|
2246
|
-
parseArrayValue(part.slice(pos + 1), options),
|
|
2247
|
-
function (encodedVal) {
|
|
2248
|
-
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
2249
|
-
}
|
|
2250
|
-
);
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
|
-
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
2254
|
-
val = interpretNumericEntities(val);
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
if (part.indexOf('[]=') > -1) {
|
|
2258
|
-
val = isArray(val) ? [val] : val;
|
|
2259
|
-
}
|
|
2260
|
-
|
|
2261
|
-
if (has.call(obj, key)) {
|
|
2262
|
-
obj[key] = utils.combine(obj[key], val);
|
|
2263
|
-
} else {
|
|
2264
|
-
obj[key] = val;
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2267
|
-
|
|
2268
|
-
return obj;
|
|
2269
|
-
};
|
|
2270
|
-
|
|
2271
|
-
var parseObject = function (chain, val, options, valuesParsed) {
|
|
2272
|
-
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
|
2273
|
-
|
|
2274
|
-
for (var i = chain.length - 1; i >= 0; --i) {
|
|
2275
|
-
var obj;
|
|
2276
|
-
var root = chain[i];
|
|
2277
|
-
|
|
2278
|
-
if (root === '[]' && options.parseArrays) {
|
|
2279
|
-
obj = [].concat(leaf);
|
|
2280
|
-
} else {
|
|
2281
|
-
obj = options.plainObjects ? Object.create(null) : {};
|
|
2282
|
-
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
2283
|
-
var index = parseInt(cleanRoot, 10);
|
|
2284
|
-
if (!options.parseArrays && cleanRoot === '') {
|
|
2285
|
-
obj = { 0: leaf };
|
|
2286
|
-
} else if (
|
|
2287
|
-
!isNaN(index)
|
|
2288
|
-
&& root !== cleanRoot
|
|
2289
|
-
&& String(index) === cleanRoot
|
|
2290
|
-
&& index >= 0
|
|
2291
|
-
&& (options.parseArrays && index <= options.arrayLimit)
|
|
2292
|
-
) {
|
|
2293
|
-
obj = [];
|
|
2294
|
-
obj[index] = leaf;
|
|
2295
|
-
} else if (cleanRoot !== '__proto__') {
|
|
2296
|
-
obj[cleanRoot] = leaf;
|
|
2297
|
-
}
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
leaf = obj;
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
return leaf;
|
|
2304
|
-
};
|
|
2305
|
-
|
|
2306
|
-
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
2307
|
-
if (!givenKey) {
|
|
2308
|
-
return;
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
// Transform dot notation to bracket notation
|
|
2312
|
-
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
2313
|
-
|
|
2314
|
-
// The regex chunks
|
|
2315
|
-
|
|
2316
|
-
var brackets = /(\[[^[\]]*])/;
|
|
2317
|
-
var child = /(\[[^[\]]*])/g;
|
|
2318
|
-
|
|
2319
|
-
// Get the parent
|
|
2320
|
-
|
|
2321
|
-
var segment = options.depth > 0 && brackets.exec(key);
|
|
2322
|
-
var parent = segment ? key.slice(0, segment.index) : key;
|
|
2323
|
-
|
|
2324
|
-
// Stash the parent if it exists
|
|
2325
|
-
|
|
2326
|
-
var keys = [];
|
|
2327
|
-
if (parent) {
|
|
2328
|
-
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
2329
|
-
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
2330
|
-
if (!options.allowPrototypes) {
|
|
2331
|
-
return;
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
|
|
2335
|
-
keys.push(parent);
|
|
2336
|
-
}
|
|
2337
|
-
|
|
2338
|
-
// Loop through children appending to the array until we hit depth
|
|
2339
|
-
|
|
2340
|
-
var i = 0;
|
|
2341
|
-
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
|
2342
|
-
i += 1;
|
|
2343
|
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
2344
|
-
if (!options.allowPrototypes) {
|
|
2345
|
-
return;
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
keys.push(segment[1]);
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
// If there's a remainder, just add whatever is left
|
|
2352
|
-
|
|
2353
|
-
if (segment) {
|
|
2354
|
-
keys.push('[' + key.slice(segment.index) + ']');
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
|
-
return parseObject(keys, val, options, valuesParsed);
|
|
2358
|
-
};
|
|
2359
|
-
|
|
2360
|
-
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
2361
|
-
if (!opts) {
|
|
2362
|
-
return defaults;
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
|
2366
|
-
throw new TypeError('Decoder has to be a function.');
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
2370
|
-
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
2371
|
-
}
|
|
2372
|
-
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
2373
|
-
|
|
2374
|
-
return {
|
|
2375
|
-
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
|
2376
|
-
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
2377
|
-
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
2378
|
-
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
2379
|
-
charset: charset,
|
|
2380
|
-
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2381
|
-
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
2382
|
-
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
2383
|
-
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2384
|
-
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2385
|
-
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
2386
|
-
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2387
|
-
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2388
|
-
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
2389
|
-
parseArrays: opts.parseArrays !== false,
|
|
2390
|
-
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
2391
|
-
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
|
2392
|
-
};
|
|
2393
|
-
};
|
|
2394
|
-
|
|
2395
|
-
var parse$1 = function (str, opts) {
|
|
2396
|
-
var options = normalizeParseOptions(opts);
|
|
2397
|
-
|
|
2398
|
-
if (str === '' || str === null || typeof str === 'undefined') {
|
|
2399
|
-
return options.plainObjects ? Object.create(null) : {};
|
|
2400
|
-
}
|
|
2401
|
-
|
|
2402
|
-
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
2403
|
-
var obj = options.plainObjects ? Object.create(null) : {};
|
|
2404
|
-
|
|
2405
|
-
// Iterate over the keys and setup the new object
|
|
2406
|
-
|
|
2407
|
-
var keys = Object.keys(tempObj);
|
|
2408
|
-
for (var i = 0; i < keys.length; ++i) {
|
|
2409
|
-
var key = keys[i];
|
|
2410
|
-
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
|
2411
|
-
obj = utils.merge(obj, newObj, options);
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
|
-
if (options.allowSparse === true) {
|
|
2415
|
-
return obj;
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
return utils.compact(obj);
|
|
2419
|
-
};
|
|
2420
|
-
|
|
2421
|
-
var stringify = stringify_1;
|
|
2422
|
-
var parse = parse$1;
|
|
2423
|
-
var formats = formats$3;
|
|
2424
|
-
|
|
2425
|
-
var lib = {
|
|
2426
|
-
formats: formats,
|
|
2427
|
-
parse: parse,
|
|
2428
|
-
stringify: stringify
|
|
2429
|
-
};
|
|
2430
|
-
|
|
2431
389
|
var IMAGE_SIZE_LIMIT_IN_MEGABYTES = 1;
|
|
2432
390
|
var NEETO_TEMPLATES_URL = "/neeto_templates_engine/api/v1";
|
|
2433
391
|
var TEMPLATE_TAGS_URL = "".concat(NEETO_TEMPLATES_URL, "/tags/template_tags");
|
|
@@ -2441,12 +399,7 @@ var IMAGE_UPLOAD_CONFIG = {
|
|
|
2441
399
|
|
|
2442
400
|
var list$1 = function list(params) {
|
|
2443
401
|
return axios.get(TEMPLATES_URL, {
|
|
2444
|
-
params: params
|
|
2445
|
-
paramsSerializer: function paramsSerializer(params) {
|
|
2446
|
-
return lib.stringify(params, {
|
|
2447
|
-
arrayFormat: "brackets"
|
|
2448
|
-
});
|
|
2449
|
-
}
|
|
402
|
+
params: params
|
|
2450
403
|
});
|
|
2451
404
|
};
|
|
2452
405
|
var create$1 = function create(_ref) {
|
|
@@ -2478,23 +431,25 @@ var templatesApi = {
|
|
|
2478
431
|
var QUERY_KEYS = {
|
|
2479
432
|
TEMPLATES_LIST: "templates-list",
|
|
2480
433
|
TEMPLATE: "templates-detail",
|
|
2481
|
-
TEMPLATE_TAGS: "
|
|
434
|
+
TEMPLATE_TAGS: "tag-key"
|
|
2482
435
|
};
|
|
2483
436
|
|
|
2484
|
-
function ownKeys$
|
|
2485
|
-
function _objectSpread$
|
|
437
|
+
function ownKeys$5(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; }
|
|
438
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2486
439
|
var useFetchTemplates = function useFetchTemplates(_ref) {
|
|
2487
440
|
var searchTerm = _ref.searchTerm,
|
|
2488
441
|
category = _ref.category;
|
|
2489
|
-
return useInfiniteQuery(
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
442
|
+
return useInfiniteQuery({
|
|
443
|
+
queryKey: [QUERY_KEYS.TEMPLATES_LIST, searchTerm, category],
|
|
444
|
+
queryFn: function queryFn(_ref2) {
|
|
445
|
+
var _ref2$pageParam = _ref2.pageParam,
|
|
446
|
+
pageParam = _ref2$pageParam === void 0 ? 1 : _ref2$pageParam;
|
|
447
|
+
return templatesApi.list({
|
|
448
|
+
page: pageParam,
|
|
449
|
+
searchTerm: searchTerm,
|
|
450
|
+
category: category
|
|
451
|
+
});
|
|
452
|
+
},
|
|
2498
453
|
getNextPageParam: function getNextPageParam(lastPage) {
|
|
2499
454
|
return lastPage.hasNextPage ? lastPage.page + 1 : undefined;
|
|
2500
455
|
},
|
|
@@ -2512,31 +467,26 @@ var useFetchTemplates = function useFetchTemplates(_ref) {
|
|
|
2512
467
|
keepPreviousData: true
|
|
2513
468
|
});
|
|
2514
469
|
};
|
|
2515
|
-
var useCreateTemplate = function useCreateTemplate(
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
470
|
+
var useCreateTemplate = function useCreateTemplate() {
|
|
471
|
+
return useMutation({
|
|
472
|
+
mutationFn: templatesApi.create
|
|
473
|
+
});
|
|
474
|
+
};
|
|
475
|
+
var useFetchTemplate = function useFetchTemplate(_ref3, options) {
|
|
476
|
+
var resourceId = _ref3.resourceId;
|
|
477
|
+
return useQuery(_objectSpread$5({
|
|
478
|
+
queryKey: [QUERY_KEYS.TEMPLATE, resourceId],
|
|
479
|
+
queryFn: function queryFn() {
|
|
480
|
+
return templatesApi.fetch({
|
|
481
|
+
templateId: resourceId
|
|
482
|
+
});
|
|
2524
483
|
}
|
|
2525
|
-
}));
|
|
484
|
+
}, options));
|
|
2526
485
|
};
|
|
2527
|
-
var
|
|
486
|
+
var useUpdateTemplate = function useUpdateTemplate(_ref4) {
|
|
2528
487
|
var resourceId = _ref4.resourceId;
|
|
2529
|
-
return
|
|
2530
|
-
|
|
2531
|
-
templateId: resourceId
|
|
2532
|
-
});
|
|
2533
|
-
}, options);
|
|
2534
|
-
};
|
|
2535
|
-
var useUpdateTemplate = function useUpdateTemplate(_ref5) {
|
|
2536
|
-
var resourceId = _ref5.resourceId;
|
|
2537
|
-
var queryClient = useQueryClient();
|
|
2538
|
-
return useMutation(function (_ref6) {
|
|
2539
|
-
var template = _ref6.template;
|
|
488
|
+
return useMutationWithInvalidation(function (_ref5) {
|
|
489
|
+
var template = _ref5.template;
|
|
2540
490
|
return templatesApi.update({
|
|
2541
491
|
resourceId: resourceId,
|
|
2542
492
|
payload: {
|
|
@@ -2544,9 +494,9 @@ var useUpdateTemplate = function useUpdateTemplate(_ref5) {
|
|
|
2544
494
|
}
|
|
2545
495
|
});
|
|
2546
496
|
}, {
|
|
497
|
+
keysToInvalidate: [[QUERY_KEYS.TEMPLATES_LIST], [QUERY_KEYS.TEMPLATE, resourceId]],
|
|
2547
498
|
onSuccess: function onSuccess() {
|
|
2548
|
-
|
|
2549
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEMPLATES_LIST);
|
|
499
|
+
refetchTags();
|
|
2550
500
|
}
|
|
2551
501
|
});
|
|
2552
502
|
};
|
|
@@ -2559,43 +509,49 @@ var BlankCard = function BlankCard(_ref) {
|
|
|
2559
509
|
onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
|
|
2560
510
|
_ref$disabled = _ref.disabled,
|
|
2561
511
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
2562
|
-
return /*#__PURE__*/
|
|
2563
|
-
className: "neeto-ui-rounded-lg neeto-ui-bg-white hover:neeto-ui-bg-white neeto-ui-border-primary-500
|
|
512
|
+
return /*#__PURE__*/jsxs("div", {
|
|
513
|
+
className: "neeto-ui-rounded-lg neeto-ui-bg-white hover:neeto-ui-bg-white neeto-ui-border-primary-500 flex cursor-pointer flex-col items-center justify-center border border-dashed p-6 outline-none transition-all duration-300 ease-in-out hover:border-solid focus:border-solid",
|
|
2564
514
|
"data-cy": "start-from-scratch-button",
|
|
2565
515
|
tabIndex: 0,
|
|
2566
|
-
onClick: !disabled ? onClick : noop
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
516
|
+
onClick: !disabled ? onClick : noop,
|
|
517
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
518
|
+
className: "neeto-ui-text-primary-500 mb-4",
|
|
519
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
520
|
+
size: 40
|
|
521
|
+
})
|
|
522
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
523
|
+
className: "text-center",
|
|
524
|
+
lineHeight: "normal",
|
|
525
|
+
style: "h5",
|
|
526
|
+
weight: "semibold",
|
|
527
|
+
children: title
|
|
528
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
529
|
+
className: "neeto-ui-text-gray-600 text-center",
|
|
530
|
+
lineHeight: "leading-4",
|
|
531
|
+
style: "body3",
|
|
532
|
+
children: description
|
|
533
|
+
})]
|
|
534
|
+
});
|
|
2581
535
|
};
|
|
2582
536
|
|
|
2583
537
|
var ButtonLoader = function ButtonLoader() {
|
|
2584
|
-
return /*#__PURE__*/
|
|
2585
|
-
role: "status"
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
538
|
+
return /*#__PURE__*/jsx("div", {
|
|
539
|
+
role: "status",
|
|
540
|
+
children: /*#__PURE__*/jsxs("svg", {
|
|
541
|
+
"aria-hidden": "true",
|
|
542
|
+
className: "neeto-ui-text-gray-400 inline h-4 w-4 animate-spin",
|
|
543
|
+
fill: "none",
|
|
544
|
+
viewBox: "0 0 100 101",
|
|
545
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
546
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
547
|
+
d: "M100 50.59c0 27.615-22.386 50.001-50 50.001s-50-22.386-50-50 22.386-50 50-50 50 22.386 50 50zm-90.919 0c0 22.6 18.32 40.92 40.919 40.92 22.599 0 40.919-18.32 40.919-40.92 0-22.598-18.32-40.918-40.919-40.918-22.599 0-40.919 18.32-40.919 40.919z",
|
|
548
|
+
fill: "currentColor"
|
|
549
|
+
}), /*#__PURE__*/jsx("path", {
|
|
550
|
+
d: "M93.968 39.04c2.425-.636 3.894-3.128 3.04-5.486A50 50 0 0041.735 1.279c-2.474.414-3.922 2.919-3.285 5.344.637 2.426 3.12 3.849 5.6 3.484a40.916 40.916 0 0144.131 25.769c.902 2.34 3.361 3.802 5.787 3.165z",
|
|
551
|
+
fill: "#3642df"
|
|
552
|
+
})]
|
|
553
|
+
})
|
|
554
|
+
});
|
|
2599
555
|
};
|
|
2600
556
|
|
|
2601
557
|
var getMenuItems = function getMenuItems(_ref) {
|
|
@@ -2607,7 +563,7 @@ var getMenuItems = function getMenuItems(_ref) {
|
|
|
2607
563
|
"data-cy": "use-this-template-button",
|
|
2608
564
|
isDisabled: isCreating,
|
|
2609
565
|
label: t$1("neetoTemplate.templates.editTemplate"),
|
|
2610
|
-
suffix: isCreating && /*#__PURE__*/
|
|
566
|
+
suffix: isCreating && /*#__PURE__*/jsx(ButtonLoader, {}),
|
|
2611
567
|
onClick: function onClick(event) {
|
|
2612
568
|
return handleCreateTemplate(event, template.id);
|
|
2613
569
|
}
|
|
@@ -2623,55 +579,58 @@ var Card = function Card(_ref) {
|
|
|
2623
579
|
onClick = _ref.onClick,
|
|
2624
580
|
afterCreate = _ref.afterCreate,
|
|
2625
581
|
refetchResource = _ref.refetchResource;
|
|
2626
|
-
var _useCreateTemplate = useCreateTemplate(
|
|
2627
|
-
refetchResource: refetchResource
|
|
2628
|
-
}),
|
|
582
|
+
var _useCreateTemplate = useCreateTemplate(),
|
|
2629
583
|
createTemplate = _useCreateTemplate.mutate,
|
|
2630
|
-
isCreating = _useCreateTemplate.
|
|
584
|
+
isCreating = _useCreateTemplate.isPending;
|
|
2631
585
|
var handleCreateTemplate = function handleCreateTemplate(e, templateId) {
|
|
2632
586
|
e.stopPropagation();
|
|
2633
587
|
createTemplate({
|
|
2634
588
|
id: templateId
|
|
2635
589
|
}, {
|
|
2636
590
|
onSuccess: function onSuccess(response) {
|
|
2637
|
-
|
|
591
|
+
afterCreate(response);
|
|
592
|
+
refetchResource();
|
|
2638
593
|
}
|
|
2639
594
|
});
|
|
2640
595
|
};
|
|
2641
|
-
return /*#__PURE__*/
|
|
2642
|
-
|
|
596
|
+
return /*#__PURE__*/jsxs("div", {
|
|
597
|
+
onClick: onClick,
|
|
598
|
+
className: "neeto-template neeto-ui-bg-white neeto-ui-shadow-sm hover:neeto-ui-border-gray-400 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col overflow-hidden border outline-none transition-colors duration-300 ease-in-out",
|
|
2643
599
|
"data-cy": "template-card",
|
|
2644
600
|
tabIndex: 0,
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
601
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
602
|
+
className: "neeto-template__header",
|
|
603
|
+
children: /*#__PURE__*/jsx("img", {
|
|
604
|
+
className: "neeto-template__image",
|
|
605
|
+
"data-cy": "template-thumbnail-image",
|
|
606
|
+
src: template.imageUrl || "https://d2v7kzglnr2dnh.cloudfront.net/images/neetoForm/default-form-template.svg"
|
|
607
|
+
})
|
|
608
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
609
|
+
className: "neeto-template__description neeto-ui-bg-white flex items-center justify-between gap-2 rounded-b-lg p-2 py-1.5",
|
|
610
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
611
|
+
className: "neeto-ui-text-gray-800 line-clamp-2",
|
|
612
|
+
"data-cy": "template-card-title",
|
|
613
|
+
lineHeight: "normal",
|
|
614
|
+
style: "body2",
|
|
615
|
+
children: template.title
|
|
616
|
+
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
617
|
+
dropdownButtonProps: {
|
|
618
|
+
className: "flex-shrink-0",
|
|
619
|
+
size: "small"
|
|
620
|
+
},
|
|
621
|
+
dropdownProps: {
|
|
622
|
+
onClick: function onClick(event) {
|
|
623
|
+
return event.stopPropagation();
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
menuItems: getMenuItems({
|
|
627
|
+
handleCreateTemplate: handleCreateTemplate,
|
|
628
|
+
isCreating: isCreating,
|
|
629
|
+
template: template
|
|
630
|
+
})
|
|
631
|
+
})]
|
|
632
|
+
})]
|
|
633
|
+
});
|
|
2675
634
|
};
|
|
2676
635
|
|
|
2677
636
|
var CategoryItem = function CategoryItem(_ref) {
|
|
@@ -2679,19 +638,24 @@ var CategoryItem = function CategoryItem(_ref) {
|
|
|
2679
638
|
count = _ref.count,
|
|
2680
639
|
isActive = _ref.isActive,
|
|
2681
640
|
setCurrentCategory = _ref.setCurrentCategory;
|
|
2682
|
-
return /*#__PURE__*/
|
|
641
|
+
return /*#__PURE__*/jsxs("button", {
|
|
2683
642
|
"data-cy": "category-".concat(joinHyphenCase(label)),
|
|
2684
643
|
tabIndex: 0,
|
|
2685
644
|
className: classnames("neeto-ui-rounded-lg outline-none flex w-full items-center justify-between gap-2 border border-solid px-3 py-2 text-sm font-medium leading-4 transition-all duration-300 ease-in-out", {
|
|
2686
645
|
"neeto-ui-text-gray-700 hover:neeto-ui-bg-gray-200 focus:neeto-ui-bg-gray-200 border-transparent": !isActive,
|
|
2687
646
|
"neeto-ui-text-gray-800 neeto-ui-bg-white neeto-ui-border-gray-300 focus:neeto-ui-border-gray-500": isActive
|
|
2688
647
|
}),
|
|
2689
|
-
onClick: setCurrentCategory
|
|
2690
|
-
|
|
648
|
+
onClick: setCurrentCategory,
|
|
649
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
650
|
+
children: label
|
|
651
|
+
}), /*#__PURE__*/jsx("span", {
|
|
652
|
+
children: count
|
|
653
|
+
})]
|
|
654
|
+
});
|
|
2691
655
|
};
|
|
2692
656
|
|
|
2693
|
-
function ownKeys$
|
|
2694
|
-
function _objectSpread$
|
|
657
|
+
function ownKeys$4(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; }
|
|
658
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2695
659
|
var List = function List(_ref) {
|
|
2696
660
|
var setCurrentScreen = _ref.setCurrentScreen,
|
|
2697
661
|
setSelectedTemplate = _ref.setSelectedTemplate,
|
|
@@ -2734,7 +698,7 @@ var List = function List(_ref) {
|
|
|
2734
698
|
setSelectedTemplate(template);
|
|
2735
699
|
};
|
|
2736
700
|
if (isTemplatesLoading) {
|
|
2737
|
-
return /*#__PURE__*/
|
|
701
|
+
return /*#__PURE__*/jsx(PageLoader, {});
|
|
2738
702
|
}
|
|
2739
703
|
var _data$tags = data.tags,
|
|
2740
704
|
tags = _data$tags === void 0 ? [] : _data$tags,
|
|
@@ -2742,83 +706,96 @@ var List = function List(_ref) {
|
|
|
2742
706
|
templates = _data$templates === void 0 ? [] : _data$templates,
|
|
2743
707
|
_data$templatesCount = data.templatesCount,
|
|
2744
708
|
templatesCount = _data$templatesCount === void 0 ? 0 : _data$templatesCount;
|
|
2745
|
-
var categories = [_objectSpread$
|
|
709
|
+
var categories = [_objectSpread$4(_objectSpread$4({}, DEFAULT_CATEGORY), {}, {
|
|
2746
710
|
count: templatesCount
|
|
2747
711
|
})].concat(_toConsumableArray(tags));
|
|
2748
|
-
return /*#__PURE__*/
|
|
2749
|
-
className: "neeto-ui-bg-gray-100 relative flex min-h-full items-start"
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
712
|
+
return /*#__PURE__*/jsxs("div", {
|
|
713
|
+
className: "neeto-ui-bg-gray-100 relative flex min-h-full items-start",
|
|
714
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
715
|
+
className: "sticky left-0 top-0 w-52 flex-shrink-0 space-y-8 py-6 pl-4 md:w-72 md:pl-10 lg:w-80 xl:pl-16",
|
|
716
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
717
|
+
className: "space-y-4",
|
|
718
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
719
|
+
className: "space-y-1",
|
|
720
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
721
|
+
"data-cy": "create-new-form-title",
|
|
722
|
+
style: "h2",
|
|
723
|
+
weight: "semibold",
|
|
724
|
+
children: t("neetoTemplate.templates.createNewEntity")
|
|
725
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
726
|
+
lineHeight: "normal",
|
|
727
|
+
style: "body2",
|
|
728
|
+
children: t("neetoTemplate.templates.description")
|
|
729
|
+
})]
|
|
730
|
+
}), /*#__PURE__*/jsx(Search, {
|
|
731
|
+
autoFocus: true,
|
|
732
|
+
disableTrimOnBlur: true,
|
|
733
|
+
"data-cy": "template-search-input",
|
|
734
|
+
placeholder: t("neetoTemplate.templates.search"),
|
|
735
|
+
onSearch: function onSearch(value) {
|
|
736
|
+
return setSearchTerm(value);
|
|
737
|
+
}
|
|
738
|
+
})]
|
|
739
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
740
|
+
className: "space-y-3",
|
|
741
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
742
|
+
className: "uppercase",
|
|
743
|
+
"data-cy": "template-categories-label",
|
|
744
|
+
style: "h6",
|
|
745
|
+
children: t("neetoTemplate.templates.categories")
|
|
746
|
+
}), /*#__PURE__*/jsx("div", {
|
|
747
|
+
className: "space-y-2",
|
|
748
|
+
children: categories.map(function (_ref2) {
|
|
749
|
+
var id = _ref2.id,
|
|
750
|
+
name = _ref2.name,
|
|
751
|
+
count = _ref2.count;
|
|
752
|
+
return /*#__PURE__*/createElement(CategoryItem, {
|
|
753
|
+
count: count,
|
|
754
|
+
isActive: currentCategory.id === id,
|
|
755
|
+
key: id,
|
|
756
|
+
label: name,
|
|
757
|
+
setCurrentCategory: function setCurrentCategory() {
|
|
758
|
+
return _setCurrentCategory({
|
|
759
|
+
id: id,
|
|
760
|
+
name: name
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
})
|
|
765
|
+
})]
|
|
766
|
+
})]
|
|
767
|
+
}), /*#__PURE__*/jsx("div", {
|
|
768
|
+
className: "h-screen w-full overflow-y-auto py-8 pl-5 pr-4 md:pl-8 md:pr-20 xl:px-20",
|
|
769
|
+
ref: rootRef,
|
|
770
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
771
|
+
className: "flex-grow space-y-6",
|
|
772
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
773
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 lg:gap-5 xl:gap-6 2xl:grid-cols-4",
|
|
774
|
+
children: [/*#__PURE__*/jsx(BlankCard, {
|
|
775
|
+
description: t("neetoTemplate.templates.blankCard.description"),
|
|
776
|
+
disabled: isCreating,
|
|
777
|
+
icon: isCreating ? Spinner : SvgCustom,
|
|
778
|
+
title: t("neetoTemplate.templates.blankCard.title"),
|
|
779
|
+
onClick: onCreate
|
|
780
|
+
}), templates.map(function (template, index) {
|
|
781
|
+
return /*#__PURE__*/createElement(Card, {
|
|
782
|
+
afterCreate: afterCreate,
|
|
783
|
+
refetchResource: refetchResource,
|
|
784
|
+
template: template,
|
|
785
|
+
key: index,
|
|
786
|
+
onClick: function onClick() {
|
|
787
|
+
return handleCardClick(template);
|
|
788
|
+
}
|
|
789
|
+
});
|
|
790
|
+
})]
|
|
791
|
+
}), hasNextPage && /*#__PURE__*/jsx("div", {
|
|
792
|
+
className: "my-10 text-center",
|
|
793
|
+
ref: sentryRef,
|
|
794
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
795
|
+
})]
|
|
796
|
+
})
|
|
797
|
+
})]
|
|
798
|
+
});
|
|
2822
799
|
};
|
|
2823
800
|
|
|
2824
801
|
var Preview$1 = function Preview(_ref) {
|
|
@@ -2828,55 +805,59 @@ var Preview$1 = function Preview(_ref) {
|
|
|
2828
805
|
refetchResource = _ref.refetchResource;
|
|
2829
806
|
var _useTranslation = useTranslation(),
|
|
2830
807
|
t = _useTranslation.t;
|
|
2831
|
-
var _useCreateTemplate = useCreateTemplate(
|
|
2832
|
-
refetchResource: refetchResource
|
|
2833
|
-
}),
|
|
808
|
+
var _useCreateTemplate = useCreateTemplate(),
|
|
2834
809
|
createTemplate = _useCreateTemplate.mutate,
|
|
2835
|
-
isCreating = _useCreateTemplate.
|
|
810
|
+
isCreating = _useCreateTemplate.isPending;
|
|
2836
811
|
var handleCreateTemplate = function handleCreateTemplate() {
|
|
2837
812
|
createTemplate({
|
|
2838
813
|
id: selectedTemplate.id
|
|
2839
814
|
}, {
|
|
2840
815
|
onSuccess: function onSuccess(response) {
|
|
2841
|
-
|
|
816
|
+
afterCreate(response);
|
|
817
|
+
refetchResource();
|
|
2842
818
|
}
|
|
2843
819
|
});
|
|
2844
820
|
};
|
|
2845
821
|
var title = selectedTemplate.title,
|
|
2846
822
|
previewUrl = selectedTemplate.previewUrl;
|
|
2847
|
-
return /*#__PURE__*/
|
|
2848
|
-
className: "m-auto flex h-full w-full max-w-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
823
|
+
return /*#__PURE__*/jsxs("div", {
|
|
824
|
+
className: "m-auto flex h-full w-full max-w-6xl flex-col space-y-6 py-6",
|
|
825
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
826
|
+
className: "flex flex-col items-center justify-between gap-6 pl-4 pr-16 md:flex-row md:pr-20 xl:px-0",
|
|
827
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
828
|
+
className: "flex min-w-0 flex-grow items-center gap-2",
|
|
829
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
830
|
+
className: "flex-shrink-0",
|
|
831
|
+
"data-cy": "preview-template-back-button",
|
|
832
|
+
icon: LeftArrow,
|
|
833
|
+
style: "text",
|
|
834
|
+
onClick: function onClick() {
|
|
835
|
+
return setCurrentScreen(TEMPLATE_SCREENS.LIST);
|
|
836
|
+
}
|
|
837
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
838
|
+
className: "leading-none",
|
|
839
|
+
"data-cy": "preview-template-title",
|
|
840
|
+
style: "h2",
|
|
841
|
+
weight: "semibold",
|
|
842
|
+
children: title
|
|
843
|
+
})]
|
|
844
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
845
|
+
className: "flex-shrink-0",
|
|
846
|
+
"data-cy": "preview-use-template-button",
|
|
847
|
+
disabled: isCreating,
|
|
848
|
+
label: t("neetoTemplate.templates.editTemplate"),
|
|
849
|
+
loading: isCreating,
|
|
850
|
+
onClick: handleCreateTemplate
|
|
851
|
+
})]
|
|
852
|
+
}), /*#__PURE__*/jsx("div", {
|
|
853
|
+
className: "neeto-templates-share-preview neeto-ui-rounded-sm sticky top-10",
|
|
854
|
+
children: /*#__PURE__*/jsx("iframe", {
|
|
855
|
+
className: "w-full flex-1 shadow-inner",
|
|
856
|
+
"data-cy": "iframe-id",
|
|
857
|
+
src: previewUrl
|
|
858
|
+
})
|
|
859
|
+
})]
|
|
860
|
+
});
|
|
2880
861
|
};
|
|
2881
862
|
|
|
2882
863
|
var CreateTemplateModal = function CreateTemplateModal(_ref) {
|
|
@@ -2903,24 +884,25 @@ var CreateTemplateModal = function CreateTemplateModal(_ref) {
|
|
|
2903
884
|
}, 300); //To accommodate the animation duration.
|
|
2904
885
|
};
|
|
2905
886
|
|
|
2906
|
-
return /*#__PURE__*/
|
|
887
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
2907
888
|
className: "neeto-template-list h-screen w-screen overflow-y-auto",
|
|
2908
889
|
isOpen: isOpen,
|
|
2909
890
|
size: "fullScreen",
|
|
2910
|
-
onClose: onModalClose
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
891
|
+
onClose: onModalClose,
|
|
892
|
+
children: currentScreen === TEMPLATE_SCREENS.LIST ? /*#__PURE__*/jsx(List, {
|
|
893
|
+
setCurrentScreen: setCurrentScreen,
|
|
894
|
+
setSelectedTemplate: setSelectedTemplate,
|
|
895
|
+
isCreating: isCreating,
|
|
896
|
+
afterCreate: afterCreate,
|
|
897
|
+
onCreate: onCreate,
|
|
898
|
+
refetchResource: refetchResource
|
|
899
|
+
}) : /*#__PURE__*/jsx(Preview$1, {
|
|
900
|
+
selectedTemplate: selectedTemplate,
|
|
901
|
+
setCurrentScreen: setCurrentScreen,
|
|
902
|
+
afterCreate: afterCreate,
|
|
903
|
+
refetchResource: refetchResource
|
|
904
|
+
})
|
|
905
|
+
});
|
|
2924
906
|
};
|
|
2925
907
|
|
|
2926
908
|
var create = function create(payload) {
|
|
@@ -2938,21 +920,24 @@ var templateTagsApi = {
|
|
|
2938
920
|
list: list
|
|
2939
921
|
};
|
|
2940
922
|
|
|
2941
|
-
function ownKeys$
|
|
2942
|
-
function _objectSpread$
|
|
923
|
+
function ownKeys$3(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; }
|
|
924
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2943
925
|
var useCreateTemplateTag = function useCreateTemplateTag(options) {
|
|
2944
|
-
|
|
2945
|
-
|
|
926
|
+
return useMutation(_objectSpread$3(_objectSpread$3({
|
|
927
|
+
mutationFn: templateTagsApi.create
|
|
928
|
+
}, options), {}, {
|
|
2946
929
|
onSuccess: function onSuccess() {
|
|
2947
930
|
var _options$onSuccess;
|
|
2948
931
|
refetchTags();
|
|
2949
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEMPLATE_TAGS);
|
|
2950
932
|
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options);
|
|
2951
933
|
}
|
|
2952
934
|
}));
|
|
2953
935
|
};
|
|
2954
936
|
var useFetchTemplateTags = function useFetchTemplateTags() {
|
|
2955
|
-
return useQuery(
|
|
937
|
+
return useQuery({
|
|
938
|
+
queryKey: [QUERY_KEYS.TEMPLATE_TAGS],
|
|
939
|
+
queryFn: templateTagsApi.list
|
|
940
|
+
});
|
|
2956
941
|
};
|
|
2957
942
|
|
|
2958
943
|
var FormikImageUploader = function FormikImageUploader(_ref) {
|
|
@@ -2968,7 +953,7 @@ var FormikImageUploader = function FormikImageUploader(_ref) {
|
|
|
2968
953
|
setFieldValue("imageSignedId", file.signedId);
|
|
2969
954
|
return setValue(file.url);
|
|
2970
955
|
};
|
|
2971
|
-
return /*#__PURE__*/
|
|
956
|
+
return /*#__PURE__*/jsx(ImageUploader, {
|
|
2972
957
|
className: "h-52 w-full md:h-80",
|
|
2973
958
|
src: field.value,
|
|
2974
959
|
uploadConfig: IMAGE_UPLOAD_CONFIG,
|
|
@@ -2979,20 +964,22 @@ var FormikImageUploader = function FormikImageUploader(_ref) {
|
|
|
2979
964
|
var PageWrapper = function PageWrapper(_ref) {
|
|
2980
965
|
var children = _ref.children,
|
|
2981
966
|
className = _ref.className;
|
|
2982
|
-
return /*#__PURE__*/
|
|
2983
|
-
className: classnames("w-full flex-col", className)
|
|
2984
|
-
|
|
967
|
+
return /*#__PURE__*/jsx("div", {
|
|
968
|
+
className: classnames("w-full flex-col", className),
|
|
969
|
+
children: children
|
|
970
|
+
});
|
|
2985
971
|
};
|
|
2986
972
|
var PageHeader = function PageHeader(_ref2) {
|
|
2987
973
|
var title = _ref2.title,
|
|
2988
974
|
breadcrumbs = _ref2.breadcrumbs;
|
|
2989
|
-
return /*#__PURE__*/
|
|
2990
|
-
className: "w-full px-6"
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
975
|
+
return /*#__PURE__*/jsx("div", {
|
|
976
|
+
className: "w-full px-6",
|
|
977
|
+
children: /*#__PURE__*/jsx(Header, {
|
|
978
|
+
breadcrumbs: breadcrumbs,
|
|
979
|
+
size: "small",
|
|
980
|
+
title: title
|
|
981
|
+
})
|
|
982
|
+
});
|
|
2996
983
|
};
|
|
2997
984
|
var customPropEqualityCheck = function customPropEqualityCheck(prevProps, nextProps) {
|
|
2998
985
|
return prevProps.title === nextProps.title && prevProps.breadcrumbs === nextProps.breadcrumbs;
|
|
@@ -3002,13 +989,17 @@ var PageContent = function PageContent(_ref3) {
|
|
|
3002
989
|
var children = _ref3.children,
|
|
3003
990
|
_ref3$className = _ref3.className,
|
|
3004
991
|
className = _ref3$className === void 0 ? "" : _ref3$className;
|
|
3005
|
-
return /*#__PURE__*/
|
|
3006
|
-
className: "w-full px-6 pb-6"
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
992
|
+
return /*#__PURE__*/jsx(Scrollable, {
|
|
993
|
+
className: "w-full px-6 pb-6",
|
|
994
|
+
children: /*#__PURE__*/jsx("div", {
|
|
995
|
+
className: classnames(["mx-auto max-w-7xl", className]),
|
|
996
|
+
children: children
|
|
997
|
+
})
|
|
998
|
+
});
|
|
3010
999
|
};
|
|
3011
1000
|
|
|
1001
|
+
function ownKeys$2(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; }
|
|
1002
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3012
1003
|
var Tags = function Tags(_ref) {
|
|
3013
1004
|
var allTags = _ref.allTags,
|
|
3014
1005
|
selectedTags = _ref.selectedTags,
|
|
@@ -3040,44 +1031,52 @@ var Tags = function Tags(_ref) {
|
|
|
3040
1031
|
}
|
|
3041
1032
|
});
|
|
3042
1033
|
};
|
|
3043
|
-
return /*#__PURE__*/
|
|
3044
|
-
className: className
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
1034
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1035
|
+
className: className,
|
|
1036
|
+
children: [labelProps.label && /*#__PURE__*/jsx(Label, _objectSpread$2(_objectSpread$2({}, labelProps), {}, {
|
|
1037
|
+
children: labelProps.label
|
|
1038
|
+
})), /*#__PURE__*/jsx("div", {
|
|
1039
|
+
className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white border p-4",
|
|
1040
|
+
children: /*#__PURE__*/jsx(TagsComponent, {
|
|
1041
|
+
allTags: allTags,
|
|
1042
|
+
selectedTags: selectedTags,
|
|
1043
|
+
buttonProps: {
|
|
1044
|
+
loading: isLoading,
|
|
1045
|
+
disabled: isLoading,
|
|
1046
|
+
iconPosition: "left"
|
|
1047
|
+
},
|
|
1048
|
+
onTagCreate: handleTagCreate,
|
|
1049
|
+
onTagDelete: handleTagRemove,
|
|
1050
|
+
onTagSelect: handleTagSelect
|
|
1051
|
+
})
|
|
1052
|
+
})]
|
|
1053
|
+
});
|
|
3059
1054
|
};
|
|
3060
1055
|
|
|
3061
1056
|
var Preview = function Preview(_ref) {
|
|
3062
1057
|
var template = _ref.template,
|
|
3063
1058
|
imageUrl = _ref.imageUrl;
|
|
3064
|
-
return /*#__PURE__*/
|
|
1059
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3065
1060
|
className: "neeto-template neeto-ui-bg-white outline-none neeto-ui-shadow-sm hover:neeto-ui-border-gray-400 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col overflow-hidden border transition-colors duration-300 ease-in-out",
|
|
3066
|
-
tabIndex: 0
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
1061
|
+
tabIndex: 0,
|
|
1062
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
1063
|
+
className: "neeto-template__header",
|
|
1064
|
+
children: /*#__PURE__*/jsx("img", {
|
|
1065
|
+
className: "neeto-template__image",
|
|
1066
|
+
"data-cy": "template-image-preview",
|
|
1067
|
+
src: imageUrl || "https://d2v7kzglnr2dnh.cloudfront.net/images/neetoForm/default-form-template.svg"
|
|
1068
|
+
})
|
|
1069
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1070
|
+
className: "neeto-ui-bg-white flex items-center justify-between gap-2 rounded-b-lg px-2 py-1.5",
|
|
1071
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1072
|
+
className: "neeto-ui-text-gray-800",
|
|
1073
|
+
"data-cy": "template-title-text",
|
|
1074
|
+
lineHeight: "normal",
|
|
1075
|
+
style: "body2",
|
|
1076
|
+
children: template.title
|
|
1077
|
+
})
|
|
1078
|
+
})]
|
|
1079
|
+
});
|
|
3081
1080
|
};
|
|
3082
1081
|
|
|
3083
1082
|
var buildSelectOptionsBy = function buildSelectOptionsBy(labelField) {
|
|
@@ -3104,8 +1103,8 @@ var buildTemplateUpdatePayload = function buildTemplateUpdatePayload(values) {
|
|
|
3104
1103
|
};
|
|
3105
1104
|
};
|
|
3106
1105
|
|
|
3107
|
-
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; }
|
|
3108
|
-
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; }
|
|
1106
|
+
function ownKeys$1(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; }
|
|
1107
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3109
1108
|
var TemplateSettings = function TemplateSettings(_ref) {
|
|
3110
1109
|
var _ref$onCancelTemplate = _ref.onCancelTemplatePreview,
|
|
3111
1110
|
onCancelTemplatePreview = _ref$onCancelTemplate === void 0 ? "" : _ref$onCancelTemplate,
|
|
@@ -3126,10 +1125,10 @@ var TemplateSettings = function TemplateSettings(_ref) {
|
|
|
3126
1125
|
resourceId: resourceId
|
|
3127
1126
|
}),
|
|
3128
1127
|
updateTemplate = _useUpdateTemplate.mutate,
|
|
3129
|
-
isUpdatingTemplate = _useUpdateTemplate.
|
|
1128
|
+
isUpdatingTemplate = _useUpdateTemplate.isPending;
|
|
3130
1129
|
var _useCreateTemplateTag = useCreateTemplateTag(),
|
|
3131
1130
|
createTemplateTag = _useCreateTemplateTag.mutate,
|
|
3132
|
-
isCreatingTags = _useCreateTemplateTag.
|
|
1131
|
+
isCreatingTags = _useCreateTemplateTag.isPending;
|
|
3133
1132
|
var _useFetchTemplateTags = useFetchTemplateTags(),
|
|
3134
1133
|
_useFetchTemplateTags2 = _useFetchTemplateTags.data,
|
|
3135
1134
|
templateTags = _useFetchTemplateTags2 === void 0 ? {} : _useFetchTemplateTags2,
|
|
@@ -3141,85 +1140,197 @@ var TemplateSettings = function TemplateSettings(_ref) {
|
|
|
3141
1140
|
};
|
|
3142
1141
|
var isLoading = isFetchingTemplate || isTagsLoading;
|
|
3143
1142
|
var tags = buildTagOptions(data === null || data === void 0 ? void 0 : data.tags);
|
|
3144
|
-
var resourceInitialValues = _objectSpread(_objectSpread({
|
|
1143
|
+
var resourceInitialValues = _objectSpread$1(_objectSpread$1({
|
|
3145
1144
|
imageUrl: null
|
|
3146
1145
|
}, data), {}, {
|
|
3147
1146
|
tags: tags
|
|
3148
1147
|
});
|
|
3149
|
-
return /*#__PURE__*/
|
|
3150
|
-
className: className
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
1148
|
+
return /*#__PURE__*/jsxs(PageWrapper, {
|
|
1149
|
+
className: className,
|
|
1150
|
+
children: [/*#__PURE__*/jsx(MemoizedPageHeader, {
|
|
1151
|
+
breadcrumbs: breadcrumbs,
|
|
1152
|
+
title: t("neetoTemplate.templateSettings.title")
|
|
1153
|
+
}), /*#__PURE__*/jsx(PageContent, {
|
|
1154
|
+
className: classnames({
|
|
1155
|
+
"min-h-0": !isLoading,
|
|
1156
|
+
"h-full": isLoading
|
|
1157
|
+
}),
|
|
1158
|
+
children: isLoading ? /*#__PURE__*/jsx(PageLoader, {}) : /*#__PURE__*/jsxs(Fragment, {
|
|
1159
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1160
|
+
className: "mb-1",
|
|
1161
|
+
"data-cy": "thank-you-action-text",
|
|
1162
|
+
style: "h2",
|
|
1163
|
+
weight: "semibold",
|
|
1164
|
+
children: t("neetoTemplate.templateSettings.configureTemplates")
|
|
1165
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1166
|
+
className: "mb-2",
|
|
1167
|
+
"data-cy": "thank-you-description-label",
|
|
1168
|
+
style: "body2",
|
|
1169
|
+
children: t("neetoTemplate.templateSettings.subText")
|
|
1170
|
+
}), /*#__PURE__*/jsx(Form, {
|
|
1171
|
+
formikProps: {
|
|
1172
|
+
enableReinitialize: true,
|
|
1173
|
+
initialValues: resourceInitialValues,
|
|
1174
|
+
onSubmit: handleSubmit
|
|
1175
|
+
},
|
|
1176
|
+
children: function children(_ref2) {
|
|
1177
|
+
var values = _ref2.values,
|
|
1178
|
+
setFieldValue = _ref2.setFieldValue;
|
|
1179
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1180
|
+
className: "grid grid-cols-2 gap-8 pt-6",
|
|
1181
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1182
|
+
className: "space-y-4",
|
|
1183
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1184
|
+
className: "mb-3",
|
|
1185
|
+
style: "h4",
|
|
1186
|
+
weight: "semibold",
|
|
1187
|
+
children: t("neetoTemplate.templateSettings.imageLabel")
|
|
1188
|
+
}), /*#__PURE__*/jsx(FormikImageUploader, {
|
|
1189
|
+
name: "imageUrl"
|
|
1190
|
+
}), /*#__PURE__*/jsx(Tags, {
|
|
1191
|
+
allTags: buildSelectOptionsBy("name", templateTags.tags),
|
|
1192
|
+
className: "space-y-2",
|
|
1193
|
+
isLoading: isCreatingTags,
|
|
1194
|
+
selectedTags: values.tags,
|
|
1195
|
+
labelProps: {
|
|
1196
|
+
label: t("neetoTemplate.templateSettings.categoryLabel")
|
|
1197
|
+
},
|
|
1198
|
+
onCreate: createTemplateTag,
|
|
1199
|
+
onUpdate: function onUpdate(tags) {
|
|
1200
|
+
return setFieldValue("tags", tags);
|
|
1201
|
+
}
|
|
1202
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1203
|
+
className: "mt-12 flex flex-row items-center justify-start",
|
|
1204
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1205
|
+
isSubmitting: isUpdatingTemplate,
|
|
1206
|
+
cancelButtonProps: {
|
|
1207
|
+
to: onCancelTemplatePreview,
|
|
1208
|
+
"data-cy": "reset-changes-button",
|
|
1209
|
+
onClick: noop
|
|
1210
|
+
}
|
|
1211
|
+
})
|
|
1212
|
+
})]
|
|
1213
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1214
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1215
|
+
className: "mb-3",
|
|
1216
|
+
style: "h4",
|
|
1217
|
+
weight: "semibold",
|
|
1218
|
+
children: t("neetoTemplate.templateSettings.previewLabel")
|
|
1219
|
+
}), /*#__PURE__*/jsx(Preview, {
|
|
1220
|
+
imageUrl: values.imageUrl,
|
|
1221
|
+
template: data
|
|
1222
|
+
})]
|
|
1223
|
+
})]
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
})]
|
|
1227
|
+
})
|
|
1228
|
+
})]
|
|
1229
|
+
});
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1233
|
+
if (source == null) return {};
|
|
1234
|
+
var target = {};
|
|
1235
|
+
var sourceKeys = Object.keys(source);
|
|
1236
|
+
var key, i;
|
|
1237
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1238
|
+
key = sourceKeys[i];
|
|
1239
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1240
|
+
target[key] = source[key];
|
|
1241
|
+
}
|
|
1242
|
+
return target;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1246
|
+
if (source == null) return {};
|
|
1247
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
1248
|
+
var key, i;
|
|
1249
|
+
if (Object.getOwnPropertySymbols) {
|
|
1250
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1251
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1252
|
+
key = sourceSymbolKeys[i];
|
|
1253
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1254
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1255
|
+
target[key] = source[key];
|
|
3173
1256
|
}
|
|
3174
|
-
}
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
1257
|
+
}
|
|
1258
|
+
return target;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
var TAG_TYPES = [{
|
|
1262
|
+
id: 1,
|
|
1263
|
+
label: t$1("neetoTemplate.templatesTags.template"),
|
|
1264
|
+
url: "".concat(NEETO_TEMPLATES_URL, "/tags/template_tags"),
|
|
1265
|
+
columns: [{
|
|
1266
|
+
title: t$1("neetoTemplate.templatesTags.numberOfActiveTemplates"),
|
|
1267
|
+
key: "templates_count",
|
|
1268
|
+
dataIndex: "templatesCount",
|
|
1269
|
+
align: "center",
|
|
1270
|
+
width: 300,
|
|
1271
|
+
sorter: true,
|
|
1272
|
+
render: function render(templatesCount) {
|
|
1273
|
+
return templatesCount !== 0 ? /*#__PURE__*/jsxs(Typography, {
|
|
1274
|
+
style: "body1",
|
|
1275
|
+
children: [" ", templatesCount, " "]
|
|
1276
|
+
}) : "-";
|
|
1277
|
+
}
|
|
1278
|
+
}]
|
|
1279
|
+
}];
|
|
1280
|
+
|
|
1281
|
+
var _excluded = ["breadcrumbs", "tagsPath"];
|
|
1282
|
+
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; }
|
|
1283
|
+
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; }
|
|
1284
|
+
var TemplateTags = function TemplateTags(_ref) {
|
|
1285
|
+
var breadcrumbs = _ref.breadcrumbs,
|
|
1286
|
+
tagsPath = _ref.tagsPath,
|
|
1287
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
1288
|
+
var queryClient = useQueryClient();
|
|
1289
|
+
var invalidateTags = function invalidateTags() {
|
|
1290
|
+
queryClient.invalidateQueries({
|
|
1291
|
+
queryKey: [QUERY_KEYS.TEMPLATE_TAGS]
|
|
1292
|
+
});
|
|
1293
|
+
};
|
|
1294
|
+
var invalidateTagsAndTemplates = function invalidateTagsAndTemplates() {
|
|
1295
|
+
invalidateTags();
|
|
1296
|
+
queryClient.invalidateQueries({
|
|
1297
|
+
queryKey: [QUERY_KEYS.TEMPLATES_LIST]
|
|
1298
|
+
});
|
|
1299
|
+
queryClient.invalidateQueries({
|
|
1300
|
+
queryKey: [QUERY_KEYS.TEMPLATE]
|
|
1301
|
+
});
|
|
1302
|
+
};
|
|
1303
|
+
var config = _objectSpread({
|
|
1304
|
+
tagTypes: TAG_TYPES,
|
|
1305
|
+
tagsMergable: true,
|
|
1306
|
+
breadcrumbs: breadcrumbs,
|
|
1307
|
+
displayMenu: false,
|
|
1308
|
+
tagsPath: tagsPath,
|
|
1309
|
+
onTagRowClick: noop,
|
|
1310
|
+
createTags: {
|
|
1311
|
+
onSuccess: {
|
|
1312
|
+
callback: invalidateTags
|
|
3199
1313
|
}
|
|
3200
|
-
}
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
template: data
|
|
3221
|
-
})));
|
|
3222
|
-
}))));
|
|
1314
|
+
},
|
|
1315
|
+
updateTags: {
|
|
1316
|
+
onSuccess: {
|
|
1317
|
+
callback: invalidateTagsAndTemplates
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
deleteTags: {
|
|
1321
|
+
onSuccess: {
|
|
1322
|
+
callback: invalidateTagsAndTemplates
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
mergeTags: {
|
|
1326
|
+
onSuccess: {
|
|
1327
|
+
callback: invalidateTagsAndTemplates
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
}, otherProps);
|
|
1331
|
+
return /*#__PURE__*/jsx(NeetoTags, {
|
|
1332
|
+
config: config
|
|
1333
|
+
});
|
|
3223
1334
|
};
|
|
3224
1335
|
|
|
3225
1336
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
@@ -3227,5 +1338,5 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
|
|
|
3227
1338
|
var css = ".neeto-template-list .neeto-ui-modal__close{z-index:1}.neeto-template__header{flex-grow:1;min-height:120px}.neeto-template__image{aspect-ratio:16/9;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;width:100%}.neeto-template__description{min-height:54px}.neeto-templates-share-preview{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-gray-300));box-shadow:var(--neeto-ui-shadow-m);display:flex;flex-direction:column;height:calc(100vh - 104px);width:100%}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL3RlbXBsYXRlcy9fdGVtcGxhdGUtbGlzdC5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL3RlbXBsYXRlcy9fc2hhcmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDRSw0Q0FDRSxTQ0FKLENES0Usd0JBRUUsV0FBQSxDQURBLGdCQ0RKLENES0UsdUJBRUUsaUJBQUEsQ0FHQSxlQUFBLENBREEsY0FBQSxDQURBLG1CQUFBLENBQUEsZ0JBQUEsQ0FGQSxVQ0NKLENES0UsNkJBQ0UsZUNISixDQ2pCQSwrQkFPRSwyQ0FBQSxDQUpBLCtDQUFBLENBQ0EsbUNBQUEsQ0FDQSxZQUFBLENBQ0EscUJBQUEsQ0FKQSwwQkFBQSxDQURBLFVEMEJGIiwic291cmNlc0NvbnRlbnQiOlsiLm5lZXRvLXRlbXBsYXRlLWxpc3Qge1xuICAubmVldG8tdWktbW9kYWxfX2Nsb3NlIHtcbiAgICB6LWluZGV4OiAxO1xuICB9XG59XG5cbi5uZWV0by10ZW1wbGF0ZSB7XG4gICZfX2hlYWRlciB7XG4gICAgbWluLWhlaWdodDogJG5lZXRvLXRlbXBsYXRlLWhlYWRlci1taW4taGVpZ2h0O1xuICAgIGZsZXgtZ3JvdzogMTtcbiAgfVxuXG4gICZfX2ltYWdlIHtcbiAgICB3aWR0aDogMTAwJTtcbiAgICBhc3BlY3QtcmF0aW86IDE2IC8gOTtcbiAgICBvYmplY3QtZml0OiBjb3ZlcjtcbiAgICBtYXgtd2lkdGg6IDEwMCU7XG4gICAgbWF4LWhlaWdodDogMTAwJTtcbiAgfVxuICAmX19kZXNjcmlwdGlvbiB7XG4gICAgbWluLWhlaWdodDogJG5lZXRvLXRlbXBsYXRlLWRlc2NyaXB0aW9uLW1pbi1oZWlnaHQ7XG4gIH1cbn1cbiIsIi5uZWV0by10ZW1wbGF0ZS1saXN0IC5uZWV0by11aS1tb2RhbF9fY2xvc2Uge1xuICB6LWluZGV4OiAxO1xufVxuXG4ubmVldG8tdGVtcGxhdGVfX2hlYWRlciB7XG4gIG1pbi1oZWlnaHQ6IDEyMHB4O1xuICBmbGV4LWdyb3c6IDE7XG59XG4ubmVldG8tdGVtcGxhdGVfX2ltYWdlIHtcbiAgd2lkdGg6IDEwMCU7XG4gIGFzcGVjdC1yYXRpbzogMTYvOTtcbiAgb2JqZWN0LWZpdDogY292ZXI7XG4gIG1heC13aWR0aDogMTAwJTtcbiAgbWF4LWhlaWdodDogMTAwJTtcbn1cbi5uZWV0by10ZW1wbGF0ZV9fZGVzY3JpcHRpb24ge1xuICBtaW4taGVpZ2h0OiA1NHB4O1xufVxuXG4ubmVldG8tdGVtcGxhdGVzLXNoYXJlLXByZXZpZXcge1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiBjYWxjKDEwMHZoIC0gMTA0cHgpO1xuICBib3JkZXI6IHRoaW4gc29saWQgcmdiKHZhcigtLW5lZXRvLXVpLWdyYXktMzAwKSk7XG4gIGJveC1zaGFkb3c6IHZhcigtLW5lZXRvLXVpLXNoYWRvdy1tKTtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgYmFja2dyb3VuZC1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLXdoaXRlKSk7XG59IiwiLm5lZXRvLXRlbXBsYXRlcy1zaGFyZS1wcmV2aWV3IHtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogY2FsYygxMDB2aCAtIDEwNHB4KTtcbiAgYm9yZGVyOiB0aGluIHNvbGlkIHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTMwMCkpO1xuICBib3gtc2hhZG93OiB2YXIoLS1uZWV0by11aS1zaGFkb3ctbSk7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIGJhY2tncm91bmQtY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS13aGl0ZSkpO1xufVxuIl19 */";
|
|
3228
1339
|
n(css,{});
|
|
3229
1340
|
|
|
3230
|
-
export { CreateTemplateModal, TemplateSettings };
|
|
1341
|
+
export { CreateTemplateModal, TemplateSettings, TemplateTags };
|
|
3231
1342
|
//# sourceMappingURL=index.js.map
|