@ppg_pl/pallete 0.0.7 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +11 -3
  2. package/dist/cjs/{index-160fcb6c.js → index-53e78fc8.js} +3 -1
  3. package/dist/cjs/index-53e78fc8.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/my-backdrop_8.cjs.entry.js +503 -253
  6. package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
  7. package/dist/cjs/pallete.cjs.js +2 -2
  8. package/dist/collection/components/api/index.js +4 -2
  9. package/dist/collection/components/api/index.js.map +1 -1
  10. package/dist/collection/components/api/services.js +31 -64
  11. package/dist/collection/components/api/services.js.map +1 -1
  12. package/dist/collection/components/my-colorinfo/my-colorinfo.js +6 -4
  13. package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
  14. package/dist/collection/components/my-loader/my-loader.css +1 -1
  15. package/dist/collection/components/my-modal/my-modal.js +65 -47
  16. package/dist/collection/components/my-modal/my-modal.js.map +1 -1
  17. package/dist/collection/components/my-search/my-search.js +28 -2
  18. package/dist/collection/components/my-search/my-search.js.map +1 -1
  19. package/dist/collection/components/my-slider/index.js +5 -8
  20. package/dist/collection/components/my-slider/index.js.map +1 -1
  21. package/dist/collection/types.js.map +1 -1
  22. package/dist/components/index2.js +25 -3
  23. package/dist/components/index2.js.map +1 -1
  24. package/dist/components/my-colorinfo2.js +4 -3
  25. package/dist/components/my-colorinfo2.js.map +1 -1
  26. package/dist/components/my-loader2.js +1 -1
  27. package/dist/components/my-loader2.js.map +1 -1
  28. package/dist/components/my-modal2.js +458 -248
  29. package/dist/components/my-modal2.js.map +1 -1
  30. package/dist/components/my-search2.js +20 -3
  31. package/dist/components/my-search2.js.map +1 -1
  32. package/dist/esm/{index-943c259f.js → index-b0145abf.js} +3 -1
  33. package/dist/esm/index-b0145abf.js.map +1 -0
  34. package/dist/esm/loader.js +3 -3
  35. package/dist/esm/my-backdrop_8.entry.js +503 -253
  36. package/dist/esm/my-backdrop_8.entry.js.map +1 -1
  37. package/dist/esm/pallete.js +3 -3
  38. package/dist/pallete/p-037cfde2.entry.js +2 -0
  39. package/dist/pallete/p-037cfde2.entry.js.map +1 -0
  40. package/dist/pallete/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
  41. package/dist/pallete/p-c6a049a2.js.map +1 -0
  42. package/dist/pallete/pallete.esm.js +1 -1
  43. package/dist/pallete/pallete.esm.js.map +1 -1
  44. package/dist/types/components/api/index.d.ts +2 -1
  45. package/dist/types/components/api/services.d.ts +3 -3
  46. package/dist/types/components/my-modal/my-modal.d.ts +1 -0
  47. package/dist/types/components/my-search/my-search.d.ts +2 -0
  48. package/dist/types/components/my-slider/index.d.ts +2 -2
  49. package/dist/types/components.d.ts +5 -4
  50. package/dist/types/types.d.ts +35 -24
  51. package/package.json +4 -3
  52. package/www/build/p-037cfde2.entry.js +2 -0
  53. package/www/build/p-037cfde2.entry.js.map +1 -0
  54. package/www/build/{p-c77aaa54.js → p-c6a049a2.js} +2 -2
  55. package/www/build/p-c6a049a2.js.map +1 -0
  56. package/www/build/pallete.esm.js +1 -1
  57. package/www/build/pallete.esm.js.map +1 -1
  58. package/www/index.html +1 -1
  59. package/dist/cjs/index-160fcb6c.js.map +0 -1
  60. package/dist/esm/index-943c259f.js.map +0 -1
  61. package/dist/pallete/p-c77aaa54.js.map +0 -1
  62. package/dist/pallete/p-deffcd80.entry.js +0 -2
  63. package/dist/pallete/p-deffcd80.entry.js.map +0 -1
  64. package/www/build/p-825a7d1d.js +0 -163
  65. package/www/build/p-c77aaa54.js.map +0 -1
  66. package/www/build/p-deffcd80.entry.js +0 -2
  67. package/www/build/p-deffcd80.entry.js.map +0 -1
  68. package/www/build/p-fd390eef.css +0 -3
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index$1 = require('./index-160fcb6c.js');
5
+ const index$1 = require('./index-53e78fc8.js');
6
6
 
7
7
  const myBackdropCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}my-backdrop{width:100%;height:100%;background-color:rgba(0, 0, 0, 0.7);position:fixed;z-index:100;left:0;top:0}";
8
8
 
@@ -62,6 +62,28 @@ const MyColorBox = class {
62
62
  };
63
63
  MyColorBox.style = myColorboxCss;
64
64
 
65
+ const APIURL = 'http://147.135.211.144:8055'; //'https://pallete-colors-backend.herokuapp.com';
66
+ const accessToken = 'uBKzhiNM4rkdZSe_PQvKJp9pE-DSTmtu';
67
+ class API {
68
+ async getData(ep) {
69
+ try {
70
+ const request = await fetch(`${APIURL}/${ep}`, {
71
+ method: 'GET',
72
+ headers: {
73
+ 'Authorization': `Bearer ${accessToken}`,
74
+ 'Content-Type': 'application/json',
75
+ },
76
+ });
77
+ const response = await request.json();
78
+ return response;
79
+ }
80
+ catch (error) {
81
+ console.error(error);
82
+ }
83
+ }
84
+ }
85
+ const ApiService = new API();
86
+
65
87
  const MyColorInfo = class {
66
88
  constructor(hostRef) {
67
89
  index$1.registerInstance(this, hostRef);
@@ -88,13 +110,14 @@ const MyColorInfo = class {
88
110
  this.closeImage = 'close.png';
89
111
  }
90
112
  render() {
91
- var _a, _b, _c, _d, _e, _f, _g;
113
+ var _a, _b, _c, _d, _e, _f;
114
+ console.log('current', this.currentColor);
92
115
  return (index$1.h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
93
116
  background: this.currentColor.hex,
94
117
  maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
95
118
  } }, this.isMobile && index$1.h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), index$1.h("div", { class: "boxes__box-content__info", style: {
96
119
  maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
97
- } }, !this.isMobile && index$1.h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && index$1.h("h2", null, this.currentColor.name), !this.isMobile && index$1.h("h4", null, this.currentColor.number), !this.isMobile && index$1.h("div", { class: "divider" }), index$1.h("div", { class: "boxes__box-content__info__value" }, index$1.h("div", { class: "boxes__box-content__info__value-image" }, ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.image.data) && index$1.h("img", { src: `${(_e = (_d = (_c = (_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.image) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.attributes) === null || _e === void 0 ? void 0 : _e.formats.thumbnail.url}`, alt: "color-image" })), index$1.h("div", { class: "boxes__box-content__info__value-product" }, index$1.h("div", null, !this.isMobile && index$1.h("p", null, "Produkt:"), this.isMobile && index$1.h("h2", null, this.currentColor.name), " ", index$1.h("p", null, this.product)), this.isMobile && index$1.h("div", { class: 'divider' }), this.currentColor && this.currentColor.links.find((link) => { var _a, _b, _c; return ((_c = (_b = (_a = link === null || link === void 0 ? void 0 : link.shop) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.attributes) === null || _c === void 0 ? void 0 : _c.name) === this.shop; }) && (index$1.h("a", { onClick: this.goToProduct, class: `${this.currentColor.buttonInverse ? 'inverse' : ''}`, target: "_blank", href: (_f = this === null || this === void 0 ? void 0 : this.currentColor.links.find((link) => { var _a, _b, _c; return ((_c = (_b = (_a = link === null || link === void 0 ? void 0 : link.shop) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.attributes) === null || _c === void 0 ? void 0 : _c.name) === this.shop; })) === null || _f === void 0 ? void 0 : _f.path }, "przejd\u017A do produktu"))))), index$1.h("div", { class: "boxes__box-content__slider" }, index$1.h("my-slider", { color: this.currentColor.name, shop: this.shop, product: this.product, slides: (_g = this.data) === null || _g === void 0 ? void 0 : _g.images.data }), ' ')));
120
+ } }, !this.isMobile && index$1.h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && index$1.h("h2", null, this.currentColor.name), !this.isMobile && index$1.h("h4", null, this.currentColor.number), !this.isMobile && index$1.h("div", { class: "divider" }), index$1.h("div", { class: "boxes__box-content__info__value" }, index$1.h("div", { class: "boxes__box-content__info__value-image" }, ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.image) && index$1.h("img", { src: `${APIURL}/assets/${this.currentColor.image}?access_token=${accessToken}`, alt: "color-image" })), index$1.h("div", { class: "boxes__box-content__info__value-product" }, index$1.h("div", null, !this.isMobile && index$1.h("p", null, "Produkt:"), this.isMobile && index$1.h("h2", null, (_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.name), " ", index$1.h("p", null, this.product)), this.isMobile && index$1.h("div", { class: 'divider' }), this.currentColor && ((_c = this.currentColor.links) === null || _c === void 0 ? void 0 : _c.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) && (index$1.h("a", { onClick: this.goToProduct, class: `${this.currentColor.buttonInverse ? 'inverse' : ''}`, target: "_blank", href: (_e = (_d = this === null || this === void 0 ? void 0 : this.currentColor.links) === null || _d === void 0 ? void 0 : _d.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) === null || _e === void 0 ? void 0 : _e.path }, "przejd\u017A do produktu"))))), index$1.h("div", { class: "boxes__box-content__slider" }, index$1.h("my-slider", { color: this.currentColor.name, shop: this.shop, product: this.product, slides: (_f = this.data) === null || _f === void 0 ? void 0 : _f.images }), ' ')));
98
121
  }
