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