@searchcraft/javascript-sdk 0.10.0 → 0.10.2

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 (84) hide show
  1. package/dist/components/defineCustomElements.js +2 -0
  2. package/dist/components/index.d.ts +348 -187
  3. package/dist/components/index.js +8 -29
  4. package/dist/components/index.js.map +1 -1
  5. package/dist/components/p-01589c0b.js +46 -0
  6. package/dist/components/p-01589c0b.js.map +1 -0
  7. package/dist/components/{p-8aa0fff5.js → p-0f5b47be.js} +17 -17
  8. package/dist/components/p-0f5b47be.js.map +1 -0
  9. package/dist/components/{p-3f63fa14.js → p-2999498a.js} +34 -22
  10. package/dist/components/p-2999498a.js.map +1 -0
  11. package/dist/components/{p-f8df3d49.js → p-3465cbc7.js} +578 -468
  12. package/dist/components/p-3465cbc7.js.map +1 -0
  13. package/dist/components/{p-e72d0167.js → p-435bec83.js} +3 -3
  14. package/dist/components/p-435bec83.js.map +1 -0
  15. package/dist/components/{p-39e70a00.js → p-48fa555e.js} +30 -4
  16. package/dist/components/p-48fa555e.js.map +1 -0
  17. package/dist/components/p-4d37616e.js +105 -0
  18. package/dist/components/p-4d37616e.js.map +1 -0
  19. package/dist/components/{p-c317a36a.js → p-66109c31.js} +7 -12
  20. package/dist/components/p-66109c31.js.map +1 -0
  21. package/dist/components/{p-d361b781.js → p-760c6845.js} +4 -4
  22. package/dist/components/{p-d361b781.js.map → p-760c6845.js.map} +1 -1
  23. package/dist/components/{p-bc9e0e40.js → p-7c650118.js} +4 -4
  24. package/dist/components/{p-bc9e0e40.js.map → p-7c650118.js.map} +1 -1
  25. package/dist/components/{p-34a32648.js → p-c1f43fe1.js} +4 -4
  26. package/dist/components/{p-34a32648.js.map → p-c1f43fe1.js.map} +1 -1
  27. package/dist/components/searchcraft-ad.js +1 -1
  28. package/dist/components/searchcraft-facet-list.js +1 -1
  29. package/dist/components/searchcraft-filter-panel.js +6 -6
  30. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  31. package/dist/components/searchcraft-input-form.js +1 -1
  32. package/dist/components/searchcraft-pagination.js +1 -1
  33. package/dist/components/searchcraft-pagination.js.map +1 -1
  34. package/dist/components/searchcraft-popover-button.js +97 -3
  35. package/dist/components/searchcraft-popover-button.js.map +1 -1
  36. package/dist/components/searchcraft-popover-footer.d.ts +11 -0
  37. package/dist/components/searchcraft-popover-footer.js +8 -0
  38. package/dist/components/searchcraft-popover-footer.js.map +1 -0
  39. package/dist/components/searchcraft-popover-form.js +34 -24
  40. package/dist/components/searchcraft-popover-form.js.map +1 -1
  41. package/dist/components/searchcraft-popover-list-item.js +1 -1
  42. package/dist/components/searchcraft-popover-list-view.js +1 -1
  43. package/dist/components/searchcraft-results-info.js +2 -9
  44. package/dist/components/searchcraft-results-info.js.map +1 -1
  45. package/dist/components/searchcraft-search-result.js +1 -1
  46. package/dist/components/searchcraft-search-results-per-page.js +1 -1
  47. package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
  48. package/dist/components/searchcraft-search-results.js +69 -32
  49. package/dist/components/searchcraft-search-results.js.map +1 -1
  50. package/dist/components/searchcraft-slider.js +1 -1
  51. package/dist/components/searchcraft-theme.js +2 -2
  52. package/dist/components/searchcraft-theme.js.map +1 -1
  53. package/dist/components/searchcraft-toggle-button.js +1 -1
  54. package/dist/hydrate/index.js +730 -445
  55. package/dist/hydrate/index.mjs +730 -445
  56. package/dist/themes/hologram.css +1 -0
  57. package/dist/themes/hologram.css.map +1 -0
  58. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +4 -3
  59. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +11 -6
  60. package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +4 -3
  61. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +49 -5
  62. package/dist/types/components/searchcraft-popover-footer/searchcraft-popover-footer.d.ts +13 -0
  63. package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +4 -3
  64. package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +3 -3
  65. package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +6 -10
  66. package/dist/types/components/searchcraft-search-result/searchcraft-search-result.d.ts +3 -0
  67. package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +15 -9
  68. package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +4 -3
  69. package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +4 -3
  70. package/dist/types/components.d.ts +239 -120
  71. package/dist/types/index.d.ts +0 -1
  72. package/dist/types/store/SearchcraftStore.types.d.ts +18 -6
  73. package/dist/types/utils/index.d.ts +0 -1
  74. package/dist/types/utils/units.d.ts +19 -6
  75. package/package.json +5 -4
  76. package/dist/components/p-39e70a00.js.map +0 -1
  77. package/dist/components/p-3f63fa14.js.map +0 -1
  78. package/dist/components/p-6104fe5d.js +0 -84
  79. package/dist/components/p-6104fe5d.js.map +0 -1
  80. package/dist/components/p-8aa0fff5.js.map +0 -1
  81. package/dist/components/p-c317a36a.js.map +0 -1
  82. package/dist/components/p-e72d0167.js.map +0 -1
  83. package/dist/components/p-f8df3d49.js.map +0 -1
  84. package/dist/types/utils/styles.d.ts +0 -3
