@searchstax-inc/searchstudio-ux-react 0.0.1 → 0.0.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.
- package/dist/components/SearchstaxInputWidget.d.ts +11 -0
- package/dist/components/SearchstaxResultWidget.d.ts +7 -0
- package/dist/components/SearchstaxWrapper.d.ts +12 -0
- package/{src/main.tsx → dist/main.d.ts} +1 -2
- package/dist/searchstudio-ux-react-ts.cjs.js +95 -0
- package/dist/searchstudio-ux-react-ts.es.js +1726 -0
- package/dist/searchstudio-ux-react-ts.umd.js +95 -0
- package/package.json +4 -1
- package/index.html +0 -24
- package/src/App.scss +0 -1
- package/src/App.tsx +0 -234
- package/src/assets/react.svg +0 -1
- package/src/components/SearchstaxInputWidget.tsx +0 -83
- package/src/components/SearchstaxResultWidget.tsx +0 -202
- package/src/components/SearchstaxWrapper.tsx +0 -34
- package/src/index.css +0 -0
- package/src/main.js +0 -4
- package/src/stores/searchstaxStore.js +0 -5
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -24
- package/tsconfig.node.json +0 -10
- package/vite.config.ts +0 -30
- /package/{public → dist}/vite.svg +0 -0
|
@@ -0,0 +1,1726 @@
|
|
|
1
|
+
import ze, { useEffect as be, useState as pe } from "react";
|
|
2
|
+
var d = {}, Rt = {
|
|
3
|
+
get exports() {
|
|
4
|
+
return d;
|
|
5
|
+
},
|
|
6
|
+
set exports(r) {
|
|
7
|
+
d = r;
|
|
8
|
+
}
|
|
9
|
+
}, J = {};
|
|
10
|
+
/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
var qe;
|
|
20
|
+
function St() {
|
|
21
|
+
if (qe)
|
|
22
|
+
return J;
|
|
23
|
+
qe = 1;
|
|
24
|
+
var r = ze, e = Symbol.for("react.element"), s = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function u(l, h, p) {
|
|
26
|
+
var C, I = {}, L = null, D = null;
|
|
27
|
+
p !== void 0 && (L = "" + p), h.key !== void 0 && (L = "" + h.key), h.ref !== void 0 && (D = h.ref);
|
|
28
|
+
for (C in h)
|
|
29
|
+
n.call(h, C) && !i.hasOwnProperty(C) && (I[C] = h[C]);
|
|
30
|
+
if (l && l.defaultProps)
|
|
31
|
+
for (C in h = l.defaultProps, h)
|
|
32
|
+
I[C] === void 0 && (I[C] = h[C]);
|
|
33
|
+
return { $$typeof: e, type: l, key: L, ref: D, props: I, _owner: a.current };
|
|
34
|
+
}
|
|
35
|
+
return J.Fragment = s, J.jsx = u, J.jsxs = u, J;
|
|
36
|
+
}
|
|
37
|
+
var X = {};
|
|
38
|
+
/**
|
|
39
|
+
* @license React
|
|
40
|
+
* react-jsx-runtime.development.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/
|
|
47
|
+
var $e;
|
|
48
|
+
function Et() {
|
|
49
|
+
return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
var r = ze, e = Symbol.for("react.element"), s = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), K = Symbol.iterator, E = "@@iterator";
|
|
51
|
+
function O(t) {
|
|
52
|
+
if (t === null || typeof t != "object")
|
|
53
|
+
return null;
|
|
54
|
+
var o = K && t[K] || t[E];
|
|
55
|
+
return typeof o == "function" ? o : null;
|
|
56
|
+
}
|
|
57
|
+
var R = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
|
+
function y(t) {
|
|
59
|
+
{
|
|
60
|
+
for (var o = arguments.length, c = new Array(o > 1 ? o - 1 : 0), f = 1; f < o; f++)
|
|
61
|
+
c[f - 1] = arguments[f];
|
|
62
|
+
B("error", t, c);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function B(t, o, c) {
|
|
66
|
+
{
|
|
67
|
+
var f = R.ReactDebugCurrentFrame, b = f.getStackAddendum();
|
|
68
|
+
b !== "" && (o += "%s", c = c.concat([b]));
|
|
69
|
+
var x = c.map(function(m) {
|
|
70
|
+
return String(m);
|
|
71
|
+
});
|
|
72
|
+
x.unshift("Warning: " + o), Function.prototype.apply.call(console[t], console, x);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
var H = !1, P = !1, Y = !1, ie = !1, j = !1, xe;
|
|
76
|
+
xe = Symbol.for("react.module.reference");
|
|
77
|
+
function Ge(t) {
|
|
78
|
+
return !!(typeof t == "string" || typeof t == "function" || t === n || t === i || j || t === a || t === p || t === C || ie || t === D || H || P || Y || typeof t == "object" && t !== null && (t.$$typeof === L || t.$$typeof === I || t.$$typeof === u || t.$$typeof === l || t.$$typeof === h || // This needs to include all possible module reference object
|
|
79
|
+
// types supported by any Flight configuration anywhere since
|
|
80
|
+
// we don't know which Flight build this will end up being used
|
|
81
|
+
// with.
|
|
82
|
+
t.$$typeof === xe || t.getModuleId !== void 0));
|
|
83
|
+
}
|
|
84
|
+
function Je(t, o, c) {
|
|
85
|
+
var f = t.displayName;
|
|
86
|
+
if (f)
|
|
87
|
+
return f;
|
|
88
|
+
var b = o.displayName || o.name || "";
|
|
89
|
+
return b !== "" ? c + "(" + b + ")" : c;
|
|
90
|
+
}
|
|
91
|
+
function Ce(t) {
|
|
92
|
+
return t.displayName || "Context";
|
|
93
|
+
}
|
|
94
|
+
function V(t) {
|
|
95
|
+
if (t == null)
|
|
96
|
+
return null;
|
|
97
|
+
if (typeof t.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
98
|
+
return t.displayName || t.name || null;
|
|
99
|
+
if (typeof t == "string")
|
|
100
|
+
return t;
|
|
101
|
+
switch (t) {
|
|
102
|
+
case n:
|
|
103
|
+
return "Fragment";
|
|
104
|
+
case s:
|
|
105
|
+
return "Portal";
|
|
106
|
+
case i:
|
|
107
|
+
return "Profiler";
|
|
108
|
+
case a:
|
|
109
|
+
return "StrictMode";
|
|
110
|
+
case p:
|
|
111
|
+
return "Suspense";
|
|
112
|
+
case C:
|
|
113
|
+
return "SuspenseList";
|
|
114
|
+
}
|
|
115
|
+
if (typeof t == "object")
|
|
116
|
+
switch (t.$$typeof) {
|
|
117
|
+
case l:
|
|
118
|
+
var o = t;
|
|
119
|
+
return Ce(o) + ".Consumer";
|
|
120
|
+
case u:
|
|
121
|
+
var c = t;
|
|
122
|
+
return Ce(c._context) + ".Provider";
|
|
123
|
+
case h:
|
|
124
|
+
return Je(t, t.render, "ForwardRef");
|
|
125
|
+
case I:
|
|
126
|
+
var f = t.displayName || null;
|
|
127
|
+
return f !== null ? f : V(t.type) || "Memo";
|
|
128
|
+
case L: {
|
|
129
|
+
var b = t, x = b._payload, m = b._init;
|
|
130
|
+
try {
|
|
131
|
+
return V(m(x));
|
|
132
|
+
} catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
var U = Object.assign, z = 0, Re, Se, Ee, ke, Te, Ie, Ae;
|
|
140
|
+
function we() {
|
|
141
|
+
}
|
|
142
|
+
we.__reactDisabledLog = !0;
|
|
143
|
+
function Xe() {
|
|
144
|
+
{
|
|
145
|
+
if (z === 0) {
|
|
146
|
+
Re = console.log, Se = console.info, Ee = console.warn, ke = console.error, Te = console.group, Ie = console.groupCollapsed, Ae = console.groupEnd;
|
|
147
|
+
var t = {
|
|
148
|
+
configurable: !0,
|
|
149
|
+
enumerable: !0,
|
|
150
|
+
value: we,
|
|
151
|
+
writable: !0
|
|
152
|
+
};
|
|
153
|
+
Object.defineProperties(console, {
|
|
154
|
+
info: t,
|
|
155
|
+
log: t,
|
|
156
|
+
warn: t,
|
|
157
|
+
error: t,
|
|
158
|
+
group: t,
|
|
159
|
+
groupCollapsed: t,
|
|
160
|
+
groupEnd: t
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
z++;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function Qe() {
|
|
167
|
+
{
|
|
168
|
+
if (z--, z === 0) {
|
|
169
|
+
var t = {
|
|
170
|
+
configurable: !0,
|
|
171
|
+
enumerable: !0,
|
|
172
|
+
writable: !0
|
|
173
|
+
};
|
|
174
|
+
Object.defineProperties(console, {
|
|
175
|
+
log: U({}, t, {
|
|
176
|
+
value: Re
|
|
177
|
+
}),
|
|
178
|
+
info: U({}, t, {
|
|
179
|
+
value: Se
|
|
180
|
+
}),
|
|
181
|
+
warn: U({}, t, {
|
|
182
|
+
value: Ee
|
|
183
|
+
}),
|
|
184
|
+
error: U({}, t, {
|
|
185
|
+
value: ke
|
|
186
|
+
}),
|
|
187
|
+
group: U({}, t, {
|
|
188
|
+
value: Te
|
|
189
|
+
}),
|
|
190
|
+
groupCollapsed: U({}, t, {
|
|
191
|
+
value: Ie
|
|
192
|
+
}),
|
|
193
|
+
groupEnd: U({}, t, {
|
|
194
|
+
value: Ae
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
z < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
var oe = R.ReactCurrentDispatcher, ue;
|
|
202
|
+
function te(t, o, c) {
|
|
203
|
+
{
|
|
204
|
+
if (ue === void 0)
|
|
205
|
+
try {
|
|
206
|
+
throw Error();
|
|
207
|
+
} catch (b) {
|
|
208
|
+
var f = b.stack.trim().match(/\n( *(at )?)/);
|
|
209
|
+
ue = f && f[1] || "";
|
|
210
|
+
}
|
|
211
|
+
return `
|
|
212
|
+
` + ue + t;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
var ce = !1, se;
|
|
216
|
+
{
|
|
217
|
+
var Ze = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
+
se = new Ze();
|
|
219
|
+
}
|
|
220
|
+
function Le(t, o) {
|
|
221
|
+
if (!t || ce)
|
|
222
|
+
return "";
|
|
223
|
+
{
|
|
224
|
+
var c = se.get(t);
|
|
225
|
+
if (c !== void 0)
|
|
226
|
+
return c;
|
|
227
|
+
}
|
|
228
|
+
var f;
|
|
229
|
+
ce = !0;
|
|
230
|
+
var b = Error.prepareStackTrace;
|
|
231
|
+
Error.prepareStackTrace = void 0;
|
|
232
|
+
var x;
|
|
233
|
+
x = oe.current, oe.current = null, Xe();
|
|
234
|
+
try {
|
|
235
|
+
if (o) {
|
|
236
|
+
var m = function() {
|
|
237
|
+
throw Error();
|
|
238
|
+
};
|
|
239
|
+
if (Object.defineProperty(m.prototype, "props", {
|
|
240
|
+
set: function() {
|
|
241
|
+
throw Error();
|
|
242
|
+
}
|
|
243
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
244
|
+
try {
|
|
245
|
+
Reflect.construct(m, []);
|
|
246
|
+
} catch (M) {
|
|
247
|
+
f = M;
|
|
248
|
+
}
|
|
249
|
+
Reflect.construct(t, [], m);
|
|
250
|
+
} else {
|
|
251
|
+
try {
|
|
252
|
+
m.call();
|
|
253
|
+
} catch (M) {
|
|
254
|
+
f = M;
|
|
255
|
+
}
|
|
256
|
+
t.call(m.prototype);
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
try {
|
|
260
|
+
throw Error();
|
|
261
|
+
} catch (M) {
|
|
262
|
+
f = M;
|
|
263
|
+
}
|
|
264
|
+
t();
|
|
265
|
+
}
|
|
266
|
+
} catch (M) {
|
|
267
|
+
if (M && f && typeof M.stack == "string") {
|
|
268
|
+
for (var v = M.stack.split(`
|
|
269
|
+
`), A = f.stack.split(`
|
|
270
|
+
`), S = v.length - 1, k = A.length - 1; S >= 1 && k >= 0 && v[S] !== A[k]; )
|
|
271
|
+
k--;
|
|
272
|
+
for (; S >= 1 && k >= 0; S--, k--)
|
|
273
|
+
if (v[S] !== A[k]) {
|
|
274
|
+
if (S !== 1 || k !== 1)
|
|
275
|
+
do
|
|
276
|
+
if (S--, k--, k < 0 || v[S] !== A[k]) {
|
|
277
|
+
var _ = `
|
|
278
|
+
` + v[S].replace(" at new ", " at ");
|
|
279
|
+
return t.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", t.displayName)), typeof t == "function" && se.set(t, _), _;
|
|
280
|
+
}
|
|
281
|
+
while (S >= 1 && k >= 0);
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
} finally {
|
|
286
|
+
ce = !1, oe.current = x, Qe(), Error.prepareStackTrace = b;
|
|
287
|
+
}
|
|
288
|
+
var W = t ? t.displayName || t.name : "", We = W ? te(W) : "";
|
|
289
|
+
return typeof t == "function" && se.set(t, We), We;
|
|
290
|
+
}
|
|
291
|
+
function et(t, o, c) {
|
|
292
|
+
return Le(t, !1);
|
|
293
|
+
}
|
|
294
|
+
function tt(t) {
|
|
295
|
+
var o = t.prototype;
|
|
296
|
+
return !!(o && o.isReactComponent);
|
|
297
|
+
}
|
|
298
|
+
function re(t, o, c) {
|
|
299
|
+
if (t == null)
|
|
300
|
+
return "";
|
|
301
|
+
if (typeof t == "function")
|
|
302
|
+
return Le(t, tt(t));
|
|
303
|
+
if (typeof t == "string")
|
|
304
|
+
return te(t);
|
|
305
|
+
switch (t) {
|
|
306
|
+
case p:
|
|
307
|
+
return te("Suspense");
|
|
308
|
+
case C:
|
|
309
|
+
return te("SuspenseList");
|
|
310
|
+
}
|
|
311
|
+
if (typeof t == "object")
|
|
312
|
+
switch (t.$$typeof) {
|
|
313
|
+
case h:
|
|
314
|
+
return et(t.render);
|
|
315
|
+
case I:
|
|
316
|
+
return re(t.type, o, c);
|
|
317
|
+
case L: {
|
|
318
|
+
var f = t, b = f._payload, x = f._init;
|
|
319
|
+
try {
|
|
320
|
+
return re(x(b), o, c);
|
|
321
|
+
} catch {
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return "";
|
|
326
|
+
}
|
|
327
|
+
var ae = Object.prototype.hasOwnProperty, _e = {}, je = R.ReactDebugCurrentFrame;
|
|
328
|
+
function ne(t) {
|
|
329
|
+
if (t) {
|
|
330
|
+
var o = t._owner, c = re(t.type, t._source, o ? o.type : null);
|
|
331
|
+
je.setExtraStackFrame(c);
|
|
332
|
+
} else
|
|
333
|
+
je.setExtraStackFrame(null);
|
|
334
|
+
}
|
|
335
|
+
function st(t, o, c, f, b) {
|
|
336
|
+
{
|
|
337
|
+
var x = Function.call.bind(ae);
|
|
338
|
+
for (var m in t)
|
|
339
|
+
if (x(t, m)) {
|
|
340
|
+
var v = void 0;
|
|
341
|
+
try {
|
|
342
|
+
if (typeof t[m] != "function") {
|
|
343
|
+
var A = Error((f || "React class") + ": " + c + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
|
+
throw A.name = "Invariant Violation", A;
|
|
345
|
+
}
|
|
346
|
+
v = t[m](o, m, f, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
|
+
} catch (S) {
|
|
348
|
+
v = S;
|
|
349
|
+
}
|
|
350
|
+
v && !(v instanceof Error) && (ne(b), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", f || "React class", c, m, typeof v), ne(null)), v instanceof Error && !(v.message in _e) && (_e[v.message] = !0, ne(b), y("Failed %s type: %s", c, v.message), ne(null));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
var rt = Array.isArray;
|
|
355
|
+
function le(t) {
|
|
356
|
+
return rt(t);
|
|
357
|
+
}
|
|
358
|
+
function at(t) {
|
|
359
|
+
{
|
|
360
|
+
var o = typeof Symbol == "function" && Symbol.toStringTag, c = o && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
361
|
+
return c;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function nt(t) {
|
|
365
|
+
try {
|
|
366
|
+
return Oe(t), !1;
|
|
367
|
+
} catch {
|
|
368
|
+
return !0;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function Oe(t) {
|
|
372
|
+
return "" + t;
|
|
373
|
+
}
|
|
374
|
+
function Pe(t) {
|
|
375
|
+
if (nt(t))
|
|
376
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", at(t)), Oe(t);
|
|
377
|
+
}
|
|
378
|
+
var G = R.ReactCurrentOwner, it = {
|
|
379
|
+
key: !0,
|
|
380
|
+
ref: !0,
|
|
381
|
+
__self: !0,
|
|
382
|
+
__source: !0
|
|
383
|
+
}, Ve, Me, he;
|
|
384
|
+
he = {};
|
|
385
|
+
function ot(t) {
|
|
386
|
+
if (ae.call(t, "ref")) {
|
|
387
|
+
var o = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
388
|
+
if (o && o.isReactWarning)
|
|
389
|
+
return !1;
|
|
390
|
+
}
|
|
391
|
+
return t.ref !== void 0;
|
|
392
|
+
}
|
|
393
|
+
function ut(t) {
|
|
394
|
+
if (ae.call(t, "key")) {
|
|
395
|
+
var o = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
396
|
+
if (o && o.isReactWarning)
|
|
397
|
+
return !1;
|
|
398
|
+
}
|
|
399
|
+
return t.key !== void 0;
|
|
400
|
+
}
|
|
401
|
+
function ct(t, o) {
|
|
402
|
+
if (typeof t.ref == "string" && G.current && o && G.current.stateNode !== o) {
|
|
403
|
+
var c = V(G.current.type);
|
|
404
|
+
he[c] || (y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', V(G.current.type), t.ref), he[c] = !0);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function lt(t, o) {
|
|
408
|
+
{
|
|
409
|
+
var c = function() {
|
|
410
|
+
Ve || (Ve = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
411
|
+
};
|
|
412
|
+
c.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
413
|
+
get: c,
|
|
414
|
+
configurable: !0
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function ht(t, o) {
|
|
419
|
+
{
|
|
420
|
+
var c = function() {
|
|
421
|
+
Me || (Me = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
422
|
+
};
|
|
423
|
+
c.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
424
|
+
get: c,
|
|
425
|
+
configurable: !0
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
var gt = function(t, o, c, f, b, x, m) {
|
|
430
|
+
var v = {
|
|
431
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
432
|
+
$$typeof: e,
|
|
433
|
+
// Built-in properties that belong on the element
|
|
434
|
+
type: t,
|
|
435
|
+
key: o,
|
|
436
|
+
ref: c,
|
|
437
|
+
props: m,
|
|
438
|
+
// Record the component responsible for creating this element.
|
|
439
|
+
_owner: x
|
|
440
|
+
};
|
|
441
|
+
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
442
|
+
configurable: !1,
|
|
443
|
+
enumerable: !1,
|
|
444
|
+
writable: !0,
|
|
445
|
+
value: !1
|
|
446
|
+
}), Object.defineProperty(v, "_self", {
|
|
447
|
+
configurable: !1,
|
|
448
|
+
enumerable: !1,
|
|
449
|
+
writable: !1,
|
|
450
|
+
value: f
|
|
451
|
+
}), Object.defineProperty(v, "_source", {
|
|
452
|
+
configurable: !1,
|
|
453
|
+
enumerable: !1,
|
|
454
|
+
writable: !1,
|
|
455
|
+
value: b
|
|
456
|
+
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
457
|
+
};
|
|
458
|
+
function dt(t, o, c, f, b) {
|
|
459
|
+
{
|
|
460
|
+
var x, m = {}, v = null, A = null;
|
|
461
|
+
c !== void 0 && (Pe(c), v = "" + c), ut(o) && (Pe(o.key), v = "" + o.key), ot(o) && (A = o.ref, ct(o, b));
|
|
462
|
+
for (x in o)
|
|
463
|
+
ae.call(o, x) && !it.hasOwnProperty(x) && (m[x] = o[x]);
|
|
464
|
+
if (t && t.defaultProps) {
|
|
465
|
+
var S = t.defaultProps;
|
|
466
|
+
for (x in S)
|
|
467
|
+
m[x] === void 0 && (m[x] = S[x]);
|
|
468
|
+
}
|
|
469
|
+
if (v || A) {
|
|
470
|
+
var k = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
471
|
+
v && lt(m, k), A && ht(m, k);
|
|
472
|
+
}
|
|
473
|
+
return gt(t, v, A, b, f, G.current, m);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
var ge = R.ReactCurrentOwner, Fe = R.ReactDebugCurrentFrame;
|
|
477
|
+
function N(t) {
|
|
478
|
+
if (t) {
|
|
479
|
+
var o = t._owner, c = re(t.type, t._source, o ? o.type : null);
|
|
480
|
+
Fe.setExtraStackFrame(c);
|
|
481
|
+
} else
|
|
482
|
+
Fe.setExtraStackFrame(null);
|
|
483
|
+
}
|
|
484
|
+
var de;
|
|
485
|
+
de = !1;
|
|
486
|
+
function fe(t) {
|
|
487
|
+
return typeof t == "object" && t !== null && t.$$typeof === e;
|
|
488
|
+
}
|
|
489
|
+
function De() {
|
|
490
|
+
{
|
|
491
|
+
if (ge.current) {
|
|
492
|
+
var t = V(ge.current.type);
|
|
493
|
+
if (t)
|
|
494
|
+
return `
|
|
495
|
+
|
|
496
|
+
Check the render method of \`` + t + "`.";
|
|
497
|
+
}
|
|
498
|
+
return "";
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
function ft(t) {
|
|
502
|
+
{
|
|
503
|
+
if (t !== void 0) {
|
|
504
|
+
var o = t.fileName.replace(/^.*[\\\/]/, ""), c = t.lineNumber;
|
|
505
|
+
return `
|
|
506
|
+
|
|
507
|
+
Check your code at ` + o + ":" + c + ".";
|
|
508
|
+
}
|
|
509
|
+
return "";
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
var Be = {};
|
|
513
|
+
function pt(t) {
|
|
514
|
+
{
|
|
515
|
+
var o = De();
|
|
516
|
+
if (!o) {
|
|
517
|
+
var c = typeof t == "string" ? t : t.displayName || t.name;
|
|
518
|
+
c && (o = `
|
|
519
|
+
|
|
520
|
+
Check the top-level render call using <` + c + ">.");
|
|
521
|
+
}
|
|
522
|
+
return o;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
function Ue(t, o) {
|
|
526
|
+
{
|
|
527
|
+
if (!t._store || t._store.validated || t.key != null)
|
|
528
|
+
return;
|
|
529
|
+
t._store.validated = !0;
|
|
530
|
+
var c = pt(o);
|
|
531
|
+
if (Be[c])
|
|
532
|
+
return;
|
|
533
|
+
Be[c] = !0;
|
|
534
|
+
var f = "";
|
|
535
|
+
t && t._owner && t._owner !== ge.current && (f = " It was passed a child from " + V(t._owner.type) + "."), N(t), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, f), N(null);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
function He(t, o) {
|
|
539
|
+
{
|
|
540
|
+
if (typeof t != "object")
|
|
541
|
+
return;
|
|
542
|
+
if (le(t))
|
|
543
|
+
for (var c = 0; c < t.length; c++) {
|
|
544
|
+
var f = t[c];
|
|
545
|
+
fe(f) && Ue(f, o);
|
|
546
|
+
}
|
|
547
|
+
else if (fe(t))
|
|
548
|
+
t._store && (t._store.validated = !0);
|
|
549
|
+
else if (t) {
|
|
550
|
+
var b = O(t);
|
|
551
|
+
if (typeof b == "function" && b !== t.entries)
|
|
552
|
+
for (var x = b.call(t), m; !(m = x.next()).done; )
|
|
553
|
+
fe(m.value) && Ue(m.value, o);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
function vt(t) {
|
|
558
|
+
{
|
|
559
|
+
var o = t.type;
|
|
560
|
+
if (o == null || typeof o == "string")
|
|
561
|
+
return;
|
|
562
|
+
var c;
|
|
563
|
+
if (typeof o == "function")
|
|
564
|
+
c = o.propTypes;
|
|
565
|
+
else if (typeof o == "object" && (o.$$typeof === h || // Note: Memo only checks outer props here.
|
|
566
|
+
// Inner props are checked in the reconciler.
|
|
567
|
+
o.$$typeof === I))
|
|
568
|
+
c = o.propTypes;
|
|
569
|
+
else
|
|
570
|
+
return;
|
|
571
|
+
if (c) {
|
|
572
|
+
var f = V(o);
|
|
573
|
+
st(c, t.props, "prop", f, t);
|
|
574
|
+
} else if (o.PropTypes !== void 0 && !de) {
|
|
575
|
+
de = !0;
|
|
576
|
+
var b = V(o);
|
|
577
|
+
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
|
|
578
|
+
}
|
|
579
|
+
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
function mt(t) {
|
|
583
|
+
{
|
|
584
|
+
for (var o = Object.keys(t.props), c = 0; c < o.length; c++) {
|
|
585
|
+
var f = o[c];
|
|
586
|
+
if (f !== "children" && f !== "key") {
|
|
587
|
+
N(t), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", f), N(null);
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
t.ref !== null && (N(t), y("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
function Ne(t, o, c, f, b, x) {
|
|
595
|
+
{
|
|
596
|
+
var m = Ge(t);
|
|
597
|
+
if (!m) {
|
|
598
|
+
var v = "";
|
|
599
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
600
|
+
var A = ft(b);
|
|
601
|
+
A ? v += A : v += De();
|
|
602
|
+
var S;
|
|
603
|
+
t === null ? S = "null" : le(t) ? S = "array" : t !== void 0 && t.$$typeof === e ? (S = "<" + (V(t.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : S = typeof t, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, v);
|
|
604
|
+
}
|
|
605
|
+
var k = dt(t, o, c, b, x);
|
|
606
|
+
if (k == null)
|
|
607
|
+
return k;
|
|
608
|
+
if (m) {
|
|
609
|
+
var _ = o.children;
|
|
610
|
+
if (_ !== void 0)
|
|
611
|
+
if (f)
|
|
612
|
+
if (le(_)) {
|
|
613
|
+
for (var W = 0; W < _.length; W++)
|
|
614
|
+
He(_[W], t);
|
|
615
|
+
Object.freeze && Object.freeze(_);
|
|
616
|
+
} else
|
|
617
|
+
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
618
|
+
else
|
|
619
|
+
He(_, t);
|
|
620
|
+
}
|
|
621
|
+
return t === n ? mt(k) : vt(k), k;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function bt(t, o, c) {
|
|
625
|
+
return Ne(t, o, c, !0);
|
|
626
|
+
}
|
|
627
|
+
function yt(t, o, c) {
|
|
628
|
+
return Ne(t, o, c, !1);
|
|
629
|
+
}
|
|
630
|
+
var xt = yt, Ct = bt;
|
|
631
|
+
X.Fragment = n, X.jsx = xt, X.jsxs = Ct;
|
|
632
|
+
}()), X;
|
|
633
|
+
}
|
|
634
|
+
(function(r) {
|
|
635
|
+
process.env.NODE_ENV === "production" ? r.exports = St() : r.exports = Et();
|
|
636
|
+
})(Rt);
|
|
637
|
+
var kt = Object.defineProperty, Tt = (r, e, s) => e in r ? kt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s, g = (r, e, s) => (Tt(r, typeof e != "symbol" ? e + "" : e, s), s);
|
|
638
|
+
class Q {
|
|
639
|
+
constructor(e) {
|
|
640
|
+
g(this, "value"), g(this, "observers", []), this.value = e, this.observers = [];
|
|
641
|
+
}
|
|
642
|
+
subscribe(e) {
|
|
643
|
+
this.observers.push(e), e(this.value);
|
|
644
|
+
}
|
|
645
|
+
unsubscribe(e) {
|
|
646
|
+
const s = this.observers.indexOf(e);
|
|
647
|
+
s !== -1 && this.observers.splice(s, 1);
|
|
648
|
+
}
|
|
649
|
+
setValue(e) {
|
|
650
|
+
this.value = e, this.notify();
|
|
651
|
+
}
|
|
652
|
+
getValue() {
|
|
653
|
+
return this.value;
|
|
654
|
+
}
|
|
655
|
+
notify() {
|
|
656
|
+
this.observers.forEach((e) => e(this.value));
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
class It {
|
|
660
|
+
constructor() {
|
|
661
|
+
g(this, "searchTermChangeObservable", new Q("")), g(this, "loadingChangeObservable", new Q(!1)), g(this, "searchResultsObservable", new Q(null)), g(this, "searchResultsMetadataObservable", new Q(null)), g(this, "searchAutosuggestObservable", new Q(null)), g(this, "currentPage", 1), g(this, "renderingEngine", "mustache");
|
|
662
|
+
}
|
|
663
|
+
setSearchTerm(e) {
|
|
664
|
+
this.searchTermChangeObservable.setValue(e);
|
|
665
|
+
}
|
|
666
|
+
setRenderingEngine(e) {
|
|
667
|
+
this.renderingEngine = e;
|
|
668
|
+
}
|
|
669
|
+
setCurrentPage(e) {
|
|
670
|
+
this.currentPage = e;
|
|
671
|
+
}
|
|
672
|
+
setLoading(e) {
|
|
673
|
+
this.loadingChangeObservable.setValue(e);
|
|
674
|
+
}
|
|
675
|
+
setSearchResults(e) {
|
|
676
|
+
this.searchResultsObservable.setValue(e);
|
|
677
|
+
}
|
|
678
|
+
setSearchResultsMetadata(e) {
|
|
679
|
+
this.searchResultsMetadataObservable.setValue(e);
|
|
680
|
+
}
|
|
681
|
+
setSearchAutosuggest(e) {
|
|
682
|
+
this.searchAutosuggestObservable.setValue(e);
|
|
683
|
+
}
|
|
684
|
+
get searchResultsValue() {
|
|
685
|
+
return this.searchResultsObservable.getValue();
|
|
686
|
+
}
|
|
687
|
+
get searchTermValue() {
|
|
688
|
+
return this.searchTermChangeObservable.getValue();
|
|
689
|
+
}
|
|
690
|
+
get loadingValue() {
|
|
691
|
+
return this.loadingChangeObservable.getValue();
|
|
692
|
+
}
|
|
693
|
+
get searchAutosuggestValue() {
|
|
694
|
+
return this.searchAutosuggestObservable.getValue();
|
|
695
|
+
}
|
|
696
|
+
get searchResultsMetadataValue() {
|
|
697
|
+
return this.searchResultsMetadataObservable.getValue();
|
|
698
|
+
}
|
|
699
|
+
get currentPageValue() {
|
|
700
|
+
return this.currentPage;
|
|
701
|
+
}
|
|
702
|
+
get renderingEngineValue() {
|
|
703
|
+
return this.renderingEngine;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
class ve {
|
|
707
|
+
static combineResultsWithMetadata(e) {
|
|
708
|
+
const s = [], n = parseInt(e.response.start + "");
|
|
709
|
+
return e.response.docs.forEach((a, i) => {
|
|
710
|
+
const u = {
|
|
711
|
+
custom: null,
|
|
712
|
+
uniqueId: this.getValueByKey(
|
|
713
|
+
e.responseHeader.params.uniqueId,
|
|
714
|
+
a,
|
|
715
|
+
e
|
|
716
|
+
) ?? "",
|
|
717
|
+
position: n + i + 1,
|
|
718
|
+
ribbon: this.doesMapExist("ribbon", e) ? this.getValueByKey("ribbon", a, e) : null,
|
|
719
|
+
paths: this.doesMapExist("paths", e) ? this.getValueByKey("paths", a, e) : null,
|
|
720
|
+
url: this.doesMapExist("url", e) ? this.getValueByKey("url", a, e) : null,
|
|
721
|
+
title: this.doesMapExist("title", e) ? this.getValueByKey("title", a, e) : null,
|
|
722
|
+
promoted: a["[elevated]"] ? a["[elevated]"] : !1,
|
|
723
|
+
thumbnail: this.doesMapExist("thumbnail", e) ? this.getValueByKey("thumbnail", a, e) : null,
|
|
724
|
+
date: this.doesMapExist("date", e) ? this.getValueByKey("date", a, e) : null,
|
|
725
|
+
snippet: this.doesMapExist("snippet", e) ? this.getValueByKey("snippet", a, e) : null,
|
|
726
|
+
description: this.doesMapExist("description", e) ? this.getValueByKey("description", a, e) : null,
|
|
727
|
+
unmappedFields: this.getUnmappedFields(a, e),
|
|
728
|
+
allFields: this.getAllFields(a, e)
|
|
729
|
+
};
|
|
730
|
+
s.push(u);
|
|
731
|
+
}), s;
|
|
732
|
+
}
|
|
733
|
+
static extractSearchResultsMetadata(e) {
|
|
734
|
+
var s, n, a, i;
|
|
735
|
+
let u = "";
|
|
736
|
+
return u = ((i = (a = (n = (s = e == null ? void 0 : e.spellcheck) == null ? void 0 : s.suggestions) == null ? void 0 : n[0]) == null ? void 0 : a.suggestion) == null ? void 0 : i[0]) ?? "", typeof u != "string" && (u = (u == null ? void 0 : u.word) ?? ""), {
|
|
737
|
+
recordsPerPageValue: parseInt(e.responseHeader.params.rows),
|
|
738
|
+
startDocVal: parseInt(e.response.start + ""),
|
|
739
|
+
totalResultsValue: parseInt(e.response.numFound + ""),
|
|
740
|
+
latency: parseInt(e.responseHeader.QTime + ""),
|
|
741
|
+
endDocValue: parseInt(e.responseHeader.params.rows) + parseInt(e.response.start + ""),
|
|
742
|
+
spellingSuggestion: u
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
static findResultByUniqueId(e, s) {
|
|
746
|
+
return s.find((n) => n.uniqueId === e) ?? null;
|
|
747
|
+
}
|
|
748
|
+
static getUnmappedFields(e, s) {
|
|
749
|
+
const n = s.metadata.results.filter((i) => i.result_card === "").map((i) => i.name), a = [];
|
|
750
|
+
for (const i of Object.keys(e))
|
|
751
|
+
if (n.indexOf(i) !== -1) {
|
|
752
|
+
const u = Array.isArray(e[i]) ? e[i].join(", ") : e[i];
|
|
753
|
+
a.push({
|
|
754
|
+
key: i,
|
|
755
|
+
value: u,
|
|
756
|
+
isImage: this.checkIfImage(e[i])
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
return a;
|
|
760
|
+
}
|
|
761
|
+
static checkIfImage(e) {
|
|
762
|
+
return e === void 0 || typeof e != "string" ? !1 : /\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e);
|
|
763
|
+
}
|
|
764
|
+
static getAllFields(e, s) {
|
|
765
|
+
const n = s.metadata.results.map((i) => i.name), a = [];
|
|
766
|
+
for (const i of Object.keys(e))
|
|
767
|
+
n.indexOf(i) !== -1 && a.push({
|
|
768
|
+
key: i,
|
|
769
|
+
value: e[i],
|
|
770
|
+
isImage: this.checkIfImage(e[i])
|
|
771
|
+
});
|
|
772
|
+
return a;
|
|
773
|
+
}
|
|
774
|
+
static doesMapExist(e, s) {
|
|
775
|
+
return s.metadata.results.find((n) => n.result_card === e) !== void 0;
|
|
776
|
+
}
|
|
777
|
+
static getValueByKey(e, s, n) {
|
|
778
|
+
const a = n.metadata.results.find(
|
|
779
|
+
(u) => u.result_card === e
|
|
780
|
+
);
|
|
781
|
+
if (a === void 0)
|
|
782
|
+
return null;
|
|
783
|
+
const i = s[a.name];
|
|
784
|
+
return i === void 0 ? null : typeof i == "string" ? i : Array.isArray(i) ? i.join(", ") : null;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
class At {
|
|
788
|
+
constructor(e, s) {
|
|
789
|
+
g(this, "url", ""), g(this, "relatedSearches", ""), g(this, "suggester", ""), g(this, "authHeader"), g(this, "authHeaderRelated"), g(this, "language", "en"), g(this, "trackApiKey", ""), g(this, "session", ""), g(this, "searchAuthType"), g(this, "controllerSearch"), g(this, "signalSearch"), g(this, "controllerSuggest"), g(this, "signalSuggest"), g(this, "dataLayer"), this.dataLayer = s, this.url = e.searchURL, this.language = e.language, this.suggester = e.suggesterURL, this.trackApiKey = e.trackApiKey, this.session = e.sessionId, this.searchAuthType = e.authType, this.authHeader = new Headers(), this.authHeader.append("Accept", "application/json");
|
|
790
|
+
const n = this.searchAuthType === "token" ? `Token ${e.searchAuth}` : `Basic ${e.searchAuth}`;
|
|
791
|
+
this.authHeader.append("Authorization", n), this.authHeaderRelated = new Headers(), this.authHeaderRelated.append("Accept", "application/json"), this.authHeaderRelated.append("Authorization", e.searchAuth);
|
|
792
|
+
}
|
|
793
|
+
search(e, s, n) {
|
|
794
|
+
this.dataLayer.setSearchTerm(e), this.dataLayer.setLoading(!0), this.controllerSearch && this.controllerSearch.abort(), this.controllerSearch = new AbortController(), this.signalSearch = this.controllerSearch.signal;
|
|
795
|
+
const a = new Proxy(
|
|
796
|
+
new URLSearchParams(window.location.search),
|
|
797
|
+
{
|
|
798
|
+
get: (l, h) => l.get(h) ?? ""
|
|
799
|
+
}
|
|
800
|
+
), i = a.languageVariant ? (
|
|
801
|
+
//@ts-expect-error - this is a hack to get around the fact that the urlQueryParams is a proxy
|
|
802
|
+
"&fq=_language:" + a.languageVariant
|
|
803
|
+
) : "", u = this.url + "?q=" + encodeURIComponent(e.trim()) + this.toQueryString(n) + "&language=" + this.language + i;
|
|
804
|
+
fetch(u, {
|
|
805
|
+
method: "GET",
|
|
806
|
+
headers: this.authHeader,
|
|
807
|
+
credentials: "same-origin",
|
|
808
|
+
signal: this.signalSearch
|
|
809
|
+
}).then((l) => l.json()).then((l) => {
|
|
810
|
+
this.dataLayer.setLoading(!1), s(l);
|
|
811
|
+
}).catch((l) => {
|
|
812
|
+
this.dataLayer.setLoading(!1), console.log(l);
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
suggest(e, s, n) {
|
|
816
|
+
this.controllerSuggest && this.controllerSuggest.abort(), this.controllerSuggest = new AbortController(), this.signalSuggest = this.controllerSuggest.signal;
|
|
817
|
+
const a = this.suggester + "?q=" + e.trim() + this.toQueryString(n) + "&language=" + this.language;
|
|
818
|
+
fetch(a, {
|
|
819
|
+
method: "GET",
|
|
820
|
+
headers: this.authHeader,
|
|
821
|
+
credentials: "same-origin",
|
|
822
|
+
signal: this.signalSuggest
|
|
823
|
+
}).then((i) => i.json()).then((i) => {
|
|
824
|
+
s(i);
|
|
825
|
+
}).catch((i) => console.log(i));
|
|
826
|
+
}
|
|
827
|
+
fields() {
|
|
828
|
+
return this.fields;
|
|
829
|
+
}
|
|
830
|
+
toQueryString(e) {
|
|
831
|
+
return "&" + e.join("&");
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
class wt {
|
|
835
|
+
static getOrSetCookie(e) {
|
|
836
|
+
let s = this.getCookie(e);
|
|
837
|
+
return s == null && (s = this.makeid(25), this.setCookie(e, s, {
|
|
838
|
+
secure: !0,
|
|
839
|
+
"max-age": 3600
|
|
840
|
+
})), s;
|
|
841
|
+
}
|
|
842
|
+
static makeid(e) {
|
|
843
|
+
let s = "";
|
|
844
|
+
const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", a = n.length;
|
|
845
|
+
for (let i = 0; i < e; i++)
|
|
846
|
+
s += n.charAt(Math.floor(Math.random() * a));
|
|
847
|
+
return s;
|
|
848
|
+
}
|
|
849
|
+
static getCookie(e) {
|
|
850
|
+
const s = document.cookie.match(
|
|
851
|
+
new RegExp(
|
|
852
|
+
"(?:^|; )" + e.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + "=([^;]*)"
|
|
853
|
+
)
|
|
854
|
+
);
|
|
855
|
+
return s ? decodeURIComponent(s[1]) : void 0;
|
|
856
|
+
}
|
|
857
|
+
static setCookie(e, s, n) {
|
|
858
|
+
const a = { path: "/", ...n };
|
|
859
|
+
n.expires instanceof Date && (a.expires = n.expires.toUTCString());
|
|
860
|
+
let i = encodeURIComponent(e) + "=" + encodeURIComponent(s);
|
|
861
|
+
for (const u in a) {
|
|
862
|
+
i += "; " + u;
|
|
863
|
+
const l = a[u];
|
|
864
|
+
l !== !0 && (i += "=" + l);
|
|
865
|
+
}
|
|
866
|
+
document.cookie = i;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
class Lt {
|
|
870
|
+
static trackClick(e) {
|
|
871
|
+
const s = {
|
|
872
|
+
key: e.trackApiKey,
|
|
873
|
+
query: e.searchTermValue,
|
|
874
|
+
shownHits: e.recordsPerPage,
|
|
875
|
+
totalHits: e.totalResults,
|
|
876
|
+
pageNo: e.currentPage,
|
|
877
|
+
latency: e.latencyVal,
|
|
878
|
+
session: e.session,
|
|
879
|
+
cDocId: e.result.uniqueId,
|
|
880
|
+
cDocTitle: e.result.title,
|
|
881
|
+
position: e.result.position,
|
|
882
|
+
language: e.language
|
|
883
|
+
};
|
|
884
|
+
_msq.push(["trackClick", s]);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
/*!
|
|
888
|
+
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
889
|
+
* http://github.com/janl/mustache.js
|
|
890
|
+
*/
|
|
891
|
+
var _t = Object.prototype.toString, $ = Array.isArray || function(r) {
|
|
892
|
+
return _t.call(r) === "[object Array]";
|
|
893
|
+
};
|
|
894
|
+
function ye(r) {
|
|
895
|
+
return typeof r == "function";
|
|
896
|
+
}
|
|
897
|
+
function jt(r) {
|
|
898
|
+
return $(r) ? "array" : typeof r;
|
|
899
|
+
}
|
|
900
|
+
function me(r) {
|
|
901
|
+
return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
902
|
+
}
|
|
903
|
+
function Ke(r, e) {
|
|
904
|
+
return r != null && typeof r == "object" && e in r;
|
|
905
|
+
}
|
|
906
|
+
function Ot(r, e) {
|
|
907
|
+
return r != null && typeof r != "object" && r.hasOwnProperty && r.hasOwnProperty(e);
|
|
908
|
+
}
|
|
909
|
+
var Pt = RegExp.prototype.test;
|
|
910
|
+
function Vt(r, e) {
|
|
911
|
+
return Pt.call(r, e);
|
|
912
|
+
}
|
|
913
|
+
var Mt = /\S/;
|
|
914
|
+
function Ft(r) {
|
|
915
|
+
return !Vt(Mt, r);
|
|
916
|
+
}
|
|
917
|
+
var Dt = {
|
|
918
|
+
"&": "&",
|
|
919
|
+
"<": "<",
|
|
920
|
+
">": ">",
|
|
921
|
+
'"': """,
|
|
922
|
+
"'": "'",
|
|
923
|
+
"/": "/",
|
|
924
|
+
"`": "`",
|
|
925
|
+
"=": "="
|
|
926
|
+
};
|
|
927
|
+
function Bt(r) {
|
|
928
|
+
return String(r).replace(/[&<>"'`=\/]/g, function(e) {
|
|
929
|
+
return Dt[e];
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
var Ut = /\s*/, Ht = /\s+/, Ye = /\s*=/, Nt = /\s*\}/, Wt = /#|\^|\/|>|\{|&|=|!/;
|
|
933
|
+
function qt(r, e) {
|
|
934
|
+
if (!r)
|
|
935
|
+
return [];
|
|
936
|
+
var s = !1, n = [], a = [], i = [], u = !1, l = !1, h = "", p = 0;
|
|
937
|
+
function C() {
|
|
938
|
+
if (u && !l)
|
|
939
|
+
for (; i.length; )
|
|
940
|
+
delete a[i.pop()];
|
|
941
|
+
else
|
|
942
|
+
i = [];
|
|
943
|
+
u = !1, l = !1;
|
|
944
|
+
}
|
|
945
|
+
var I, L, D;
|
|
946
|
+
function K(j) {
|
|
947
|
+
if (typeof j == "string" && (j = j.split(Ht, 2)), !$(j) || j.length !== 2)
|
|
948
|
+
throw new Error("Invalid tags: " + j);
|
|
949
|
+
I = new RegExp(me(j[0]) + "\\s*"), L = new RegExp("\\s*" + me(j[1])), D = new RegExp("\\s*" + me("}" + j[1]));
|
|
950
|
+
}
|
|
951
|
+
K(e || T.tags);
|
|
952
|
+
for (var E = new ee(r), O, R, y, B, H, P; !E.eos(); ) {
|
|
953
|
+
if (O = E.pos, y = E.scanUntil(I), y)
|
|
954
|
+
for (var Y = 0, ie = y.length; Y < ie; ++Y)
|
|
955
|
+
B = y.charAt(Y), Ft(B) ? (i.push(a.length), h += B) : (l = !0, s = !0, h += " "), a.push(["text", B, O, O + 1]), O += 1, B === `
|
|
956
|
+
` && (C(), h = "", p = 0, s = !1);
|
|
957
|
+
if (!E.scan(I))
|
|
958
|
+
break;
|
|
959
|
+
if (u = !0, R = E.scan(Wt) || "name", E.scan(Ut), R === "=" ? (y = E.scanUntil(Ye), E.scan(Ye), E.scanUntil(L)) : R === "{" ? (y = E.scanUntil(D), E.scan(Nt), E.scanUntil(L), R = "&") : y = E.scanUntil(L), !E.scan(L))
|
|
960
|
+
throw new Error("Unclosed tag at " + E.pos);
|
|
961
|
+
if (R == ">" ? H = [R, y, O, E.pos, h, p, s] : H = [R, y, O, E.pos], p++, a.push(H), R === "#" || R === "^")
|
|
962
|
+
n.push(H);
|
|
963
|
+
else if (R === "/") {
|
|
964
|
+
if (P = n.pop(), !P)
|
|
965
|
+
throw new Error('Unopened section "' + y + '" at ' + O);
|
|
966
|
+
if (P[1] !== y)
|
|
967
|
+
throw new Error('Unclosed section "' + P[1] + '" at ' + O);
|
|
968
|
+
} else
|
|
969
|
+
R === "name" || R === "{" || R === "&" ? l = !0 : R === "=" && K(y);
|
|
970
|
+
}
|
|
971
|
+
if (C(), P = n.pop(), P)
|
|
972
|
+
throw new Error('Unclosed section "' + P[1] + '" at ' + E.pos);
|
|
973
|
+
return Kt($t(a));
|
|
974
|
+
}
|
|
975
|
+
function $t(r) {
|
|
976
|
+
for (var e = [], s, n, a = 0, i = r.length; a < i; ++a)
|
|
977
|
+
s = r[a], s && (s[0] === "text" && n && n[0] === "text" ? (n[1] += s[1], n[3] = s[3]) : (e.push(s), n = s));
|
|
978
|
+
return e;
|
|
979
|
+
}
|
|
980
|
+
function Kt(r) {
|
|
981
|
+
for (var e = [], s = e, n = [], a, i, u = 0, l = r.length; u < l; ++u)
|
|
982
|
+
switch (a = r[u], a[0]) {
|
|
983
|
+
case "#":
|
|
984
|
+
case "^":
|
|
985
|
+
s.push(a), n.push(a), s = a[4] = [];
|
|
986
|
+
break;
|
|
987
|
+
case "/":
|
|
988
|
+
i = n.pop(), i[5] = a[2], s = n.length > 0 ? n[n.length - 1][4] : e;
|
|
989
|
+
break;
|
|
990
|
+
default:
|
|
991
|
+
s.push(a);
|
|
992
|
+
}
|
|
993
|
+
return e;
|
|
994
|
+
}
|
|
995
|
+
function ee(r) {
|
|
996
|
+
this.string = r, this.tail = r, this.pos = 0;
|
|
997
|
+
}
|
|
998
|
+
ee.prototype.eos = function() {
|
|
999
|
+
return this.tail === "";
|
|
1000
|
+
};
|
|
1001
|
+
ee.prototype.scan = function(r) {
|
|
1002
|
+
var e = this.tail.match(r);
|
|
1003
|
+
if (!e || e.index !== 0)
|
|
1004
|
+
return "";
|
|
1005
|
+
var s = e[0];
|
|
1006
|
+
return this.tail = this.tail.substring(s.length), this.pos += s.length, s;
|
|
1007
|
+
};
|
|
1008
|
+
ee.prototype.scanUntil = function(r) {
|
|
1009
|
+
var e = this.tail.search(r), s;
|
|
1010
|
+
switch (e) {
|
|
1011
|
+
case -1:
|
|
1012
|
+
s = this.tail, this.tail = "";
|
|
1013
|
+
break;
|
|
1014
|
+
case 0:
|
|
1015
|
+
s = "";
|
|
1016
|
+
break;
|
|
1017
|
+
default:
|
|
1018
|
+
s = this.tail.substring(0, e), this.tail = this.tail.substring(e);
|
|
1019
|
+
}
|
|
1020
|
+
return this.pos += s.length, s;
|
|
1021
|
+
};
|
|
1022
|
+
function q(r, e) {
|
|
1023
|
+
this.view = r, this.cache = { ".": this.view }, this.parent = e;
|
|
1024
|
+
}
|
|
1025
|
+
q.prototype.push = function(r) {
|
|
1026
|
+
return new q(r, this);
|
|
1027
|
+
};
|
|
1028
|
+
q.prototype.lookup = function(r) {
|
|
1029
|
+
var e = this.cache, s;
|
|
1030
|
+
if (e.hasOwnProperty(r))
|
|
1031
|
+
s = e[r];
|
|
1032
|
+
else {
|
|
1033
|
+
for (var n = this, a, i, u, l = !1; n; ) {
|
|
1034
|
+
if (r.indexOf(".") > 0)
|
|
1035
|
+
for (a = n.view, i = r.split("."), u = 0; a != null && u < i.length; )
|
|
1036
|
+
u === i.length - 1 && (l = Ke(a, i[u]) || Ot(a, i[u])), a = a[i[u++]];
|
|
1037
|
+
else
|
|
1038
|
+
a = n.view[r], l = Ke(n.view, r);
|
|
1039
|
+
if (l) {
|
|
1040
|
+
s = a;
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
n = n.parent;
|
|
1044
|
+
}
|
|
1045
|
+
e[r] = s;
|
|
1046
|
+
}
|
|
1047
|
+
return ye(s) && (s = s.call(this.view)), s;
|
|
1048
|
+
};
|
|
1049
|
+
function w() {
|
|
1050
|
+
this.templateCache = {
|
|
1051
|
+
_cache: {},
|
|
1052
|
+
set: function(r, e) {
|
|
1053
|
+
this._cache[r] = e;
|
|
1054
|
+
},
|
|
1055
|
+
get: function(r) {
|
|
1056
|
+
return this._cache[r];
|
|
1057
|
+
},
|
|
1058
|
+
clear: function() {
|
|
1059
|
+
this._cache = {};
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
w.prototype.clearCache = function() {
|
|
1064
|
+
typeof this.templateCache < "u" && this.templateCache.clear();
|
|
1065
|
+
};
|
|
1066
|
+
w.prototype.parse = function(r, e) {
|
|
1067
|
+
var s = this.templateCache, n = r + ":" + (e || T.tags).join(":"), a = typeof s < "u", i = a ? s.get(n) : void 0;
|
|
1068
|
+
return i == null && (i = qt(r, e), a && s.set(n, i)), i;
|
|
1069
|
+
};
|
|
1070
|
+
w.prototype.render = function(r, e, s, n) {
|
|
1071
|
+
var a = this.getConfigTags(n), i = this.parse(r, a), u = e instanceof q ? e : new q(e, void 0);
|
|
1072
|
+
return this.renderTokens(i, u, s, r, n);
|
|
1073
|
+
};
|
|
1074
|
+
w.prototype.renderTokens = function(r, e, s, n, a) {
|
|
1075
|
+
for (var i = "", u, l, h, p = 0, C = r.length; p < C; ++p)
|
|
1076
|
+
h = void 0, u = r[p], l = u[0], l === "#" ? h = this.renderSection(u, e, s, n, a) : l === "^" ? h = this.renderInverted(u, e, s, n, a) : l === ">" ? h = this.renderPartial(u, e, s, a) : l === "&" ? h = this.unescapedValue(u, e) : l === "name" ? h = this.escapedValue(u, e, a) : l === "text" && (h = this.rawValue(u)), h !== void 0 && (i += h);
|
|
1077
|
+
return i;
|
|
1078
|
+
};
|
|
1079
|
+
w.prototype.renderSection = function(r, e, s, n, a) {
|
|
1080
|
+
var i = this, u = "", l = e.lookup(r[1]);
|
|
1081
|
+
function h(I) {
|
|
1082
|
+
return i.render(I, e, s, a);
|
|
1083
|
+
}
|
|
1084
|
+
if (l) {
|
|
1085
|
+
if ($(l))
|
|
1086
|
+
for (var p = 0, C = l.length; p < C; ++p)
|
|
1087
|
+
u += this.renderTokens(r[4], e.push(l[p]), s, n, a);
|
|
1088
|
+
else if (typeof l == "object" || typeof l == "string" || typeof l == "number")
|
|
1089
|
+
u += this.renderTokens(r[4], e.push(l), s, n, a);
|
|
1090
|
+
else if (ye(l)) {
|
|
1091
|
+
if (typeof n != "string")
|
|
1092
|
+
throw new Error("Cannot use higher-order sections without the original template");
|
|
1093
|
+
l = l.call(e.view, n.slice(r[3], r[5]), h), l != null && (u += l);
|
|
1094
|
+
} else
|
|
1095
|
+
u += this.renderTokens(r[4], e, s, n, a);
|
|
1096
|
+
return u;
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
w.prototype.renderInverted = function(r, e, s, n, a) {
|
|
1100
|
+
var i = e.lookup(r[1]);
|
|
1101
|
+
if (!i || $(i) && i.length === 0)
|
|
1102
|
+
return this.renderTokens(r[4], e, s, n, a);
|
|
1103
|
+
};
|
|
1104
|
+
w.prototype.indentPartial = function(r, e, s) {
|
|
1105
|
+
for (var n = e.replace(/[^ \t]/g, ""), a = r.split(`
|
|
1106
|
+
`), i = 0; i < a.length; i++)
|
|
1107
|
+
a[i].length && (i > 0 || !s) && (a[i] = n + a[i]);
|
|
1108
|
+
return a.join(`
|
|
1109
|
+
`);
|
|
1110
|
+
};
|
|
1111
|
+
w.prototype.renderPartial = function(r, e, s, n) {
|
|
1112
|
+
if (s) {
|
|
1113
|
+
var a = this.getConfigTags(n), i = ye(s) ? s(r[1]) : s[r[1]];
|
|
1114
|
+
if (i != null) {
|
|
1115
|
+
var u = r[6], l = r[5], h = r[4], p = i;
|
|
1116
|
+
l == 0 && h && (p = this.indentPartial(i, h, u));
|
|
1117
|
+
var C = this.parse(p, a);
|
|
1118
|
+
return this.renderTokens(C, e, s, p, n);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
w.prototype.unescapedValue = function(r, e) {
|
|
1123
|
+
var s = e.lookup(r[1]);
|
|
1124
|
+
if (s != null)
|
|
1125
|
+
return s;
|
|
1126
|
+
};
|
|
1127
|
+
w.prototype.escapedValue = function(r, e, s) {
|
|
1128
|
+
var n = this.getConfigEscape(s) || T.escape, a = e.lookup(r[1]);
|
|
1129
|
+
if (a != null)
|
|
1130
|
+
return typeof a == "number" && n === T.escape ? String(a) : n(a);
|
|
1131
|
+
};
|
|
1132
|
+
w.prototype.rawValue = function(r) {
|
|
1133
|
+
return r[1];
|
|
1134
|
+
};
|
|
1135
|
+
w.prototype.getConfigTags = function(r) {
|
|
1136
|
+
return $(r) ? r : r && typeof r == "object" ? r.tags : void 0;
|
|
1137
|
+
};
|
|
1138
|
+
w.prototype.getConfigEscape = function(r) {
|
|
1139
|
+
if (r && typeof r == "object" && !$(r))
|
|
1140
|
+
return r.escape;
|
|
1141
|
+
};
|
|
1142
|
+
var T = {
|
|
1143
|
+
name: "mustache.js",
|
|
1144
|
+
version: "4.2.0",
|
|
1145
|
+
tags: ["{{", "}}"],
|
|
1146
|
+
clearCache: void 0,
|
|
1147
|
+
escape: void 0,
|
|
1148
|
+
parse: void 0,
|
|
1149
|
+
render: void 0,
|
|
1150
|
+
Scanner: void 0,
|
|
1151
|
+
Context: void 0,
|
|
1152
|
+
Writer: void 0,
|
|
1153
|
+
/**
|
|
1154
|
+
* Allows a user to override the default caching strategy, by providing an
|
|
1155
|
+
* object with set, get and clear methods. This can also be used to disable
|
|
1156
|
+
* the cache by setting it to the literal `undefined`.
|
|
1157
|
+
*/
|
|
1158
|
+
set templateCache(r) {
|
|
1159
|
+
Z.templateCache = r;
|
|
1160
|
+
},
|
|
1161
|
+
/**
|
|
1162
|
+
* Gets the default or overridden caching object from the default writer.
|
|
1163
|
+
*/
|
|
1164
|
+
get templateCache() {
|
|
1165
|
+
return Z.templateCache;
|
|
1166
|
+
}
|
|
1167
|
+
}, Z = new w();
|
|
1168
|
+
T.clearCache = function() {
|
|
1169
|
+
return Z.clearCache();
|
|
1170
|
+
};
|
|
1171
|
+
T.parse = function(r, e) {
|
|
1172
|
+
return Z.parse(r, e);
|
|
1173
|
+
};
|
|
1174
|
+
T.render = function(r, e, s, n) {
|
|
1175
|
+
if (typeof r != "string")
|
|
1176
|
+
throw new TypeError('Invalid template! Template should be a "string" but "' + jt(r) + '" was given as the first argument for mustache#render(template, view, partials)');
|
|
1177
|
+
return Z.render(r, e, s, n);
|
|
1178
|
+
};
|
|
1179
|
+
T.escape = Bt;
|
|
1180
|
+
T.Scanner = ee;
|
|
1181
|
+
T.Context = q;
|
|
1182
|
+
T.Writer = w;
|
|
1183
|
+
class Yt {
|
|
1184
|
+
constructor(e) {
|
|
1185
|
+
g(this, "dataLayer"), g(this, "config"), g(this, "suggestAfterMinChars"), g(this, "containerId"), g(this, "currentInputValue", ""), g(this, "autosuggestResults"), g(this, "searchInput"), g(this, "actionButton"), g(this, "autosuggestContainer"), g(this, "buttonState", "search"), g(this, "selectedAutosuggestItem", -1), g(this, "suggestTrigger"), g(this, "searchTrigger"), this.dataLayer = e.dataLayer, this.config = e.config, this.searchTrigger = e.searchTrigger, this.suggestTrigger = e.suggestTrigger, this.containerId = e.containerId, this.suggestAfterMinChars = e.config.suggestAfterMinChars, this.renderMainTemplate(), this.actionButtonInit(), this.updateActionButtonState("search"), this.searchInput && (this.createAutosuggestContainer(), this.attachSubscriptions());
|
|
1186
|
+
}
|
|
1187
|
+
renderMainTemplate() {
|
|
1188
|
+
var e, s;
|
|
1189
|
+
const n = document.getElementById(this.containerId);
|
|
1190
|
+
if (!n)
|
|
1191
|
+
throw new Error("Search input container not found");
|
|
1192
|
+
const a = ((e = this.config.templates) == null ? void 0 : e.mainTemplate) || `
|
|
1193
|
+
<div class="searchstax-search-input-container">
|
|
1194
|
+
<div class="searchstax-search-input-wrapper">
|
|
1195
|
+
<input type="text" id="searchstax-search-input" class="searchstax-search-input" placeholder="SEARCH FOR..." />
|
|
1196
|
+
<button class="searchstax-spinner-icon" id="searchstax-search-input-action-button"></button>
|
|
1197
|
+
</div>
|
|
1198
|
+
</div>
|
|
1199
|
+
`;
|
|
1200
|
+
if (console.log(
|
|
1201
|
+
"this.dataLayer.renderingEngineValue",
|
|
1202
|
+
this.dataLayer.renderingEngineValue
|
|
1203
|
+
), this.dataLayer.renderingEngineValue === "mustache") {
|
|
1204
|
+
const l = T.render(a, {});
|
|
1205
|
+
n.innerHTML = l;
|
|
1206
|
+
}
|
|
1207
|
+
const i = ((s = this.config.templates) == null ? void 0 : s.searchInputId) || "searchstax-search-input", u = document.querySelector(`#${i}`);
|
|
1208
|
+
if (u)
|
|
1209
|
+
this.searchInput = u, u.addEventListener("keyup", this.inputKeyupEvent.bind(this)), u.addEventListener("blur", this.hideAutosuggest.bind(this)), u.addEventListener("paste", this.inputPasteEvent.bind(this));
|
|
1210
|
+
else
|
|
1211
|
+
throw new Error("Input not found");
|
|
1212
|
+
}
|
|
1213
|
+
createAutosuggestContainer() {
|
|
1214
|
+
var e;
|
|
1215
|
+
this.autosuggestContainer = document.createElement("div"), this.autosuggestContainer.classList.add("searchstax-autosuggest-container"), this.autosuggestContainer.addEventListener("mouseleave", () => {
|
|
1216
|
+
this.resetAutosuggestSelection(), this.markActiveAutosuggestItem();
|
|
1217
|
+
}), (e = this.searchInput) == null || e.after(this.autosuggestContainer);
|
|
1218
|
+
}
|
|
1219
|
+
actionButtonInit() {
|
|
1220
|
+
this.actionButton = document.getElementById(
|
|
1221
|
+
"searchstax-search-input-action-button"
|
|
1222
|
+
), this.actionButton && this.actionButton.addEventListener("click", () => {
|
|
1223
|
+
var e;
|
|
1224
|
+
this.buttonState === "search" ? this.executeSearch(((e = this.searchInput) == null ? void 0 : e.value) ?? "") : this.buttonState === "close" && this.searchInput && (this.searchInput.value = "", this.executeSearch(""));
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
attachSubscriptions() {
|
|
1228
|
+
this.dataLayer.searchTermChangeObservable.subscribe(() => {
|
|
1229
|
+
this.handleSearchTermChange();
|
|
1230
|
+
}), this.dataLayer.loadingChangeObservable.subscribe(() => {
|
|
1231
|
+
this.handleLoadingChange();
|
|
1232
|
+
}), this.dataLayer.searchAutosuggestObservable.subscribe(
|
|
1233
|
+
(e) => {
|
|
1234
|
+
e && this.appendSuggestions(e);
|
|
1235
|
+
}
|
|
1236
|
+
);
|
|
1237
|
+
}
|
|
1238
|
+
handleLoadingChange() {
|
|
1239
|
+
this.dataLayer.loadingValue ? this.updateActionButtonState("loading") : this.handleSearchTermChange();
|
|
1240
|
+
}
|
|
1241
|
+
handleSearchTermChange() {
|
|
1242
|
+
var e;
|
|
1243
|
+
this.dataLayer.searchTermValue === ((e = this.searchInput) == null ? void 0 : e.value) && this.searchInput.value !== "" ? this.updateActionButtonState("close") : this.updateActionButtonState("search");
|
|
1244
|
+
}
|
|
1245
|
+
updateActionButtonState(e) {
|
|
1246
|
+
if (this.buttonState = e, this.actionButton)
|
|
1247
|
+
switch (this.actionButton.classList.remove("searchstax-spinner-icon"), this.actionButton.classList.remove("searchstax-search-close"), this.actionButton.classList.remove("searchstax-search-icon"), e) {
|
|
1248
|
+
case "loading":
|
|
1249
|
+
this.actionButton.classList.add("searchstax-spinner-icon");
|
|
1250
|
+
break;
|
|
1251
|
+
case "search":
|
|
1252
|
+
this.actionButton.classList.add("searchstax-search-icon");
|
|
1253
|
+
break;
|
|
1254
|
+
case "close":
|
|
1255
|
+
this.actionButton.classList.add("searchstax-search-close");
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
selectPreviousAutosuggestItem() {
|
|
1260
|
+
this.selectedAutosuggestItem > 0 ? this.selectedAutosuggestItem-- : this.selectedAutosuggestItem = this.autosuggestResults.suggestions.length - 1, this.markActiveAutosuggestItem();
|
|
1261
|
+
}
|
|
1262
|
+
selectNextAutosuggestItem() {
|
|
1263
|
+
this.selectedAutosuggestItem < this.autosuggestResults.suggestions.length - 1 ? this.selectedAutosuggestItem++ : this.selectedAutosuggestItem = 0, this.markActiveAutosuggestItem();
|
|
1264
|
+
}
|
|
1265
|
+
resetAutosuggestSelection() {
|
|
1266
|
+
this.selectedAutosuggestItem = -1, this.markActiveAutosuggestItem();
|
|
1267
|
+
}
|
|
1268
|
+
markActiveAutosuggestItem() {
|
|
1269
|
+
const e = document.getElementsByClassName(
|
|
1270
|
+
"searchstax-autosuggest-item"
|
|
1271
|
+
);
|
|
1272
|
+
for (let s = 0; s < e.length; s++) {
|
|
1273
|
+
const n = e[s];
|
|
1274
|
+
s === this.selectedAutosuggestItem ? n.classList.add("active") : n.classList.remove("active");
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
inputKeyupEvent(e) {
|
|
1278
|
+
const s = e.key;
|
|
1279
|
+
this.currentInputValue = e.target.value, s === "Enter" ? this.suggestionChosen() : s === "Escape" ? this.hideAutosuggest() : s === "ArrowUp" ? this.selectPreviousAutosuggestItem() : s === "ArrowDown" ? this.selectNextAutosuggestItem() : this.autosuggestHandling(e), this.handleSearchTermChange();
|
|
1280
|
+
}
|
|
1281
|
+
autosuggestHandling(e) {
|
|
1282
|
+
e.target && e.target.value.length >= this.suggestAfterMinChars ? this.executeSuggest(e.target.value) : this.hideAutosuggest();
|
|
1283
|
+
}
|
|
1284
|
+
inputPasteEvent(e) {
|
|
1285
|
+
setTimeout(() => {
|
|
1286
|
+
this.autosuggestHandling(e), this.handleSearchTermChange();
|
|
1287
|
+
}, 0);
|
|
1288
|
+
}
|
|
1289
|
+
executeSuggest(e) {
|
|
1290
|
+
this.suggestTrigger(e);
|
|
1291
|
+
}
|
|
1292
|
+
executeSearch(e) {
|
|
1293
|
+
this.hideAutosuggest(), this.searchTrigger(e === "" ? "*" : e);
|
|
1294
|
+
}
|
|
1295
|
+
suggestionChosen() {
|
|
1296
|
+
this.selectedAutosuggestItem > -1 ? this.autosuggestItemClicked(
|
|
1297
|
+
this.autosuggestResults.suggestions[this.selectedAutosuggestItem]
|
|
1298
|
+
) : this.executeSearch(this.currentInputValue);
|
|
1299
|
+
}
|
|
1300
|
+
hideAutosuggest() {
|
|
1301
|
+
this.autosuggestContainer && (this.autosuggestContainer.innerHTML = "", this.autosuggestContainer.classList.add("hidden")), this.resetAutosuggestSelection();
|
|
1302
|
+
}
|
|
1303
|
+
cleanSuggestionTerm(e) {
|
|
1304
|
+
return e.replace(/(<([^>]+)>)/gi, "").trim();
|
|
1305
|
+
}
|
|
1306
|
+
autosuggestItemClicked(e) {
|
|
1307
|
+
this.searchInput.value = this.cleanSuggestionTerm(e.term), this.executeSearch(this.cleanSuggestionTerm(e.term));
|
|
1308
|
+
}
|
|
1309
|
+
createAutosuggestItem(e) {
|
|
1310
|
+
var s;
|
|
1311
|
+
const n = document.createElement("div");
|
|
1312
|
+
n.classList.add("searchstax-autosuggest-item"), n.addEventListener("click", () => {
|
|
1313
|
+
this.autosuggestItemClicked(e);
|
|
1314
|
+
}), n.addEventListener("mouseenter", () => {
|
|
1315
|
+
var i;
|
|
1316
|
+
this.selectedAutosuggestItem = ((i = this.autosuggestResults) == null ? void 0 : i.suggestions.indexOf(e)) || 0, this.markActiveAutosuggestItem();
|
|
1317
|
+
});
|
|
1318
|
+
const a = ((s = this.config.templates) == null ? void 0 : s.autosuggestItemTemplate) || '<div class="searchstax-autosuggest-item-term-container">{{{term}}}</div>';
|
|
1319
|
+
return n.innerHTML = T.render(a, e), n;
|
|
1320
|
+
}
|
|
1321
|
+
appendSuggestions(e) {
|
|
1322
|
+
if (this.autosuggestContainer) {
|
|
1323
|
+
this.autosuggestContainer.innerHTML = "", this.autosuggestContainer.classList.remove("hidden");
|
|
1324
|
+
for (const s in e.suggest)
|
|
1325
|
+
if (Object.prototype.hasOwnProperty.call(e.suggest, s)) {
|
|
1326
|
+
const n = e.suggest[s];
|
|
1327
|
+
for (const a in n)
|
|
1328
|
+
if (Object.prototype.hasOwnProperty.call(n, a)) {
|
|
1329
|
+
const i = n[a];
|
|
1330
|
+
this.autosuggestResults = i, i.numFound > 0 ? i.suggestions.forEach((u) => {
|
|
1331
|
+
this.autosuggestContainer.appendChild(
|
|
1332
|
+
this.createAutosuggestItem(u)
|
|
1333
|
+
);
|
|
1334
|
+
}) : this.autosuggestContainer.classList.add("hidden");
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
class zt {
|
|
1341
|
+
constructor(e) {
|
|
1342
|
+
g(this, "dataLayer"), g(this, "config"), g(this, "linkClickCallback"), g(this, "searchCallback"), g(this, "containerId"), g(this, "searchResultsMainContainer"), g(this, "searchResultsContainer"), g(this, "searchResultLinks", []), this.linkClickCallback = e.linkClickCallback, this.searchCallback = e.searchTrigger, this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId;
|
|
1343
|
+
const s = document.getElementById(this.containerId);
|
|
1344
|
+
if (console.log("resultsContainer", s), s)
|
|
1345
|
+
this.searchResultsMainContainer = s;
|
|
1346
|
+
else
|
|
1347
|
+
throw new Error(
|
|
1348
|
+
`Search Results Main Container with id ${this.containerId} not found`
|
|
1349
|
+
);
|
|
1350
|
+
this.initializeSubscriptions(), this.renderMainTemplate();
|
|
1351
|
+
}
|
|
1352
|
+
initializeSubscriptions() {
|
|
1353
|
+
this.dataLayer.searchResultsObservable.subscribe((e) => {
|
|
1354
|
+
e && this.searchResultsContainer && this.renderResults(e);
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
renderNoResultsTemplate() {
|
|
1358
|
+
var e, s, n;
|
|
1359
|
+
const a = ((s = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : s.noSearchResultTemplate) || `
|
|
1360
|
+
<div class="searchstax-no-results">
|
|
1361
|
+
Showing <strong>no results</strong> for <strong>"{{ searchTerm }}"</strong>
|
|
1362
|
+
<br>
|
|
1363
|
+
{{#spellingSuggestion}}
|
|
1364
|
+
<span> Did you mean <a href="#"
|
|
1365
|
+
class="searchstax-suggestion-term">{{ spellingSuggestion }}</a>?</span>
|
|
1366
|
+
{{/spellingSuggestion}}
|
|
1367
|
+
</div>
|
|
1368
|
+
<div>
|
|
1369
|
+
<p>Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need.</p>
|
|
1370
|
+
<p>Lost? Click on the ‘X” in the Search Box to reset your search.</p>
|
|
1371
|
+
</div>
|
|
1372
|
+
`, i = ((n = this.dataLayer.searchResultsMetadataValue) == null ? void 0 : n.spellingSuggestion) ?? "";
|
|
1373
|
+
if (this.dataLayer.renderingEngineValue === "mustache" && this.searchResultsContainer && (this.searchResultsContainer.innerHTML = T.render(
|
|
1374
|
+
a,
|
|
1375
|
+
{
|
|
1376
|
+
spellingSuggestion: i,
|
|
1377
|
+
searchTerm: this.dataLayer.searchTermValue
|
|
1378
|
+
}
|
|
1379
|
+
)), i && this.searchResultsContainer) {
|
|
1380
|
+
const u = this.searchResultsContainer.querySelector("a");
|
|
1381
|
+
u && u.addEventListener("click", (l) => {
|
|
1382
|
+
l.preventDefault(), l.stopPropagation(), this.searchCallback(i);
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
renderResults(e) {
|
|
1387
|
+
var s, n;
|
|
1388
|
+
if (this.dataLayer.renderingEngineValue === "mustache" && this.searchResultsContainer)
|
|
1389
|
+
if (this.removeLinkClickEvents(), e.length === 0)
|
|
1390
|
+
this.renderNoResultsTemplate();
|
|
1391
|
+
else {
|
|
1392
|
+
const a = ((n = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : n.searchResultTemplate) || `
|
|
1393
|
+
<div class="searchstax-search-result">
|
|
1394
|
+
{{#url}}
|
|
1395
|
+
<a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" class="searchstax-result-item-link"></a>
|
|
1396
|
+
{{/url}}
|
|
1397
|
+
{{#ribbon}}
|
|
1398
|
+
<div class="searchstax-search-result-ribbon">
|
|
1399
|
+
{{ribbon}}
|
|
1400
|
+
</div>
|
|
1401
|
+
{{/ribbon}}
|
|
1402
|
+
{{#thumbnail}}
|
|
1403
|
+
<img :src="thumbnail" class="searchstax-thumbnail">
|
|
1404
|
+
{{/thumbnail}}
|
|
1405
|
+
<div class="searchstax-search-result-title-container">
|
|
1406
|
+
<span class="searchstax-search-result-title">{{title}}</span>
|
|
1407
|
+
</div>
|
|
1408
|
+
{{#paths}}
|
|
1409
|
+
<p class="searchstax-search-result-common">
|
|
1410
|
+
{{paths}}
|
|
1411
|
+
</p>
|
|
1412
|
+
{{/paths}}
|
|
1413
|
+
{{#description}}
|
|
1414
|
+
<p class="searchstax-search-result-description searchstax-search-result-common">
|
|
1415
|
+
{{description}}
|
|
1416
|
+
</p>
|
|
1417
|
+
{{/description}}
|
|
1418
|
+
{{#unmappedFields}}
|
|
1419
|
+
{{#isImage}}
|
|
1420
|
+
<div class="searchstax-search-result-image-container">
|
|
1421
|
+
<img :src="result[value]" class="searchstax-result-image">
|
|
1422
|
+
</div>
|
|
1423
|
+
{{/isImage}}
|
|
1424
|
+
{{^isImage}}
|
|
1425
|
+
<p class="searchstax-search-result-common">
|
|
1426
|
+
{{value}}
|
|
1427
|
+
</p>
|
|
1428
|
+
{{/isImage}}
|
|
1429
|
+
{{/unmappedFields}}
|
|
1430
|
+
</div>`, i = e.map((u) => T.render(a, u));
|
|
1431
|
+
this.searchResultsContainer.innerHTML = i.join(""), this.searchResultLinks = Array.from(
|
|
1432
|
+
this.searchResultsContainer.querySelectorAll(
|
|
1433
|
+
`[${this.uniqueIdAttribute}]`
|
|
1434
|
+
)
|
|
1435
|
+
), this.attachLinkClickEvents();
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
removeLinkClickEvents() {
|
|
1439
|
+
this.searchResultLinks.forEach((e) => {
|
|
1440
|
+
e.removeEventListener("click", () => {
|
|
1441
|
+
});
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
get uniqueIdAttribute() {
|
|
1445
|
+
return this.config.searchResultUniqueIdAttribute || "data-searchstax-unique-result-id";
|
|
1446
|
+
}
|
|
1447
|
+
attachLinkClickEvents() {
|
|
1448
|
+
this.searchResultLinks.forEach((e) => {
|
|
1449
|
+
e.addEventListener("click", (s) => {
|
|
1450
|
+
s.preventDefault(), s.stopPropagation();
|
|
1451
|
+
const n = e.getAttribute(this.uniqueIdAttribute) ?? "";
|
|
1452
|
+
n && this.linkClickCallback(n);
|
|
1453
|
+
});
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
renderMainTemplate() {
|
|
1457
|
+
var e, s;
|
|
1458
|
+
const n = ((s = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : s.mainTemplate) || `
|
|
1459
|
+
<div class="searchstax-search-results-container">
|
|
1460
|
+
<div class="searchstax-search-results"></div>
|
|
1461
|
+
</div>
|
|
1462
|
+
`;
|
|
1463
|
+
this.dataLayer.renderingEngineValue === "mustache" && (this.searchResultsMainContainer.innerHTML = T.render(
|
|
1464
|
+
n,
|
|
1465
|
+
{}
|
|
1466
|
+
)), setTimeout(() => {
|
|
1467
|
+
var a, i;
|
|
1468
|
+
const u = (a = this.config) != null && a.searchResultsContainerId ? (i = this.config) == null ? void 0 : i.searchResultsContainerId : "searchstax-search-results", l = document.getElementById(u);
|
|
1469
|
+
if (l)
|
|
1470
|
+
this.searchResultsContainer = l;
|
|
1471
|
+
else
|
|
1472
|
+
throw new Error(`Search Results Container with id ${u} not found`);
|
|
1473
|
+
}, 0);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
class Gt {
|
|
1477
|
+
constructor(e = "mustache") {
|
|
1478
|
+
g(this, "sessionId"), g(this, "searchstaxConfig"), g(this, "searchHelper"), g(this, "searchInputConfig"), g(this, "searchResultsConfig"), g(this, "searchInputWidget"), g(this, "searchResultsWidget"), g(this, "dataLayer", new It()), e && this.dataLayer.setRenderingEngine(e), this.sessionId = wt.getOrSetCookie("searchstax_session_id"), this.handleHooks();
|
|
1479
|
+
}
|
|
1480
|
+
setRenderingEngine(e = "mustache") {
|
|
1481
|
+
this.dataLayer.setRenderingEngine(e);
|
|
1482
|
+
}
|
|
1483
|
+
handleHooks() {
|
|
1484
|
+
var e, s;
|
|
1485
|
+
(s = (e = this.searchInputConfig) == null ? void 0 : e.hooks) != null && s.afterSearch && this.dataLayer.searchResultsObservable.subscribe((n) => {
|
|
1486
|
+
this.searchInputConfig.hooks.afterSearch(n);
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
initialize(e) {
|
|
1490
|
+
this.searchstaxConfig || (this.searchstaxConfig = e, this.searchHelper = new At(
|
|
1491
|
+
{ ...e, sessionId: this.sessionId },
|
|
1492
|
+
this.dataLayer
|
|
1493
|
+
));
|
|
1494
|
+
}
|
|
1495
|
+
search(e, s) {
|
|
1496
|
+
this.searchHelper && this.searchHelper.search(
|
|
1497
|
+
e,
|
|
1498
|
+
this.parseSearchResultsResponse.bind(this),
|
|
1499
|
+
s
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
parseSearchResultsResponse(e) {
|
|
1503
|
+
var s, n;
|
|
1504
|
+
let a = ve.combineResultsWithMetadata(e);
|
|
1505
|
+
(n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.afterSearch && (a = this.searchInputConfig.hooks.afterSearch(a)), this.dataLayer.setSearchResults(a), this.dataLayer.setSearchResultsMetadata(
|
|
1506
|
+
ve.extractSearchResultsMetadata(e)
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
parseSuggestSuggestResponse(e) {
|
|
1510
|
+
var s, n;
|
|
1511
|
+
let a = e;
|
|
1512
|
+
(n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.afterAutosuggest && (a = this.searchInputConfig.hooks.afterAutosuggest(e)), this.dataLayer.setSearchAutosuggest(a);
|
|
1513
|
+
}
|
|
1514
|
+
suggest(e, s) {
|
|
1515
|
+
this.searchHelper && this.searchHelper.suggest(
|
|
1516
|
+
e,
|
|
1517
|
+
this.parseSuggestSuggestResponse.bind(this),
|
|
1518
|
+
s
|
|
1519
|
+
);
|
|
1520
|
+
}
|
|
1521
|
+
changeLanguage(e) {
|
|
1522
|
+
this.searchHelper && (this.searchHelper.language = e);
|
|
1523
|
+
}
|
|
1524
|
+
addSearchInputWidget(e, s) {
|
|
1525
|
+
this.searchInputConfig || (this.searchInputConfig = s, this.searchInputWidget = new Yt({
|
|
1526
|
+
containerId: e,
|
|
1527
|
+
config: s,
|
|
1528
|
+
searchTrigger: this.executeSearch.bind(this),
|
|
1529
|
+
suggestTrigger: this.executeSuggest.bind(this),
|
|
1530
|
+
dataLayer: this.dataLayer
|
|
1531
|
+
}));
|
|
1532
|
+
}
|
|
1533
|
+
addSearchResultsWidget(e, s) {
|
|
1534
|
+
this.searchResultsConfig || (this.searchResultsConfig = s, this.searchResultsWidget = new zt({
|
|
1535
|
+
containerId: e,
|
|
1536
|
+
linkClickCallback: this.executeLinkClick.bind(this),
|
|
1537
|
+
searchTrigger: this.executeSearch.bind(this),
|
|
1538
|
+
config: s,
|
|
1539
|
+
dataLayer: this.dataLayer
|
|
1540
|
+
}));
|
|
1541
|
+
}
|
|
1542
|
+
executeSearch(e) {
|
|
1543
|
+
var s, n;
|
|
1544
|
+
let a = { term: e, queryParams: [] };
|
|
1545
|
+
(n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.beforeSearch && (a = this.searchInputConfig.hooks.beforeSearch(a)), a && a.term !== void 0 && a.queryParams !== void 0 && this.search(a.term, a.queryParams);
|
|
1546
|
+
}
|
|
1547
|
+
executeSuggest(e) {
|
|
1548
|
+
var s, n;
|
|
1549
|
+
let a = { term: e, queryParams: [] };
|
|
1550
|
+
(n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.beforeAutosuggest && (a = this.searchInputConfig.hooks.beforeAutosuggest(a)), a && a.term !== void 0 && a.queryParams !== void 0 && this.suggest(a.term, a.queryParams);
|
|
1551
|
+
}
|
|
1552
|
+
executeLinkClick(e) {
|
|
1553
|
+
var s, n, a, i;
|
|
1554
|
+
let u = ve.findResultByUniqueId(
|
|
1555
|
+
e,
|
|
1556
|
+
this.dataLayer.searchResultsValue ?? []
|
|
1557
|
+
);
|
|
1558
|
+
u && ((n = (s = this.searchResultsConfig) == null ? void 0 : s.hooks) != null && n.afterLinkClick && (u = this.searchResultsConfig.hooks.afterLinkClick(u)), u && (console.log("foundResult", u), this.dataLayer.searchResultsMetadataValue && Lt.trackClick({
|
|
1559
|
+
result: u,
|
|
1560
|
+
searchTermValue: this.dataLayer.searchTermValue,
|
|
1561
|
+
trackApiKey: ((a = this.searchstaxConfig) == null ? void 0 : a.trackApiKey) ?? "",
|
|
1562
|
+
session: this.sessionId,
|
|
1563
|
+
language: ((i = this.searchHelper) == null ? void 0 : i.language) ?? "",
|
|
1564
|
+
recordsPerPage: this.dataLayer.searchResultsMetadataValue.recordsPerPageValue,
|
|
1565
|
+
totalResults: this.dataLayer.searchResultsMetadataValue.totalResultsValue,
|
|
1566
|
+
currentPage: this.dataLayer.currentPageValue,
|
|
1567
|
+
latencyVal: this.dataLayer.searchResultsMetadataValue.latency
|
|
1568
|
+
})));
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
const F = {
|
|
1572
|
+
searchstax: new Gt("react")
|
|
1573
|
+
};
|
|
1574
|
+
function Xt(r) {
|
|
1575
|
+
return be(() => {
|
|
1576
|
+
if (F.searchstax) {
|
|
1577
|
+
const e = {};
|
|
1578
|
+
r.beforeSearch && (e.beforeSearch = r.beforeSearch), r.afterSearch && (e.afterSearch = r.afterSearch), r.afterAutosuggest && (e.afterAutosuggest = r.afterAutosuggest), r.beforeAutosuggest && (e.beforeAutosuggest = r.beforeAutosuggest), F.searchstax.addSearchInputWidget("searchstax-input-container", {
|
|
1579
|
+
suggestAfterMinChars: r.suggestAfterMinChars ?? 3,
|
|
1580
|
+
hooks: e,
|
|
1581
|
+
templates: {
|
|
1582
|
+
searchInputId: r.searchInputId ?? "searchstax-search-input"
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
} else
|
|
1586
|
+
throw Error("Searchstax instance needs to be passed via props");
|
|
1587
|
+
}, []), /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx("div", { id: "searchstax-input-container", children: /* @__PURE__ */ d.jsxs("div", { className: "searchstax-search-input-container", children: [
|
|
1588
|
+
!r.inputTemplate && /* @__PURE__ */ d.jsxs("div", { className: "searchstax-search-input-wrapper", children: [
|
|
1589
|
+
/* @__PURE__ */ d.jsx(
|
|
1590
|
+
"input",
|
|
1591
|
+
{
|
|
1592
|
+
type: "text",
|
|
1593
|
+
id: "searchstax-search-input",
|
|
1594
|
+
className: "searchstax-search-input",
|
|
1595
|
+
placeholder: "SEARCH FOR..."
|
|
1596
|
+
}
|
|
1597
|
+
),
|
|
1598
|
+
/* @__PURE__ */ d.jsx(
|
|
1599
|
+
"button",
|
|
1600
|
+
{
|
|
1601
|
+
className: "searchstax-spinner-icon",
|
|
1602
|
+
id: "searchstax-search-input-action-button"
|
|
1603
|
+
}
|
|
1604
|
+
)
|
|
1605
|
+
] }),
|
|
1606
|
+
r.inputTemplate && /* @__PURE__ */ d.jsx(d.Fragment, { children: r.inputTemplate() })
|
|
1607
|
+
] }) }) });
|
|
1608
|
+
}
|
|
1609
|
+
function Qt(r) {
|
|
1610
|
+
return be(() => {
|
|
1611
|
+
F.searchstax.initialize({
|
|
1612
|
+
language: r.language ?? "en",
|
|
1613
|
+
searchURL: r.searchURL,
|
|
1614
|
+
suggesterURL: r.suggesterURL,
|
|
1615
|
+
trackApiKey: r.trackApiKey,
|
|
1616
|
+
searchAuth: r.searchAuth,
|
|
1617
|
+
authType: r.authType ?? "basic"
|
|
1618
|
+
}), r.initialized(F.searchstax);
|
|
1619
|
+
}, [r.initialized]), /* @__PURE__ */ d.jsx(d.Fragment, { children: r.children });
|
|
1620
|
+
}
|
|
1621
|
+
function Zt(r) {
|
|
1622
|
+
const [e, s] = pe(
|
|
1623
|
+
null
|
|
1624
|
+
), [n, a] = pe(""), [i, u] = pe(""), l = (h, p) => {
|
|
1625
|
+
p.preventDefault(), p.stopPropagation(), F.searchstax.executeLinkClick(h.uniqueId);
|
|
1626
|
+
};
|
|
1627
|
+
return be(() => {
|
|
1628
|
+
const h = {};
|
|
1629
|
+
r.afterLinkClick && (h.afterLinkClick = r.afterLinkClick), F.searchstax.dataLayer.searchResultsObservable.subscribe(
|
|
1630
|
+
(p) => {
|
|
1631
|
+
s(p);
|
|
1632
|
+
}
|
|
1633
|
+
), F.searchstax.dataLayer.searchResultsMetadataObservable.subscribe(
|
|
1634
|
+
(p) => {
|
|
1635
|
+
u((p == null ? void 0 : p.spellingSuggestion) ?? "");
|
|
1636
|
+
}
|
|
1637
|
+
), F.searchstax.dataLayer.searchTermChangeObservable.subscribe(
|
|
1638
|
+
(p) => {
|
|
1639
|
+
a(p);
|
|
1640
|
+
}
|
|
1641
|
+
), F.searchstax.addSearchResultsWidget("searchstax-results-container", {
|
|
1642
|
+
searchResultsContainerId: "searchstax-result-container",
|
|
1643
|
+
// if main template is over ridden this points to an
|
|
1644
|
+
templates: {},
|
|
1645
|
+
hooks: h
|
|
1646
|
+
});
|
|
1647
|
+
}, []), /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx("div", { id: "searchstax-results-container", children: /* @__PURE__ */ d.jsx("div", { className: "searchstax-search-results-container", children: /* @__PURE__ */ d.jsxs("div", { id: "searchstax-result-container", children: [
|
|
1648
|
+
e && e.length === 0 && !r.noResultTemplate && /* @__PURE__ */ d.jsxs("div", { children: [
|
|
1649
|
+
/* @__PURE__ */ d.jsxs("div", { className: "searchstax-no-results", children: [
|
|
1650
|
+
"Showing ",
|
|
1651
|
+
/* @__PURE__ */ d.jsx("strong", { children: "no results" }),
|
|
1652
|
+
" for",
|
|
1653
|
+
/* @__PURE__ */ d.jsxs("strong", { children: [
|
|
1654
|
+
'"',
|
|
1655
|
+
n,
|
|
1656
|
+
'"'
|
|
1657
|
+
] }),
|
|
1658
|
+
/* @__PURE__ */ d.jsx("br", {}),
|
|
1659
|
+
i && /* @__PURE__ */ d.jsxs("span", { children: [
|
|
1660
|
+
" Did you mean",
|
|
1661
|
+
/* @__PURE__ */ d.jsx("a", { href: "#", className: "searchstax-suggestion-term", children: i }),
|
|
1662
|
+
"?"
|
|
1663
|
+
] })
|
|
1664
|
+
] }),
|
|
1665
|
+
/* @__PURE__ */ d.jsxs("div", { children: [
|
|
1666
|
+
/* @__PURE__ */ d.jsx("p", { children: "Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need." }),
|
|
1667
|
+
/* @__PURE__ */ d.jsx("p", { children: "Lost? Click on the ‘X” in the Search Box to reset your search." })
|
|
1668
|
+
] })
|
|
1669
|
+
] }),
|
|
1670
|
+
e && e.length === 0 && r.noResultTemplate && /* @__PURE__ */ d.jsx(d.Fragment, { children: r.noResultTemplate(n, i) }),
|
|
1671
|
+
e && e.length && !r.resultsTemplate && /* @__PURE__ */ d.jsxs("div", { className: "searchstax-search-results", children: [
|
|
1672
|
+
e !== null && e.map(function(h) {
|
|
1673
|
+
return /* @__PURE__ */ d.jsxs(
|
|
1674
|
+
"div",
|
|
1675
|
+
{
|
|
1676
|
+
className: "searchstax-search-result",
|
|
1677
|
+
children: [
|
|
1678
|
+
h.url && /* @__PURE__ */ d.jsx(
|
|
1679
|
+
"a",
|
|
1680
|
+
{
|
|
1681
|
+
href: h.url,
|
|
1682
|
+
"data-searchstax-unique-result-id": h.uniqueId,
|
|
1683
|
+
onClick: (p) => {
|
|
1684
|
+
l(h, p);
|
|
1685
|
+
},
|
|
1686
|
+
className: "searchstax-result-item-link"
|
|
1687
|
+
}
|
|
1688
|
+
),
|
|
1689
|
+
h.ribbon && /* @__PURE__ */ d.jsx("div", { className: "searchstax-search-result-ribbon", children: h.ribbon }),
|
|
1690
|
+
h.thumbnail && /* @__PURE__ */ d.jsx(
|
|
1691
|
+
"img",
|
|
1692
|
+
{
|
|
1693
|
+
src: h.thumbnail,
|
|
1694
|
+
className: "searchstax-thumbnail"
|
|
1695
|
+
}
|
|
1696
|
+
),
|
|
1697
|
+
/* @__PURE__ */ d.jsx("div", { className: "searchstax-search-result-title-container", children: /* @__PURE__ */ d.jsx("span", { className: "searchstax-search-result-title", children: h.title }) }),
|
|
1698
|
+
h.paths && /* @__PURE__ */ d.jsx("p", { className: "searchstax-search-result-common", children: h.paths }),
|
|
1699
|
+
h.description && /* @__PURE__ */ d.jsx("p", { className: "searchstax-search-result-description searchstax-search-result-common", children: h.description }),
|
|
1700
|
+
h.unmappedFields.map(function(p) {
|
|
1701
|
+
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
1702
|
+
p.isImage && /* @__PURE__ */ d.jsx("div", { className: "searchstax-search-result-image-container", children: /* @__PURE__ */ d.jsx(
|
|
1703
|
+
"img",
|
|
1704
|
+
{
|
|
1705
|
+
src: p.value,
|
|
1706
|
+
className: "searchstax-result-image"
|
|
1707
|
+
}
|
|
1708
|
+
) }),
|
|
1709
|
+
!p.isImage && /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx("p", { className: "searchstax-search-result-common", children: p.value }) })
|
|
1710
|
+
] }, p.value);
|
|
1711
|
+
})
|
|
1712
|
+
]
|
|
1713
|
+
},
|
|
1714
|
+
h.uniqueId
|
|
1715
|
+
);
|
|
1716
|
+
}),
|
|
1717
|
+
e !== null && e.length && /* @__PURE__ */ d.jsx("div", { "v-if": "searchResults && searchResults.length && hasResultSlot" })
|
|
1718
|
+
] }),
|
|
1719
|
+
e && e.length && r.resultsTemplate && /* @__PURE__ */ d.jsx(d.Fragment, { children: r.resultsTemplate(e, l) })
|
|
1720
|
+
] }) }) }) });
|
|
1721
|
+
}
|
|
1722
|
+
export {
|
|
1723
|
+
Xt as SearchstaxInputWidget,
|
|
1724
|
+
Zt as SearchstaxResultWidget,
|
|
1725
|
+
Qt as SearchstaxWrapper
|
|
1726
|
+
};
|