99
122
  };
100
123
 
@@ -258,7 +281,7 @@ const MyModalBundle = class {
258
281
  };
259
282
  MyModalBundle.style = myComponentCss;
260
283
 
261
- const myLoaderCss = ".container.sc-my-loader{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.item.sc-my-loader{width:20px;height:20px;margin:3px;list-style-type:none;transition:0.5s all ease}.item.sc-my-loader:nth-child(1){animation:right-1 1s infinite alternate;background-color:#b8cf40;animation-delay:20ms}@keyframes right-1{0%{transform:translateY(-18px)}100%{transform:translateY(18px)}}.item.sc-my-loader:nth-child(2){animation:right-2 1s infinite alternate;background-color:#ee4b5e;animation-delay:40ms}@keyframes right-2{0%{transform:translateY(-21px)}100%{transform:translateY(21px)}}.item.sc-my-loader:nth-child(3){animation:right-3 1s infinite alternate;background-color:#ea0f47;animation-delay:60ms}@keyframes right-3{0%{transform:translateY(-24px)}100%{transform:translateY(24px)}}.item.sc-my-loader:nth-child(4){animation:right-4 1s infinite alternate;background-color:#d42840;animation-delay:80ms}@keyframes right-4{0%{transform:translateY(-27px)}100%{transform:translateY(27px)}}.item.sc-my-loader:nth-child(5){animation:right-5 1s infinite alternate;background-color:#8b2850;animation-delay:100ms}@keyframes right-5{0%{transform:translateY(-30px)}100%{transform:translateY(30px)}}";
284
+ const myLoaderCss = ".container.sc-my-loader{display:flex;justify-content:center;align-items:center;height:190px;overflow:hidden}.item.sc-my-loader{width:20px;height:20px;margin:3px;list-style-type:none;transition:0.5s all ease}.item.sc-my-loader:nth-child(1){animation:right-1 1s infinite alternate;background-color:#b8cf40;animation-delay:20ms}@keyframes right-1{0%{transform:translateY(-18px)}100%{transform:translateY(18px)}}.item.sc-my-loader:nth-child(2){animation:right-2 1s infinite alternate;background-color:#ee4b5e;animation-delay:40ms}@keyframes right-2{0%{transform:translateY(-21px)}100%{transform:translateY(21px)}}.item.sc-my-loader:nth-child(3){animation:right-3 1s infinite alternate;background-color:#ea0f47;animation-delay:60ms}@keyframes right-3{0%{transform:translateY(-24px)}100%{transform:translateY(24px)}}.item.sc-my-loader:nth-child(4){animation:right-4 1s infinite alternate;background-color:#d42840;animation-delay:80ms}@keyframes right-4{0%{transform:translateY(-27px)}100%{transform:translateY(27px)}}.item.sc-my-loader:nth-child(5){animation:right-5 1s infinite alternate;background-color:#8b2850;animation-delay:100ms}@keyframes right-5{0%{transform:translateY(-30px)}100%{transform:translateY(30px)}}";
262
285
 
