@searchcraft/javascript-sdk 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/bundled.types.d.ts +83 -10
  2. package/dist/components/index.js +5 -5
  3. package/dist/components/{p-7777d986.js → p-0bbc3aff.js} +2 -2
  4. package/dist/components/{p-7777d986.js.map → p-0bbc3aff.js.map} +1 -1
  5. package/dist/components/{p-05872320.js → p-10b0d0dc.js} +50 -23
  6. package/dist/components/p-10b0d0dc.js.map +1 -0
  7. package/dist/components/{p-6d8b0ead.js → p-2e293015.js} +539 -441
  8. package/dist/components/p-2e293015.js.map +1 -0
  9. package/dist/components/{p-3568414f.js → p-44e6ed36.js} +2 -2
  10. package/dist/components/{p-3568414f.js.map → p-44e6ed36.js.map} +1 -1
  11. package/dist/components/{p-b0bc5cee.js → p-94837dcb.js} +36 -4
  12. package/dist/components/p-94837dcb.js.map +1 -0
  13. package/dist/components/{p-cd9ba361.js → p-9bdcb929.js} +2 -2
  14. package/dist/components/{p-cd9ba361.js.map → p-9bdcb929.js.map} +1 -1
  15. package/dist/components/{p-11b05b94.js → p-bb9e9d7d.js} +2 -2
  16. package/dist/components/{p-11b05b94.js.map → p-bb9e9d7d.js.map} +1 -1
  17. package/dist/components/{p-5bd5c3cb.js → p-c1c14447.js} +7 -10
  18. package/dist/components/p-c1c14447.js.map +1 -0
  19. package/dist/components/searchcraft-ad.js +1 -1
  20. package/dist/components/searchcraft-base-search-result.js +1 -1
  21. package/dist/components/searchcraft-base-search-results.js +39 -6
  22. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  23. package/dist/components/searchcraft-facet-list.js +1 -1
  24. package/dist/components/searchcraft-filter-panel.js +3 -3
  25. package/dist/components/searchcraft-input-form.js +1 -1
  26. package/dist/components/searchcraft-pagination.js +1 -1
  27. package/dist/components/searchcraft-popover-button.js +1 -1
  28. package/dist/components/searchcraft-popover-form.js +5 -5
  29. package/dist/components/searchcraft-popover-list-item.js +1 -1
  30. package/dist/components/searchcraft-popover-list-view.js +1 -1
  31. package/dist/components/searchcraft-results-info.js +1 -1
  32. package/dist/components/searchcraft-search-results-per-page.js +1 -1
  33. package/dist/components/searchcraft-toggle-button.js +1 -1
  34. package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +6 -2
  35. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +2 -1
  36. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +1 -4
  37. package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +1 -0
  38. package/dist/types/components.d.ts +0 -8
  39. package/package.json +3 -3
  40. package/dist/components/p-05872320.js.map +0 -1
  41. package/dist/components/p-5bd5c3cb.js.map +0 -1
  42. package/dist/components/p-6d8b0ead.js.map +0 -1
  43. package/dist/components/p-b0bc5cee.js.map +0 -1