@@ -1,15 +1,15 @@
1
- var B = Object.defineProperty;
2
- var q = (r, e, n) => e in r ? B(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
- var h = (r, e, n) => q(r, typeof e != "symbol" ? e + "" : e, n);
4
- var P = /* @__PURE__ */ ((r) => (r[r.DEBUG = 0] = "DEBUG", r[r.INFO = 1] = "INFO", r[r.WARN = 2] = "WARN", r[r.ERROR = 3] = "ERROR", r))(P || {});
5
- class ge {
1
+ var q = Object.defineProperty;
2
+ var B = (a, e, n) => e in a ? q(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
3
+ var h = (a, e, n) => B(a, typeof e != "symbol" ? e + "" : e, n);
4
+ var F = /* @__PURE__ */ ((a) => (a[a.DEBUG = 0] = "DEBUG", a[a.INFO = 1] = "INFO", a[a.WARN = 2] = "WARN", a[a.ERROR = 3] = "ERROR", a))(F || {});
5
+ class pe {
6
6
  constructor(e) {
7
7
  h(this, "logLevel");
8
8
  h(this, "logFormatter");
9
9
  this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
10
10
  }
11
11
  defaultFormatter(e, n) {
12
- return `[${P[e]}] ${( new Date()).toISOString()}: ${n}`;
12
+ return `[${F[e]}] ${( new Date()).toISOString()}: ${n}`;
13
13
  }
14
14
  debug(e) {
15
15
  this.logLevel <= 0 && console.log(this.logFormatter(0, e));
@@ -40,263 +40,263 @@ class ge {
40
40
  }
41
41
  }
42
42
  }
43
- function w(r, e, n, o) {
44
- return new (n || (n = Promise))(function(a, i) {
45
- function t(c) {
43
+ function y(a, e, n, r) {
44
+ return new (n || (n = Promise))(function(i, o) {
45
+ function t(s) {
46
46
  try {
47
- l(o.next(c));
48
- } catch (s) {
49
- i(s);
47
+ l(r.next(s));
48
+ } catch (c) {
49
+ o(c);
50
50
  }
51
51
  }
52
- function u(c) {
52
+ function u(s) {
53
53
  try {
54
- l(o.throw(c));
55
- } catch (s) {
56
- i(s);
54
+ l(r.throw(s));
55
+ } catch (c) {
56
+ o(c);
57
57
  }
58
58
  }
59
- function l(c) {
60
- var s;
61
- c.done ? a(c.value) : (s = c.value, s instanceof n ? s : new n(function(f) {
62
- f(s);
59
+ function l(s) {
60
+ var c;
61
+ s.done ? i(s.value) : (c = s.value, c instanceof n ? c : new n(function(p) {
62
+ p(c);
63
63
  })).then(t, u);
64
64
  }
65
- l((o = o.apply(r, [])).next());
65
+ l((r = r.apply(a, [])).next());
66
66
  });
67
67
  }
68
- function y(r, e) {
69
- var n, o, a, i, t = { label: 0, sent: function() {
70
- if (1 & a[0]) throw a[1];
71
- return a[1];
68
+ function w(a, e) {
69
+ var n, r, i, o, t = { label: 0, sent: function() {
70
+ if (1 & i[0]) throw i[1];
71
+ return i[1];
72
72
  }, trys: [], ops: [] };
73
- return i = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() {
73
+ return o = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() {
74
74
  return this;
75
- }), i;
75
+ }), o;
76
76
  function u(l) {
77
- return function(c) {
78
- return function(s) {
77
+ return function(s) {
78
+ return function(c) {
79
79
  if (n) throw new TypeError("Generator is already executing.");
80
- for (; i && (i = 0, s[0] && (t = 0)), t; ) try {
81
- if (n = 1, o && (a = 2 & s[0] ? o.return : s[0] ? o.throw || ((a = o.return) && a.call(o), 0) : o.next) && !(a = a.call(o, s[1])).done) return a;
82
- switch (o = 0, a && (s = [2 & s[0], a.value]), s[0]) {
80
+ for (; o && (o = 0, c[0] && (t = 0)), t; ) try {
81
+ if (n = 1, r && (i = 2 & c[0] ? r.return : c[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, c[1])).done) return i;
82
+ switch (r = 0, i && (c = [2 & c[0], i.value]), c[0]) {
83
83
  case 0:
84
84
  case 1:
85
- a = s;
85
+ i = c;
86
86
  break;
87
87
  case 4:
88
- return t.label++, { value: s[1], done: !1 };
88
+ return t.label++, { value: c[1], done: !1 };
89
89
  case 5:
90
- t.label++, o = s[1], s = [0];
90
+ t.label++, r = c[1], c = [0];
91
91
  continue;
92
92
  case 7:
93
- s = t.ops.pop(), t.trys.pop();
93
+ c = t.ops.pop(), t.trys.pop();
94
94
  continue;
95
95
  default:
96
- if (a = t.trys, !((a = a.length > 0 && a[a.length - 1]) || s[0] !== 6 && s[0] !== 2)) {
96
+ if (i = t.trys, !((i = i.length > 0 && i[i.length - 1]) || c[0] !== 6 && c[0] !== 2)) {
97
97
  t = 0;
98
98
  continue;
99
99
  }
100
- if (s[0] === 3 && (!a || s[1] > a[0] && s[1] < a[3])) {
101
- t.label = s[1];
100
+ if (c[0] === 3 && (!i || c[1] > i[0] && c[1] < i[3])) {
101
+ t.label = c[1];
102
102
  break;
103
103
  }
104
- if (s[0] === 6 && t.label < a[1]) {
105
- t.label = a[1], a = s;
104
+ if (c[0] === 6 && t.label < i[1]) {
105
+ t.label = i[1], i = c;
106
106
  break;
107
107
  }
108
- if (a && t.label < a[2]) {
109
- t.label = a[2], t.ops.push(s);
108
+ if (i && t.label < i[2]) {
109
+ t.label = i[2], t.ops.push(c);
110
110
  break;
111
111
  }
112
- a[2] && t.ops.pop(), t.trys.pop();
112
+ i[2] && t.ops.pop(), t.trys.pop();
113
113
  continue;
114
114
  }
115
- s = e.call(r, t);
116
- } catch (f) {
117
- s = [6, f], o = 0;
115
+ c = e.call(a, t);
116
+ } catch (p) {
117
+ c = [6, p], r = 0;
118
118
  } finally {
119
- n = a = 0;
119
+ n = i = 0;
120
120
  }
121
- if (5 & s[0]) throw s[1];
122
- return { value: s[0] ? s[1] : void 0, done: !0 };
123
- }([l, c]);
121
+ if (5 & c[0]) throw c[1];
122
+ return { value: c[0] ? c[1] : void 0, done: !0 };
123
+ }([l, s]);
124
124
  };
125
125
  }
126
126
  }
127
- var b = { exclude: [] }, D = {}, N = { timeout: "true" }, v = function(r, e) {
128
- typeof window < "u" && (D[r] = e);
127
+ var S = { exclude: [] }, O = {}, N = { timeout: "true" }, v = function(a, e) {
128
+ typeof window < "u" && (O[a] = e);
129
129
  }, j = function() {
130
- return Object.fromEntries(Object.entries(D).filter(function(r) {
131
- var e, n = r[0];
132
- return !(!((e = b == null ? void 0 : b.exclude) === null || e === void 0) && e.includes(n));
133
- }).map(function(r) {
134
- return [r[0], (0, r[1])()];
130
+ return Object.fromEntries(Object.entries(O).filter(function(a) {
131
+ var e, n = a[0];
132
+ return !(!((e = S == null ? void 0 : S.exclude) === null || e === void 0) && e.includes(n));
133
+ }).map(function(a) {
134
+ return [a[0], (0, a[1])()];
135
135
  }));
136
136
  };
137
- function C(r) {
138
- return r ^= r >>> 16, r = Math.imul(r, 2246822507), r ^= r >>> 13, r = Math.imul(r, 3266489909), (r ^= r >>> 16) >>> 0;
137
+ function C(a) {
138
+ return a ^= a >>> 16, a = Math.imul(a, 2246822507), a ^= a >>> 13, a = Math.imul(a, 3266489909), (a ^= a >>> 16) >>> 0;
139
139
  }
140
140
  var m = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
141
- function g(r, e) {
142
- return r << e | r >>> 32 - e;
141
+ function g(a, e) {
142
+ return a << e | a >>> 32 - e;
143
143
  }
144
- function M(r, e) {
144
+ function _(a, e) {
145
145
  var n;
146
- if (e === void 0 && (e = 0), e = e ? 0 | e : 0, typeof r == "string" && (n = r, r = new TextEncoder().encode(n).buffer), !(r instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
147
- var o = new Uint32Array([e, e, e, e]);
148
- ((function(i, t) {
149
- for (var u = i.byteLength / 16 | 0, l = new Uint32Array(i, 0, 4 * u), c = 0; c < u; c++) {
150
- var s = l.subarray(4 * c, 4 * (c + 1));
151
- s[0] = Math.imul(s[0], m[0]), s[0] = g(s[0], 15), s[0] = Math.imul(s[0], m[1]), t[0] = t[0] ^ s[0], t[0] = g(t[0], 19), t[0] = t[0] + t[1], t[0] = Math.imul(t[0], 5) + 1444728091, s[1] = Math.imul(s[1], m[1]), s[1] = g(s[1], 16), s[1] = Math.imul(s[1], m[2]), t[1] = t[1] ^ s[1], t[1] = g(t[1], 17), t[1] = t[1] + t[2], t[1] = Math.imul(t[1], 5) + 197830471, s[2] = Math.imul(s[2], m[2]), s[2] = g(s[2], 17), s[2] = Math.imul(s[2], m[3]), t[2] = t[2] ^ s[2], t[2] = g(t[2], 15), t[2] = t[2] + t[3], t[2] = Math.imul(t[2], 5) + 2530024501, s[3] = Math.imul(s[3], m[3]), s[3] = g(s[3], 18), s[3] = Math.imul(s[3], m[0]), t[3] = t[3] ^ s[3], t[3] = g(t[3], 13), t[3] = t[3] + t[0], t[3] = Math.imul(t[3], 5) + 850148119;
146
+ if (e === void 0 && (e = 0), e = e ? 0 | e : 0, typeof a == "string" && (n = a, a = new TextEncoder().encode(n).buffer), !(a instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
147
+ var r = new Uint32Array([e, e, e, e]);
148
+ ((function(o, t) {
149
+ for (var u = o.byteLength / 16 | 0, l = new Uint32Array(o, 0, 4 * u), s = 0; s < u; s++) {
150
+ var c = l.subarray(4 * s, 4 * (s + 1));
151
+ c[0] = Math.imul(c[0], m[0]), c[0] = g(c[0], 15), c[0] = Math.imul(c[0], m[1]), t[0] = t[0] ^ c[0], t[0] = g(t[0], 19), t[0] = t[0] + t[1], t[0] = Math.imul(t[0], 5) + 1444728091, c[1] = Math.imul(c[1], m[1]), c[1] = g(c[1], 16), c[1] = Math.imul(c[1], m[2]), t[1] = t[1] ^ c[1], t[1] = g(t[1], 17), t[1] = t[1] + t[2], t[1] = Math.imul(t[1], 5) + 197830471, c[2] = Math.imul(c[2], m[2]), c[2] = g(c[2], 17), c[2] = Math.imul(c[2], m[3]), t[2] = t[2] ^ c[2], t[2] = g(t[2], 15), t[2] = t[2] + t[3], t[2] = Math.imul(t[2], 5) + 2530024501, c[3] = Math.imul(c[3], m[3]), c[3] = g(c[3], 18), c[3] = Math.imul(c[3], m[0]), t[3] = t[3] ^ c[3], t[3] = g(t[3], 13), t[3] = t[3] + t[0], t[3] = Math.imul(t[3], 5) + 850148119;
152
152
  }
153
- }))(r, o), function(i, t) {
154
- var u = i.byteLength / 16 | 0, l = i.byteLength % 16, c = new Uint32Array(4), s = new Uint8Array(i, 16 * u, l);
153
+ }))(a, r), function(o, t) {
154
+ var u = o.byteLength / 16 | 0, l = o.byteLength % 16, s = new Uint32Array(4), c = new Uint8Array(o, 16 * u, l);
155
155
  switch (l) {
156
156
  case 15:
157
- c[3] = c[3] ^ s[14] << 16;
157
+ s[3] = s[3] ^ c[14] << 16;
158
158
  case 14:
159
- c[3] = c[3] ^ s[13] << 8;
159
+ s[3] = s[3] ^ c[13] << 8;
160
160
  case 13:
161
- c[3] = c[3] ^ s[12] << 0, c[3] = Math.imul(c[3], m[3]), c[3] = g(c[3], 18), c[3] = Math.imul(c[3], m[0]), t[3] = t[3] ^ c[3];
161
+ s[3] = s[3] ^ c[12] << 0, s[3] = Math.imul(s[3], m[3]), s[3] = g(s[3], 18), s[3] = Math.imul(s[3], m[0]), t[3] = t[3] ^ s[3];
162
162
  case 12:
163
- c[2] = c[2] ^ s[11] << 24;
163
+ s[2] = s[2] ^ c[11] << 24;
164
164
  case 11:
165
- c[2] = c[2] ^ s[10] << 16;
165
+ s[2] = s[2] ^ c[10] << 16;
166
166
  case 10:
167
- c[2] = c[2] ^ s[9] << 8;
167
+ s[2] = s[2] ^ c[9] << 8;
168
168
  case 9:
169
- c[2] = c[2] ^ s[8] << 0, c[2] = Math.imul(c[2], m[2]), c[2] = g(c[2], 17), c[2] = Math.imul(c[2], m[3]), t[2] = t[2] ^ c[2];
169
+ s[2] = s[2] ^ c[8] << 0, s[2] = Math.imul(s[2], m[2]), s[2] = g(s[2], 17), s[2] = Math.imul(s[2], m[3]), t[2] = t[2] ^ s[2];
170
170
  case 8:
171
- c[1] = c[1] ^ s[7] << 24;
171
+ s[1] = s[1] ^ c[7] << 24;
172
172
  case 7:
173
- c[1] = c[1] ^ s[6] << 16;
173
+ s[1] = s[1] ^ c[6] << 16;
174
174
  case 6:
175
- c[1] = c[1] ^ s[5] << 8;
175
+ s[1] = s[1] ^ c[5] << 8;
176
176
  case 5:
177
- c[1] = c[1] ^ s[4] << 0, c[1] = Math.imul(c[1], m[1]), c[1] = g(c[1], 16), c[1] = Math.imul(c[1], m[2]), t[1] = t[1] ^ c[1];
177
+ s[1] = s[1] ^ c[4] << 0, s[1] = Math.imul(s[1], m[1]), s[1] = g(s[1], 16), s[1] = Math.imul(s[1], m[2]), t[1] = t[1] ^ s[1];
178
178
  case 4:
179
- c[0] = c[0] ^ s[3] << 24;
179
+ s[0] = s[0] ^ c[3] << 24;
180
180
  case 3:
181
- c[0] = c[0] ^ s[2] << 16;
181
+ s[0] = s[0] ^ c[2] << 16;
182
182
  case 2:
183
- c[0] = c[0] ^ s[1] << 8;
183
+ s[0] = s[0] ^ c[1] << 8;
184
184
  case 1:
185
- c[0] = c[0] ^ s[0] << 0, c[0] = Math.imul(c[0], m[0]), c[0] = g(c[0], 15), c[0] = Math.imul(c[0], m[1]), t[0] = t[0] ^ c[0];
185
+ s[0] = s[0] ^ c[0] << 0, s[0] = Math.imul(s[0], m[0]), s[0] = g(s[0], 15), s[0] = Math.imul(s[0], m[1]), t[0] = t[0] ^ s[0];
186
186
  }
187
- }(r, o), function(i, t) {
188
- t[0] = t[0] ^ i.byteLength, t[1] = t[1] ^ i.byteLength, t[2] = t[2] ^ i.byteLength, t[3] = t[3] ^ i.byteLength, t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0, t[0] = C(t[0]), t[1] = C(t[1]), t[2] = C(t[2]), t[3] = C(t[3]), t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0;
189
- }(r, o);
190
- var a = new Uint8Array(o.buffer);
191
- return Array.from(a).map(function(i) {
192
- return i.toString(16).padStart(2, "0");
187
+ }(a, r), function(o, t) {
188
+ t[0] = t[0] ^ o.byteLength, t[1] = t[1] ^ o.byteLength, t[2] = t[2] ^ o.byteLength, t[3] = t[3] ^ o.byteLength, t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0, t[0] = C(t[0]), t[1] = C(t[1]), t[2] = C(t[2]), t[3] = C(t[3]), t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0;
189
+ }(a, r);
190
+ var i = new Uint8Array(r.buffer);
191
+ return Array.from(i).map(function(o) {
192
+ return o.toString(16).padStart(2, "0");
193
193
  }).join("");
194
194
  }
195
- function G(r, e) {
195
+ function G(a, e) {
196
196
  return new Promise(function(n) {
197
197
  setTimeout(function() {
198
198
  return n(e);
199
- }, r);
199
+ }, a);
200
200
  });
201
201
  }
202
- function V(r, e, n) {
203
- return Promise.all(r.map(function(o) {
204
- return Promise.race([o, G(e, n)]);
202
+ function W(a, e, n) {
203
+ return Promise.all(a.map(function(r) {
204
+ return Promise.race([r, G(e, n)]);
205
205
  }));
206
206
  }
207
- function W() {
208
- return w(this, void 0, void 0, function() {
209
- var r, e, n, o, a;
210
- return y(this, function(i) {
211
- switch (i.label) {
207
+ function V() {
208
+ return y(this, void 0, void 0, function() {
209
+ var a, e, n, r, i;
210
+ return w(this, function(o) {
211
+ switch (o.label) {
212
212
  case 0:
213
- return i.trys.push([0, 2, , 3]), r = j(), e = Object.keys(r), [4, V(Object.values(r), (b == null ? void 0 : b.timeout) || 1e3, N)];
213
+ return o.trys.push([0, 2, , 3]), a = j(), e = Object.keys(a), [4, W(Object.values(a), (S == null ? void 0 : S.timeout) || 1e3, N)];
214
214
  case 1:
215
- return n = i.sent(), o = n.filter(function(t) {
215
+ return n = o.sent(), r = n.filter(function(t) {
216
216
  return t !== void 0;
217
- }), a = {}, o.forEach(function(t, u) {
218
- a[e[u]] = t;
219
- }), [2, O(a, b.exclude || [])];
217
+ }), i = {}, r.forEach(function(t, u) {
218
+ i[e[u]] = t;
219
+ }), [2, D(i, S.exclude || [])];
220
220
  case 2:
221
- throw i.sent();
221
+ throw o.sent();
222
222
  case 3:
223
223
  return [2];
224
224
  }
225
225
  });
226
226
  });
227
227
  }
228
- function O(r, e) {
229
- var n = {}, o = function(i) {
230
- if (r.hasOwnProperty(i)) {
231
- var t = r[i];
232
- if (typeof t != "object" || Array.isArray(t)) e.includes(i) || (n[i] = t);
228
+ function D(a, e) {
229
+ var n = {}, r = function(o) {
230
+ if (a.hasOwnProperty(o)) {
231
+ var t = a[o];
232
+ if (typeof t != "object" || Array.isArray(t)) e.includes(o) || (n[o] = t);
233
233
  else {
234
- var u = O(t, e.map(function(l) {
235
- return l.startsWith(i + ".") ? l.slice(i.length + 1) : l;
234
+ var u = D(t, e.map(function(l) {
235
+ return l.startsWith(o + ".") ? l.slice(o.length + 1) : l;
236
236
  }));
237
- Object.keys(u).length > 0 && (n[i] = u);
237
+ Object.keys(u).length > 0 && (n[o] = u);
238
238
  }
239
239
  }
240
240
  };
241
- for (var a in r) o(a);
241
+ for (var i in a) r(i);
242
242
  return n;
243
243
  }
244
- function $(r) {
245
- return w(this, void 0, void 0, function() {
244
+ function $(a) {
245
+ return y(this, void 0, void 0, function() {
246
246
  var e, n;
247
- return y(this, function(o) {
248
- switch (o.label) {
247
+ return w(this, function(r) {
248
+ switch (r.label) {
249
249
  case 0:
250
- return o.trys.push([0, 2, , 3]), [4, W()];
250
+ return r.trys.push([0, 2, , 3]), [4, V()];
251
251
  case 1:
252
- return e = o.sent(), n = M(JSON.stringify(e)), [2, n.toString()];
252
+ return e = r.sent(), n = _(JSON.stringify(e)), [2, n.toString()];
253
253
  case 2:
254
- throw o.sent();
254
+ throw r.sent();
255
255
  case 3:
256
256
  return [2];
257
257
  }
258
258
  });
259
259
  });
260
260
  }
261
- function H(r) {
262
- for (var e = 0, n = 0; n < r.length; ++n) e += Math.abs(r[n]);
261
+ function z(a) {
262
+ for (var e = 0, n = 0; n < a.length; ++n) e += Math.abs(a[n]);
263
263
  return e;
264
264
  }
265
- function U(r, e, n) {
266
- for (var o = [], a = 0; a < r[0].data.length; a++) {
267
- for (var i = [], t = 0; t < r.length; t++) i.push(r[t].data[a]);
268
- o.push(Q(i));
265
+ function U(a, e, n) {
266
+ for (var r = [], i = 0; i < a[0].data.length; i++) {
267
+ for (var o = [], t = 0; t < a.length; t++) o.push(a[t].data[i]);
268
+ r.push(H(o));
269
269
  }
270
- var u = new Uint8ClampedArray(o);
270
+ var u = new Uint8ClampedArray(r);
271
271
  return new ImageData(u, e, n);
272
272
  }
273
- function Q(r) {
274
- if (r.length === 0) return 0;
275
- for (var e = {}, n = 0, o = r; n < o.length; n++)
276
- e[i = o[n]] = (e[i] || 0) + 1;
277
- var a = r[0];
278
- for (var i in e) e[i] > e[a] && (a = parseInt(i, 10));
279
- return a;
273
+ function H(a) {
274
+ if (a.length === 0) return 0;
275
+ for (var e = {}, n = 0, r = a; n < r.length; n++)
276
+ e[o = r[n]] = (e[o] || 0) + 1;
277
+ var i = a[0];
278
+ for (var o in e) e[o] > e[i] && (i = parseInt(o, 10));
279
+ return i;
280
280
  }
281
281
  function E() {
282
282
  if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
283
- for (var r = navigator.userAgent, e = { Edg: "Edge", OPR: "Opera" }, n = 0, o = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; n < o.length; n++) {
284
- var a = o[n], i = r.match(a);
285
- if (i && i.groups) return { name: e[i.groups.name] || i.groups.name, version: i.groups.version };
283
+ for (var a = navigator.userAgent, e = { Edg: "Edge", OPR: "Opera" }, n = 0, r = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; n < r.length; n++) {
284
+ var i = r[n], o = a.match(i);
285
+ if (o && o.groups) return { name: e[o.groups.name] || o.groups.name, version: o.groups.version };
286
286
  }
287
287
  return { name: "unknown", version: "unknown" };
288
288
  }
289
289
  v("audio", function() {
290
- return w(this, void 0, void 0, function() {
291
- return y(this, function(r) {
290
+ return y(this, void 0, void 0, function() {
291
+ return w(this, function(a) {
292
292
  return [2, new Promise(function(e, n) {
293
293
  try {
294
- var o = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), a = o.createBufferSource(), i = o.createOscillator();
295
- i.frequency.value = 1e3;
296
- var t, u = o.createDynamicsCompressor();
297
- u.threshold.value = -50, u.knee.value = 40, u.ratio.value = 12, u.attack.value = 0, u.release.value = 0.2, i.connect(u), u.connect(o.destination), i.start(), o.oncomplete = function(l) {
298
- t = l.renderedBuffer.getChannelData(0), e({ sampleHash: H(t), oscillator: i.type, maxChannels: o.destination.maxChannelCount, channelCountMode: a.channelCountMode });
299
- }, o.startRendering();
294
+ var r = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), i = r.createBufferSource(), o = r.createOscillator();
295
+ o.frequency.value = 1e3;
296
+ var t, u = r.createDynamicsCompressor();
297
+ u.threshold.value = -50, u.knee.value = 40, u.ratio.value = 12, u.attack.value = 0, u.release.value = 0.2, o.connect(u), u.connect(r.destination), o.start(), r.oncomplete = function(l) {
298
+ t = l.renderedBuffer.getChannelData(0), e({ sampleHash: z(t), oscillator: o.type, maxChannels: r.destination.maxChannelCount, channelCountMode: i.channelCountMode });
299
+ }, r.startRendering();
300
300
  } catch (l) {
301
301
  console.error("Error creating audio fingerprint:", l), n(l);
302
302
  }
@@ -304,123 +304,123 @@ v("audio", function() {
304
304
  });
305
305
  });
306
306
  });
307
- var z = E().name !== "SamsungBrowser" ? 1 : 3, x = 280, F = 20;
307
+ var Q = E().name !== "SamsungBrowser" ? 1 : 3, P = 280, x = 20;
308
308
  E().name != "Firefox" && v("canvas", function() {
309
- return document.createElement("canvas").getContext("2d"), new Promise(function(r) {
310
- var e = Array.from({ length: z }, function() {
309
+ return document.createElement("canvas").getContext("2d"), new Promise(function(a) {
310
+ var e = Array.from({ length: Q }, function() {
311
311
  return function() {
312
- var n = document.createElement("canvas"), o = n.getContext("2d");
313
- if (!o) return new ImageData(1, 1);
314
- n.width = x, n.height = F;
315
- var a = o.createLinearGradient(0, 0, n.width, n.height);
316
- a.addColorStop(0, "red"), a.addColorStop(0.16666666666666666, "orange"), a.addColorStop(0.3333333333333333, "yellow"), a.addColorStop(0.5, "green"), a.addColorStop(0.6666666666666666, "blue"), a.addColorStop(0.8333333333333334, "indigo"), a.addColorStop(1, "violet"), o.fillStyle = a, o.fillRect(0, 0, n.width, n.height);
317
- var i = "Random Text WMwmil10Oo";
318
- o.font = "23.123px Arial", o.fillStyle = "black", o.fillText(i, -5, 15), o.fillStyle = "rgba(0, 0, 255, 0.5)", o.fillText(i, -3.3, 17.7), o.beginPath(), o.moveTo(0, 0), o.lineTo(2 * n.width / 7, n.height), o.strokeStyle = "white", o.lineWidth = 2, o.stroke();
319
- var t = o.getImageData(0, 0, n.width, n.height);
312
+ var n = document.createElement("canvas"), r = n.getContext("2d");
313
+ if (!r) return new ImageData(1, 1);
314
+ n.width = P, n.height = x;
315
+ var i = r.createLinearGradient(0, 0, n.width, n.height);
316
+ i.addColorStop(0, "red"), i.addColorStop(0.16666666666666666, "orange"), i.addColorStop(0.3333333333333333, "yellow"), i.addColorStop(0.5, "green"), i.addColorStop(0.6666666666666666, "blue"), i.addColorStop(0.8333333333333334, "indigo"), i.addColorStop(1, "violet"), r.fillStyle = i, r.fillRect(0, 0, n.width, n.height);
317
+ var o = "Random Text WMwmil10Oo";
318
+ r.font = "23.123px Arial", r.fillStyle = "black", r.fillText(o, -5, 15), r.fillStyle = "rgba(0, 0, 255, 0.5)", r.fillText(o, -3.3, 17.7), r.beginPath(), r.moveTo(0, 0), r.lineTo(2 * n.width / 7, n.height), r.strokeStyle = "white", r.lineWidth = 2, r.stroke();
319
+ var t = r.getImageData(0, 0, n.width, n.height);
320
320
  return t;
321
321
  }();
322
322
  });
323
- r({ commonImageDataHash: M(U(e, x, F).data.toString()).toString() });
323
+ a({ commonImageDataHash: _(U(e, P, x).data.toString()).toString() });
324
324
  });
325
325
  });
326
- var T, K = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], Y = ["monospace", "sans-serif", "serif"];
327
- function k(r, e) {
328
- if (!r) throw new Error("Canvas context not supported");
329
- return r.font = "72px ".concat(e), r.measureText("WwMmLli0Oo").width;
326
+ var A, K = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], J = ["monospace", "sans-serif", "serif"];
327
+ function k(a, e) {
328
+ if (!a) throw new Error("Canvas context not supported");
329
+ return a.font = "72px ".concat(e), a.measureText("WwMmLli0Oo").width;
330
330
  }
331
- function J() {
332
- var r, e = document.createElement("canvas"), n = (r = e.getContext("webgl")) !== null && r !== void 0 ? r : e.getContext("experimental-webgl");
331
+ function X() {
332
+ var a, e = document.createElement("canvas"), n = (a = e.getContext("webgl")) !== null && a !== void 0 ? a : e.getContext("experimental-webgl");
333
333
  if (n && "getParameter" in n) try {
334
- var o = (n.getParameter(n.VENDOR) || "").toString(), a = (n.getParameter(n.RENDERER) || "").toString(), i = { vendor: o, renderer: a, version: (n.getParameter(n.VERSION) || "").toString(), shadingLanguageVersion: (n.getParameter(n.SHADING_LANGUAGE_VERSION) || "").toString() };
335
- if (!a.length || !o.length) {
334
+ var r = (n.getParameter(n.VENDOR) || "").toString(), i = (n.getParameter(n.RENDERER) || "").toString(), o = { vendor: r, renderer: i, version: (n.getParameter(n.VERSION) || "").toString(), shadingLanguageVersion: (n.getParameter(n.SHADING_LANGUAGE_VERSION) || "").toString() };
335
+ if (!i.length || !r.length) {
336
336
  var t = n.getExtension("WEBGL_debug_renderer_info");
337
337
  if (t) {
338
338
  var u = (n.getParameter(t.UNMASKED_VENDOR_WEBGL) || "").toString(), l = (n.getParameter(t.UNMASKED_RENDERER_WEBGL) || "").toString();
339
- u && (i.vendorUnmasked = u), l && (i.rendererUnmasked = l);
339
+ u && (o.vendorUnmasked = u), l && (o.rendererUnmasked = l);
340
340
  }
341
341
  }
342
- return i;
342
+ return o;
343
343
  } catch {
344
344
  }
345
345
  return "undefined";
346
346
  }
347
- function X() {
348
- var r = new Float32Array(1), e = new Uint8Array(r.buffer);
349
- return r[0] = 1 / 0, r[0] = r[0] - r[0], e[3];
347
+ function Y() {
348
+ var a = new Float32Array(1), e = new Uint8Array(a.buffer);
349
+ return a[0] = 1 / 0, a[0] = a[0] - a[0], e[3];
350
350
  }
351
- function Z(r, e) {
351
+ function Z(a, e) {
352
352
  var n = {};
353
- return e.forEach(function(o) {
354
- var a = function(i) {
355
- if (i.length === 0) return null;
353
+ return e.forEach(function(r) {
354
+ var i = function(o) {
355
+ if (o.length === 0) return null;
356
356
  var t = {};
357
- i.forEach(function(c) {
358
- var s = String(c);
359
- t[s] = (t[s] || 0) + 1;
357
+ o.forEach(function(s) {
358
+ var c = String(s);
359
+ t[c] = (t[c] || 0) + 1;
360
360
  });
361
- var u = i[0], l = 1;
362
- return Object.keys(t).forEach(function(c) {
363
- t[c] > l && (u = c, l = t[c]);
361
+ var u = o[0], l = 1;
362
+ return Object.keys(t).forEach(function(s) {
363
+ t[s] > l && (u = s, l = t[s]);
364
364
  }), u;
365
- }(r.map(function(i) {
366
- return o in i ? i[o] : void 0;
367
- }).filter(function(i) {
368
- return i !== void 0;
365
+ }(a.map(function(o) {
366
+ return r in o ? o[r] : void 0;
367
+ }).filter(function(o) {
368
+ return o !== void 0;
369
369
  }));
370
- a && (n[o] = a);
370
+ i && (n[r] = i);
371
371
  }), n;
372
372
  }
373
373
  function ee() {
374
- var r = [], e = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
374
+ var a = [], e = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
375
375
  return Object.keys(e).forEach(function(n) {
376
- e[n].forEach(function(o) {
377
- matchMedia("(".concat(n, ": ").concat(o, ")")).matches && r.push("".concat(n, ": ").concat(o));
376
+ e[n].forEach(function(r) {
377
+ matchMedia("(".concat(n, ": ").concat(r, ")")).matches && a.push("".concat(n, ": ").concat(r));
378
378
  });
379
- }), r;
379
+ }), a;
380
380
  }
381
381
  function te() {
382
382
  if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
383
- for (var r = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (r(e)) return e;
383
+ for (var a = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (a(e)) return e;
384
384
  } catch {
385
385
  return 0;
386
386
  }
387
387
  return 0;
388
388
  }
389
389
  E().name != "Firefox" && v("fonts", function() {
390
- var r = this;
390
+ var a = this;
391
391
  return new Promise(function(e, n) {
392
392
  try {
393
- (function(o) {
394
- var a;
395
- w(this, void 0, void 0, function() {
396
- var i, t, u;
397
- return y(this, function(l) {
393
+ (function(r) {
394
+ var i;
395
+ y(this, void 0, void 0, function() {
396
+ var o, t, u;
397
+ return w(this, function(l) {
398
398
  switch (l.label) {
399
399
  case 0:
400
- return document.body ? [3, 2] : [4, (c = 50, new Promise(function(f) {
401
- return setTimeout(f, c, s);
400
+ return document.body ? [3, 2] : [4, (s = 50, new Promise(function(p) {
401
+ return setTimeout(p, s, c);
402
402
  }))];
403
403
  case 1:
404
404
  return l.sent(), [3, 0];
405
405
  case 2:
406
- if ((i = document.createElement("iframe")).setAttribute("frameBorder", "0"), (t = i.style).setProperty("position", "fixed"), t.setProperty("display", "block", "important"), t.setProperty("visibility", "visible"), t.setProperty("border", "0"), t.setProperty("opacity", "0"), i.src = "about:blank", document.body.appendChild(i), !(u = i.contentDocument || ((a = i.contentWindow) === null || a === void 0 ? void 0 : a.document))) throw new Error("Iframe document is not accessible");
407
- return o({ iframe: u }), setTimeout(function() {
408
- document.body.removeChild(i);
406
+ if ((o = document.createElement("iframe")).setAttribute("frameBorder", "0"), (t = o.style).setProperty("position", "fixed"), t.setProperty("display", "block", "important"), t.setProperty("visibility", "visible"), t.setProperty("border", "0"), t.setProperty("opacity", "0"), o.src = "about:blank", document.body.appendChild(o), !(u = o.contentDocument || ((i = o.contentWindow) === null || i === void 0 ? void 0 : i.document))) throw new Error("Iframe document is not accessible");
407
+ return r({ iframe: u }), setTimeout(function() {
408
+ document.body.removeChild(o);
409
409
  }, 0), [2];
410
410
  }
411
- var c, s;
411
+ var s, c;
412
412
  });
413
413
  });
414
- })(function(o) {
415
- var a = o.iframe;
416
- return w(r, void 0, void 0, function() {
417
- var i, t, u, l;
418
- return y(this, function(c) {
419
- return i = a.createElement("canvas"), t = i.getContext("2d"), u = Y.map(function(s) {
420
- return k(t, s);
421
- }), l = {}, K.forEach(function(s) {
422
- var f = k(t, s);
423
- u.includes(f) || (l[s] = f);
414
+ })(function(r) {
415
+ var i = r.iframe;
416
+ return y(a, void 0, void 0, function() {
417
+ var o, t, u, l;
418
+ return w(this, function(s) {
419
+ return o = i.createElement("canvas"), t = o.getContext("2d"), u = J.map(function(c) {
420
+ return k(t, c);
421
+ }), l = {}, K.forEach(function(c) {
422
+ var p = k(t, c);
423
+ u.includes(p) || (l[c] = p);
424
424
  }), e(l), [2];
425
425
  });
426
426
  });
@@ -430,76 +430,76 @@ E().name != "Firefox" && v("fonts", function() {
430
430
  }
431
431
  });
432
432
  }), v("hardware", function() {
433
- return new Promise(function(r, e) {
434
- var n = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, o = window.performance && window.performance.memory ? window.performance.memory : 0;
435
- r({ videocard: J(), architecture: X(), deviceMemory: n.toString() || "undefined", jsHeapSizeLimit: o.jsHeapSizeLimit || 0 });
433
+ return new Promise(function(a, e) {
434
+ var n = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, r = window.performance && window.performance.memory ? window.performance.memory : 0;
435
+ a({ videocard: X(), architecture: Y(), deviceMemory: n.toString() || "undefined", jsHeapSizeLimit: r.jsHeapSizeLimit || 0 });
436
436
  });
437
437
  }), v("locales", function() {
438
- return new Promise(function(r) {
439
- r({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
438
+ return new Promise(function(a) {
439
+ a({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
440
440
  });
441
441
  }), v("permissions", function() {
442
- return w(this, void 0, void 0, function() {
443
- var r;
444
- return y(this, function(e) {
445
- return T = (b == null ? void 0 : b.permissions_to_check) || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], r = Array.from({ length: (b == null ? void 0 : b.retries) || 3 }, function() {
442
+ return y(this, void 0, void 0, function() {
443
+ var a;
444
+ return w(this, function(e) {
445
+ return A = (S == null ? void 0 : S.permissions_to_check) || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], a = Array.from({ length: (S == null ? void 0 : S.retries) || 3 }, function() {
446
446
  return function() {
447
- return w(this, void 0, void 0, function() {
448
- var n, o, a, i, t;
449
- return y(this, function(u) {
447
+ return y(this, void 0, void 0, function() {
448
+ var n, r, i, o, t;
449
+ return w(this, function(u) {
450
450
  switch (u.label) {
451
451
  case 0:
452
- n = {}, o = 0, a = T, u.label = 1;
452
+ n = {}, r = 0, i = A, u.label = 1;
453
453
  case 1:
454
- if (!(o < a.length)) return [3, 6];
455
- i = a[o], u.label = 2;
454
+ if (!(r < i.length)) return [3, 6];
455
+ o = i[r], u.label = 2;
456
456
  case 2:
457
- return u.trys.push([2, 4, , 5]), [4, navigator.permissions.query({ name: i })];
457
+ return u.trys.push([2, 4, , 5]), [4, navigator.permissions.query({ name: o })];
458
458
  case 3:
459
- return t = u.sent(), n[i] = t.state.toString(), [3, 5];
459
+ return t = u.sent(), n[o] = t.state.toString(), [3, 5];
460
460
  case 4:
461
461
  return u.sent(), [3, 5];
462
462
  case 5:
463
- return o++, [3, 1];
463
+ return r++, [3, 1];
464
464
  case 6:
465
465
  return [2, n];
466
466
  }
467
467
  });
468
468
  });
469
469
  }();
470
- }), [2, Promise.all(r).then(function(n) {
471
- return Z(n, T);
470
+ }), [2, Promise.all(a).then(function(n) {
471
+ return Z(n, A);
472
472
  })];
473
473
  });
474
474
  });
475
475
  }), v("plugins", function() {
476
- var r = [];
476
+ var a = [];
477
477
  if (navigator.plugins) for (var e = 0; e < navigator.plugins.length; e++) {
478
478
  var n = navigator.plugins[e];
479
- r.push([n.name, n.filename, n.description].join("|"));
479
+ a.push([n.name, n.filename, n.description].join("|"));
480
480
  }
481
- return new Promise(function(o) {
482
- o({ plugins: r });
481
+ return new Promise(function(r) {
482
+ r({ plugins: a });
483
483
  });
484
484
  }), v("screen", function() {
485
- return new Promise(function(r) {
486
- r({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: ee() });
485
+ return new Promise(function(a) {
486
+ a({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: ee() });
487
487
  });
488
488
  }), v("system", function() {
489
- return new Promise(function(r) {
489
+ return new Promise(function(a) {
490
490
  var e = E();
491
- r({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: te() });
491
+ a({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: te() });
492
492
  });
493
493
  });
494
- var p, ne = E().name !== "SamsungBrowser" ? 1 : 3, d = null;
494
+ var f, ne = E().name !== "SamsungBrowser" ? 1 : 3, d = null;
495
495
  v("webgl", function() {
496
- return w(this, void 0, void 0, function() {
497
- var r;
498
- return y(this, function(e) {
499
- typeof document < "u" && ((p = document.createElement("canvas")).width = 200, p.height = 100, d = p.getContext("webgl"));
496
+ return y(this, void 0, void 0, function() {
497
+ var a;
498
+ return w(this, function(e) {
499
+ typeof document < "u" && ((f = document.createElement("canvas")).width = 200, f.height = 100, d = f.getContext("webgl"));
500
500
  try {
501
501
  if (!d) throw new Error("WebGL not supported");
502
- return r = Array.from({ length: ne }, function() {
502
+ return a = Array.from({ length: ne }, function() {
503
503
  return function() {
504
504
  try {
505
505
  if (!d) throw new Error("WebGL not supported");
@@ -508,36 +508,36 @@ v("webgl", function() {
508
508
  void main() {
509
509
  gl_Position = vec4(position, 0.0, 1.0);
510
510
  }
511
- `, o = `
511
+ `, r = `
512
512
  precision mediump float;
513
513
  void main() {
514
514
  gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
515
515
  }
516
- `, a = d.createShader(d.VERTEX_SHADER), i = d.createShader(d.FRAGMENT_SHADER);
517
- if (!a || !i) throw new Error("Failed to create shaders");
518
- if (d.shaderSource(a, n), d.shaderSource(i, o), d.compileShader(a), !d.getShaderParameter(a, d.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + d.getShaderInfoLog(a));
519
- if (d.compileShader(i), !d.getShaderParameter(i, d.COMPILE_STATUS)) throw new Error("Fragment shader compilation failed: " + d.getShaderInfoLog(i));
516
+ `, i = d.createShader(d.VERTEX_SHADER), o = d.createShader(d.FRAGMENT_SHADER);
517
+ if (!i || !o) throw new Error("Failed to create shaders");
518
+ if (d.shaderSource(i, n), d.shaderSource(o, r), d.compileShader(i), !d.getShaderParameter(i, d.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + d.getShaderInfoLog(i));
519
+ if (d.compileShader(o), !d.getShaderParameter(o, d.COMPILE_STATUS)) throw new Error("Fragment shader compilation failed: " + d.getShaderInfoLog(o));
520
520
  var t = d.createProgram();
521
521
  if (!t) throw new Error("Failed to create shader program");
522
- if (d.attachShader(t, a), d.attachShader(t, i), d.linkProgram(t), !d.getProgramParameter(t, d.LINK_STATUS)) throw new Error("Shader program linking failed: " + d.getProgramInfoLog(t));
522
+ if (d.attachShader(t, i), d.attachShader(t, o), d.linkProgram(t), !d.getProgramParameter(t, d.LINK_STATUS)) throw new Error("Shader program linking failed: " + d.getProgramInfoLog(t));
523
523
  d.useProgram(t);
524
- for (var u = 137, l = new Float32Array(4 * u), c = 2 * Math.PI / u, s = 0; s < u; s++) {
525
- var f = s * c;
526
- l[4 * s] = 0, l[4 * s + 1] = 0, l[4 * s + 2] = Math.cos(f) * (p.width / 2), l[4 * s + 3] = Math.sin(f) * (p.height / 2);
524
+ for (var u = 137, l = new Float32Array(4 * u), s = 2 * Math.PI / u, c = 0; c < u; c++) {
525
+ var p = c * s;
526
+ l[4 * c] = 0, l[4 * c + 1] = 0, l[4 * c + 2] = Math.cos(p) * (f.width / 2), l[4 * c + 3] = Math.sin(p) * (f.height / 2);
527
527
  }
528
528
  var L = d.createBuffer();
529
529
  d.bindBuffer(d.ARRAY_BUFFER, L), d.bufferData(d.ARRAY_BUFFER, l, d.STATIC_DRAW);
530
530
  var I = d.getAttribLocation(t, "position");
531
- d.enableVertexAttribArray(I), d.vertexAttribPointer(I, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, p.width, p.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * u);
532
- var R = new Uint8ClampedArray(p.width * p.height * 4);
533
- return d.readPixels(0, 0, p.width, p.height, d.RGBA, d.UNSIGNED_BYTE, R), new ImageData(R, p.width, p.height);
531
+ d.enableVertexAttribArray(I), d.vertexAttribPointer(I, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, f.width, f.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * u);
532
+ var R = new Uint8ClampedArray(f.width * f.height * 4);
533
+ return d.readPixels(0, 0, f.width, f.height, d.RGBA, d.UNSIGNED_BYTE, R), new ImageData(R, f.width, f.height);
534
534
  } catch {
535
535
  return new ImageData(1, 1);
536
536
  } finally {
537
537
  d && (d.bindBuffer(d.ARRAY_BUFFER, null), d.useProgram(null), d.viewport(0, 0, d.drawingBufferWidth, d.drawingBufferHeight), d.clearColor(0, 0, 0, 0));
538
538
  }
539
539
  }();
540
- }), [2, { commonImageHash: M(U(r, p.width, p.height).data.toString()).toString() }];
540
+ }), [2, { commonImageHash: _(U(a, f.width, f.height).data.toString()).toString() }];
541
541
  } catch {
542
542
  return [2, { webgl: "unsupported" }];
543
543
  }
@@ -545,31 +545,31 @@ v("webgl", function() {
545
545
  });
546
546
  });
547
547
  });
548
- var S = function(r, e, n, o) {
549
- for (var a = (n - e) / o, i = 0, t = 0; t < o; t++)
550
- i += r(e + (t + 0.5) * a);
551
- return i * a;
548
+ var b = function(a, e, n, r) {
549
+ for (var i = (n - e) / r, o = 0, t = 0; t < r; t++)
550
+ o += a(e + (t + 0.5) * i);
551
+ return o * i;
552
552
  };
553
553
  v("math", function() {
554
- return w(void 0, void 0, void 0, function() {
555
- return y(this, function(r) {
556
- return [2, { acos: Math.acos(0.5), asin: S(Math.asin, -1, 1, 97), atan: S(Math.atan, -1, 1, 97), cos: S(Math.cos, 0, Math.PI, 97), cosh: Math.cosh(9 / 7), e: Math.E, largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), log: Math.log(1e3), pi: Math.PI, sin: S(Math.sin, -Math.PI, Math.PI, 97), sinh: S(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: S(Math.tan, 0, 2 * Math.PI, 97), tanh: S(Math.tanh, -9 / 7, 7 / 9, 97) }];
554
+ return y(void 0, void 0, void 0, function() {
555
+ return w(this, function(a) {
556
+ return [2, { acos: Math.acos(0.5), asin: b(Math.asin, -1, 1, 97), atan: b(Math.atan, -1, 1, 97), cos: b(Math.cos, 0, Math.PI, 97), cosh: Math.cosh(9 / 7), e: Math.E, largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), log: Math.log(1e3), pi: Math.PI, sin: b(Math.sin, -Math.PI, Math.PI, 97), sinh: b(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: b(Math.tan, 0, 2 * Math.PI, 97), tanh: b(Math.tanh, -9 / 7, 7 / 9, 97) }];
557
557
  });
558
558
  });
559
559
  });
560
560
  const re = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
561
- let A = (r = 21) => {
562
- let e = "", n = crypto.getRandomValues(new Uint8Array(r |= 0));
563
- for (; r--; )
564
- e += re[n[r] & 63];
561
+ let T = (a = 21) => {
562
+ let e = "", n = crypto.getRandomValues(new Uint8Array(a |= 0));
563
+ for (; a--; )
564
+ e += re[n[a] & 63];
565
565
  return e;
566
566
  };
567
- class _ {
567
+ class M {
568
568
  constructor(e) {
569
569
  h(this, "config");
570
570
  this.config = e;
571
571
  }
572
- async getAdsForSearchParams(e) {
572
+ async getAds(e) {
573
573
  return [];
574
574
  }
575
575
  async onQuerySubmitted(e) {
@@ -583,14 +583,14 @@ class _ {
583
583
  async onAdContainerViewed(e) {
584
584
  }
585
585
  }
586
- class oe extends _ {
586
+ class ae extends M {
587
587
  /**
588
588
  * Gets ads from the adMarketplace API based on the search term.
589
589
  */
590
- async getAdsForSearchParams(e) {
590
+ async getAds(e) {
591
591
  if (!this.config.admSub)
592
592
  return console.error("No admSub specified in config."), [];
593
- const o = `https://demofeed.is.ampfeed.com/is?${new URLSearchParams({
593
+ const r = `https://demofeed.is.ampfeed.com/is?${new URLSearchParams({
594
594
  partner: "demofeed",
595
595
  sub1: this.config.admSub,
596
596
  qt: e.searchTerm,
@@ -598,34 +598,34 @@ class oe extends _ {
598
598
  rfr: "searchcraft.io",
599
599
  "results-ta": `${this.config.admTextAdQuantity || 0}`,
600
600
  "results-pa": `${this.config.admProductAdQuantity || 0}`
601
- }).toString()}`, i = await (await fetch(o, { method: "GET" })).json(), t = i.product_ads.map(
602
- (c) => ({
603
- id: A(),
601
+ }).toString()}`, o = await (await fetch(r, { method: "GET" })).json(), t = o.product_ads.map(
602
+ (s) => ({
603
+ id: T(),
604
604
  adSource: "adMarketplace",
605
605
  admAdType: "adm-product-ad",
606
- admAd: c
606
+ admAd: s
607
607
  })
608
- ), u = i.text_ads.map((c) => ({
609
- id: A(),
608
+ ), u = o.text_ads.map((s) => ({
609
+ id: T(),
610
610
  adSource: "adMarketplace",
611
611
  admAdType: "adm-text-ad",
612
- admAd: c
612
+ admAd: s
613
613
  }));
614
614
  return t.concat(u);
615
615
  }
616
616
  async onAdContainerViewed(e) {
617
- var o;
617
+ var r;
618
618
  const n = e.adClientResponseItem;
619
- (o = n.admAd) != null && o.impression_url && fetch(n.admAd.impression_url);
619
+ (r = n.admAd) != null && r.impression_url && fetch(n.admAd.impression_url);
620
620
  }
621
621
  }
622
- class ie extends _ {
623
- async getAdsForSearchParams(e) {
622
+ class oe extends M {
623
+ async getAds(e) {
624
624
  return [];
625
625
  }
626
626
  }
627
- const ae = 1e3;
628
- class se extends _ {
627
+ const ie = 1e3;
628
+ class se extends M {
629
629
  constructor(n) {
630
630
  super(n);
631
631
  h(this, "adCallTimeout");
@@ -634,13 +634,13 @@ class se extends _ {
634
634
  async onQuerySubmitted(n) {
635
635
  this.addScriptTagToDocument();
636
636
  }
637
- async onQueryFetched(n, o) {
638
- var a;
639
- if ((((a = o.data.hits) == null ? void 0 : a.length) || 0) === 0) {
637
+ async onQueryFetched(n, r) {
638
+ var i;
639
+ if ((((i = r.data.hits) == null ? void 0 : i.length) || 0) === 0) {
640
640
  this.removeScriptTagFromDocument();
641
641
  return;
642
642
  }
643
- this.performAdCall(ae);
643
+ this.performAdCall(ie);
644
644
  }
645
645
  async onInputCleared() {
646
646
  this.removeScriptTagFromDocument();
@@ -650,12 +650,12 @@ class se extends _ {
650
650
  this.addScriptTagToDocument();
651
651
  try {
652
652
  PostRelease == null || PostRelease.Start({ ptd: [this.config.nativoPlacementId] });
653
- } catch (o) {
654
- console.error(o);
653
+ } catch (r) {
654
+ console.error(r);
655
655
  }
656
656
  }, n);
657
657
  }
658
- async getAdsForSearchParams(n) {
658
+ async getAds(n) {
659
659
  return [];
660
660
  }
661
661
  addScriptTagToDocument() {
@@ -669,9 +669,9 @@ class se extends _ {
669
669
  n && document.head.removeChild(n);
670
670
  }
671
671
  }
672
- const ce = 500;
672
+ const ce = 600;
673
673
  class ue {
674
- constructor(e, n, o) {
674
+ constructor(e, n, r) {
675
675
  h(this, "measureRequestTimeout");
676
676
  h(this, "measureRequestsBatched", []);
677
677
  h(this, "config");
@@ -685,8 +685,8 @@ class ue {
685
685
  * @param {Partial<MeasureRequestProperties>} properties - Additional properties to send with the event.
686
686
  * @param {Partial<MeasureRequestUser>} user - Additional user properites to send with the event.
687
687
  */
688
- h(this, "sendMeasureEvent", (e, n = {}, o = {}) => {
689
- const a = {
688
+ h(this, "sendMeasureEvent", async (e, n = {}, r = {}) => {
689
+ const i = {
690
690
  event_name: e,
691
691
  properties: {
692
692
  searchcraft_index_names: this.config.index,
@@ -695,11 +695,11 @@ class ue {
695
695
  },
696
696
  user: {
697
697
  ...this.measureRequestUser,
698
- ...o
698
+ ...r
699
699
  }
700
700
  };
701
- this.measureRequestsBatched.push(a), clearTimeout(this.measureRequestTimeout), this.measureRequestTimeout = setTimeout(async () => {
702
- const i = JSON.stringify({ items: this.measureRequestsBatched }), t = `${this.baseMeasureUrl}/batch`;
701
+ if (e === "document_clicked") {
702
+ const o = JSON.stringify(i), t = `${this.baseMeasureUrl}/event`;
703
703
  try {
704
704
  const u = await fetch(t, {
705
705
  method: "POST",
@@ -708,21 +708,41 @@ class ue {
708
708
  Authorization: this.config.readKey,
709
709
  "X-Sc-User-Id": this.userId
710
710
  },
711
- body: i,
711
+ body: o,
712
712
  keepalive: !0
713
713
  });
714
714
  if (!u.ok)
715
715
  throw new Error(
716
716
  `Failed to send request: ${u.status} ${u.statusText}`
717
717
  );
718
- this.measureRequestsBatched = [];
719
- return;
720
718
  } catch (u) {
721
719
  throw console.error("Error sending MeasureRequest:", u), u;
722
720
  }
723
- }, ce);
721
+ } else
722
+ this.measureRequestsBatched.push(i), clearTimeout(this.measureRequestTimeout), this.measureRequestTimeout = setTimeout(async () => {
723
+ const o = JSON.stringify({ items: this.measureRequestsBatched }), t = `${this.baseMeasureUrl}/batch`;
724
+ try {
725
+ const u = await fetch(t, {
726
+ method: "POST",
727
+ headers: {
728
+ "Content-Type": "application/json",
729
+ Authorization: this.config.readKey,
730
+ "X-Sc-User-Id": this.userId
731
+ },
732
+ body: o,
733
+ keepalive: !0
734
+ });
735
+ if (this.measureRequestsBatched = [], !u.ok)
736
+ throw new Error(
737
+ `Failed to send request: ${u.status} ${u.statusText}`
738
+ );
739
+ return;
740
+ } catch (u) {
741
+ throw this.measureRequestsBatched = [], console.error("Error sending MeasureRequest:", u), u;
742
+ }
743
+ }, ce);
724
744
  });
725
- this.config = e, this.sdkInfo = n, this.userId = o, this.sessionId = A(), this.sendMeasureEvent("sdk_initialized");
745
+ this.config = e, this.sdkInfo = n, this.userId = r, this.sessionId = T(), this.sendMeasureEvent("sdk_initialized");
726
746
  }
727
747
  /**
728
748
  * Getter for the base url used by the /measure endpoints.
@@ -745,106 +765,124 @@ class ue {
745
765
  };
746
766
  }
747
767
  }
748
- function de(r) {
749
- const e = [];
750
- let n = "should";
751
- return r.facetPathsForIndexFields && Object.keys(r.facetPathsForIndexFields).forEach((o) => {
752
- var i;
753
- const a = (i = r.facetPathsForIndexFields) == null ? void 0 : i[o];
754
- a && (n = "must", e.push({
755
- occur: n,
756
- exact: {
757
- ctx: a.value
758
- }
759
- }));
760
- }), r.rangeValueForIndexFields && Object.keys(r.rangeValueForIndexFields).forEach((o) => {
761
- var i;
762
- const a = (i = r.rangeValueForIndexFields) == null ? void 0 : i[o];
763
- a && (n = "must", e.push({
764
- occur: n,
765
- exact: {
766
- ctx: a.value
767
- }
768
- }));
769
- }), r.sort === "desc" ? r.order_by = "date_published" : r.order_by = "", e.push({
770
- occur: n,
771
- // Valid, as 'occur' is a required property in QueryItem
772
- [r.mode]: { ctx: r.searchTerm }
773
- // Ensure dynamic mode is inside queryType
774
- }), e;
775
- }
776
- const le = (r) => r.endsWith("/") ? r.slice(0, -1) : r, he = (r) => {
768
+ const de = (a) => a.endsWith("/") ? a.slice(0, -1) : a, le = (a) => {
777
769
  let e = "";
778
- if (e = r.trim(), e = e.replace(/[‘’“”]/g, (o) => ({
770
+ if (e = a.trim(), e = e.replace(/[‘’“”]/g, (r) => ({
779
771
  "‘": "'",
780
772
  "’": "'",
781
773
  "“": '"',
782
774
  "”": '"'
783
- })[o] || o), (e.match(/"/g) || []).length % 2 !== 0)
775
+ })[r] || r), (e.match(/"/g) || []).length % 2 !== 0)
784
776
  throw new Error(
785
777
  "The search term contains an uneven number of quote characters."
786
778
  );
787
779
  return e;
788
- };
789
- class fe {
790
- constructor(e, n, o) {
780
+ }, he = 500;
781
+ class me {
782
+ constructor(e, n, r) {
791
783
  h(this, "config");
792
784
  h(this, "userId");
793
785
  h(this, "parent");
786
+ h(this, "searchCompletedEventTimeout");
794
787
  /**
795
- * Performs a search operation.
796
- * @param {SearchParams} searchParams - The parameters for the search.
788
+ * Make the request to get the search results.
789
+ * @param {properties} properties - The properties for the search.
790
+ * @returns
797
791
  */
798
- h(this, "getSearchResponse", async (e) => {
799
- var o, a, i, t, u;
800
- const n = he(e.searchTerm);
801
- (o = this.parent.measureClient) == null || o.sendMeasureEvent("search_requested", {
802
- search_term: n
803
- }), this.parent.emitEvent("query_submitted", {
804
- name: "query_submitted",
805
- data: {
806
- searchTerm: n
807
- }
808
- }), (a = this.parent.adClient) == null || a.onQuerySubmitted(e);
792
+ h(this, "getSearchResponseItems", async (e) => {
793
+ var i, o, t, u, l;
794
+ let n;
795
+ const r = typeof e == "string" ? e : e.searchTerm;
796
+ try {
797
+ return (i = this.parent.measureClient) == null || i.sendMeasureEvent("search_requested", {
798
+ search_term: r
799
+ }), this.parent.emitEvent("query_submitted", {
800
+ name: "query_submitted",
801
+ data: {
802
+ searchTerm: r
803
+ }
804
+ }), (o = this.parent.adClient) == null || o.onQuerySubmitted(
805
+ typeof e == "string" ? { searchTerm: r, mode: "exact" } : e
806
+ ), typeof e == "string" ? n = await this.handleGetSearchResponseItemsWithString(e) : n = await this.handleGetSearchResponseItemsWithObject(e), (t = this.parent.measureClient) == null || t.sendMeasureEvent("search_response_received", {
807
+ search_term: r,
808
+ number_of_documents: n.data.count
809
+ }), clearTimeout(this.searchCompletedEventTimeout), this.searchCompletedEventTimeout = setTimeout(() => {
810
+ var s;
811
+ (s = this.parent.measureClient) == null || s.sendMeasureEvent("search_completed", {
812
+ search_term: r,
813
+ number_of_documents: n.data.count
814
+ });
815
+ }, he), this.parent.emitEvent("query_fetched", {
816
+ name: "query_fetched",
817
+ data: {
818
+ searchTerm: r
819
+ }
820
+ }), (((u = n.data.hits) == null ? void 0 : u.length) || 0) === 0 && this.parent.emitEvent("no_results_returned", {
821
+ name: "no_results_returned"
822
+ }), (l = this.parent.adClient) == null || l.onQueryFetched(
823
+ typeof e == "string" ? { searchTerm: r, mode: "exact" } : e,
824
+ n
825
+ ), n;
826
+ } catch (s) {
827
+ throw console.error("Error parsing response:", s), s;
828
+ }
829
+ });
830
+ h(this, "handleGetSearchResponseItemsWithString", async (e) => {
831
+ let n;
809
832
  try {
810
- const l = {
811
- query: de(e),
833
+ n = JSON.parse(e), n = {
834
+ limit: this.config.searchResultsPerPage,
835
+ order_by: this.config.indexFieldName,
836
+ ...n
837
+ };
838
+ } catch {
839
+ throw new Error("Error: Query string is not valid json.");
840
+ }
841
+ const r = await fetch(this.baseSearchUrl, {
842
+ method: "POST",
843
+ headers: {
844
+ Authorization: this.config.readKey,
845
+ "Content-Type": "application/json",
846
+ "X-Sc-User-Id": this.userId
847
+ },
848
+ body: JSON.stringify(n)
849
+ });
850
+ if (!r.ok)
851
+ throw new Error(
852
+ `Error: ${r.statusText} (Status: ${r.status})`
853
+ );
854
+ return await r.json();
855
+ });
856
+ h(this, "handleGetSearchResponseItemsWithObject", async (e) => {
857
+ try {
858
+ const n = {
859
+ query: this.formatParamsForRequest(e),
812
860
  offset: e.offset || 0,
813
861
  // Default to 0 (first page) if not provided
814
- limit: e.limit || this.config.searchResultsPerPage || 20
862
+ limit: e.limit || this.config.searchResultsPerPage || 20,
815
863
  // Default to 20 if not provided
864
+ order_by: e.order_by || this.config.indexFieldName
816
865
  };
817
- e.order_by && (l.order_by = e.order_by, l.sort = e.sort === "desc" || e.sort === "asc" ? e.sort : "asc");
818
- const c = {
866
+ n.order_by && (n.sort = e.sort === "desc" || e.sort === "asc" ? e.sort : "asc");
867
+ const r = await fetch(this.baseSearchUrl, {
819
868
  method: "POST",
820
869
  headers: {
821
870
  Authorization: this.config.readKey,
822
871
  "Content-Type": "application/json",
823
872
  "X-Sc-User-Id": this.userId
824
873
  },
825
- body: JSON.stringify(l)
826
- }, s = await fetch(this.baseSearchUrl, c);
827
- if (!s.ok)
874
+ body: JSON.stringify(n)
875
+ });
876
+ if (!r.ok)
828
877
  throw new Error(
829
- `Error: ${s.statusText} (Status: ${s.status})`
878
+ `Error: ${r.statusText} (Status: ${r.status})`
830
879
  );
831
- const f = await s.json();
832
- return (i = this.parent.measureClient) == null || i.sendMeasureEvent("search_response_received", {
833
- search_term: n,
834
- number_of_documents: f.data.count
835
- }), this.parent.emitEvent("query_fetched", {
836
- name: "query_fetched",
837
- data: {
838
- searchTerm: n
839
- }
840
- }), (((t = f.data.hits) == null ? void 0 : t.length) || 0) === 0 && this.parent.emitEvent("no_results_returned", {
841
- name: "no_results_returned"
842
- }), (u = this.parent.adClient) == null || u.onQueryFetched(e, f), f;
843
- } catch (l) {
844
- throw console.error("Error parsing response:", l), l;
880
+ return await r.json();
881
+ } catch (n) {
882
+ throw console.error("Error parsing response:", n), n;
845
883
  }
846
884
  });
847
- this.parent = e, this.config = n, this.userId = o;
885
+ this.parent = e, this.config = n, this.userId = r;
848
886
  }
849
887
  /**
850
888
  * Getter for the base url used by the /search endpoint.
@@ -852,6 +890,40 @@ class fe {
852
890
  get baseSearchUrl() {
853
891
  return `${this.config.endpointURL}/index/${this.config.index.join(",")}/search`;
854
892
  }
893
+ /**
894
+ * Builds a query object for the SearchClient request.
895
+ * @param {properties} properties - The properties for the search.
896
+ * @returns {SearchClientQuery} - A properly formatted SearchClient query object.
897
+ */
898
+ formatParamsForRequest(e) {
899
+ const n = [];
900
+ let r = "should";
901
+ e.facetPathsForIndexFields && Object.keys(e.facetPathsForIndexFields).forEach((o) => {
902
+ var u;
903
+ const t = (u = e.facetPathsForIndexFields) == null ? void 0 : u[o];
904
+ t && (r = "must", n.push({
905
+ occur: r,
906
+ exact: {
907
+ ctx: le(t.value)
908
+ }
909
+ }));
910
+ }), e.rangeValueForIndexFields && Object.keys(e.rangeValueForIndexFields).forEach((o) => {
911
+ var u;
912
+ const t = (u = e.rangeValueForIndexFields) == null ? void 0 : u[o];
913
+ t && (r = "must", n.push({
914
+ occur: r,
915
+ exact: {
916
+ ctx: t.value
917
+ }
918
+ }));
919
+ });
920
+ const i = e.mode === "fuzzy" ? { fuzzy: { ctx: e.searchTerm } } : { exact: { ctx: e.searchTerm } };
921
+ return n.push({
922
+ occur: r,
923
+ // Valid, as 'occur' is a required property in SearchClientQuery
924
+ ...i
925
+ }), n;
926
+ }
855
927
  }
856
928
  class ve {
857
929
  constructor(e, n) {
@@ -862,33 +934,30 @@ class ve {
862
934
  h(this, "userId");
863
935
  h(this, "requestTimeout");
864
936
  h(this, "subscriptionEvents", {});
865
- /**
866
- * Gets items from the SearchClient and the AdClient.
867
- */
868
- h(this, "getItems", (e, n, o) => {
869
- const a = async () => {
937
+ h(this, "getResponseItems", (e, n, r) => {
938
+ const i = async () => {
870
939
  (async () => {
871
940
  var u, l;
872
- const i = await ((u = this == null ? void 0 : this.searchClient) == null ? void 0 : u.getSearchResponse(e));
873
- if (!i)
941
+ const o = await ((u = this == null ? void 0 : this.searchClient) == null ? void 0 : u.getSearchResponseItems(e));
942
+ if (!o)
874
943
  throw new Error("Search client was not initialized.");
875
- const t = (l = i.data.hits || []) == null ? void 0 : l.map((c) => c.doc).filter((c) => !!c).map((c) => ({
944
+ const t = (l = o.data.hits || []) == null ? void 0 : l.map((s) => s.doc).filter((s) => !!s).map((s) => ({
876
945
  type: "SearchDocument",
877
- id: A(),
878
- document: c
946
+ id: T(),
947
+ document: s
879
948
  }));
880
- n(i, t);
949
+ n(o, t);
881
950
  })(), (async () => {
882
- if (this.adClient) {
883
- const i = await this.adClient.getAdsForSearchParams(e);
884
- o(i);
951
+ if (this.adClient && typeof e != "string") {
952
+ const o = await this.adClient.getAds(e);
953
+ r(o);
885
954
  }
886
955
  })();
887
956
  };
888
957
  clearTimeout(this.requestTimeout), this.config.searchDebounceDelay ? this.requestTimeout = setTimeout(
889
- a,
958
+ i,
890
959
  this.config.searchDebounceDelay
891
- ) : a();
960
+ ) : i();
892
961
  });
893
962
  if (!e.endpointURL || !e.index || !e.readKey)
894
963
  throw new Error(
@@ -897,7 +966,7 @@ class ve {
897
966
  this.config = {
898
967
  ...e,
899
968
  // Strips off the trailing '/' from an endpointURL if one is accidentally added
900
- endpointURL: le(e.endpointURL)
969
+ endpointURL: de(e.endpointURL)
901
970
  }, this.userId = "", typeof window < "u" && typeof customElements < "u" && n.sdkName === "@searchcraft/javascript-sdk" && globalThis.__scDefineCustomElements__ && globalThis.__scDefineCustomElements__(), typeof window < "u" && (this.initClients(this.config, n), this.initInputForms(), this.startObservingMutations());
902
971
  }
903
972
  initInputForms() {
@@ -914,42 +983,45 @@ class ve {
914
983
  * When changes happen in the DOM, we want to link any input forms found to the instance of the core.
915
984
  */
916
985
  startObservingMutations() {
917
- new MutationObserver((n, o) => {
918
- let a = !1;
919
- for (const i of n)
920
- i.type === "childList" && i.addedNodes.forEach((t) => {
921
- t.nodeType === 1 && t.className.toLowerCase() === "searchcraft-input-form" && (a = !0);
986
+ new MutationObserver((n, r) => {
987
+ let i = !1;
988
+ for (const o of n)
989
+ o.type === "childList" && o.addedNodes.forEach((t) => {
990
+ t.nodeType === 1 && (t.getAttribute("class") || "").toLowerCase() === "searchcraft-input-form" && (i = !0);
922
991
  });
923
- a && this.initInputForms();
992
+ i && this.initInputForms();
924
993
  }).observe(document.body, { childList: !0, subtree: !0 });
925
994
  }
926
995
  initClients(e, n) {
927
996
  setTimeout(async () => {
928
- let o = this.config.userId;
929
- switch (o || (o = await $()), this.measureClient = new ue(e, n, o), this.searchClient = new fe(this, e, o), e.adSource) {
997
+ let r = this.config.userId;
998
+ switch (r || (r = await $()), this.measureClient = new ue(e, n, r), this.searchClient = new me(this, e, r), e.adSource) {
930
999
  case "adMarketplace":
931
- this.adClient = new oe(e);
1000
+ this.adClient = new ae(e);
932
1001
  break;
933
1002
  case "Nativo":
934
1003
  this.adClient = new se(e);
935
1004
  break;
936
1005
  case "Custom":
937
- this.adClient = new ie(e);
1006
+ this.adClient = new oe(e);
938
1007
  break;
939
1008
  }
1009
+ this.emitEvent("initialized", {
1010
+ name: "initialized"
1011
+ });
940
1012
  }, 300);
941
1013
  }
942
1014
  emitEvent(e, n) {
943
- var o;
944
- (o = this.subscriptionEvents[e]) == null || o.forEach((a) => {
945
- a(n);
1015
+ var r;
1016
+ (r = this.subscriptionEvents[e]) == null || r.forEach((i) => {
1017
+ i(n);
946
1018
  });
947
1019
  }
948
1020
  subscribe(e, n) {
949
1021
  return this.subscriptionEvents[e] || (this.subscriptionEvents[e] = []), this.subscriptionEvents[e].push(
950
1022
  n
951
1023
  ), () => {
952
- this.subscriptionEvents[e] = this.subscriptionEvents[e].filter((o) => o !== n);
1024
+ this.subscriptionEvents[e] = this.subscriptionEvents[e].filter((r) => r !== n);
953
1025
  };
954
1026
  }
955
1027
  /**
@@ -1615,12 +1687,16 @@ Object.keys(react).forEach(function (k) {
1615
1687
  const initialSearchcraftStateValues = {
1616
1688
  adClientResponseItems: [],
1617
1689
  core: undefined,
1690
+ hotkey: 'k',
1691
+ hotkeyModifier: 'meta',
1618
1692
  logger: undefined,
1619
1693
  facetPathsForIndexFields: {},
1694
+ initialQuery: '',
1695
+ initialSearchClientResponseItems: [],
1620
1696
  isPopoverVisible: false,
1621
1697
  isSearchInProgress: false,
1622
- searchTerm: '',
1623
1698
  rangeValueForIndexFields: {},
1699
+ searchTerm: '',
1624
1700
  searchMode: 'fuzzy',
1625
1701
  searchClientResponseItems: [],
1626
1702
  searchResponseTimeTaken: undefined,
@@ -1629,37 +1705,47 @@ const initialSearchcraftStateValues = {
1629
1705
  searchResultsPerPage: 20,
1630
1706
  searchResultsPage: 1,
1631
1707
  sortType: 'asc',
1708
+ // Callbacks
1709
+ afterInit: () => { },
1632
1710
  };
1633
- const searchcraftStore = zustand.createStore((set, get) => {
1711
+ const searchcraftStore = zustand.createStore((_set, get) => {
1634
1712
  const functions = {
1635
- addFacetPathsForIndexField: (data) => set((state) => ({
1713
+ set: (state) => {
1714
+ _set(state);
1715
+ return get();
1716
+ },
1717
+ addFacetPathsForIndexField: (facetPaths) => functions.set((state) => ({
1636
1718
  facetPathsForIndexFields: {
1637
1719
  ...state.facetPathsForIndexFields,
1638
- [data.fieldName]: data,
1720
+ [facetPaths.fieldName]: facetPaths,
1639
1721
  },
1640
1722
  })),
1641
- addRangeValueForIndexField: (data) => set((state) => ({
1723
+ addRangeValueForIndexField: (rangeValue) => functions.set((state) => ({
1642
1724
  rangeValueForIndexFields: {
1643
1725
  ...state.rangeValueForIndexFields,
1644
- [data.fieldName]: data,
1726
+ [rangeValue.fieldName]: rangeValue,
1645
1727
  },
1646
1728
  })),
1647
- getSearchcraftInstance: () => {
1729
+ getSearchcraftCore: () => {
1648
1730
  const { core } = get();
1649
1731
  return core;
1650
1732
  },
1651
- initialize: (searchcraftInstance, debug = false) => {
1652
- const core = searchcraftInstance;
1733
+ init: (core, debug = false) => {
1653
1734
  const logger = debug
1654
- ? new ge({ logLevel: P.DEBUG })
1735
+ ? new pe({ logLevel: F.DEBUG })
1655
1736
  : undefined;
1656
- set({
1737
+ const state = functions.set({
1657
1738
  core,
1658
1739
  logger,
1659
- searchResultsPerPage: core.config.searchResultsPerPage || 20,
1740
+ searchResultsPerPage: core?.config.searchResultsPerPage || 20,
1741
+ });
1742
+ core?.subscribe('initialized', () => {
1743
+ if (state.afterInit) {
1744
+ state.afterInit(state);
1745
+ }
1660
1746
  });
1661
1747
  },
1662
- removeFacetPathsForIndexField: (fieldName) => set((state) => {
1748
+ removeFacetPathsForIndexField: (fieldName) => functions.set((state) => {
1663
1749
  const currentPaths = state.facetPathsForIndexFields;
1664
1750
  delete currentPaths[fieldName];
1665
1751
  return {
@@ -1668,7 +1754,7 @@ const searchcraftStore = zustand.createStore((set, get) => {
1668
1754
  },
1669
1755
  };
1670
1756
  }),
1671
- removeRangeValueForIndexField: (fieldName) => set((state) => {
1757
+ removeRangeValueForIndexField: (fieldName) => functions.set((state) => {
1672
1758
  const currentValues = state.rangeValueForIndexFields;
1673
1759
  delete currentValues[fieldName];
1674
1760
  return {
@@ -1678,19 +1764,19 @@ const searchcraftStore = zustand.createStore((set, get) => {
1678
1764
  };
1679
1765
  }),
1680
1766
  resetFacetPaths: () => {
1681
- set({
1767
+ functions.set({
1682
1768
  facetPathsForIndexFields: {},
1683
1769
  });
1684
1770
  },
1685
1771
  search: async () => {
1686
1772
  const state = get();
1687
- state.logger?.log(P.INFO, `Starting search with search term: "${state.searchTerm}"`);
1773
+ state.logger?.log(F.INFO, `Starting search with search term: "${state.searchTerm}"`);
1688
1774
  if (!state.core) {
1689
1775
  throw new Error('Searchcraft instance is not initialized.');
1690
1776
  }
1691
1777
  if (!state.searchTerm.trim()) {
1692
- state.logger?.log(P.INFO, 'No search request was made: search term was empty.');
1693
- set({
1778
+ state.logger?.log(F.INFO, 'No search request was made: search term was empty.');
1779
+ functions.set({
1694
1780
  searchClientResponseItems: [],
1695
1781
  searchResultsCount: 0,
1696
1782
  searchResultsPage: 1,
@@ -1698,32 +1784,8 @@ const searchcraftStore = zustand.createStore((set, get) => {
1698
1784
  });
1699
1785
  return;
1700
1786
  }
1701
- set({ isSearchInProgress: true });
1702
- const handleSearchcraftResponse = (response, items) => {
1703
- const facetsFromResponse = response.data.facets;
1704
- set((state) => {
1705
- return {
1706
- isSearchInProgress: false,
1707
- searchClientResponseItems: items,
1708
- searchResponseTimeTaken: response.data.time_taken || 0,
1709
- searchResultsPage:
1710
- // reset to first page when response count changes
1711
- response.data.count === state.searchResultsCount
1712
- ? state.searchResultsPage
1713
- : 1,
1714
- searchResultsCount: response.data.count || 0,
1715
- };
1716
- });
1717
- if (facetsFromResponse) {
1718
- set({ searchResponseFacetPrime: facetsFromResponse });
1719
- }
1720
- state.logger?.log(P.DEBUG, `Search results: ${JSON.stringify(items)}`);
1721
- state.logger?.log(P.DEBUG, `Facets from response: ${JSON.stringify(facetsFromResponse)}`);
1722
- };
1723
- const handleAdResponse = (adClientResponseItems) => {
1724
- set({ adClientResponseItems });
1725
- };
1726
- state.core.getItems({
1787
+ functions.set({ isSearchInProgress: true });
1788
+ state.core.getResponseItems({
1727
1789
  searchTerm: state.searchTerm,
1728
1790
  mode: state.searchMode,
1729
1791
  sort: state.sortType,
@@ -1733,15 +1795,55 @@ const searchcraftStore = zustand.createStore((set, get) => {
1733
1795
  ? state.searchResultsPerPage * (state.searchResultsPage - 1)
1734
1796
  : 0,
1735
1797
  limit: state.searchResultsPerPage,
1736
- }, handleSearchcraftResponse, handleAdResponse);
1798
+ }, functions.setSearchClientResponseItemsFromResponse, functions.setAdClientResponseItems);
1737
1799
  },
1738
- setPopoverVisibility: (isVisible) => {
1739
- set({
1740
- isPopoverVisible: isVisible,
1800
+ setAdClientResponseItems: (items) => functions.set({ adClientResponseItems: items }),
1801
+ setSearchClientResponseItemsFromResponse: (response, items) => {
1802
+ const { facets, count = 0, time_taken = 0 } = response.data;
1803
+ const state = functions.set((state) => {
1804
+ return {
1805
+ isSearchInProgress: false,
1806
+ searchClientResponseItems: items,
1807
+ searchResponseTimeTaken: time_taken,
1808
+ searchResultsPage:
1809
+ // Reset to first page when response count changes
1810
+ count === state.searchResultsCount ? state.searchResultsPage : 1,
1811
+ searchResultsCount: count,
1812
+ ...(facets && { searchResponseFacetPrime: facets }),
1813
+ };
1741
1814
  });
1815
+ state.logger?.log(F.DEBUG, `Search results: ${JSON.stringify(items)}`);
1816
+ state.logger?.log(F.DEBUG, `Facets from response: ${JSON.stringify(facets)}`);
1742
1817
  },
1743
- setSearchMode: (mode) => set({ searchMode: mode }),
1744
- setSortType: (type) => set({ sortType: type }),
1818
+ setInitialSearchClientResponseItemsFromResponse: (response, items) => {
1819
+ const state = get();
1820
+ const { count = 0, time_taken = 0 } = response.data;
1821
+ functions.set((state) => {
1822
+ return {
1823
+ isSearchInProgress: false,
1824
+ initialSearchClientResponseItems: items,
1825
+ searchResponseTimeTaken: time_taken,
1826
+ searchResultsPage:
1827
+ // Reset to first page when response count changes
1828
+ count === state.searchResultsCount ? state.searchResultsPage : 1,
1829
+ searchResultsCount: count,
1830
+ };
1831
+ });
1832
+ state.logger?.log(F.DEBUG, `Search results: ${JSON.stringify(items)}`);
1833
+ },
1834
+ setInitialQuery: async (query) => {
1835
+ const state = functions.set({ initialQuery: query });
1836
+ state.logger?.log(F.INFO, `Starting search with query: "${state.initialQuery}"`);
1837
+ if (!state.core) {
1838
+ throw new Error('Searchcraft instance is not initialized.');
1839
+ }
1840
+ await state.core.getResponseItems(query, functions.setInitialSearchClientResponseItemsFromResponse, functions.setAdClientResponseItems);
1841
+ },
1842
+ setPopoverVisibility: (isVisible) => functions.set({
1843
+ isPopoverVisible: isVisible,
1844
+ }),
1845
+ setSearchMode: (mode) => functions.set({ searchMode: mode }),
1846
+ setSortType: (type) => functions.set({ sortType: type }),
1745
1847
  setSearchTerm: (searchTerm) => {
1746
1848
  const { core } = get();
1747
1849
  if (searchTerm.length === 0) {
@@ -1750,7 +1852,7 @@ const searchcraftStore = zustand.createStore((set, get) => {
1750
1852
  /**
1751
1853
  * When a new searchTerm is set, also reset the sort type, search mode, and facet paths.
1752
1854
  */
1753
- set({
1855
+ functions.set({
1754
1856
  searchTerm,
1755
1857
  facetPathsForIndexFields: {},
1756
1858
  ...(searchTerm.trim().length === 0 && {
@@ -1759,15 +1861,23 @@ const searchcraftStore = zustand.createStore((set, get) => {
1759
1861
  }),
1760
1862
  });
1761
1863
  },
1762
- setSearchClientResponseItems: (items) => set({ searchClientResponseItems: items }),
1864
+ setSearchClientResponseItems: (items) => functions.set({ searchClientResponseItems: items }),
1865
+ setSearchResultsCount: (count) => functions.set({ searchResultsCount: count }),
1763
1866
  setSearchResultsPage: async (page) => {
1764
- set({ searchResultsPage: page });
1867
+ functions.set({ searchResultsPage: page });
1765
1868
  await functions.search();
1766
1869
  },
1767
1870
  setSearchResultsPerPage: async (perPage) => {
1768
- set({ searchResultsPerPage: perPage });
1871
+ functions.set({ searchResultsPerPage: perPage });
1769
1872
  await functions.search();
1770
1873
  },
1874
+ setHotKeyAndHotKeyModifier: (hotkey, hotkeyModifier) => {
1875
+ const { hotkey: initialHotkey, hotkeyModifier: initialHotkeyModifier } = initialSearchcraftStateValues;
1876
+ functions.set({
1877
+ hotkey: hotkey || initialHotkey,
1878
+ hotkeyModifier: hotkeyModifier || initialHotkeyModifier,
1879
+ });
1880
+ },
1771
1881
  };
1772
1882
  const stateObject = {
1773
1883
  ...initialSearchcraftStateValues,
@@ -1778,4 +1888,4 @@ const searchcraftStore = zustand.createStore((set, get) => {
1778
1888
 
1779
1889
  export { searchcraftStore as s, ve as v };
1780
1890
 
1781
- //# sourceMappingURL=p-f8df3d49.js.map
1891
+ //# sourceMappingURL=p-3465cbc7.js.map