263
286
  const MyLoader = class {
264
287
  constructor(hostRef) {
@@ -270,25 +293,26 @@ const MyLoader = class {
270
293
  };
271
294
  MyLoader.style = myLoaderCss;
272
295
 
273
- const APIURL = 'https://pallete-colors-backend.herokuapp.com';
274
- class API {
275
- async getData(ep) {
276
- try {
277
- const request = await fetch(`${APIURL}/api/${ep}`, {
278
- method: 'GET',
279
- headers: {
280
- 'Content-Type': 'application/json',
281
- },
282
- });
283
- const response = await request.json();
284
- return response;
285
- }
286
- catch (error) {
287
- console.error(error);
288
- }
289
- }
290
- }
291
- const ApiService = new API();
296
+ /** @type {import('.')} */
297
+ var esErrors = Error;
298
+
299
+ /** @type {import('./eval')} */
300
+ var _eval = EvalError;
301
+
302
+ /** @type {import('./range')} */
303
+ var range = RangeError;
304
+
305
+ /** @type {import('./ref')} */
306
+ var ref = ReferenceError;
307
+
308
+ /** @type {import('./syntax')} */
309
+ var syntax = SyntaxError;
310
+
311
+ /** @type {import('./type')} */
312
+ var type = TypeError;
313
+
314
+ /** @type {import('./uri')} */
315
+ var uri = URIError;
292
316
 
293
317
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
294
318
  var shams = function hasSymbols() {
@@ -344,55 +368,91 @@ var hasSymbols$1 = function hasNativeSymbols() {
344
368
  };
345
369
 
346
370
  var test = {
371
+ __proto__: null,
347
372
  foo: {}
348
373
  };
349
374
 
350
375
  var $Object = Object;
351
376
 
377
+ /** @type {import('.')} */
352
378
  var hasProto$1 = function hasProto() {
353
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
379
+ // @ts-expect-error: TS errors on an inherited property for some reason
380
+ return { __proto__: test }.foo === test.foo
381
+ && !(test instanceof $Object);
354
382
  };
355
383
 
356
384
  /* eslint no-invalid-this: 1 */
357
385
 
358
386
  var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
359
- var slice = Array.prototype.slice;
360
387
  var toStr$1 = Object.prototype.toString;
388
+ var max = Math.max;
361
389
  var funcType = '[object Function]';
362
390
 
391
+ var concatty = function concatty(a, b) {
392
+ var arr = [];
393
+
394
+ for (var i = 0; i < a.length; i += 1) {
395
+ arr[i] = a[i];
396
+ }
397
+ for (var j = 0; j < b.length; j += 1) {
398
+ arr[j + a.length] = b[j];
399
+ }
400
+
401
+ return arr;
402
+ };
403
+
404
+ var slicy = function slicy(arrLike, offset) {
405
+ var arr = [];
406
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
407
+ arr[j] = arrLike[i];
408
+ }
409
+ return arr;
410
+ };
411
+
412
+ var joiny = function (arr, joiner) {
413
+ var str = '';
414
+ for (var i = 0; i < arr.length; i += 1) {
415
+ str += arr[i];
416
+ if (i + 1 < arr.length) {
417
+ str += joiner;
418
+ }
419
+ }
420
+ return str;
421
+ };
422
+
363
423
  var implementation = function bind(that) {
364
424
  var target = this;
365
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
425
+ if (typeof target !== 'function' || toStr$1.apply(target) !== funcType) {
366
426
  throw new TypeError(ERROR_MESSAGE + target);
367
427
  }
368
- var args = slice.call(arguments, 1);
428
+ var args = slicy(arguments, 1);
369
429
 
370
430
  var bound;
371
431
  var binder = function () {
372
432
  if (this instanceof bound) {
373
433
  var result = target.apply(
374
434
  this,
375
- args.concat(slice.call(arguments))
435
+ concatty(args, arguments)
376
436
  );
377
437
  if (Object(result) === result) {
378
438
  return result;
379
439
  }
380
440
  return this;
381
- } else {
382
- return target.apply(
383
- that,
384
- args.concat(slice.call(arguments))
385
- );
386
441
  }
442
+ return target.apply(
443
+ that,
444
+ concatty(args, arguments)
445
+ );
446
+
387
447
  };
388
448
 
389
- var boundLength = Math.max(0, target.length - args.length);
449
+ var boundLength = max(0, target.length - args.length);
390
450
  var boundArgs = [];
391
451
  for (var i = 0; i < boundLength; i++) {
392
- boundArgs.push('$' + i);
452
+ boundArgs[i] = '$' + i;
393
453
  }
394
454
 
395
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
455
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
396
456
 
397
457
  if (target.prototype) {
398
458
  var Empty = function Empty() {};
@@ -406,13 +466,24 @@ var implementation = function bind(that) {
406
466
 
407
467
  var functionBind = Function.prototype.bind || implementation;
408
468
 
409
- var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
469
+ var call = Function.prototype.call;
470
+ var $hasOwn = Object.prototype.hasOwnProperty;
471
+
472
+
473
+ /** @type {import('.')} */
474
+ var hasown = functionBind.call(call, $hasOwn);
410
475
 
411
476
  var undefined$1;
412
477
 
413
- var $SyntaxError = SyntaxError;
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
414
486
  var $Function = Function;
415
- var $TypeError$1 = TypeError;
416
487
 
417
488
  // eslint-disable-next-line consistent-return
418
489
  var getEvalledConstructor = function (expressionSyntax) {
@@ -421,19 +492,19 @@ var getEvalledConstructor = function (expressionSyntax) {
421
492
  } catch (e) {}
422
493
  };
423
494
 
424
- var $gOPD = Object.getOwnPropertyDescriptor;
495
+ var $gOPD$1 = Object.getOwnPropertyDescriptor;
425
496
 
426
497
  var throwTypeError = function () {
427
- throw new $TypeError$1();
498
+ throw new type();
428
499
  };
429
- var ThrowTypeError = $gOPD
500
+ var ThrowTypeError = $gOPD$1
430
501
  ? (function () {
431
502
  try {
432
503
  return throwTypeError;
433
504
  } catch (calleeThrows) {
434
505
  try {
435
506
  // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
436
- return $gOPD(arguments, 'callee').get;
507
+ return $gOPD$1(arguments, 'callee').get;
437
508
  } catch (gOPDthrows) {
438
509
  return throwTypeError;
439
510
  }
@@ -455,6 +526,7 @@ var needsEval = {};
455
526
  var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
456
527
 
457
528
  var INTRINSICS = {
529
+ __proto__: null,
458
530
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
459
531
  '%Array%': Array,
460
532
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
@@ -475,9 +547,9 @@ var INTRINSICS = {
475
547
  '%decodeURIComponent%': decodeURIComponent,
476
548
  '%encodeURI%': encodeURI,
477
549
  '%encodeURIComponent%': encodeURIComponent,
478
- '%Error%': Error,
550
+ '%Error%': esErrors,
479
551
  '%eval%': eval, // eslint-disable-line no-eval
480
- '%EvalError%': EvalError,
552
+ '%EvalError%': _eval,
481
553
  '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
482
554
  '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
483
555
  '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
@@ -499,8 +571,8 @@ var INTRINSICS = {
499
571
  '%parseInt%': parseInt,
500
572
  '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
501
573
  '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
502
- '%RangeError%': RangeError,
503
- '%ReferenceError%': ReferenceError,
574
+ '%RangeError%': range,
575
+ '%ReferenceError%': ref,
504
576
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
505
577
  '%RegExp%': RegExp,
506
578
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
@@ -509,15 +581,15 @@ var INTRINSICS = {
509
581
  '%String%': String,
510
582
  '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
511
583
  '%Symbol%': hasSymbols ? Symbol : undefined$1,
512
- '%SyntaxError%': $SyntaxError,
584
+ '%SyntaxError%': syntax,
513
585
  '%ThrowTypeError%': ThrowTypeError,
514
586
  '%TypedArray%': TypedArray,
515
- '%TypeError%': $TypeError$1,
587
+ '%TypeError%': type,
516
588
  '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
517
589
  '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
518
590
  '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
519
591
  '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
520
- '%URIError%': URIError,
592
+ '%URIError%': uri,
521
593
  '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
522
594
  '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
523
595
  '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
@@ -549,6 +621,7 @@ var doEval = function doEval(name) {
549
621
  };
550
622
 
551
623
  var LEGACY_ALIASES = {
624
+ __proto__: null,
552
625
  '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
553
626
  '%ArrayPrototype%': ['Array', 'prototype'],
554
627
  '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
@@ -617,9 +690,9 @@ var stringToPath = function stringToPath(string) {
617
690
  var first = $strSlice(string, 0, 1);
618
691
  var last = $strSlice(string, -1);
619
692
  if (first === '%' && last !== '%') {
620
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
693
+ throw new syntax('invalid intrinsic syntax, expected closing `%`');
621
694
  } else if (last === '%' && first !== '%') {
622
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
695
+ throw new syntax('invalid intrinsic syntax, expected opening `%`');
623
696
  }
624
697
  var result = [];
625
698
  $replace$1(string, rePropName, function (match, number, quote, subString) {
@@ -632,18 +705,18 @@ var stringToPath = function stringToPath(string) {
632
705
  var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
633
706
  var intrinsicName = name;
634
707
  var alias;
635
- if (src(LEGACY_ALIASES, intrinsicName)) {
708
+ if (hasown(LEGACY_ALIASES, intrinsicName)) {
636
709
  alias = LEGACY_ALIASES[intrinsicName];
637
710
  intrinsicName = '%' + alias[0] + '%';
638
711
  }
639
712
 
640
- if (src(INTRINSICS, intrinsicName)) {
713
+ if (hasown(INTRINSICS, intrinsicName)) {
641
714
  var value = INTRINSICS[intrinsicName];
642
715
  if (value === needsEval) {
643
716
  value = doEval(intrinsicName);
644
717
  }
645
718
  if (typeof value === 'undefined' && !allowMissing) {
646
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
719
+ throw new type('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
647
720
  }
648
721
 
649
722
  return {
@@ -653,19 +726,19 @@ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
653
726
  };
654
727
  }
655
728
 
656
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
729
+ throw new syntax('intrinsic ' + name + ' does not exist!');
657
730
  };
658
731
 
659
732
  var getIntrinsic = function GetIntrinsic(name, allowMissing) {
660
733
  if (typeof name !== 'string' || name.length === 0) {
661
- throw new $TypeError$1('intrinsic name must be a non-empty string');
734
+ throw new type('intrinsic name must be a non-empty string');
662
735
  }
663
736
  if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
664
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
737
+ throw new type('"allowMissing" argument must be a boolean');
665
738
  }
666
739
 
667
740
  if ($exec(/^%?[^%]*%?$/, name) === null) {
668
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
741
+ throw new syntax('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
669
742
  }
670
743
  var parts = stringToPath(name);
671
744
  var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
@@ -692,7 +765,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
692
765
  )
693
766
  && first !== last
694
767
  ) {
695
- throw new $SyntaxError('property names with quotes must have matching quotes');
768
+ throw new syntax('property names with quotes must have matching quotes');
696
769
  }
697
770
  if (part === 'constructor' || !isOwn) {
698
771
  skipFurtherCaching = true;
@@ -701,17 +774,17 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
701
774
  intrinsicBaseName += '.' + part;
702
775
  intrinsicRealName = '%' + intrinsicBaseName + '%';
703
776
 
704
- if (src(INTRINSICS, intrinsicRealName)) {
777
+ if (hasown(INTRINSICS, intrinsicRealName)) {
705
778
  value = INTRINSICS[intrinsicRealName];
706
779
  } else if (value != null) {
707
780
  if (!(part in value)) {
708
781
  if (!allowMissing) {
709
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
782
+ throw new type('base intrinsic for ' + name + ' exists, but the property is not available.');
710
783
  }
711
784
  return void undefined$1;
712
785
  }
713
- if ($gOPD && (i + 1) >= parts.length) {
714
- var desc = $gOPD(value, part);
786
+ if ($gOPD$1 && (i + 1) >= parts.length) {
787
+ var desc = $gOPD$1(value, part);
715
788
  isOwn = !!desc;
716
789
 
717
790
  // By convention, when a data property is converted to an accessor
@@ -727,7 +800,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
727
800
  value = value[part];
728
801
  }
729
802
  } else {
730
- isOwn = src(value, part);
803
+ isOwn = hasown(value, part);
731
804
  value = value[part];
732
805
  }
733
806
 
@@ -739,6 +812,8 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
739
812
  return value;
740
813
  };
741
814
 
815
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
816
+
742
817
  function createCommonjsModule(fn, basedir, module) {
743
818
  return module = {
744
819
  path: basedir,
@@ -768,50 +843,170 @@ function commonjsRequire () {
768
843
  throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
769
844
  }
770
845
 
846
+ /** @type {import('.')} */
847
+ var $defineProperty = getIntrinsic('%Object.defineProperty%', true) || false;
848
+ if ($defineProperty) {
849
+ try {
850
+ $defineProperty({}, 'a', { value: 1 });
851
+ } catch (e) {
852
+ // IE 8 has a broken defineProperty
853
+ $defineProperty = false;
854
+ }
855
+ }
856
+
857
+ var esDefineProperty = $defineProperty;
858
+
859
+ var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
860
+
861
+ if ($gOPD) {
862
+ try {
863
+ $gOPD([], 'length');
864
+ } catch (e) {
865
+ // IE 8 has a broken gOPD
866
+ $gOPD = null;
867
+ }
868
+ }
869
+
870
+ var gopd = $gOPD;
871
+
872
+ /** @type {import('.')} */
873
+ var defineDataProperty = function defineDataProperty(
874
+ obj,
875
+ property,
876
+ value
877
+ ) {
878
+ if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
879
+ throw new type('`obj` must be an object or a function`');
880
+ }
881
+ if (typeof property !== 'string' && typeof property !== 'symbol') {
882
+ throw new type('`property` must be a string or a symbol`');
883
+ }
884
+ if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
885
+ throw new type('`nonEnumerable`, if provided, must be a boolean or null');
886
+ }
887
+ if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
888
+ throw new type('`nonWritable`, if provided, must be a boolean or null');
889
+ }
890
+ if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
891
+ throw new type('`nonConfigurable`, if provided, must be a boolean or null');
892
+ }
893
+ if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
894
+ throw new type('`loose`, if provided, must be a boolean');
895
+ }
896
+
897
+ var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
898
+ var nonWritable = arguments.length > 4 ? arguments[4] : null;
899
+ var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
900
+ var loose = arguments.length > 6 ? arguments[6] : false;
901
+
902
+ /* @type {false | TypedPropertyDescriptor<unknown>} */
903
+ var desc = !!gopd && gopd(obj, property);
904
+
905
+ if (esDefineProperty) {
906
+ esDefineProperty(obj, property, {
907
+ configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
908
+ enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
909
+ value: value,
910
+ writable: nonWritable === null && desc ? desc.writable : !nonWritable
911
+ });
912
+ } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
913
+ // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
914
+ obj[property] = value; // eslint-disable-line no-param-reassign
915
+ } else {
916
+ throw new syntax('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
917
+ }
918
+ };
919
+
920
+ var hasPropertyDescriptors = function hasPropertyDescriptors() {
921
+ return !!esDefineProperty;
922
+ };
923
+
924
+ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
925
+ // node v0.6 has a bug where array lengths can be Set but not Defined
926
+ if (!esDefineProperty) {
927
+ return null;
928
+ }
929
+ try {
930
+ return esDefineProperty([], 'length', { value: 1 }).length !== 1;
931
+ } catch (e) {
932
+ // In Firefox 4-22, defining length on an array throws an exception.
933
+ return true;
934
+ }
935
+ };
936
+
937
+ var hasPropertyDescriptors_1 = hasPropertyDescriptors;
938
+
939
+ var hasDescriptors = hasPropertyDescriptors_1();
940
+
941
+
942
+
943
+ var $floor$1 = getIntrinsic('%Math.floor%');
944
+
945
+ /** @type {import('.')} */
946
+ var setFunctionLength = function setFunctionLength(fn, length) {
947
+ if (typeof fn !== 'function') {
948
+ throw new type('`fn` is not a function');
949
+ }
950
+ if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
951
+ throw new type('`length` must be a positive 32-bit integer');
952
+ }
953
+
954
+ var loose = arguments.length > 2 && !!arguments[2];
955
+
956
+ var functionLengthIsConfigurable = true;
957
+ var functionLengthIsWritable = true;
958
+ if ('length' in fn && gopd) {
959
+ var desc = gopd(fn, 'length');
960
+ if (desc && !desc.configurable) {
961
+ functionLengthIsConfigurable = false;
962
+ }
963
+ if (desc && !desc.writable) {
964
+ functionLengthIsWritable = false;
965
+ }
966
+ }
967
+
968
+ if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
969
+ if (hasDescriptors) {
970
+ defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
971
+ } else {
972
+ defineDataProperty(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
973
+ }
974
+ }
975
+ return fn;
976
+ };
977
+
771
978
  var callBind = createCommonjsModule(function (module) {
772
979
 
773
980
 
774
981
 
775
982
 
983
+
984
+
776
985
  var $apply = getIntrinsic('%Function.prototype.apply%');
777
986
  var $call = getIntrinsic('%Function.prototype.call%');
778
987
  var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
779
988
 
780
- var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
781
- var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
782
- var $max = getIntrinsic('%Math.max%');
783
989
 
784
- if ($defineProperty) {
785
- try {
786
- $defineProperty({}, 'a', { value: 1 });
787
- } catch (e) {
788
- // IE 8 has a broken defineProperty
789
- $defineProperty = null;
790
- }
791
- }
990
+ var $max = getIntrinsic('%Math.max%');
792
991
 
793
992
  module.exports = function callBind(originalFunction) {
794
- var func = $reflectApply(functionBind, $call, arguments);
795
- if ($gOPD && $defineProperty) {
796
- var desc = $gOPD(func, 'length');
797
- if (desc.configurable) {
798
- // original length, plus the receiver, minus any additional arguments (after the receiver)
799
- $defineProperty(
800
- func,
801
- 'length',
802
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
803
- );
804
- }
993
+ if (typeof originalFunction !== 'function') {
994
+ throw new type('a function is required');
805
995
  }
806
- return func;
996
+ var func = $reflectApply(functionBind, $call, arguments);
997
+ return setFunctionLength(
998
+ func,
999
+ 1 + $max(0, originalFunction.length - (arguments.length - 1)),
1000
+ true
1001
+ );
807
1002
  };
808
1003
 
809
1004
  var applyBind = function applyBind() {
810
1005
  return $reflectApply(functionBind, $apply, arguments);
811
1006
  };
812
1007
 
813
- if ($defineProperty) {
814
- $defineProperty(module.exports, 'apply', { value: applyBind });
1008
+ if (esDefineProperty) {
1009
+ esDefineProperty(module.exports, 'apply', { value: applyBind });
815
1010
  } else {
816
1011
  module.exports.apply = applyBind;
817
1012
  }
@@ -1077,6 +1272,14 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
1077
1272
  if (isString(obj)) {
1078
1273
  return markBoxed(inspect(String(obj)));
1079
1274
  }
1275
+ // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
1276
+ /* eslint-env browser */
1277
+ if (typeof window !== 'undefined' && obj === window) {
1278
+ return '{ [object Window] }';
1279
+ }
1280
+ if (obj === commonjsGlobal) {
1281
+ return '{ [object globalThis] }';
1282
+ }
1080
1283
  if (!isDate(obj) && !isRegExp$1(obj)) {
1081
1284
  var ys = arrObjKeys(obj, inspect);
1082
1285
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
@@ -1353,7 +1556,6 @@ function arrObjKeys(obj, inspect) {
1353
1556
  return xs;
1354
1557
  }
1355
1558
 
1356
- var $TypeError = getIntrinsic('%TypeError%');
1357
1559
  var $WeakMap = getIntrinsic('%WeakMap%', true);
1358
1560
  var $Map = getIntrinsic('%Map%', true);
1359
1561
 
@@ -1365,53 +1567,62 @@ var $mapSet = callBound('Map.prototype.set', true);
1365
1567
  var $mapHas = callBound('Map.prototype.has', true);
1366
1568
 
1367
1569
  /*
1368
- * This function traverses the list returning the node corresponding to the
1369
- * given key.
1370
- *
1371
- * That node is also moved to the head of the list, so that if it's accessed
1372
- * again we don't need to traverse the whole list. By doing so, all the recently
1373
- * used nodes can be accessed relatively quickly.
1374
- */
1570
+ * This function traverses the list returning the node corresponding to the given key.
1571
+ *
1572
+ * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
1573
+ */
1574
+ /** @type {import('.').listGetNode} */
1375
1575
  var listGetNode = function (list, key) { // eslint-disable-line consistent-return
1376
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
1576
+ /** @type {typeof list | NonNullable<(typeof list)['next']>} */
1577
+ var prev = list;
1578
+ /** @type {(typeof list)['next']} */
1579
+ var curr;
1580
+ for (; (curr = prev.next) !== null; prev = curr) {
1377
1581
  if (curr.key === key) {
1378
1582
  prev.next = curr.next;
1379
- curr.next = list.next;
1583
+ // eslint-disable-next-line no-extra-parens
1584
+ curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
1380
1585
  list.next = curr; // eslint-disable-line no-param-reassign
1381
1586
  return curr;
1382
1587
  }
1383
1588
  }
1384
1589
  };
1385
1590
 
1591
+ /** @type {import('.').listGet} */
1386
1592
  var listGet = function (objects, key) {
1387
1593
  var node = listGetNode(objects, key);
1388
1594
  return node && node.value;
1389
1595
  };
1596
+ /** @type {import('.').listSet} */
1390
1597
  var listSet = function (objects, key, value) {
1391
1598
  var node = listGetNode(objects, key);
1392
1599
  if (node) {
1393
1600
  node.value = value;
1394
1601
  } else {
1395
1602
  // Prepend the new node to the beginning of the list
1396
- objects.next = { // eslint-disable-line no-param-reassign
1603
+ objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
1397
1604
  key: key,
1398
1605
  next: objects.next,
1399
1606
  value: value
1400
- };
1607
+ });
1401
1608
  }
1402
1609
  };
1610
+ /** @type {import('.').listHas} */
1403
1611
  var listHas = function (objects, key) {
1404
1612
  return !!listGetNode(objects, key);
1405
1613
  };
1406
1614
 
1615
+ /** @type {import('.')} */
1407
1616
  var sideChannel = function getSideChannel() {
1408
- var $wm;
1409
- var $m;
1410
- var $o;
1617
+ /** @type {WeakMap<object, unknown>} */ var $wm;
1618
+ /** @type {Map<object, unknown>} */ var $m;
1619
+ /** @type {import('.').RootNode<unknown>} */ var $o;
1620
+
1621
+ /** @type {import('.').Channel} */
1411
1622
  var channel = {
1412
1623
  assert: function (key) {
1413
1624
  if (!channel.has(key)) {
1414
- throw new $TypeError('Side channel does not contain ' + objectInspect(key));
1625
+ throw new type('Side channel does not contain ' + objectInspect(key));
1415
1626
  }
1416
1627
  },
1417
1628
  get: function (key) { // eslint-disable-line consistent-return
@@ -1458,11 +1669,7 @@ var sideChannel = function getSideChannel() {
1458
1669
  $mapSet($m, key, value);
1459
1670
  } else {
1460
1671
  if (!$o) {
1461
- /*
1462
- * Initialize the linked list as an empty node, so that we don't have
1463
- * to special-case handling of the first node: we can always refer to
1464
- * it as (previous node).next, instead of something like (list).head
1465
- */
1672
+ // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
1466
1673
  $o = { key: {}, next: null };
1467
1674
  }
1468
1675
  listSet($o, key, value);
@@ -1770,10 +1977,13 @@ var defaultFormat = formats['default'];
1770
1977
  var defaults$2 = {
1771
1978
  addQueryPrefix: false,
1772
1979
  allowDots: false,
1980
+ allowEmptyArrays: false,
1981
+ arrayFormat: 'indices',
1773
1982
  charset: 'utf-8',
1774
1983
  charsetSentinel: false,
1775
1984
  delimiter: '&',
1776
1985
  encode: true,
1986
+ encodeDotInKeys: false,
1777
1987
  encoder: utils.encode,
1778
1988
  encodeValuesOnly: false,
1779
1989
  format: defaultFormat,
@@ -1802,8 +2012,10 @@ var stringify = function stringify(
1802
2012
  prefix,
1803
2013
  generateArrayPrefix,
1804
2014
  commaRoundTrip,
2015
+ allowEmptyArrays,
1805
2016
  strictNullHandling,
1806
2017
  skipNulls,
2018
+ encodeDotInKeys,
1807
2019
  encoder,
1808
2020
  filter,
1809
2021
  sort,
@@ -1885,7 +2097,13 @@ var stringify = function stringify(
1885
2097
  objKeys = sort ? keys.sort(sort) : keys;
1886
2098
  }
1887
2099
 
1888
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
2100
+ var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
2101
+
2102
+ var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
2103
+
2104
+ if (allowEmptyArrays && isArray$1(obj) && obj.length === 0) {
2105
+ return adjustedPrefix + '[]';
2106
+ }
1889
2107
 
1890
2108
  for (var j = 0; j < objKeys.length; ++j) {
1891
2109
  var key = objKeys[j];
@@ -1895,9 +2113,10 @@ var stringify = function stringify(
1895
2113
  continue;
1896
2114
  }
1897
2115
 
2116
+ var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
1898
2117
  var keyPrefix = isArray$1(obj)
1899
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
1900
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
2118
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
2119
+ : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
1901
2120
 
1902
2121
  sideChannel$1.set(object, step);
1903
2122
  var valueSideChannel = sideChannel();
@@ -1907,8 +2126,10 @@ var stringify = function stringify(
1907
2126
  keyPrefix,
1908
2127
  generateArrayPrefix,
1909
2128
  commaRoundTrip,
2129
+ allowEmptyArrays,
1910
2130
  strictNullHandling,
1911
2131
  skipNulls,
2132
+ encodeDotInKeys,
1912
2133
  generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
1913
2134
  filter,
1914
2135
  sort,
@@ -1930,6 +2151,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
1930
2151
  return defaults$2;
1931
2152
  }
1932
2153
 
2154
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
2155
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
2156
+ }
2157
+
2158
+ if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
2159
+ throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
2160
+ }
2161
+
1933
2162
  if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
1934
2163
  throw new TypeError('Encoder has to be a function.');
1935
2164
  }
@@ -1953,13 +2182,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
1953
2182
  filter = opts.filter;
1954
2183
  }
1955
2184
 
2185
+ var arrayFormat;
2186
+ if (opts.arrayFormat in arrayPrefixGenerators) {
2187
+ arrayFormat = opts.arrayFormat;
2188
+ } else if ('indices' in opts) {
2189
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
2190
+ } else {
2191
+ arrayFormat = defaults$2.arrayFormat;
2192
+ }
2193
+
2194
+ if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2195
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2196
+ }
2197
+
2198
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults$2.allowDots : !!opts.allowDots;
2199
+
1956
2200
  return {
1957
2201
  addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$2.addQueryPrefix,
1958
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$2.allowDots : !!opts.allowDots,
2202
+ allowDots: allowDots,
2203
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults$2.allowEmptyArrays,
2204
+ arrayFormat: arrayFormat,
1959
2205
  charset: charset,
1960
2206
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$2.charsetSentinel,
2207
+ commaRoundTrip: opts.commaRoundTrip,
1961
2208
  delimiter: typeof opts.delimiter === 'undefined' ? defaults$2.delimiter : opts.delimiter,
1962
2209
  encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$2.encode,
2210
+ encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults$2.encodeDotInKeys,
1963
2211
  encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$2.encoder,
1964
2212
  encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$2.encodeValuesOnly,
1965
2213
  filter: filter,
@@ -1993,20 +2241,8 @@ var stringify_1 = function (object, opts) {
1993
2241
  return '';
1994
2242
  }
1995
2243
 
1996
- var arrayFormat;
1997
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
1998
- arrayFormat = opts.arrayFormat;
1999
- } else if (opts && 'indices' in opts) {
2000
- arrayFormat = opts.indices ? 'indices' : 'repeat';
2001
- } else {
2002
- arrayFormat = 'indices';
2003
- }
2004
-
2005
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2006
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2007
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2008
- }
2009
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
2244
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
2245
+ var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
2010
2246
 
2011
2247
  if (!objKeys) {
2012
2248
  objKeys = Object.keys(obj);
@@ -2028,8 +2264,10 @@ var stringify_1 = function (object, opts) {
2028
2264
  key,
2029
2265
  generateArrayPrefix,
2030
2266
  commaRoundTrip,
2267
+ options.allowEmptyArrays,
2031
2268
  options.strictNullHandling,
2032
2269
  options.skipNulls,
2270
+ options.encodeDotInKeys,
2033
2271
  options.encode ? options.encoder : null,
2034
2272
  options.filter,
2035
2273
  options.sort,
@@ -2064,15 +2302,18 @@ var isArray = Array.isArray;
2064
2302
 
2065
2303
  var defaults$1 = {
2066
2304
  allowDots: false,
2305
+ allowEmptyArrays: false,
2067
2306
  allowPrototypes: false,
2068
2307
  allowSparse: false,
2069
2308
  arrayLimit: 20,
2070
2309
  charset: 'utf-8',
2071
2310
  charsetSentinel: false,
2072
2311
  comma: false,
2312
+ decodeDotInKeys: true,
2073
2313
  decoder: utils.decode,
2074
2314
  delimiter: '&',
2075
2315
  depth: 5,
2316
+ duplicates: 'combine',
2076
2317
  ignoreQueryPrefix: false,
2077
2318
  interpretNumericEntities: false,
2078
2319
  parameterLimit: 1000,
@@ -2160,9 +2401,10 @@ var parseValues = function parseQueryStringValues(str, options) {
2160
2401
  val = isArray(val) ? [val] : val;
2161
2402
  }
2162
2403
 
2163
- if (has.call(obj, key)) {
2404
+ var existing = has.call(obj, key);
2405
+ if (existing && options.duplicates === 'combine') {
2164
2406
  obj[key] = utils.combine(obj[key], val);
2165
- } else {
2407
+ } else if (!existing || options.duplicates === 'last') {
2166
2408
  obj[key] = val;
2167
2409
  }
2168
2410
  }
@@ -2178,24 +2420,25 @@ var parseObject = function (chain, val, options, valuesParsed) {
2178
2420
  var root = chain[i];
2179
2421
 
2180
2422
  if (root === '[]' && options.parseArrays) {
2181
- obj = [].concat(leaf);
2423
+ obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf);
2182
2424
  } else {
2183
2425
  obj = options.plainObjects ? Object.create(null) : {};
2184
2426
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
2185
- var index = parseInt(cleanRoot, 10);
2186
- if (!options.parseArrays && cleanRoot === '') {
2427
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
2428
+ var index = parseInt(decodedRoot, 10);
2429
+ if (!options.parseArrays && decodedRoot === '') {
2187
2430
  obj = { 0: leaf };
2188
2431
  } else if (
2189
2432
  !isNaN(index)
2190
- && root !== cleanRoot
2191
- && String(index) === cleanRoot
2433
+ && root !== decodedRoot
2434
+ && String(index) === decodedRoot
2192
2435
  && index >= 0
2193
2436
  && (options.parseArrays && index <= options.arrayLimit)
2194
2437
  ) {
2195
2438
  obj = [];
2196
2439
  obj[index] = leaf;
2197
- } else if (cleanRoot !== '__proto__') {
2198
- obj[cleanRoot] = leaf;
2440
+ } else if (decodedRoot !== '__proto__') {
2441
+ obj[decodedRoot] = leaf;
2199
2442
  }
2200
2443
  }
2201
2444
 
@@ -2264,7 +2507,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
2264
2507
  return defaults$1;
2265
2508
  }
2266
2509
 
2267
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2510
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
2511
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
2512
+ }
2513
+
2514
+ if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
2515
+ throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
2516
+ }
2517
+
2518
+ if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
2268
2519
  throw new TypeError('Decoder has to be a function.');
2269
2520
  }
2270
2521
 
@@ -2273,18 +2524,29 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
2273
2524
  }
2274
2525
  var charset = typeof opts.charset === 'undefined' ? defaults$1.charset : opts.charset;
2275
2526
 
2527
+ var duplicates = typeof opts.duplicates === 'undefined' ? defaults$1.duplicates : opts.duplicates;
2528
+
2529
+ if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
2530
+ throw new TypeError('The duplicates option must be either combine, first, or last');
2531
+ }
2532
+
2533
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
2534
+
2276
2535
  return {
2277
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
2536
+ allowDots: allowDots,
2537
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
2278
2538
  allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$1.allowPrototypes,
2279
2539
  allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults$1.allowSparse,
2280
2540
  arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$1.arrayLimit,
2281
2541
  charset: charset,
2282
2542
  charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
2283
2543
  comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$1.comma,
2544
+ decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults$1.decodeDotInKeys,
2284
2545
  decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$1.decoder,
2285
2546
  delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults$1.delimiter,
2286
2547
  // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2287
2548
  depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$1.depth,
2549
+ duplicates: duplicates,
2288
2550
  ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2289
2551
  interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$1.interpretNumericEntities,
2290
2552
  parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$1.parameterLimit,
@@ -2326,85 +2588,52 @@ var lib = {
2326
2588
  stringify: stringify_1
2327
2589
  };
2328
2590
 
2591
+ const limit = 100;
2329
2592
  const fetchProductColorsQuery = (id, page) => lib.stringify({
2330
- filters: {
2593
+ fields: ['*', 'products.*'].join(','),
2594
+ filter: {
2331
2595
  products: {
2332
- id: {
2333
- $eq: id,
2596
+ Product_id: {
2597
+ _eq: id,
2334
2598
  },
2335
2599
  },
2336
2600
  },
2337
- sort: ['position:asc'],
2338
- populate: ['image', 'category', 'links', 'links.shop'],
2339
- pagination: {
2340
- page: page || 1,
2341
- pageSize: 100,
2342
- },
2601
+ meta: '*',
2602
+ page: page || 1,
2603
+ limit,
2343
2604
  }, {
2344
- encodeValuesOnly: true, // prettify url
2605
+ encodeValuesOnly: true,
2345
2606
  });
2346
- const fetchCategoryColorsQuery = (color) => lib.stringify({
2347
- filters: {
2348
- category: {
2349
- id: {
2350
- $eq: color.id,
2607
+ const fetchCategoryColorsQuery = (id, page) => lib.stringify({
2608
+ fields: ['*', 'Category.*', 'products.*'].join(','),
2609
+ filter: {
2610
+ Category: {
2611
+ Category_id: {
2612
+ _eq: id,
2351
2613
  },
2352
2614
  },
2353
2615
  },
2354
- sort: ['position:asc'],
2355
- populate: ['image', 'category', 'links', 'links.shop'],
2356
- pagination: {
2357
- page: 1,
2358
- pageSize: 100,
2359
- },
2616
+ meta: '*',
2617
+ page: page || 1,
2618
+ limit,
2360
2619
  }, {
2361
- encodeValuesOnly: true, // prettify url
2620
+ encodeValuesOnly: true,
2362
2621
  });
2363
- const fetchColorByNumber = (productId, colorNumber) => lib.stringify({
2364
- filters: {
2365
- $or: [
2366
- {
2367
- $and: [
2368
- {
2369
- number: {
2370
- $contains: colorNumber,
2371
- },
2372
- },
2373
- {
2374
- products: {
2375
- id: {
2376
- $eq: productId,
2377
- },
2378
- },
2379
- },
2380
- ],
2622
+ const fetchColorByNumber = (id, colorNumber) => lib.stringify({
2623
+ fields: ['*', 'Category.*'].join(','),
2624
+ filter: {
2625
+ Category: {
2626
+ Category_id: {
2627
+ _eq: id,
2381
2628
  },
2382
- {
2383
- $and: [
2384
- {
2385
- name: {
2386
- $contains: colorNumber,
2387
- },
2388
- },
2389
- {
2390
- products: {
2391
- id: {
2392
- $eq: productId,
2393
- },
2394
- },
2395
- },
2396
- ],
2397
- },
2398
- ],
2399
- },
2400
- sort: ['position:asc'],
2401
- populate: ['image', 'category', 'product', 'links', 'links.shop'],
2402
- pagination: {
2403
- page: 1,
2404
- pageSize: 100,
2629
+ },
2630
+ number: {
2631
+ _contains: colorNumber,
2632
+ },
2405
2633
  },
2634
+ meta: '*',
2406
2635
  }, {
2407
- encodeValuesOnly: true, // prettify url
2636
+ encodeValuesOnly: true,
2408
2637
  });
2409
2638
 
2410
2639
  const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:35px 40px;max-height:calc(100vh - 100px);overflow-y:auto}@media (max-width: 1024px){.my-modal{padding:80px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal>img{width:300px;object-fit:cover}@media (max-width: 768px){.my-modal>img{width:200px}}.my-modal__close{position:absolute;right:20px;top:20px;background:transparent;border:none}.my-modal__close>img{width:45px;height:45px;object-fit:cover;cursor:pointer}@media (max-width: 1024px){.my-modal__close{top:65px}}.my-modal__see-more{font-size:22px;margin-bottom:27px;display:flex;justify-content:center;align-items:center}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}@media (max-width: 1024px){.my-modal__wrapper .boxes__list{justify-content:center}}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content{margin:0 auto}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;text-transform:capitalize;margin-bottom:7px;color:#232323}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info .divider{margin:10px 0px}}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:row;justify-content:flex-start}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-image{margin:0 auto;margin-bottom:10px}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product>div{flex-direction:column}}.my-modal__wrapper .boxes__box-content__slider{width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}.my-modal .button,.my-modal a{background-color:#fff;font-size:16px;box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.1);border-radius:22.5px;padding:15px 30px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer}.my-modal .button:hover,.my-modal a:hover{color:#fff;background-color:#232323}.my-modal .button.inverse,.my-modal a.inverse{background-color:#232323;color:#fff}.my-modal .button.inverse:hover,.my-modal a.inverse:hover{color:#232323;background-color:#fff}@media (max-width: 1024px){.my-modal .button,.my-modal a{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.my-modal .button,.my-modal a{margin:0 auto}}.my-modal>.button{margin:10px auto}";
@@ -2412,6 +2641,7 @@ const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-m
2412
2641
  const MyModal = class {
2413
2642
  constructor(hostRef) {
2414
2643
  index$1.registerInstance(this, hostRef);
2644
+ this.clearSearchText = index$1.createEvent(this, "clearSearchText", 7);
2415
2645
  this.close = index$1.createEvent(this, "close", 7);
2416
2646
  this.readyToCLose = index$1.createEvent(this, "readyToCLose", 7);
2417
2647
  this.boxDesktopWidth = 130;
@@ -2467,10 +2697,18 @@ const MyModal = class {
2467
2697
  };
2468
2698
  this.fetchProductData = async () => {
2469
2699
  try {
2470
- const response = await ApiService.getData(`products?populate[0]=modalLogo&populate[1]=images&populate[2]=shops&populate[3]=categories&filters[name][$contains]=${this.product}`);
2471
- if (response) {
2472
- if (response.data[0].attributes.shops.data.find((shop) => shop.attributes.name === this.shop).id) {
2473
- this.data = Object.assign(Object.assign({}, response.data[0].attributes), { id: response.data[0].id });
2700
+ const shopResponse = await ApiService.getData(`items/Shop?filter[name][_eq]=${this.shop}`);
2701
+ const shop = shopResponse === null || shopResponse === void 0 ? void 0 : shopResponse.data[0];
2702
+ if (shop.id) {
2703
+ const response = await ApiService.getData(`items/Product?filter[name][_eq]=${this.product}&fields=*,images.*,Shop.*,Category.*.*.*.*`);
2704
+ const product = response === null || response === void 0 ? void 0 : response.data[0];
2705
+ if (product) {
2706
+ if (product.Shop.find((s) => s.Shop_id === shop.id)) {
2707
+ this.data = Object.assign(Object.assign({}, response.data[0]), { id: response.data[0].id });
2708
+ }
2709
+ else {
2710
+ return null;
2711
+ }
2474
2712
  }
2475
2713
  }
2476
2714
  }
@@ -2481,17 +2719,16 @@ const MyModal = class {
2481
2719
  this.preloader = false;
2482
2720
  }
2483
2721
  };
2484
- // TODO:
2485
2722
  this.fetchProductColors = async (id, page) => {
2486
2723
  this.loading = true;
2487
2724
  try {
2488
- const response = await ApiService.getData(`colors?${fetchProductColorsQuery(id, page)}`);
2725
+ const response = await ApiService.getData(`items/Color?${fetchProductColorsQuery(id, page)}`);
2489
2726
  if (response) {
2490
2727
  this.colors = {
2491
2728
  list: response &&
2492
2729
  response.data &&
2493
- response.data.map((item) => (Object.assign({ id: item.id }, item.attributes))),
2494
- pagination: response.meta.pagination,
2730
+ response.data.map((item) => (Object.assign({}, item))),
2731
+ pagination: response.meta,
2495
2732
  };
2496
2733
  }
2497
2734
  }
@@ -2502,16 +2739,16 @@ const MyModal = class {
2502
2739
  this.loading = false;
2503
2740
  }
2504
2741
  };
2505
- this.fetchCategoryColors = async (color) => {
2742
+ this.fetchCategoryColors = async (id, page) => {
2506
2743
  this.loading = true;
2507
2744
  try {
2508
- const response = await ApiService.getData(`colors?${fetchCategoryColorsQuery(color)}`);
2745
+ const response = await ApiService.getData(`items/Color?${fetchCategoryColorsQuery(id, page)}`);
2509
2746
  if (response) {
2510
2747
  this.colors = {
2511
2748
  list: response &&
2512
2749
  response.data &&
2513
- response.data.map((item) => (Object.assign({ id: item.id }, item.attributes))),
2514
- pagination: response.meta.pagination,
2750
+ response.data.map((item) => (Object.assign({}, item))),
2751
+ pagination: response.meta,
2515
2752
  };
2516
2753
  }
2517
2754
  }
@@ -2522,29 +2759,21 @@ const MyModal = class {
2522
2759
  this.loading = false;
2523
2760
  }
2524
2761
  };
2525
- // private onIntersection = async (entries: any) => {
2526
- // console.log(entries[0]);
2527
- // if (entries[0].intersectionRatio === 0) {
2528
- // console.log('d');
2529
- // }
2530
- // };
2531
- // private handleObserve = () => {
2532
- // console.log(this.modalEl.shadowRoot);
2533
- // const boxesList: any = (this.modalEl as any).querySelector('.my-modal__wrapper');
2534
- // console.log(boxesList);
2535
- // if (boxesList) {
2536
- // this.observer = new IntersectionObserver(this.onIntersection);
2537
- // this.observer.observe(boxesList);
2538
- // }
2539
- // };
2540
2762
  this.onPage = (page) => {
2541
- this.data && this.fetchProductColors(String(this.data.id), page);
2763
+ if (this.data) {
2764
+ if (this.selectedCategory) {
2765
+ this.fetchCategoryColors(this.selectedCategory, page);
2766
+ }
2767
+ else {
2768
+ this.fetchProductColors(String(this.data.id), page);
2769
+ }
2770
+ }
2542
2771
  this.page = page;
2543
2772
  this.currentColor = null;
2544
2773
  this.currentIndex = null;
2545
2774
  };
2546
2775
  this.handleCategoryClick = (color) => {
2547
- if (this.selectedCategory && color && this.selectedCategory.id === color.id && !this.showRange) {
2776
+ if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
2548
2777
  this.data && this.fetchProductColors(String(this.data.id));
2549
2778
  this.selectedCategory = null;
2550
2779
  }
@@ -2553,6 +2782,7 @@ const MyModal = class {
2553
2782
  this.selectedCategory = color;
2554
2783
  }
2555
2784
  this.currentColor = null;
2785
+ this.clearSearchText.emit();
2556
2786
  };
2557
2787
  this.shop = undefined;
2558
2788
  this.product = undefined;
@@ -2578,9 +2808,9 @@ const MyModal = class {
2578
2808
  this.infoBoxWidth = newValue * this.boxWidth;
2579
2809
  }
2580
2810
  watchPropHandler(newValue) {
2581
- if (newValue.categories.data.length > 0) {
2811
+ if (newValue.Category.length > 0) {
2582
2812
  this.showRange = true;
2583
- this.handleCategoryClick(newValue.categories.data[0]);
2813
+ this.handleCategoryClick(newValue.Category[0].Category_id.id);
2584
2814
  }
2585
2815
  else {
2586
2816
  this.fetchProductColors(String(newValue.id));
@@ -2604,21 +2834,23 @@ const MyModal = class {
2604
2834
  this.displayForMobile();
2605
2835
  }
2606
2836
  async searchColorsHandler(event) {
2607
- var _a;
2837
+ this.loading = true;
2838
+ this.currentColor = null;
2608
2839
  // if search is empty set to first category to not showing whole product colors
2609
2840
  if (event.detail === '') {
2610
- this.handleCategoryClick((_a = this.data) === null || _a === void 0 ? void 0 : _a.categories.data[0]);
2841
+ this.handleCategoryClick(this.selectedCategory);
2842
+ this.loading = true;
2611
2843
  }
2612
2844
  try {
2613
2845
  if (this.data && this.data.id && event.detail !== '') {
2614
- this.selectedCategory = null;
2615
- const response = await ApiService.getData(`colors?${fetchColorByNumber(Number(this.data.id), event.detail)}`);
2846
+ const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);
2616
2847
  if (response) {
2617
2848
  this.colors = {
2618
- list: response &&
2849
+ list: (response &&
2619
2850
  response.data &&
2620
- response.data.map((item) => (Object.assign({ id: item.id }, item.attributes))),
2621
- pagination: response.meta.pagination,
2851
+ response.data.map((item) => (Object.assign({}, item)))) ||
2852
+ [],
2853
+ pagination: response.meta,
2622
2854
  };
2623
2855
  }
2624
2856
  }
@@ -2626,6 +2858,9 @@ const MyModal = class {
2626
2858
  catch (error) {
2627
2859
  console.error(error);
2628
2860
  }
2861
+ finally {
2862
+ this.loading = false;
2863
+ }
2629
2864
  }
2630
2865
  componentWillLoad() {
2631
2866
  this.preloader = true;
@@ -2637,11 +2872,9 @@ const MyModal = class {
2637
2872
  this.colorTimer();
2638
2873
  }
2639
2874
  render() {
2640
- var _a, _b, _c, _d, _e, _f, _g;
2641
- return (index$1.h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (index$1.h("div", { class: 'loader' }, index$1.h("my-loader", null))), !this.preloader && (index$1.h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, index$1.h("img", { src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && index$1.h("img", { src: `${(_d = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.attributes) === null || _d === void 0 ? void 0 : _d.url}`, alt: "modal-logo" }), !this.preloader && (index$1.h("p", { class: "my-modal__see-more" }, (_e = this.data) === null || _e === void 0 ? void 0 : _e.modalDescription)), this.showRange && (index$1.h("div", { class: 'categories' }, this.data && index$1.h("my-search", { productId: Number((_f = this.data) === null || _f === void 0 ? void 0 : _f.id), isMobile: this.isMobile }), index$1.h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_g = this.data) === null || _g === void 0 ? void 0 : _g.categories.data.map((c) => {
2642
- var _a;
2643
- return (index$1.h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c), color: c.attributes.hex, name: c.attributes.name, shop: this.shop, product: this.product, isCategoryActive: ((_a = this.selectedCategory) === null || _a === void 0 ? void 0 : _a.id) === c.id }));
2644
- })), this.isMobile && (index$1.h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, index$1.h("span", null, "Przewi\u0144 w lewo"), index$1.h("span", null, "Przewi\u0144 w prawo"))))), index$1.h("div", { class: 'my-modal__wrapper' }, this.loading && index$1.h("my-loader", null), !this.loading && this.colors && (index$1.h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
2875
+ var _a, _b, _c, _d;
2876
+ console.log(this.colors);
2877
+ return (index$1.h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (index$1.h("div", { class: 'loader' }, index$1.h("my-loader", null))), !this.preloader && (index$1.h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, index$1.h("img", { src: index$1.getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && index$1.h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (index$1.h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription)), this.showRange && (index$1.h("div", { class: 'categories' }, this.data && index$1.h("my-search", { productId: Number((_c = this.data) === null || _c === void 0 ? void 0 : _c.id), isMobile: this.isMobile }), index$1.h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_d = this.data) === null || _d === void 0 ? void 0 : _d.Category.map((c) => (index$1.h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c.Category_id.id), color: c.Category_id.hex, name: c.Category_id.category_name, shop: this.shop, product: this.product, isCategoryActive: this.selectedCategory === c.Category_id.id })))), this.isMobile && (index$1.h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, index$1.h("span", null, "Przewi\u0144 w lewo"), index$1.h("span", null, "Przewi\u0144 w prawo"))))), index$1.h("div", { class: 'my-modal__wrapper' }, this.loading && index$1.h("my-loader", null), !this.loading && this.colors && (index$1.h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
2645
2878
  var _a;
2646
2879
  return (index$1.h("div", { key: index, class: "boxes" }, index$1.h("div", { class: "boxes__list" }, color.map((c) => {
2647
2880
  var _a;
@@ -2660,10 +2893,10 @@ const MyModal = class {
2660
2893
  ];
2661
2894
  }, color: c.hex, name: c.name, isActive: ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) === c.id, shop: this.shop, product: this.product }));
2662
2895
  })), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (index$1.h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth }))));
2663
- })) : (index$1.h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.pageCount > 1 && (index$1.h("div", { class: 'pagination' }, Array.from({ length: this.colors.pagination.pageCount }).map((page, i) => (index$1.h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
2896
+ })) : (index$1.h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.filter_count > limit && (index$1.h("div", { class: 'pagination' }, Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (index$1.h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
2664
2897
  e.preventDefault();
2665
2898
  this.onPage(i + 1);
2666
- }, key: `#${i + 1 + page}` }, i + 1)))))))), ' ', !this.preloader && this.isMobile && (index$1.h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
2899
+ }, key: `#${i + 1}` }, i + 1)))))))), !this.preloader && this.isMobile && (index$1.h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
2667
2900
  }
2668
2901
  static get assetsDirs() { return ["assets"]; }
2669
2902
  get modalEl() { return index$1.getElement(this); }
@@ -2676,6 +2909,17 @@ MyModal.style = myModalCss;
2676
2909
 
2677
2910
  const mySearchCss = ".pallete-wrapper.sc-my-search *.sc-my-search{font-family:\"Galatea\", sans-serif}.search.sc-my-search{position:relative;width:400px}@media (max-width: 768px){.search.sc-my-search{width:100%}}.search.sc-my-search input.sc-my-search{margin-bottom:12px;font-size:16px;padding:19px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%}.search.sc-my-search button.sc-my-search{position:absolute;border:none;background-color:transparent;right:-20px;top:0;width:50px;height:calc(100% - 12px);display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}";
2678
2911
 
2912
+ function debounce(func, wait) {
2913
+ let timeout;
2914
+ return function executedFunction(...args) {
2915
+ const later = () => {
2916
+ clearTimeout(timeout);
2917
+ func(...args);
2918
+ };
2919
+ clearTimeout(timeout);
2920
+ timeout = setTimeout(later, wait);
2921
+ };
2922
+ }
2679
2923
  const MySearch = class {
2680
2924
  constructor(hostRef) {
2681
2925
  index$1.registerInstance(this, hostRef);
@@ -2683,6 +2927,10 @@ const MySearch = class {
2683
2927
  this.fetchColorsByName = (text) => {
2684
2928
  this.searchColors.emit(text);
2685
2929
  };
2930
+ this.debouncedInputChangeValue = debounce((value) => {
2931
+ this.fetchColorsByName(value);
2932
+ this.searchText = value;
2933
+ }, 300);
2686
2934
  this.productId = undefined;
2687
2935
  this.isMobile = undefined;
2688
2936
  this.searchIcon = 'search.svg';
@@ -2690,12 +2938,14 @@ const MySearch = class {
2690
2938
  }
2691
2939
  onInputChangeValue(event) {
2692
2940
  const value = event.target.value;
2693
- this.searchColors.emit(value);
2694
- this.searchText = value;
2941
+ this.debouncedInputChangeValue(value);
2695
2942
  }
2696
2943
  fetchColorsByNameHandle(newValue) {
2697
2944
  this.fetchColorsByName(newValue);
2698
2945
  }
2946
+ clearSearchTextHandler() {
2947
+ this.searchText = null;
2948
+ }
2699
2949
  render() {
2700
2950
  return (index$1.h("div", { class: 'search' }, index$1.h("input", { placeholder: this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie bądź numerze', value: this.searchText || '', type: "text", onInput: this.onInputChangeValue.bind(this) }), index$1.h("button", { onClick: () => {
2701
2951
  this.searchText && this.fetchColorsByName(this.searchText);
@@ -7981,9 +8231,9 @@ const JcSwiper = class {
7981
8231
  render() {
7982
8232
  return (index$1.h("div", { class: "slider-wrapper" }, index$1.h("div", { class: "swiper mySwiper2" }, index$1.h("div", { class: "swiper-wrapper" }, this.slides &&
7983
8233
  this.slides.length > 0 &&
7984
- this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: slide.attributes.url, alt: "room_image" }))))), index$1.h("div", { onClick: this.colorInteraction, class: "swiper-button-next" }), index$1.h("div", { onClick: this.colorInteraction, class: "swiper-button-prev" })), index$1.h("div", { class: "swiper mySwiper" }, index$1.h("div", { class: "swiper-wrapper" }, this.slides &&
8234
+ this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: `${APIURL}/assets/${slide.directus_files_id}?access_token=${accessToken}`, alt: "room_image" }))))), index$1.h("div", { onClick: this.colorInteraction, class: "swiper-button-next" }), index$1.h("div", { onClick: this.colorInteraction, class: "swiper-button-prev" })), index$1.h("div", { class: "swiper mySwiper" }, index$1.h("div", { class: "swiper-wrapper" }, this.slides &&
7985
8235
  this.slides.length > 0 &&
7986
- this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: slide.attributes.url, alt: "room_image" }))))))));
8236
+ this.slides.map((slide) => (index$1.h("div", { key: slide.id, class: "swiper-slide" }, index$1.h("img", { src: `${APIURL}/assets/${slide.directus_files_id}?access_token=${accessToken}`, alt: "room_image" }))))))));
7987
8237
  }
7988
8238
  get modalEl() { return index$1.getElement(this); }
7989
8239
  };