@@ -1,255 +1,255 @@
1
- var L = Object.defineProperty;
2
- var q = (n, t, r) => t in n ? L(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
3
- var h = (n, t, r) => q(n, typeof t != "symbol" ? t + "" : t, r);
4
- var F = /* @__PURE__ */ ((n) => (n[n.DEBUG = 0] = "DEBUG", n[n.INFO = 1] = "INFO", n[n.WARN = 2] = "WARN", n[n.ERROR = 3] = "ERROR", n))(F || {});
5
- class pe {
6
- constructor(t) {
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 ve {
6
+ constructor(e) {
7
7
  h(this, "logLevel");
8
8
  h(this, "logFormatter");
9
- this.logLevel = t.logLevel || 1, this.logFormatter = t.logFormatter || this.defaultFormatter;
9
+ this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
10
10
  }
11
- defaultFormatter(t, r) {
12
- return `[${F[t]}] ${( new Date()).toISOString()}: ${r}`;
11
+ defaultFormatter(e, n) {
12
+ return `[${P[e]}] ${( new Date()).toISOString()}: ${n}`;
13
13
  }
14
- debug(t) {
15
- this.logLevel <= 0 && console.log(this.logFormatter(0, t));
14
+ debug(e) {
15
+ this.logLevel <= 0 && console.log(this.logFormatter(0, e));
16
16
  }
17
- info(t) {
18
- this.logLevel <= 1 && console.info(this.logFormatter(1, t));
17
+ info(e) {
18
+ this.logLevel <= 1 && console.info(this.logFormatter(1, e));
19
19
  }
20
- warn(t) {
21
- this.logLevel <= 2 && console.warn(this.logFormatter(2, t));
20
+ warn(e) {
21
+ this.logLevel <= 2 && console.warn(this.logFormatter(2, e));
22
22
  }
23
- error(t) {
24
- this.logLevel <= 3 && console.error(this.logFormatter(3, t));
23
+ error(e) {
24
+ this.logLevel <= 3 && console.error(this.logFormatter(3, e));
25
25
  }
26
- log(t, r) {
27
- switch (t) {
26
+ log(e, n) {
27
+ switch (e) {
28
28
  case 0:
29
- this.debug(r);
29
+ this.debug(n);
30
30
  break;
31
31
  case 1:
32
- this.info(r);
32
+ this.info(n);
33
33
  break;
34
34
  case 2:
35
- this.warn(r);
35
+ this.warn(n);
36
36
  break;
37
37
  case 3:
38
- this.error(r);
38
+ this.error(n);
39
39
  break;
40
40
  }
41
41
  }
42
42
  }
43
- function w(n, t, r, o) {
44
- return new (r || (r = Promise))(function(a, i) {
45
- function e(u) {
43
+ function w(r, e, n, o) {
44
+ return new (n || (n = Promise))(function(i, a) {
45
+ function t(c) {
46
46
  try {
47
- l(o.next(u));
47
+ l(o.next(c));
48
48
  } catch (s) {
49
- i(s);
49
+ a(s);
50
50
  }
51
51
  }
52
- function c(u) {
52
+ function u(c) {
53
53
  try {
54
- l(o.throw(u));
54
+ l(o.throw(c));
55
55
  } catch (s) {
56
- i(s);
56
+ a(s);
57
57
  }
58
58
  }
59
- function l(u) {
59
+ function l(c) {
60
60
  var s;
61
- u.done ? a(u.value) : (s = u.value, s instanceof r ? s : new r(function(g) {
62
- g(s);
63
- })).then(e, c);
61
+ c.done ? i(c.value) : (s = c.value, s instanceof n ? s : new n(function(f) {
62
+ f(s);
63
+ })).then(t, u);
64
64
  }
65
- l((o = o.apply(n, [])).next());
65
+ l((o = o.apply(r, [])).next());
66
66
  });
67
67
  }
68
- function y(n, t) {
69
- var r, o, a, i, e = { label: 0, sent: function() {
70
- if (1 & a[0]) throw a[1];
71
- return a[1];
68
+ function y(r, e) {
69
+ var n, o, i, a, 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: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (i[Symbol.iterator] = function() {
73
+ return a = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
74
74
  return this;
75
- }), i;
76
- function c(l) {
77
- return function(u) {
75
+ }), a;
76
+ function u(l) {
77
+ return function(c) {
78
78
  return function(s) {
79
- if (r) throw new TypeError("Generator is already executing.");
80
- for (; i && (i = 0, s[0] && (e = 0)), e; ) try {
81
- if (r = 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]) {
79
+ if (n) throw new TypeError("Generator is already executing.");
80
+ for (; a && (a = 0, s[0] && (t = 0)), t; ) try {
81
+ if (n = 1, o && (i = 2 & s[0] ? o.return : s[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, s[1])).done) return i;
82
+ switch (o = 0, i && (s = [2 & s[0], i.value]), s[0]) {
83
83
  case 0:
84
84
  case 1:
85
- a = s;
85
+ i = s;
86
86
  break;
87
87
  case 4:
88
- return e.label++, { value: s[1], done: !1 };
88
+ return t.label++, { value: s[1], done: !1 };
89
89
  case 5:
90
- e.label++, o = s[1], s = [0];
90
+ t.label++, o = s[1], s = [0];
91
91
  continue;
92
92
  case 7:
93
- s = e.ops.pop(), e.trys.pop();
93
+ s = t.ops.pop(), t.trys.pop();
94
94
  continue;
95
95
  default:
96
- if (a = e.trys, !((a = a.length > 0 && a[a.length - 1]) || s[0] !== 6 && s[0] !== 2)) {
97
- e = 0;
96
+ if (i = t.trys, !((i = i.length > 0 && i[i.length - 1]) || s[0] !== 6 && s[0] !== 2)) {
97
+ t = 0;
98
98
  continue;
99
99
  }
100
- if (s[0] === 3 && (!a || s[1] > a[0] && s[1] < a[3])) {
101
- e.label = s[1];
100
+ if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
101
+ t.label = s[1];
102
102
  break;
103
103
  }
104
- if (s[0] === 6 && e.label < a[1]) {
105
- e.label = a[1], a = s;
104
+ if (s[0] === 6 && t.label < i[1]) {
105
+ t.label = i[1], i = s;
106
106
  break;
107
107
  }
108
- if (a && e.label < a[2]) {
109
- e.label = a[2], e.ops.push(s);
108
+ if (i && t.label < i[2]) {
109
+ t.label = i[2], t.ops.push(s);
110
110
  break;
111
111
  }
112
- a[2] && e.ops.pop(), e.trys.pop();
112
+ i[2] && t.ops.pop(), t.trys.pop();
113
113
  continue;
114
114
  }
115
- s = t.call(n, e);
116
- } catch (g) {
117
- s = [6, g], o = 0;
115
+ s = e.call(r, t);
116
+ } catch (f) {
117
+ s = [6, f], o = 0;
118
118
  } finally {
119
- r = a = 0;
119
+ n = i = 0;
120
120
  }
121
121
  if (5 & s[0]) throw s[1];
122
122
  return { value: s[0] ? s[1] : void 0, done: !0 };
123
- }([l, u]);
123
+ }([l, c]);
124
124
  };
125
125
  }
126
126
  }
127
- var b = { exclude: [] }, O = {}, N = { timeout: "true" }, v = function(n, t) {
128
- typeof window < "u" && (O[n] = t);
127
+ var b = { exclude: [] }, D = {}, N = { timeout: "true" }, v = function(r, e) {
128
+ typeof window < "u" && (D[r] = e);
129
129
  }, j = function() {
130
- return Object.fromEntries(Object.entries(O).filter(function(n) {
131
- var t, r = n[0];
132
- return !(!((t = b == null ? void 0 : b.exclude) === null || t === void 0) && t.includes(r));
133
- }).map(function(n) {
134
- return [n[0], (0, n[1])()];
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])()];
135
135
  }));
136
136
  };
137
- function M(n) {
138
- return n ^= n >>> 16, n = Math.imul(n, 2246822507), n ^= n >>> 13, n = Math.imul(n, 3266489909), (n ^= n >>> 16) >>> 0;
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;
139
139
  }
140
- var f = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
141
- function p(n, t) {
142
- return n << t | n >>> 32 - t;
140
+ var m = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
141
+ function g(r, e) {
142
+ return r << e | r >>> 32 - e;
143
143
  }
144
- function I(n, t) {
145
- var r;
146
- if (t === void 0 && (t = 0), t = t ? 0 | t : 0, typeof n == "string" && (r = n, n = new TextEncoder().encode(r).buffer), !(n instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
147
- var o = new Uint32Array([t, t, t, t]);
148
- ((function(i, e) {
149
- for (var c = i.byteLength / 16 | 0, l = new Uint32Array(i, 0, 4 * c), u = 0; u < c; u++) {
150
- var s = l.subarray(4 * u, 4 * (u + 1));
151
- s[0] = Math.imul(s[0], f[0]), s[0] = p(s[0], 15), s[0] = Math.imul(s[0], f[1]), e[0] = e[0] ^ s[0], e[0] = p(e[0], 19), e[0] = e[0] + e[1], e[0] = Math.imul(e[0], 5) + 1444728091, s[1] = Math.imul(s[1], f[1]), s[1] = p(s[1], 16), s[1] = Math.imul(s[1], f[2]), e[1] = e[1] ^ s[1], e[1] = p(e[1], 17), e[1] = e[1] + e[2], e[1] = Math.imul(e[1], 5) + 197830471, s[2] = Math.imul(s[2], f[2]), s[2] = p(s[2], 17), s[2] = Math.imul(s[2], f[3]), e[2] = e[2] ^ s[2], e[2] = p(e[2], 15), e[2] = e[2] + e[3], e[2] = Math.imul(e[2], 5) + 2530024501, s[3] = Math.imul(s[3], f[3]), s[3] = p(s[3], 18), s[3] = Math.imul(s[3], f[0]), e[3] = e[3] ^ s[3], e[3] = p(e[3], 13), e[3] = e[3] + e[0], e[3] = Math.imul(e[3], 5) + 850148119;
144
+ function M(r, e) {
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(a, t) {
149
+ for (var u = a.byteLength / 16 | 0, l = new Uint32Array(a, 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;
152
152
  }
153
- }))(n, o), function(i, e) {
154
- var c = i.byteLength / 16 | 0, l = i.byteLength % 16, u = new Uint32Array(4), s = new Uint8Array(i, 16 * c, l);
153
+ }))(r, o), function(a, t) {
154
+ var u = a.byteLength / 16 | 0, l = a.byteLength % 16, c = new Uint32Array(4), s = new Uint8Array(a, 16 * u, l);
155
155
  switch (l) {
156
156
  case 15:
157
- u[3] = u[3] ^ s[14] << 16;
157
+ c[3] = c[3] ^ s[14] << 16;
158
158
  case 14:
159
- u[3] = u[3] ^ s[13] << 8;
159
+ c[3] = c[3] ^ s[13] << 8;
160
160
  case 13:
161
- u[3] = u[3] ^ s[12] << 0, u[3] = Math.imul(u[3], f[3]), u[3] = p(u[3], 18), u[3] = Math.imul(u[3], f[0]), e[3] = e[3] ^ u[3];
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];
162
162
  case 12:
163
- u[2] = u[2] ^ s[11] << 24;
163
+ c[2] = c[2] ^ s[11] << 24;
164
164
  case 11:
165
- u[2] = u[2] ^ s[10] << 16;
165
+ c[2] = c[2] ^ s[10] << 16;
166
166
  case 10:
167
- u[2] = u[2] ^ s[9] << 8;
167
+ c[2] = c[2] ^ s[9] << 8;
168
168
  case 9:
169
- u[2] = u[2] ^ s[8] << 0, u[2] = Math.imul(u[2], f[2]), u[2] = p(u[2], 17), u[2] = Math.imul(u[2], f[3]), e[2] = e[2] ^ u[2];
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];
170
170
  case 8:
171
- u[1] = u[1] ^ s[7] << 24;
171
+ c[1] = c[1] ^ s[7] << 24;
172
172
  case 7:
173
- u[1] = u[1] ^ s[6] << 16;
173
+ c[1] = c[1] ^ s[6] << 16;
174
174
  case 6:
175
- u[1] = u[1] ^ s[5] << 8;
175
+ c[1] = c[1] ^ s[5] << 8;
176
176
  case 5:
177
- u[1] = u[1] ^ s[4] << 0, u[1] = Math.imul(u[1], f[1]), u[1] = p(u[1], 16), u[1] = Math.imul(u[1], f[2]), e[1] = e[1] ^ u[1];
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];
178
178
  case 4:
179
- u[0] = u[0] ^ s[3] << 24;
179
+ c[0] = c[0] ^ s[3] << 24;
180
180
  case 3:
181
- u[0] = u[0] ^ s[2] << 16;
181
+ c[0] = c[0] ^ s[2] << 16;
182
182
  case 2:
183
- u[0] = u[0] ^ s[1] << 8;
183
+ c[0] = c[0] ^ s[1] << 8;
184
184
  case 1:
185
- u[0] = u[0] ^ s[0] << 0, u[0] = Math.imul(u[0], f[0]), u[0] = p(u[0], 15), u[0] = Math.imul(u[0], f[1]), e[0] = e[0] ^ u[0];
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];
186
186
  }
187
- }(n, o), function(i, e) {
188
- e[0] = e[0] ^ i.byteLength, e[1] = e[1] ^ i.byteLength, e[2] = e[2] ^ i.byteLength, e[3] = e[3] ^ i.byteLength, e[0] = e[0] + e[1] | 0, e[0] = e[0] + e[2] | 0, e[0] = e[0] + e[3] | 0, e[1] = e[1] + e[0] | 0, e[2] = e[2] + e[0] | 0, e[3] = e[3] + e[0] | 0, e[0] = M(e[0]), e[1] = M(e[1]), e[2] = M(e[2]), e[3] = M(e[3]), e[0] = e[0] + e[1] | 0, e[0] = e[0] + e[2] | 0, e[0] = e[0] + e[3] | 0, e[1] = e[1] + e[0] | 0, e[2] = e[2] + e[0] | 0, e[3] = e[3] + e[0] | 0;
189
- }(n, 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
+ }(r, o), function(a, t) {
188
+ t[0] = t[0] ^ a.byteLength, t[1] = t[1] ^ a.byteLength, t[2] = t[2] ^ a.byteLength, t[3] = t[3] ^ a.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 i = new Uint8Array(o.buffer);
191
+ return Array.from(i).map(function(a) {
192
+ return a.toString(16).padStart(2, "0");
193
193
  }).join("");
194
194
  }
195
- function G(n, t) {
196
- return new Promise(function(r) {
195
+ function V(r, e) {
196
+ return new Promise(function(n) {
197
197
  setTimeout(function() {
198
- return r(t);
199
- }, n);
198
+ return n(e);
199
+ }, r);
200
200
  });
201
201
  }
202
- function W(n, t, r) {
203
- return Promise.all(n.map(function(o) {
204
- return Promise.race([o, G(t, r)]);
202
+ function G(r, e, n) {
203
+ return Promise.all(r.map(function(o) {
204
+ return Promise.race([o, V(e, n)]);
205
205
  }));
206
206
  }
207
- function V() {
207
+ function W() {
208
208
  return w(this, void 0, void 0, function() {
209
- var n, t, r, o, a;
210
- return y(this, function(i) {
211
- switch (i.label) {
209
+ var r, e, n, o, i;
210
+ return y(this, function(a) {
211
+ switch (a.label) {
212
212
  case 0:
213
- return i.trys.push([0, 2, , 3]), n = j(), t = Object.keys(n), [4, W(Object.values(n), (b == null ? void 0 : b.timeout) || 1e3, N)];
213
+ return a.trys.push([0, 2, , 3]), r = j(), e = Object.keys(r), [4, G(Object.values(r), (b == null ? void 0 : b.timeout) || 1e3, N)];
214
214
  case 1:
215
- return r = i.sent(), o = r.filter(function(e) {
216
- return e !== void 0;
217
- }), a = {}, o.forEach(function(e, c) {
218
- a[t[c]] = e;
219
- }), [2, U(a, b.exclude || [])];
215
+ return n = a.sent(), o = n.filter(function(t) {
216
+ return t !== void 0;
217
+ }), i = {}, o.forEach(function(t, u) {
218
+ i[e[u]] = t;
219
+ }), [2, O(i, b.exclude || [])];
220
220
  case 2:
221
- throw i.sent();
221
+ throw a.sent();
222
222
  case 3:
223
223
  return [2];
224
224
  }
225
225
  });
226
226
  });
227
227
  }
228
- function U(n, t) {
229
- var r = {}, o = function(i) {
230
- if (n.hasOwnProperty(i)) {
231
- var e = n[i];
232
- if (typeof e != "object" || Array.isArray(e)) t.includes(i) || (r[i] = e);
228
+ function O(r, e) {
229
+ var n = {}, o = function(a) {
230
+ if (r.hasOwnProperty(a)) {
231
+ var t = r[a];
232
+ if (typeof t != "object" || Array.isArray(t)) e.includes(a) || (n[a] = t);
233
233
  else {
234
- var c = U(e, t.map(function(l) {
235
- return l.startsWith(i + ".") ? l.slice(i.length + 1) : l;
234
+ var u = O(t, e.map(function(l) {
235
+ return l.startsWith(a + ".") ? l.slice(a.length + 1) : l;
236
236
  }));
237
- Object.keys(c).length > 0 && (r[i] = c);
237
+ Object.keys(u).length > 0 && (n[a] = u);
238
238
  }
239
239
  }
240
240
  };
241
- for (var a in n) o(a);
242
- return r;
241
+ for (var i in r) o(i);
242
+ return n;
243
243
  }
244
- function $(n) {
244
+ function $(r) {
245
245
  return w(this, void 0, void 0, function() {
246
- var t, r;
246
+ var e, n;
247
247
  return y(this, function(o) {
248
248
  switch (o.label) {
249
249
  case 0:
250
- return o.trys.push([0, 2, , 3]), [4, V()];
250
+ return o.trys.push([0, 2, , 3]), [4, W()];
251
251
  case 1:
252
- return t = o.sent(), r = I(JSON.stringify(t)), [2, r.toString()];
252
+ return e = o.sent(), n = M(JSON.stringify(e)), [2, n.toString()];
253
253
  case 2:
254
254
  throw o.sent();
255
255
  case 3:
@@ -258,252 +258,252 @@ function $(n) {
258
258
  });
259
259
  });
260
260
  }
261
- function H(n) {
262
- for (var t = 0, r = 0; r < n.length; ++r) t += Math.abs(n[r]);
263
- return t;
261
+ function H(r) {
262
+ for (var e = 0, n = 0; n < r.length; ++n) e += Math.abs(r[n]);
263
+ return e;
264
264
  }
265
- function D(n, t, r) {
266
- for (var o = [], a = 0; a < n[0].data.length; a++) {
267
- for (var i = [], e = 0; e < n.length; e++) i.push(n[e].data[a]);
268
- o.push(z(i));
265
+ function U(r, e, n) {
266
+ for (var o = [], i = 0; i < r[0].data.length; i++) {
267
+ for (var a = [], t = 0; t < r.length; t++) a.push(r[t].data[i]);
268
+ o.push(Q(a));
269
269
  }
270
- var c = new Uint8ClampedArray(o);
271
- return new ImageData(c, t, r);
270
+ var u = new Uint8ClampedArray(o);
271
+ return new ImageData(u, e, n);
272
272
  }
273
- function z(n) {
274
- if (n.length === 0) return 0;
275
- for (var t = {}, r = 0, o = n; r < o.length; r++)
276
- t[i = o[r]] = (t[i] || 0) + 1;
277
- var a = n[0];
278
- for (var i in t) t[i] > t[a] && (a = parseInt(i, 10));
279
- return a;
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[a = o[n]] = (e[a] || 0) + 1;
277
+ var i = r[0];
278
+ for (var a in e) e[a] > e[i] && (i = parseInt(a, 10));
279
+ return i;
280
280
  }
281
281
  function E() {
282
282
  if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
283
- for (var n = navigator.userAgent, t = { Edg: "Edge", OPR: "Opera" }, r = 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+)?)/]; r < o.length; r++) {
284
- var a = o[r], i = n.match(a);
285
- if (i && i.groups) return { name: t[i.groups.name] || i.groups.name, version: i.groups.version };
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 i = o[n], a = r.match(i);
285
+ if (a && a.groups) return { name: e[a.groups.name] || a.groups.name, version: a.groups.version };
286
286
  }
287
287
  return { name: "unknown", version: "unknown" };
288
288
  }
289
289
  v("audio", function() {
290
290
  return w(this, void 0, void 0, function() {
291
- return y(this, function(n) {
292
- return [2, new Promise(function(t, r) {
291
+ return y(this, function(r) {
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 e, c = o.createDynamicsCompressor();
297
- c.threshold.value = -50, c.knee.value = 40, c.ratio.value = 12, c.attack.value = 0, c.release.value = 0.2, i.connect(c), c.connect(o.destination), i.start(), o.oncomplete = function(l) {
298
- e = l.renderedBuffer.getChannelData(0), t({ sampleHash: H(e), oscillator: i.type, maxChannels: o.destination.maxChannelCount, channelCountMode: a.channelCountMode });
294
+ var o = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), i = o.createBufferSource(), a = o.createOscillator();
295
+ a.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, a.connect(u), u.connect(o.destination), a.start(), o.oncomplete = function(l) {
298
+ t = l.renderedBuffer.getChannelData(0), e({ sampleHash: H(t), oscillator: a.type, maxChannels: o.destination.maxChannelCount, channelCountMode: i.channelCountMode });
299
299
  }, o.startRendering();
300
300
  } catch (l) {
301
- console.error("Error creating audio fingerprint:", l), r(l);
301
+ console.error("Error creating audio fingerprint:", l), n(l);
302
302
  }
303
303
  })];
304
304
  });
305
305
  });
306
306
  });
307
- var K = E().name !== "SamsungBrowser" ? 1 : 3, k = 280, _ = 20;
307
+ var z = E().name !== "SamsungBrowser" ? 1 : 3, x = 280, F = 20;
308
308
  E().name != "Firefox" && v("canvas", function() {
309
- return document.createElement("canvas").getContext("2d"), new Promise(function(n) {
310
- var t = Array.from({ length: K }, function() {
309
+ return document.createElement("canvas").getContext("2d"), new Promise(function(r) {
310
+ var e = Array.from({ length: z }, function() {
311
311
  return function() {
312
- var r = document.createElement("canvas"), o = r.getContext("2d");
312
+ var n = document.createElement("canvas"), o = n.getContext("2d");
313
313
  if (!o) return new ImageData(1, 1);
314
- r.width = k, r.height = _;
315
- var a = o.createLinearGradient(0, 0, r.width, r.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, r.width, r.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 * r.width / 7, r.height), o.strokeStyle = "white", o.lineWidth = 2, o.stroke();
319
- var e = o.getImageData(0, 0, r.width, r.height);
320
- return e;
314
+ n.width = x, n.height = F;
315
+ var i = o.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"), o.fillStyle = i, o.fillRect(0, 0, n.width, n.height);
317
+ var a = "Random Text WMwmil10Oo";
318
+ o.font = "23.123px Arial", o.fillStyle = "black", o.fillText(a, -5, 15), o.fillStyle = "rgba(0, 0, 255, 0.5)", o.fillText(a, -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);
320
+ return t;
321
321
  }();
322
322
  });
323
- n({ commonImageDataHash: I(D(t, k, _).data.toString()).toString() });
323
+ r({ commonImageDataHash: M(U(e, x, F).data.toString()).toString() });
324
324
  });
325
325
  });
326
- var C, Q = ["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 P(n, t) {
328
- if (!n) throw new Error("Canvas context not supported");
329
- return n.font = "72px ".concat(t), n.measureText("WwMmLli0Oo").width;
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;
330
330
  }
331
- function Y() {
332
- var n, t = document.createElement("canvas"), r = (n = t.getContext("webgl")) !== null && n !== void 0 ? n : t.getContext("experimental-webgl");
333
- if (r && "getParameter" in r) try {
334
- var o = (r.getParameter(r.VENDOR) || "").toString(), a = (r.getParameter(r.RENDERER) || "").toString(), i = { vendor: o, renderer: a, version: (r.getParameter(r.VERSION) || "").toString(), shadingLanguageVersion: (r.getParameter(r.SHADING_LANGUAGE_VERSION) || "").toString() };
335
- if (!a.length || !o.length) {
336
- var e = r.getExtension("WEBGL_debug_renderer_info");
337
- if (e) {
338
- var c = (r.getParameter(e.UNMASKED_VENDOR_WEBGL) || "").toString(), l = (r.getParameter(e.UNMASKED_RENDERER_WEBGL) || "").toString();
339
- c && (i.vendorUnmasked = c), l && (i.rendererUnmasked = l);
331
+ function J() {
332
+ var r, e = document.createElement("canvas"), n = (r = e.getContext("webgl")) !== null && r !== void 0 ? r : e.getContext("experimental-webgl");
333
+ if (n && "getParameter" in n) try {
334
+ var o = (n.getParameter(n.VENDOR) || "").toString(), i = (n.getParameter(n.RENDERER) || "").toString(), a = { vendor: o, renderer: i, version: (n.getParameter(n.VERSION) || "").toString(), shadingLanguageVersion: (n.getParameter(n.SHADING_LANGUAGE_VERSION) || "").toString() };
335
+ if (!i.length || !o.length) {
336
+ var t = n.getExtension("WEBGL_debug_renderer_info");
337
+ if (t) {
338
+ var u = (n.getParameter(t.UNMASKED_VENDOR_WEBGL) || "").toString(), l = (n.getParameter(t.UNMASKED_RENDERER_WEBGL) || "").toString();
339
+ u && (a.vendorUnmasked = u), l && (a.rendererUnmasked = l);
340
340
  }
341
341
  }
342
- return i;
342
+ return a;
343
343
  } catch {
344
344
  }
345
345
  return "undefined";
346
346
  }
347
347
  function X() {
348
- var n = new Float32Array(1), t = new Uint8Array(n.buffer);
349
- return n[0] = 1 / 0, n[0] = n[0] - n[0], t[3];
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];
350
350
  }
351
- function Z(n, t) {
352
- var r = {};
353
- return t.forEach(function(o) {
354
- var a = function(i) {
355
- if (i.length === 0) return null;
356
- var e = {};
357
- i.forEach(function(u) {
358
- var s = String(u);
359
- e[s] = (e[s] || 0) + 1;
351
+ function Z(r, e) {
352
+ var n = {};
353
+ return e.forEach(function(o) {
354
+ var i = function(a) {
355
+ if (a.length === 0) return null;
356
+ var t = {};
357
+ a.forEach(function(c) {
358
+ var s = String(c);
359
+ t[s] = (t[s] || 0) + 1;
360
360
  });
361
- var c = i[0], l = 1;
362
- return Object.keys(e).forEach(function(u) {
363
- e[u] > l && (c = u, l = e[u]);
364
- }), c;
365
- }(n.map(function(i) {
366
- return o in i ? i[o] : void 0;
367
- }).filter(function(i) {
368
- return i !== void 0;
361
+ var u = a[0], l = 1;
362
+ return Object.keys(t).forEach(function(c) {
363
+ t[c] > l && (u = c, l = t[c]);
364
+ }), u;
365
+ }(r.map(function(a) {
366
+ return o in a ? a[o] : void 0;
367
+ }).filter(function(a) {
368
+ return a !== void 0;
369
369
  }));
370
- a && (r[o] = a);
371
- }), r;
370
+ i && (n[o] = i);
371
+ }), n;
372
372
  }
373
373
  function ee() {
374
- var n = [], t = { "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
- return Object.keys(t).forEach(function(r) {
376
- t[r].forEach(function(o) {
377
- matchMedia("(".concat(r, ": ").concat(o, ")")).matches && n.push("".concat(r, ": ").concat(o));
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"] };
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));
378
378
  });
379
- }), n;
379
+ }), r;
380
380
  }
381
381
  function te() {
382
382
  if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
383
- for (var n = window.ApplePaySession.supportsVersion, t = 15; t > 0; t--) if (n(t)) return t;
383
+ for (var r = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (r(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 n = this;
391
- return new Promise(function(t, r) {
390
+ var r = this;
391
+ return new Promise(function(e, n) {
392
392
  try {
393
393
  (function(o) {
394
- var a;
394
+ var i;
395
395
  w(this, void 0, void 0, function() {
396
- var i, e, c;
396
+ var a, t, u;
397
397
  return y(this, function(l) {
398
398
  switch (l.label) {
399
399
  case 0:
400
- return document.body ? [3, 2] : [4, (u = 50, new Promise(function(g) {
401
- return setTimeout(g, u, s);
400
+ return document.body ? [3, 2] : [4, (c = 50, new Promise(function(f) {
401
+ return setTimeout(f, c, s);
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"), (e = i.style).setProperty("position", "fixed"), e.setProperty("display", "block", "important"), e.setProperty("visibility", "visible"), e.setProperty("border", "0"), e.setProperty("opacity", "0"), i.src = "about:blank", document.body.appendChild(i), !(c = 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: c }), setTimeout(function() {
408
- document.body.removeChild(i);
406
+ if ((a = document.createElement("iframe")).setAttribute("frameBorder", "0"), (t = a.style).setProperty("position", "fixed"), t.setProperty("display", "block", "important"), t.setProperty("visibility", "visible"), t.setProperty("border", "0"), t.setProperty("opacity", "0"), a.src = "about:blank", document.body.appendChild(a), !(u = a.contentDocument || ((i = a.contentWindow) === null || i === void 0 ? void 0 : i.document))) throw new Error("Iframe document is not accessible");
407
+ return o({ iframe: u }), setTimeout(function() {
408
+ document.body.removeChild(a);
409
409
  }, 0), [2];
410
410
  }
411
- var u, s;
411
+ var c, s;
412
412
  });
413
413
  });
414
414
  })(function(o) {
415
- var a = o.iframe;
416
- return w(n, void 0, void 0, function() {
417
- var i, e, c, l;
418
- return y(this, function(u) {
419
- return i = a.createElement("canvas"), e = i.getContext("2d"), c = J.map(function(s) {
420
- return P(e, s);
421
- }), l = {}, Q.forEach(function(s) {
422
- var g = P(e, s);
423
- c.includes(g) || (l[s] = g);
424
- }), t(l), [2];
415
+ var i = o.iframe;
416
+ return w(r, void 0, void 0, function() {
417
+ var a, t, u, l;
418
+ return y(this, function(c) {
419
+ return a = i.createElement("canvas"), t = a.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);
424
+ }), e(l), [2];
425
425
  });
426
426
  });
427
427
  });
428
428
  } catch {
429
- r({ error: "unsupported" });
429
+ n({ error: "unsupported" });
430
430
  }
431
431
  });
432
432
  }), v("hardware", function() {
433
- return new Promise(function(n, t) {
434
- var r = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, o = window.performance && window.performance.memory ? window.performance.memory : 0;
435
- n({ videocard: Y(), architecture: X(), deviceMemory: r.toString() || "undefined", jsHeapSizeLimit: o.jsHeapSizeLimit || 0 });
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 });
436
436
  });
437
437
  }), v("locales", function() {
438
- return new Promise(function(n) {
439
- n({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
438
+ return new Promise(function(r) {
439
+ r({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
440
440
  });
441
441
  }), v("permissions", function() {
442
442
  return w(this, void 0, void 0, function() {
443
- var n;
444
- return y(this, function(t) {
445
- return C = (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"], n = Array.from({ length: (b == null ? void 0 : b.retries) || 3 }, 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() {
446
446
  return function() {
447
447
  return w(this, void 0, void 0, function() {
448
- var r, o, a, i, e;
449
- return y(this, function(c) {
450
- switch (c.label) {
448
+ var n, o, i, a, t;
449
+ return y(this, function(u) {
450
+ switch (u.label) {
451
451
  case 0:
452
- r = {}, o = 0, a = C, c.label = 1;
452
+ n = {}, o = 0, i = T, u.label = 1;
453
453
  case 1:
454
- if (!(o < a.length)) return [3, 6];
455
- i = a[o], c.label = 2;
454
+ if (!(o < i.length)) return [3, 6];
455
+ a = i[o], u.label = 2;
456
456
  case 2:
457
- return c.trys.push([2, 4, , 5]), [4, navigator.permissions.query({ name: i })];
457
+ return u.trys.push([2, 4, , 5]), [4, navigator.permissions.query({ name: a })];
458
458
  case 3:
459
- return e = c.sent(), r[i] = e.state.toString(), [3, 5];
459
+ return t = u.sent(), n[a] = t.state.toString(), [3, 5];
460
460
  case 4:
461
- return c.sent(), [3, 5];
461
+ return u.sent(), [3, 5];
462
462
  case 5:
463
463
  return o++, [3, 1];
464
464
  case 6:
465
- return [2, r];
465
+ return [2, n];
466
466
  }
467
467
  });
468
468
  });
469
469
  }();
470
- }), [2, Promise.all(n).then(function(r) {
471
- return Z(r, C);
470
+ }), [2, Promise.all(r).then(function(n) {
471
+ return Z(n, T);
472
472
  })];
473
473
  });
474
474
  });
475
475
  }), v("plugins", function() {
476
- var n = [];
477
- if (navigator.plugins) for (var t = 0; t < navigator.plugins.length; t++) {
478
- var r = navigator.plugins[t];
479
- n.push([r.name, r.filename, r.description].join("|"));
476
+ var r = [];
477
+ if (navigator.plugins) for (var e = 0; e < navigator.plugins.length; e++) {
478
+ var n = navigator.plugins[e];
479
+ r.push([n.name, n.filename, n.description].join("|"));
480
480
  }
481
481
  return new Promise(function(o) {
482
- o({ plugins: n });
482
+ o({ plugins: r });
483
483
  });
484
484
  }), v("screen", function() {
485
- return new Promise(function(n) {
486
- n({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: ee() });
485
+ return new Promise(function(r) {
486
+ r({ 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(n) {
490
- var t = E();
491
- n({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: t.name, version: t.version }, applePayVersion: te() });
489
+ return new Promise(function(r) {
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() });
492
492
  });
493
493
  });
494
- var m, ne = E().name !== "SamsungBrowser" ? 1 : 3, d = null;
494
+ var p, ne = E().name !== "SamsungBrowser" ? 1 : 3, d = null;
495
495
  v("webgl", function() {
496
496
  return w(this, void 0, void 0, function() {
497
- var n;
498
- return y(this, function(t) {
499
- typeof document < "u" && ((m = document.createElement("canvas")).width = 200, m.height = 100, d = m.getContext("webgl"));
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"));
500
500
  try {
501
501
  if (!d) throw new Error("WebGL not supported");
502
- return n = Array.from({ length: ne }, function() {
502
+ return r = Array.from({ length: ne }, function() {
503
503
  return function() {
504
504
  try {
505
505
  if (!d) throw new Error("WebGL not supported");
506
- var r = `
506
+ var n = `
507
507
  attribute vec2 position;
508
508
  void main() {
509
509
  gl_Position = vec4(position, 0.0, 1.0);
@@ -513,31 +513,31 @@ v("webgl", function() {
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, r), 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));
520
- var e = d.createProgram();
521
- if (!e) throw new Error("Failed to create shader program");
522
- if (d.attachShader(e, a), d.attachShader(e, i), d.linkProgram(e), !d.getProgramParameter(e, d.LINK_STATUS)) throw new Error("Shader program linking failed: " + d.getProgramInfoLog(e));
523
- d.useProgram(e);
524
- for (var c = 137, l = new Float32Array(4 * c), u = 2 * Math.PI / c, s = 0; s < c; s++) {
525
- var g = s * u;
526
- l[4 * s] = 0, l[4 * s + 1] = 0, l[4 * s + 2] = Math.cos(g) * (m.width / 2), l[4 * s + 3] = Math.sin(g) * (m.height / 2);
516
+ `, i = d.createShader(d.VERTEX_SHADER), a = d.createShader(d.FRAGMENT_SHADER);
517
+ if (!i || !a) throw new Error("Failed to create shaders");
518
+ if (d.shaderSource(i, n), d.shaderSource(a, o), d.compileShader(i), !d.getShaderParameter(i, d.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + d.getShaderInfoLog(i));
519
+ if (d.compileShader(a), !d.getShaderParameter(a, d.COMPILE_STATUS)) throw new Error("Fragment shader compilation failed: " + d.getShaderInfoLog(a));
520
+ var t = d.createProgram();
521
+ if (!t) throw new Error("Failed to create shader program");
522
+ if (d.attachShader(t, i), d.attachShader(t, a), d.linkProgram(t), !d.getProgramParameter(t, d.LINK_STATUS)) throw new Error("Shader program linking failed: " + d.getProgramInfoLog(t));
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);
527
527
  }
528
- var B = d.createBuffer();
529
- d.bindBuffer(d.ARRAY_BUFFER, B), d.bufferData(d.ARRAY_BUFFER, l, d.STATIC_DRAW);
530
- var x = d.getAttribLocation(e, "position");
531
- d.enableVertexAttribArray(x), d.vertexAttribPointer(x, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, m.width, m.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * c);
532
- var T = new Uint8ClampedArray(m.width * m.height * 4);
533
- return d.readPixels(0, 0, m.width, m.height, d.RGBA, d.UNSIGNED_BYTE, T), new ImageData(T, m.width, m.height);
528
+ var L = d.createBuffer();
529
+ d.bindBuffer(d.ARRAY_BUFFER, L), d.bufferData(d.ARRAY_BUFFER, l, d.STATIC_DRAW);
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);
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: I(D(n, m.width, m.height).data.toString()).toString() }];
540
+ }), [2, { commonImageHash: M(U(r, p.width, p.height).data.toString()).toString() }];
541
541
  } catch {
542
542
  return [2, { webgl: "unsupported" }];
543
543
  }
@@ -545,78 +545,136 @@ v("webgl", function() {
545
545
  });
546
546
  });
547
547
  });
548
- var S = function(n, t, r, o) {
549
- for (var a = (r - t) / o, i = 0, e = 0; e < o; e++)
550
- i += n(t + (e + 0.5) * a);
551
- return i * a;
548
+ var S = function(r, e, n, o) {
549
+ for (var i = (n - e) / o, a = 0, t = 0; t < o; t++)
550
+ a += r(e + (t + 0.5) * i);
551
+ return a * i;
552
552
  };
553
553
  v("math", function() {
554
554
  return w(void 0, void 0, void 0, function() {
555
- return y(this, function(n) {
555
+ return y(this, function(r) {
556
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) }];
557
557
  });
558
558
  });
559
559
  });
560
560
  const re = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
561
- let A = (n = 21) => {
562
- let t = "", r = crypto.getRandomValues(new Uint8Array(n |= 0));
563
- for (; n--; )
564
- t += re[r[n] & 63];
565
- return t;
561
+ let A = (r = 21) => {
562
+ let e = "", n = crypto.getRandomValues(new Uint8Array(r |= 0));
563
+ for (; r--; )
564
+ e += re[n[r] & 63];
565
+ return e;
566
566
  };
567
- class R {
568
- constructor(t) {
567
+ class _ {
568
+ constructor(e) {
569
569
  h(this, "config");
570
- this.config = t;
570
+ this.config = e;
571
571
  }
572
- async getAdsForSearchParams(t) {
572
+ async getAdsForSearchParams(e) {
573
573
  return [];
574
574
  }
575
+ async onQuerySubmitted(e) {
576
+ }
577
+ async onQueryFetched(e, n) {
578
+ }
579
+ async onInputCleared() {
580
+ }
581
+ async onAdContainerRendered(e) {
582
+ }
583
+ async onAdContainerViewed(e) {
584
+ }
575
585
  }
576
- class oe extends R {
586
+ class oe extends _ {
577
587
  /**
578
588
  * Gets ads from the adMarketplace API based on the search term.
579
589
  */
580
- async getAdsForSearchParams(t) {
590
+ async getAdsForSearchParams(e) {
581
591
  if (!this.config.admSub)
582
592
  return console.error("No admSub specified in config."), [];
583
593
  const o = `https://demofeed.is.ampfeed.com/is?${new URLSearchParams({
584
594
  partner: "demofeed",
585
595
  sub1: this.config.admSub,
586
- qt: t.searchTerm,
596
+ qt: e.searchTerm,
587
597
  v: "2.0",
588
598
  rfr: "searchcraft.io",
589
599
  "results-ta": `${this.config.admTextAdQuantity || 0}`,
590
600
  "results-pa": `${this.config.admProductAdQuantity || 0}`
591
- }).toString()}`, i = await (await fetch(o, { method: "GET" })).json(), e = i.product_ads.map(
592
- (u) => ({
601
+ }).toString()}`, a = await (await fetch(o, { method: "GET" })).json(), t = a.product_ads.map(
602
+ (c) => ({
593
603
  id: A(),
594
604
  adSource: "adMarketplace",
595
605
  admAdType: "adm-product-ad",
596
- admAd: u
606
+ admAd: c
597
607
  })
598
- ), c = i.text_ads.map((u) => ({
608
+ ), u = a.text_ads.map((c) => ({
599
609
  id: A(),
600
610
  adSource: "adMarketplace",
601
611
  admAdType: "adm-text-ad",
602
- admAd: u
612
+ admAd: c
603
613
  }));
604
- return e.concat(c);
614
+ return t.concat(u);
615
+ }
616
+ async onAdContainerViewed(e) {
617
+ var o;
618
+ const n = e.adClientResponseItem;
619
+ (o = n.admAd) != null && o.impression_url && fetch(n.admAd.impression_url);
605
620
  }
606
621
  }
607
- class ie extends R {
608
- async getAdsForSearchParams(t) {
622
+ class ae extends _ {
623
+ async getAdsForSearchParams(e) {
609
624
  return [];
610
625
  }
611
626
  }
612
- class ae extends R {
613
- async getAdsForSearchParams(t) {
627
+ const ie = 200, se = 100;
628
+ class ce extends _ {
629
+ constructor(n) {
630
+ super(n);
631
+ h(this, "adCallTimeout");
632
+ this.addScriptTagToDocument();
633
+ }
634
+ async onQuerySubmitted(n) {
635
+ this.addScriptTagToDocument();
636
+ }
637
+ async onQueryFetched(n, o) {
638
+ var i;
639
+ if ((((i = o.data.hits) == null ? void 0 : i.length) || 0) === 0) {
640
+ this.removeScriptTagFromDocument();
641
+ return;
642
+ }
643
+ this.performAdCall(ie);
644
+ }
645
+ async onAdContainerViewed(n) {
646
+ this.performAdCall(se);
647
+ }
648
+ async onInputCleared() {
649
+ this.removeScriptTagFromDocument();
650
+ }
651
+ performAdCall(n) {
652
+ this.adCallTimeout && clearTimeout(this.adCallTimeout), this.adCallTimeout = setTimeout(() => {
653
+ this.addScriptTagToDocument();
654
+ try {
655
+ PostRelease == null || PostRelease.Start({ ptd: [this.config.nativoPlacementId] });
656
+ } catch (o) {
657
+ console.error(o);
658
+ }
659
+ }, n);
660
+ }
661
+ async getAdsForSearchParams(n) {
614
662
  return [];
615
663
  }
664
+ addScriptTagToDocument() {
665
+ if (!document.head.querySelector("#nativo-tag")) {
666
+ const n = document.createElement("script");
667
+ n.type = "text/javascript", n.src = "https://s.ntv.io/serve/load.js", n.id = "nativo-tag", n.setAttribute("data-ntv-set-no-auto-start", "true"), document.head.appendChild(n);
668
+ }
669
+ }
670
+ removeScriptTagFromDocument() {
671
+ const n = document.head.querySelector("#nativo-tag");
672
+ n && document.head.removeChild(n);
673
+ }
616
674
  }
617
- const se = 500;
618
- class ue {
619
- constructor(t, r, o) {
675
+ const ue = 500;
676
+ class de {
677
+ constructor(e, n, o) {
620
678
  h(this, "measureRequestTimeout");
621
679
  h(this, "measureRequestsBatched", []);
622
680
  h(this, "config");
@@ -630,44 +688,44 @@ class ue {
630
688
  * @param {Partial<MeasureRequestProperties>} properties - Additional properties to send with the event.
631
689
  * @param {Partial<MeasureRequestUser>} user - Additional user properites to send with the event.
632
690
  */
633
- h(this, "sendMeasureEvent", (t, r = {}, o = {}) => {
634
- const a = {
635
- event_name: t,
691
+ h(this, "sendMeasureEvent", (e, n = {}, o = {}) => {
692
+ const i = {
693
+ event_name: e,
636
694
  properties: {
637
695
  searchcraft_index_names: this.config.index,
638
696
  session_id: this.sessionId,
639
- ...r
697
+ ...n
640
698
  },
641
699
  user: {
642
700
  ...this.measureRequestUser,
643
701
  ...o
644
702
  }
645
703
  };
646
- this.measureRequestsBatched.push(a), clearTimeout(this.measureRequestTimeout), this.measureRequestTimeout = setTimeout(async () => {
647
- const i = JSON.stringify({ items: this.measureRequestsBatched }), e = `${this.baseMeasureUrl}/batch`;
704
+ this.measureRequestsBatched.push(i), clearTimeout(this.measureRequestTimeout), this.measureRequestTimeout = setTimeout(async () => {
705
+ const a = JSON.stringify({ items: this.measureRequestsBatched }), t = `${this.baseMeasureUrl}/batch`;
648
706
  try {
649
- const c = await fetch(e, {
707
+ const u = await fetch(t, {
650
708
  method: "POST",
651
709
  headers: {
652
710
  "Content-Type": "application/json",
653
711
  Authorization: this.config.readKey,
654
712
  "X-Sc-User-Id": this.userId
655
713
  },
656
- body: i,
714
+ body: a,
657
715
  keepalive: !0
658
716
  });
659
- if (!c.ok)
717
+ if (!u.ok)
660
718
  throw new Error(
661
- `Failed to send request: ${c.status} ${c.statusText}`
719
+ `Failed to send request: ${u.status} ${u.statusText}`
662
720
  );
663
721
  this.measureRequestsBatched = [];
664
722
  return;
665
- } catch (c) {
666
- throw console.error("Error sending MeasureRequest:", c), c;
723
+ } catch (u) {
724
+ throw console.error("Error sending MeasureRequest:", u), u;
667
725
  }
668
- }, se);
726
+ }, ue);
669
727
  });
670
- this.config = t, this.sdkInfo = r, this.userId = o, this.sessionId = A(), this.sendMeasureEvent("sdk_initialized");
728
+ this.config = e, this.sdkInfo = n, this.userId = o, this.sessionId = A(), this.sendMeasureEvent("sdk_initialized");
671
729
  }
672
730
  /**
673
731
  * Getter for the base url used by the /measure endpoints.
@@ -690,49 +748,49 @@ class ue {
690
748
  };
691
749
  }
692
750
  }
693
- function ce(n) {
694
- const t = [];
695
- let r = "should";
696
- return n.facetPathsForIndexFields && Object.keys(n.facetPathsForIndexFields).forEach((o) => {
697
- var i;
698
- const a = (i = n.facetPathsForIndexFields) == null ? void 0 : i[o];
699
- a && (r = "must", t.push({
700
- occur: r,
751
+ function le(r) {
752
+ const e = [];
753
+ let n = "should";
754
+ return r.facetPathsForIndexFields && Object.keys(r.facetPathsForIndexFields).forEach((o) => {
755
+ var a;
756
+ const i = (a = r.facetPathsForIndexFields) == null ? void 0 : a[o];
757
+ i && (n = "must", e.push({
758
+ occur: n,
701
759
  exact: {
702
- ctx: a.value
760
+ ctx: i.value
703
761
  }
704
762
  }));
705
- }), n.rangeValueForIndexFields && Object.keys(n.rangeValueForIndexFields).forEach((o) => {
706
- var i;
707
- const a = (i = n.rangeValueForIndexFields) == null ? void 0 : i[o];
708
- a && (r = "must", t.push({
709
- occur: r,
763
+ }), r.rangeValueForIndexFields && Object.keys(r.rangeValueForIndexFields).forEach((o) => {
764
+ var a;
765
+ const i = (a = r.rangeValueForIndexFields) == null ? void 0 : a[o];
766
+ i && (n = "must", e.push({
767
+ occur: n,
710
768
  exact: {
711
- ctx: a.value
769
+ ctx: i.value
712
770
  }
713
771
  }));
714
- }), n.sort === "desc" ? n.order_by = "date_published" : n.order_by = "", t.push({
715
- occur: r,
772
+ }), r.sort === "desc" ? r.order_by = "date_published" : r.order_by = "", e.push({
773
+ occur: n,
716
774
  // Valid, as 'occur' is a required property in QueryItem
717
- [n.mode]: { ctx: n.searchTerm }
775
+ [r.mode]: { ctx: r.searchTerm }
718
776
  // Ensure dynamic mode is inside queryType
719
- }), t;
777
+ }), e;
720
778
  }
721
- const de = (n) => n.endsWith("/") ? n.slice(0, -1) : n, le = (n) => {
722
- let t = "";
723
- if (t = n.trim(), t = t.replace(/[‘’“”]/g, (o) => ({
779
+ const he = (r) => r.endsWith("/") ? r.slice(0, -1) : r, fe = (r) => {
780
+ let e = "";
781
+ if (e = r.trim(), e = e.replace(/[‘’“”]/g, (o) => ({
724
782
  "‘": "'",
725
783
  "’": "'",
726
784
  "“": '"',
727
785
  "”": '"'
728
- })[o] || o), (t.match(/"/g) || []).length % 2 !== 0)
786
+ })[o] || o), (e.match(/"/g) || []).length % 2 !== 0)
729
787
  throw new Error(
730
788
  "The search term contains an uneven number of quote characters."
731
789
  );
732
- return t;
790
+ return e;
733
791
  };
734
- class he {
735
- constructor(t, r, o) {
792
+ class me {
793
+ constructor(e, n, o) {
736
794
  h(this, "config");
737
795
  h(this, "userId");
738
796
  h(this, "parent");
@@ -740,49 +798,56 @@ class he {
740
798
  * Performs a search operation.
741
799
  * @param {SearchParams} searchParams - The parameters for the search.
742
800
  */
743
- h(this, "getSearchResponse", async (t) => {
744
- var o, a;
745
- const r = le(t.searchTerm);
801
+ h(this, "getSearchResponse", async (e) => {
802
+ var o, i, a, t, u;
803
+ const n = fe(e.searchTerm);
746
804
  (o = this.parent.measureClient) == null || o.sendMeasureEvent("search_requested", {
747
- search_term: r
805
+ search_term: n
748
806
  }), this.parent.emitEvent("query_submitted", {
749
807
  name: "query_submitted",
750
808
  data: {
751
- searchTerm: r
809
+ searchTerm: n
752
810
  }
753
- });
811
+ }), (i = this.parent.adClient) == null || i.onQuerySubmitted(e);
754
812
  try {
755
- const i = {
756
- query: ce(t),
757
- offset: t.offset || 0,
813
+ const l = {
814
+ query: le(e),
815
+ offset: e.offset || 0,
758
816
  // Default to 0 (first page) if not provided
759
- limit: t.limit || this.config.searchResultsPerPage || 20
817
+ limit: e.limit || this.config.searchResultsPerPage || 20
760
818
  // Default to 20 if not provided
761
819
  };
762
- t.order_by && (i.order_by = t.order_by, i.sort = t.sort === "desc" || t.sort === "asc" ? t.sort : "asc");
763
- const e = {
820
+ e.order_by && (l.order_by = e.order_by, l.sort = e.sort === "desc" || e.sort === "asc" ? e.sort : "asc");
821
+ const c = {
764
822
  method: "POST",
765
823
  headers: {
766
824
  Authorization: this.config.readKey,
767
825
  "Content-Type": "application/json",
768
826
  "X-Sc-User-Id": this.userId
769
827
  },
770
- body: JSON.stringify(i)
771
- }, c = await fetch(this.baseSearchUrl, e);
772
- if (!c.ok)
828
+ body: JSON.stringify(l)
829
+ }, s = await fetch(this.baseSearchUrl, c);
830
+ if (!s.ok)
773
831
  throw new Error(
774
- `Error: ${c.statusText} (Status: ${c.status})`
832
+ `Error: ${s.statusText} (Status: ${s.status})`
775
833
  );
776
- const l = await c.json();
834
+ const f = await s.json();
777
835
  return (a = this.parent.measureClient) == null || a.sendMeasureEvent("search_response_received", {
778
- search_term: r,
779
- number_of_documents: l.data.count
780
- }), l;
781
- } catch (i) {
782
- throw console.error("Error parsing response:", i), i;
836
+ search_term: n,
837
+ number_of_documents: f.data.count
838
+ }), this.parent.emitEvent("query_fetched", {
839
+ name: "query_fetched",
840
+ data: {
841
+ searchTerm: n
842
+ }
843
+ }), (((t = f.data.hits) == null ? void 0 : t.length) || 0) === 0 && this.parent.emitEvent("no_results_returned", {
844
+ name: "no_results_returned"
845
+ }), (u = this.parent.adClient) == null || u.onQueryFetched(e, f), f;
846
+ } catch (l) {
847
+ throw console.error("Error parsing response:", l), l;
783
848
  }
784
849
  });
785
- this.parent = t, this.config = r, this.userId = o;
850
+ this.parent = e, this.config = n, this.userId = o;
786
851
  }
787
852
  /**
788
853
  * Getter for the base url used by the /search endpoint.
@@ -791,8 +856,8 @@ class he {
791
856
  return `${this.config.endpointURL}/index/${this.config.index.join(",")}/search`;
792
857
  }
793
858
  }
794
- class ge {
795
- constructor(t, r) {
859
+ class we {
860
+ constructor(e, n) {
796
861
  h(this, "config");
797
862
  h(this, "measureClient");
798
863
  h(this, "searchClient");
@@ -803,50 +868,48 @@ class ge {
803
868
  /**
804
869
  * Gets items from the SearchClient and the AdClient.
805
870
  */
806
- h(this, "getItems", (t, r, o) => {
807
- const a = async () => {
871
+ h(this, "getItems", (e, n, o) => {
872
+ const i = async () => {
808
873
  (async () => {
809
- var c, l;
810
- const i = await ((c = this == null ? void 0 : this.searchClient) == null ? void 0 : c.getSearchResponse(t));
811
- if (!i)
874
+ var u, l;
875
+ const a = await ((u = this == null ? void 0 : this.searchClient) == null ? void 0 : u.getSearchResponse(e));
876
+ if (!a)
812
877
  throw new Error("Search client was not initialized.");
813
- const e = (l = i.data.hits || []) == null ? void 0 : l.map((u) => u.doc).filter((u) => !!u).map((u) => ({
878
+ const t = (l = a.data.hits || []) == null ? void 0 : l.map((c) => c.doc).filter((c) => !!c).map((c) => ({
814
879
  type: "SearchDocument",
815
880
  id: A(),
816
- document: u
881
+ document: c
817
882
  }));
818
- e.length === 0 && this.emitEvent("no_results_returned", {
819
- name: "no_results_returned"
820
- }), r(i, e);
883
+ n(a, t);
821
884
  })(), (async () => {
822
885
  if (this.adClient) {
823
- const i = await this.adClient.getAdsForSearchParams(t);
824
- o(i);
886
+ const a = await this.adClient.getAdsForSearchParams(e);
887
+ o(a);
825
888
  }
826
889
  })();
827
890
  };
828
891
  clearTimeout(this.requestTimeout), this.config.searchDebounceDelay ? this.requestTimeout = setTimeout(
829
- a,
892
+ i,
830
893
  this.config.searchDebounceDelay
831
- ) : a();
894
+ ) : i();
832
895
  });
833
- if (!t.endpointURL || !t.index || !t.readKey)
896
+ if (!e.endpointURL || !e.index || !e.readKey)
834
897
  throw new Error(
835
898
  "Endpoint URL, Index value(s), and Read Key must be provided"
836
899
  );
837
900
  this.config = {
838
- ...t,
901
+ ...e,
839
902
  // Strips off the trailing '/' from an endpointURL if one is accidentally added
840
- endpointURL: de(t.endpointURL)
841
- }, this.userId = "", this.initClients(this.config, r), this.initInputForms(), this.startObservingMutations();
903
+ endpointURL: he(e.endpointURL)
904
+ }, this.userId = "", this.initClients(this.config, n), this.initInputForms(), this.startObservingMutations();
842
905
  }
843
906
  initInputForms() {
844
- const t = document.querySelectorAll(
907
+ const e = document.querySelectorAll(
845
908
  "searchcraft-input-form"
846
909
  );
847
910
  setTimeout(() => {
848
- t.forEach((r) => {
849
- r.core = this;
911
+ e.forEach((n) => {
912
+ n.core = this;
850
913
  });
851
914
  }, 40);
852
915
  }
@@ -854,44 +917,81 @@ class ge {
854
917
  * When changes happen in the DOM, we want to link any input forms found to the instance of the core.
855
918
  */
856
919
  startObservingMutations() {
857
- new MutationObserver((r, o) => {
858
- let a = !1;
859
- for (const i of r)
860
- i.type === "childList" && i.addedNodes.forEach((e) => {
861
- e.nodeType === 1 && e.className.toLowerCase() === "searchcraft-input-form" && (a = !0);
920
+ new MutationObserver((n, o) => {
921
+ let i = !1;
922
+ for (const a of n)
923
+ a.type === "childList" && a.addedNodes.forEach((t) => {
924
+ t.nodeType === 1 && t.className.toLowerCase() === "searchcraft-input-form" && (i = !0);
862
925
  });
863
- a && this.initInputForms();
926
+ i && this.initInputForms();
864
927
  }).observe(document.body, { childList: !0, subtree: !0 });
865
928
  }
866
- initClients(t, r) {
929
+ initClients(e, n) {
867
930
  setTimeout(async () => {
868
931
  let o = this.config.userId;
869
- switch (o || (o = await $()), this.measureClient = new ue(t, r, o), this.searchClient = new he(this, t, o), t.adSource) {
932
+ switch (o || (o = await $()), this.measureClient = new de(e, n, o), this.searchClient = new me(this, e, o), e.adSource) {
870
933
  case "adMarketplace":
871
- this.adClient = new oe(t);
934
+ this.adClient = new oe(e);
872
935
  break;
873
936
  case "Nativo":
874
- this.adClient = new ae(t);
937
+ this.adClient = new ce(e);
875
938
  break;
876
939
  case "Custom":
877
- this.adClient = new ie(t);
940
+ this.adClient = new ae(e);
878
941
  break;
879
942
  }
880
943
  }, 300);
881
944
  }
882
- emitEvent(t, r) {
945
+ emitEvent(e, n) {
883
946
  var o;
884
- (o = this.subscriptionEvents[t]) == null || o.forEach((a) => {
885
- a(r);
947
+ (o = this.subscriptionEvents[e]) == null || o.forEach((i) => {
948
+ i(n);
886
949
  });
887
950
  }
888
- subscribe(t, r) {
889
- return this.subscriptionEvents[t] || (this.subscriptionEvents[t] = []), this.subscriptionEvents[t].push(
890
- r
951
+ subscribe(e, n) {
952
+ return this.subscriptionEvents[e] || (this.subscriptionEvents[e] = []), this.subscriptionEvents[e].push(
953
+ n
891
954
  ), () => {
892
- this.subscriptionEvents[t] = this.subscriptionEvents[t].filter((o) => o !== r);
955
+ this.subscriptionEvents[e] = this.subscriptionEvents[e].filter((o) => o !== n);
893
956
  };
894
957
  }
958
+ /**
959
+ * Called when a `<searchcraft-ad>` component is rendered
960
+ */
961
+ handleAdContainerRendered(e) {
962
+ var n;
963
+ (n = this.adClient) == null || n.onAdContainerRendered(e), this.emitEvent("ad_container_rendered", {
964
+ name: "ad_container_rendered",
965
+ data: {
966
+ adContainerId: e.adContainerId,
967
+ adSource: e.adSource,
968
+ searchTerm: e.searchTerm
969
+ }
970
+ });
971
+ }
972
+ /**
973
+ * Called when a `<searchcraft-ad>` is viewed
974
+ */
975
+ handleAdContainerViewed(e) {
976
+ var n;
977
+ (n = this.adClient) == null || n.onAdContainerViewed(e), this.emitEvent("ad_container_viewed", {
978
+ name: "ad_container_viewed",
979
+ data: {
980
+ adContainerId: e.adContainerId,
981
+ adSource: e.adSource,
982
+ searchTerm: e.searchTerm
983
+ }
984
+ });
985
+ }
986
+ /**
987
+ * Perform various actions when the input is cleared
988
+ */
989
+ handleInputCleared() {
990
+ var e;
991
+ this.emitEvent("input_cleared", {
992
+ name: "input_cleared"
993
+ }), (e = this.adClient) == null || e.onInputCleared();
994
+ }
895
995
  }
896
996
 
897
997
  var zustand = {};
@@ -1554,7 +1654,7 @@ const searchcraftStore = zustand.createStore((set, get) => {
1554
1654
  initialize: (searchcraftInstance, debug = false) => {
1555
1655
  const core = searchcraftInstance;
1556
1656
  const logger = debug
1557
- ? new pe({ logLevel: F.DEBUG })
1657
+ ? new ve({ logLevel: P.DEBUG })
1558
1658
  : undefined;
1559
1659
  set({
1560
1660
  core,
@@ -1587,12 +1687,12 @@ const searchcraftStore = zustand.createStore((set, get) => {
1587
1687
  },
1588
1688
  search: async () => {
1589
1689
  const state = get();
1590
- state.logger?.log(F.INFO, `Starting search with search term: "${state.searchTerm}"`);
1690
+ state.logger?.log(P.INFO, `Starting search with search term: "${state.searchTerm}"`);
1591
1691
  if (!state.core) {
1592
1692
  throw new Error('Searchcraft instance is not initialized.');
1593
1693
  }
1594
1694
  if (!state.searchTerm.trim()) {
1595
- state.logger?.log(F.INFO, 'No search request was made: search term was empty.');
1695
+ state.logger?.log(P.INFO, 'No search request was made: search term was empty.');
1596
1696
  set({
1597
1697
  searchClientResponseItems: [],
1598
1698
  searchResultsCount: 0,
@@ -1620,8 +1720,8 @@ const searchcraftStore = zustand.createStore((set, get) => {
1620
1720
  if (facetsFromResponse) {
1621
1721
  set({ searchResponseFacetPrime: facetsFromResponse });
1622
1722
  }
1623
- state.logger?.log(F.DEBUG, `Search results: ${JSON.stringify(items)}`);
1624
- state.logger?.log(F.DEBUG, `Facets from response: ${JSON.stringify(facetsFromResponse)}`);
1723
+ state.logger?.log(P.DEBUG, `Search results: ${JSON.stringify(items)}`);
1724
+ state.logger?.log(P.DEBUG, `Facets from response: ${JSON.stringify(facetsFromResponse)}`);
1625
1725
  };
1626
1726
  const handleAdResponse = (adClientResponseItems) => {
1627
1727
  set({ adClientResponseItems });
@@ -1647,10 +1747,8 @@ const searchcraftStore = zustand.createStore((set, get) => {
1647
1747
  setSortType: (type) => set({ sortType: type }),
1648
1748
  setSearchTerm: (searchTerm) => {
1649
1749
  const { core } = get();
1650
- if (core && searchTerm.length === 0) {
1651
- core.emitEvent('input_cleared', {
1652
- name: 'input_cleared',
1653
- });
1750
+ if (searchTerm.length === 0) {
1751
+ core?.handleInputCleared();
1654
1752
  }
1655
1753
  /**
1656
1754
  * When a new searchTerm is set, also reset the sort type, search mode, and facet paths.
@@ -1681,6 +1779,6 @@ const searchcraftStore = zustand.createStore((set, get) => {
1681
1779
  return stateObject;
1682
1780
  });
1683
1781
 
1684
- export { ge as g, searchcraftStore as s };
1782
+ export { searchcraftStore as s, we as w };
1685
1783
 
1686
- //# sourceMappingURL=p-6d8b0ead.js.map
1784
+ //# sourceMappingURL=p-2e293015.js.map