@coveo/quantic 3.10.0-pre.efee724163 → 3.10.0-pre.fa559154a7
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/docs/out/quantic-docs.json +38 -2
- package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +199 -0
- package/force-app/main/default/lwc/quanticDidYouMean/quanticDidYouMean.js +24 -2
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/interactive-result/headless-core-interactive-result.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/headless.js +1 -1
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +5 -5
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +1 -1
- package/package.json +2 -2
|
@@ -382,7 +382,7 @@
|
|
|
382
382
|
],
|
|
383
383
|
"fires": "",
|
|
384
384
|
"examples": [
|
|
385
|
-
"<c-quantic-did-you-mean engine-id={engineId}></c-quantic-did-you-mean>"
|
|
385
|
+
"<c-quantic-did-you-mean engine-id={engineId} disable-query-auto-correction={disableQueryAutoCorrection} query-correction-mode=\"next\"></c-quantic-did-you-mean>"
|
|
386
386
|
],
|
|
387
387
|
"xmlMeta": {
|
|
388
388
|
"apiVersion": "53.0",
|
|
@@ -398,6 +398,24 @@
|
|
|
398
398
|
"required": true,
|
|
399
399
|
"defaultValue": "",
|
|
400
400
|
"type": "string"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"name": "disableQueryAutoCorrection",
|
|
404
|
+
"attribute": "disable-query-auto-correction",
|
|
405
|
+
"access": "@api",
|
|
406
|
+
"description": "<p>Whether to disable automatically applying corrections for queries that would otherwise return no results.\nWhen <code>disableQueryAutoCorrection</code> is <code>false</code>, the component automatically triggers a new query using the suggested term.\nWhen <code>disableQueryAutoCorrection</code> is <code>true</code>, the component returns the suggested term without triggering a new query.</p>",
|
|
407
|
+
"required": false,
|
|
408
|
+
"defaultValue": "false",
|
|
409
|
+
"type": "boolean"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "queryCorrectionMode",
|
|
413
|
+
"attribute": "query-correction-mode",
|
|
414
|
+
"access": "@api",
|
|
415
|
+
"description": "<p>Defines which query correction system to use.\n<code>legacy</code>: Query correction is powered by the legacy index system. This system relies on an algorithm using solely the index content to compute the suggested terms.\n<code>next</code>: Query correction is powered by a machine learning system, requiring a valid query suggestion model configured in your Coveo environment to function properly. This system relies on machine learning algorithms to compute the suggested terms.\nThe <code>legacy</code> system will send two requests to the API to get the suggestions, while the <code>next</code> system will send one request.</p>",
|
|
416
|
+
"required": false,
|
|
417
|
+
"defaultValue": "'legacy'",
|
|
418
|
+
"type": "string"
|
|
401
419
|
}
|
|
402
420
|
]
|
|
403
421
|
},
|
|
@@ -4315,7 +4333,7 @@
|
|
|
4315
4333
|
],
|
|
4316
4334
|
"fires": "",
|
|
4317
4335
|
"examples": [
|
|
4318
|
-
"<c-quantic-did-you-mean engine-id={engineId}></c-quantic-did-you-mean>"
|
|
4336
|
+
"<c-quantic-did-you-mean engine-id={engineId} disable-query-auto-correction={disableQueryAutoCorrection} query-correction-mode=\"next\"></c-quantic-did-you-mean>"
|
|
4319
4337
|
],
|
|
4320
4338
|
"xmlMeta": {
|
|
4321
4339
|
"apiVersion": "53.0",
|
|
@@ -4331,6 +4349,24 @@
|
|
|
4331
4349
|
"required": true,
|
|
4332
4350
|
"defaultValue": "",
|
|
4333
4351
|
"type": "string"
|
|
4352
|
+
},
|
|
4353
|
+
{
|
|
4354
|
+
"name": "disableQueryAutoCorrection",
|
|
4355
|
+
"attribute": "disable-query-auto-correction",
|
|
4356
|
+
"access": "@api",
|
|
4357
|
+
"description": "<p>Whether to disable automatically applying corrections for queries that would otherwise return no results.\nWhen <code>disableQueryAutoCorrection</code> is <code>false</code>, the component automatically triggers a new query using the suggested term.\nWhen <code>disableQueryAutoCorrection</code> is <code>true</code>, the component returns the suggested term without triggering a new query.</p>",
|
|
4358
|
+
"required": false,
|
|
4359
|
+
"defaultValue": "false",
|
|
4360
|
+
"type": "boolean"
|
|
4361
|
+
},
|
|
4362
|
+
{
|
|
4363
|
+
"name": "queryCorrectionMode",
|
|
4364
|
+
"attribute": "query-correction-mode",
|
|
4365
|
+
"access": "@api",
|
|
4366
|
+
"description": "<p>Defines which query correction system to use.\n<code>legacy</code>: Query correction is powered by the legacy index system. This system relies on an algorithm using solely the index content to compute the suggested terms.\n<code>next</code>: Query correction is powered by a machine learning system, requiring a valid query suggestion model configured in your Coveo environment to function properly. This system relies on machine learning algorithms to compute the suggested terms.\nThe <code>legacy</code> system will send two requests to the API to get the suggestions, while the <code>next</code> system will send one request.</p>",
|
|
4367
|
+
"required": false,
|
|
4368
|
+
"defaultValue": "'legacy'",
|
|
4369
|
+
"type": "string"
|
|
4334
4370
|
}
|
|
4335
4371
|
]
|
|
4336
4372
|
},
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/* eslint-disable no-import-assign */
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import {createElement} from 'lwc';
|
|
4
|
+
import QuanticDidYouMean from '../quanticDidYouMean';
|
|
5
|
+
import * as mockHeadlessLoader from 'c/quanticHeadlessLoader';
|
|
6
|
+
|
|
7
|
+
jest.mock('c/quanticHeadlessLoader');
|
|
8
|
+
|
|
9
|
+
let isInitialized = false;
|
|
10
|
+
|
|
11
|
+
const exampleEngine = {
|
|
12
|
+
id: 'exampleEngineId',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const defaultQueryCorrectionMode = 'legacy';
|
|
16
|
+
|
|
17
|
+
const defaultOptions = {
|
|
18
|
+
engineId: exampleEngine.id,
|
|
19
|
+
disableQueryAutoCorrection: false,
|
|
20
|
+
queryCorrectionMode: defaultQueryCorrectionMode,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const mockDidYouMeanState = {
|
|
24
|
+
wasCorrectedTo: 'example corrected query',
|
|
25
|
+
originalQuery: 'example original query',
|
|
26
|
+
wasAutomaticallyCorrected: true,
|
|
27
|
+
queryCorrection: {
|
|
28
|
+
correctedQuery: 'example corrected query',
|
|
29
|
+
wordCorrected: 'example',
|
|
30
|
+
},
|
|
31
|
+
hasQueryCorrection: true,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const functionsMocks = {
|
|
35
|
+
buildDidYouMean: jest.fn(() => ({
|
|
36
|
+
state: mockDidYouMeanState,
|
|
37
|
+
subscribe: functionsMocks.subscribe,
|
|
38
|
+
})),
|
|
39
|
+
buildQueryTrigger: jest.fn(() => ({
|
|
40
|
+
state: {},
|
|
41
|
+
subscribe: functionsMocks.subscribe,
|
|
42
|
+
})),
|
|
43
|
+
applyCorrection: jest.fn(() => {}),
|
|
44
|
+
subscribe: jest.fn((cb) => {
|
|
45
|
+
cb();
|
|
46
|
+
return functionsMocks.unsubscribe;
|
|
47
|
+
}),
|
|
48
|
+
unsubscribe: jest.fn(() => {}),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
function prepareHeadlessState() {
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
mockHeadlessLoader.getHeadlessBundle = () => {
|
|
54
|
+
return {
|
|
55
|
+
buildDidYouMean: functionsMocks.buildDidYouMean,
|
|
56
|
+
buildQueryTrigger: functionsMocks.buildQueryTrigger,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function mockSuccessfulHeadlessInitialization() {
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
mockHeadlessLoader.initializeWithHeadless = (element, _, initialize) => {
|
|
64
|
+
if (element instanceof QuanticDidYouMean && !isInitialized) {
|
|
65
|
+
isInitialized = true;
|
|
66
|
+
initialize(exampleEngine);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function createTestComponent(options = defaultOptions) {
|
|
72
|
+
prepareHeadlessState();
|
|
73
|
+
const element = createElement('c-quantic-did-you-mean', {
|
|
74
|
+
is: QuanticDidYouMean,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
for (const [key, value] of Object.entries(options)) {
|
|
78
|
+
element[key] = value;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
document.body.appendChild(element);
|
|
82
|
+
return element;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Helper function to wait until the microtask queue is empty.
|
|
86
|
+
async function flushPromises() {
|
|
87
|
+
return Promise.resolve();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
describe('c-quantic-did-you-mean', () => {
|
|
91
|
+
function cleanup() {
|
|
92
|
+
// The jsdom instance is shared across test cases in a single file so reset the DOM
|
|
93
|
+
while (document.body.firstChild) {
|
|
94
|
+
document.body.removeChild(document.body.firstChild);
|
|
95
|
+
}
|
|
96
|
+
jest.clearAllMocks();
|
|
97
|
+
isInitialized = false;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
beforeEach(() => {
|
|
101
|
+
mockSuccessfulHeadlessInitialization();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
afterEach(() => {
|
|
105
|
+
cleanup();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('controller initialization', () => {
|
|
109
|
+
it('should subscribe to the headless state changes', async () => {
|
|
110
|
+
createTestComponent();
|
|
111
|
+
await flushPromises();
|
|
112
|
+
|
|
113
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalled();
|
|
114
|
+
expect(functionsMocks.subscribe).toHaveBeenCalled();
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe('#disableQueryAutoCorrection property', () => {
|
|
118
|
+
describe('when disableQueryAutoCorrection is false (default)', () => {
|
|
119
|
+
it('should properly initialize the controller with automatic query correction enabled', async () => {
|
|
120
|
+
createTestComponent();
|
|
121
|
+
await flushPromises();
|
|
122
|
+
|
|
123
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledTimes(1);
|
|
124
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledWith(
|
|
125
|
+
exampleEngine,
|
|
126
|
+
expect.objectContaining({
|
|
127
|
+
options: expect.objectContaining({
|
|
128
|
+
automaticallyCorrectQuery: true,
|
|
129
|
+
queryCorrectionMode: defaultQueryCorrectionMode,
|
|
130
|
+
}),
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
describe('when disableQueryAutoCorrection is true', () => {
|
|
137
|
+
it('should properly initialize the controller with automatic query correction disabled', async () => {
|
|
138
|
+
createTestComponent({
|
|
139
|
+
...defaultOptions,
|
|
140
|
+
disableQueryAutoCorrection: true,
|
|
141
|
+
});
|
|
142
|
+
await flushPromises();
|
|
143
|
+
|
|
144
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledTimes(1);
|
|
145
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledWith(
|
|
146
|
+
exampleEngine,
|
|
147
|
+
expect.objectContaining({
|
|
148
|
+
options: expect.objectContaining({
|
|
149
|
+
automaticallyCorrectQuery: false,
|
|
150
|
+
queryCorrectionMode: defaultQueryCorrectionMode,
|
|
151
|
+
}),
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('#queryCorrectionMode property', () => {
|
|
159
|
+
describe('when queryCorrectionMode is `legacy` (default)', () => {
|
|
160
|
+
it('should properly initialize the controller with the query correction mode set to `legacy`', async () => {
|
|
161
|
+
createTestComponent();
|
|
162
|
+
await flushPromises();
|
|
163
|
+
|
|
164
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledTimes(1);
|
|
165
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledWith(
|
|
166
|
+
exampleEngine,
|
|
167
|
+
expect.objectContaining({
|
|
168
|
+
options: expect.objectContaining({
|
|
169
|
+
automaticallyCorrectQuery: true,
|
|
170
|
+
queryCorrectionMode: defaultQueryCorrectionMode,
|
|
171
|
+
}),
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
describe('when queryCorrectionMode is `next`', () => {
|
|
178
|
+
it('should properly initialize the controller with the query correction mode set to `next`', async () => {
|
|
179
|
+
createTestComponent({
|
|
180
|
+
...defaultOptions,
|
|
181
|
+
queryCorrectionMode: 'next',
|
|
182
|
+
});
|
|
183
|
+
await flushPromises();
|
|
184
|
+
|
|
185
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledTimes(1);
|
|
186
|
+
expect(functionsMocks.buildDidYouMean).toHaveBeenCalledWith(
|
|
187
|
+
exampleEngine,
|
|
188
|
+
expect.objectContaining({
|
|
189
|
+
options: expect.objectContaining({
|
|
190
|
+
automaticallyCorrectQuery: true,
|
|
191
|
+
queryCorrectionMode: 'next',
|
|
192
|
+
}),
|
|
193
|
+
})
|
|
194
|
+
);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
});
|
|
@@ -29,7 +29,7 @@ import queryTriggerTemplate from './templates/queryTrigger.html';
|
|
|
29
29
|
* @category Search
|
|
30
30
|
* @category Insight Panel
|
|
31
31
|
* @example
|
|
32
|
-
* <c-quantic-did-you-mean engine-id={engineId}></c-quantic-did-you-mean>
|
|
32
|
+
* <c-quantic-did-you-mean engine-id={engineId} disable-query-auto-correction={disableQueryAutoCorrection} query-correction-mode="next"></c-quantic-did-you-mean>
|
|
33
33
|
*/
|
|
34
34
|
export default class QuanticDidYouMean extends LightningElement {
|
|
35
35
|
/**
|
|
@@ -38,6 +38,25 @@ export default class QuanticDidYouMean extends LightningElement {
|
|
|
38
38
|
* @type {string}
|
|
39
39
|
*/
|
|
40
40
|
@api engineId;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to disable automatically applying corrections for queries that would otherwise return no results.
|
|
43
|
+
* When `disableQueryAutoCorrection` is `false`, the component automatically triggers a new query using the suggested term.
|
|
44
|
+
* When `disableQueryAutoCorrection` is `true`, the component returns the suggested term without triggering a new query.
|
|
45
|
+
* @api
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
* @defaultValue false
|
|
48
|
+
*/
|
|
49
|
+
@api disableQueryAutoCorrection = false;
|
|
50
|
+
/**
|
|
51
|
+
* Defines which query correction system to use.
|
|
52
|
+
* `legacy`: Query correction is powered by the legacy index system. This system relies on an algorithm using solely the index content to compute the suggested terms.
|
|
53
|
+
* `next`: Query correction is powered by a machine learning system, requiring a valid query suggestion model configured in your Coveo environment to function properly. This system relies on machine learning algorithms to compute the suggested terms.
|
|
54
|
+
* The `legacy` system will send two requests to the API to get the suggestions, while the `next` system will send one request.
|
|
55
|
+
* @api
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @defaultValue 'legacy'
|
|
58
|
+
*/
|
|
59
|
+
@api queryCorrectionMode = 'legacy';
|
|
41
60
|
|
|
42
61
|
/** @type {boolean}*/
|
|
43
62
|
@track hasQueryCorrection;
|
|
@@ -85,7 +104,10 @@ export default class QuanticDidYouMean extends LightningElement {
|
|
|
85
104
|
initialize = (engine) => {
|
|
86
105
|
this.headless = getHeadlessBundle(this.engineId);
|
|
87
106
|
this.didYouMean = this.headless.buildDidYouMean(engine, {
|
|
88
|
-
options: {
|
|
107
|
+
options: {
|
|
108
|
+
queryCorrectionMode: this.queryCorrectionMode,
|
|
109
|
+
automaticallyCorrectQuery: !this.disableQueryAutoCorrection,
|
|
110
|
+
},
|
|
89
111
|
});
|
|
90
112
|
this.queryTrigger = this.headless?.buildQueryTrigger?.(engine);
|
|
91
113
|
this.unsubscribeDidYouMean = this.didYouMean.subscribe(() =>
|
|
@@ -21,7 +21,7 @@ function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var inf
|
|
|
21
21
|
`)}
|
|
22
22
|
|
|
23
23
|
${t}
|
|
24
|
-
`;return new Ei(r)}var Ei=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Pe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let i in this.definition){let o=this.definition[i].validate(r[i]);o&&n.push(`${i}: ${o}`)}if(n.length)throw Fd(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},vt=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&$(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Dt(e){return e===void 0}function Td(e){return e===null}function $(e){return Dt(e)||Td(e)}var fe=class{constructor(e={}){ee(this,"value");this.config=e,this.value=new vt(e)}validate(e){let t=this.value.validate(e);return t||(Dd(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function Dd(e){return Dt(e)||qs(e)}function qs(e){return typeof e=="number"&&!isNaN(e)}var te=class{constructor(e={}){ee(this,"value");this.value=new vt(e)}validate(e){let t=this.value.validate(e);return t||(Md(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Md(e){return Dt(e)||Ns(e)}function Ns(e){return typeof e=="boolean"}var qd=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,Q=class{constructor(e={}){ee(this,"value");ee(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new vt(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:o}=this.config,s=this.value.validate(e);if(s)return s;if(Dt(e))return null;if(!_s(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:o&&!(qd.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function _s(e){return Object.prototype.toString.call(e)==="[object String]"}var Z=class{constructor(e={}){ee(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Dt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ls(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&$(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],o=n.validate(i);o!==null&&(t+=" "+o)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Ls(e){return e!==void 0&&typeof e=="object"}var $e=class{constructor(e={}){ee(this,"value");this.config=e,this.value=new vt(this.config)}validate(e){if(!$(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if($(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&$(n)&&(r=`value is null or undefined: ${e.join(",")}`);let i=this.validatePrimitiveValue(n,this.config.each);i!==null&&(r+=" "+i)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ns(e)||_s(e)||qs(e)||Ls(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function js(e){return Array.isArray(e)}var ki=class{constructor(e){ee(this,"value");this.config=e,this.value=new vt(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Dt(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};p();d();var Br=e=>e;p();d();p();d();var ta=Re(Gs(),1);p();d();p();d();var xe=new Error("Failed to load reducers."),Mt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var At=class extends Error{constructor(r,n){super();ee(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};p();d();function Ws(e){return Array.isArray(e)}function Ys(e,t){return[...e.reduce((r,n)=>{let i=t(n);return r.has(i)||r.set(i,n),r},new Map).values()]}var ap=new Set(["1",1,"yes",!0]);function Ks(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>ap.has(r))}function Js(e){let t={};for(let[r,n]of e)t[r]=n;return t}function dr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}p();d();function Xs(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}function Zs(e){return typeof e!="object"||!e?!1:Object.values(e).every(cp)}function cp(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ea(e){return e===429}var tt=class e{static call(t){return _asyncToGenerator(function*(){let r=up(t),{logger:n}=t,i=yield e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:o,...s}=i,c=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield b(o,s);if(ea(f.status))throw f;return f});return function c(){return _ref.apply(this,arguments)}}();try{let f=yield(0,ta.backOff)(c,{retry:a=>{let g=a&&ea(a.status);return g&&n.info("Platform retrying request"),g}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Mt;case 404:throw new At(o,f.status);default:return n.info({response:f,requestInfo:i},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new At(o):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:i,logger:o,requestMetadata:s}=r,{signal:c,...f}=t,a=dr(f);try{let g=yield i(t,n,s);return{...t,...g}}catch(g){o.error(g,"Platform request preprocessing failed. Returning default request options.")}return a})()}};function ne(e,t="prod",r="platform"){let n=t==="prod"?"":t,i=r==="platform"?"":`.${r}`;return`https://${e}${i}.org${n}.coveo.com`}function qt(e,t="prod"){return`${ne(e,t)}/rest/search/v2`}function $r(e,t="prod"){return`${ne(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function up(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:o,signal:s}=e,c=e.method==="POST"||e.method==="PUT",f=lp(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${o}`,...e.headers},...(c&&{body:f}),signal:s}}function lp(e,t){return t==="application/x-www-form-urlencoded"?Zs(e)?Xs(e):"":JSON.stringify(e)}p();d();p();d();var Nt=class{constructor(t){ee(this,"_basePath");ee(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};p();d();function _i(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...o}=e;return o}var Li=e=>{let{response:t}=e;return t.body?dp(e):pp(t)},dp=e=>gp(e)?mp(e):fp(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},pp=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function fp(e){return e.body.statusCode!==void 0}function gp(e){return e.body.exception!==void 0}var mp=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});p();d();function ra(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}p();d();var ji=(e,t,r,n)=>{let i=new Nt(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};var na=(e,t)=>{let r=new Nt(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},Ui=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield tt.call({...ji(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:_i(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ra(r),i=yield r.arrayBuffer(),s=new TextDecoder(n).decode(i);return hp(s)?{success:s}:{error:Li({response:r,body:s})}});return function Ui(_x,_x2){return _ref2.apply(this,arguments)}}();function hp(e){return typeof e=="string"}p();d();function yp(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Sp(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Hr(e,t){if(t&&e.name==="AbortError")return{error:Sp(e)};if(e instanceof At)return{error:yp(e)};throw e}p();d();p();d();var zr=(e,t,r,n,i={})=>{vp(e);let o=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=Cp(i),c=s?`${o}?${s}`:o;return{accessToken:e.accessToken,method:t,contentType:r,url:c,origin:"caseAssistApiFetch"}},Gr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r]}),{}),Wr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r].value}),{}),vp=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},Cp=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var ia=e=>{let t=e.debug?{debug:"1"}:{};return{...zr(e,"POST","application/json","/classify",t),requestParams:Ap(e)}},Ap=e=>({clientId:e.clientId,locale:e.locale,fields:Gr(e.fields)});p();d();var oa=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...zr(e,"POST","application/json","/documents/suggest",t),requestParams:bp(e)}},bp=e=>({clientId:e.clientId,locale:e.locale,fields:Gr(e.fields),context:e.context});var Yr=class{constructor(t){this.options=t}getCaseClassifications(t){var _this=this;return _asyncToGenerator(function*(){let r=yield tt.call({...ia(t),..._this.options});if(r instanceof Error)return Hr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}getDocumentSuggestions(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield tt.call({...oa(t),..._this2.options});if(r instanceof Error)return Hr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this3=this;return _asyncToGenerator(function*(){return Ui(t,_this3.options)})()}};p();d();p();d();p();d();function ce(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var wp=typeof Symbol=="function"&&Symbol.observable||"@@observable",sa=wp,Vi=()=>Math.random().toString(36).substring(7).split("").join("."),Rp={INIT:`@@redux/INIT${Vi()}`,REPLACE:`@@redux/REPLACE${Vi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Vi()}`},Kr=Rp;function Me(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Bi(e,t,r){if(typeof e!="function")throw new Error(ce(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ce(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ce(1));return r(Bi)(e,t)}let n=e,i=t,o=new Map,s=o,c=0,f=!1;function a(){s===o&&(s=new Map,o.forEach((w,R)=>{s.set(R,w)}))}function g(){if(f)throw new Error(ce(3));return i}function h(w){if(typeof w!="function")throw new Error(ce(4));if(f)throw new Error(ce(5));let R=!0;a();let S=c++;return s.set(S,w),function(){if(R){if(f)throw new Error(ce(6));R=!1,a(),s.delete(S),o=null}}}function m(w){if(!Me(w))throw new Error(ce(7));if(typeof w.type>"u")throw new Error(ce(8));if(typeof w.type!="string")throw new Error(ce(17));if(f)throw new Error(ce(9));try{f=!0,i=n(i,w)}finally{f=!1}return(o=s).forEach(S=>{S()}),w}function u(w){if(typeof w!="function")throw new Error(ce(10));n=w,m({type:Kr.REPLACE})}function y(){let w=h;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(ce(11));function S(){let C=R;C.next&&C.next(g())}return S(),{unsubscribe:w(S)}},[sa](){return this}}}return m({type:Kr.INIT}),{dispatch:m,subscribe:h,getState:g,replaceReducer:u,[sa]:y}}function xp(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Kr.INIT})>"u")throw new Error(ce(12));if(typeof r(void 0,{type:Kr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ce(13))})}function _t(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let c=t[s];typeof e[c]=="function"&&(r[c]=e[c])}let n=Object.keys(r),i,o;try{xp(r)}catch(s){o=s}return function(c={},f){if(o)throw o;let a=!1,g={};for(let h=0;h<n.length;h++){let m=n[h],u=r[m],y=c[m],A=u(y,f);if(typeof A>"u"){let w=f&&f.type;throw new Error(ce(14))}g[m]=A,a=a||A!==y}return a=a||n.length!==Object.keys(c).length,a?g:c}}function Lt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function aa(...e){return t=>(r,n)=>{let i=t(r,n),o=()=>{throw new Error(ce(15))},s={getState:i.getState,dispatch:(f,...a)=>o(f,...a)},c=e.map(f=>f(s));return o=Lt(...c)(i.dispatch),{...i,dispatch:o}}}function Jr(e){return Me(e)&&"type"in e&&typeof e.type=="string"}p();d();var Xi=Symbol.for("immer-nothing"),pr=Symbol.for("immer-draftable"),ge=Symbol.for("immer-state");function ue(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wt=Object.getPrototypeOf;function ve(e){return!!e&&!!e[ge]}function me(e){return e?pa(e)||Array.isArray(e)||!!e[pr]||!!e.constructor?.[pr]||yr(e)||Sr(e):!1}var Ip=Object.prototype.constructor.toString();function pa(e){if(!e||typeof e!="object")return!1;let t=wt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Ip}function Zi(e){return ve(e)||ue(15,e),e[ge].base_}function fr(e,t){Rt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Rt(e){let t=e[ge];return t?t.type_:Array.isArray(e)?1:yr(e)?2:Sr(e)?3:0}function gr(e,t){return Rt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Qi(e,t){return Rt(e)===2?e.get(t):e[t]}function fa(e,t,r){let n=Rt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ep(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function yr(e){return e instanceof Map}function Sr(e){return e instanceof Set}function bt(e){return e.copy_||e.base_}function zi(e,t){if(yr(e))return new Map(e);if(Sr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=pa(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ge];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){let s=i[o],c=n[s];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[s]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[s]})}return Object.create(wt(e),n)}else{let n=wt(e);if(n!==null&&r)return{...e};let i=Object.create(n);return Object.assign(i,e)}}function en(e,t=!1){return tn(e)||ve(e)||!me(e)||(Rt(e)>1&&(e.set=e.add=e.clear=e.delete=kp),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>en(n,!0))),e}function kp(){ue(2)}function tn(e){return Object.isFrozen(e)}var Gi={};function xt(e){let t=Gi[e];return t||ue(0,e),t}function Pp(e,t){Gi[e]||(Gi[e]=t)}var mr;function ga(){return mr}function Op(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ca(e,t){t&&(xt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wi(e){Yi(e),e.drafts_.forEach(Fp),e.drafts_=null}function Yi(e){e===mr&&(mr=e.parent_)}function ua(e){return mr=Op(mr,e)}function Fp(e){let t=e[ge];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function la(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ge].modified_&&(Wi(t),ue(4)),me(e)&&(e=Xr(t,e),t.parent_||Zr(t,e)),t.patches_&&xt("Patches").generateReplacementPatches_(r[ge].base_,e,t.patches_,t.inversePatches_)):e=Xr(t,r,[]),Wi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Xi?e:void 0}function Xr(e,t,r){if(tn(t))return t;let n=t[ge];if(!n)return fr(t,(i,o)=>da(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Zr(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let i=n.copy_,o=i,s=!1;n.type_===3&&(o=new Set(i),i.clear(),s=!0),fr(o,(c,f)=>da(e,n,i,c,f,r,s)),Zr(e,i,!1),r&&e.patches_&&xt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function da(e,t,r,n,i,o,s){if(ve(i)){let c=o&&t&&t.type_!==3&&!gr(t.assigned_,n)?o.concat(n):void 0,f=Xr(e,i,c);if(fa(r,n,f),ve(f))e.canAutoFreeze_=!1;else return}else s&&r.add(i);if(me(i)&&!tn(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Xr(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Zr(e,i)}}function Zr(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&en(t,r)}function Tp(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ga(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,o=eo;r&&(i=[n],o=hr);let{revoke:s,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=s,c}var eo={get(e,t){if(t===ge)return e;let r=bt(e);if(!gr(r,t))return Dp(e,r,t);let n=r[t];return e.finalized_||!me(n)?n:n===$i(e.base_,t)?(Hi(e),e.copy_[t]=Ji(n,e)):n},has(e,t){return t in bt(e)},ownKeys(e){return Reflect.ownKeys(bt(e))},set(e,t,r){let n=ma(bt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let i=$i(bt(e),t),o=i?.[ge];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ep(r,i)&&(r!==void 0||gr(e.base_,t)))return!0;Hi(e),Ki(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return $i(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Hi(e),Ki(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=bt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ue(11)},getPrototypeOf(e){return wt(e.base_)},setPrototypeOf(){ue(12)}},hr={};fr(eo,(e,t)=>{hr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});hr.deleteProperty=function(e,t){return hr.set.call(this,e,t,void 0)};hr.set=function(e,t,r){return eo.set.call(this,e[0],t,r,e[0])};function $i(e,t){let r=e[ge];return(r?bt(r):e)[t]}function Dp(e,t,r){let n=ma(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function ma(e,t){if(!(t in e))return;let r=wt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=wt(r)}}function Ki(e){e.modified_||(e.modified_=!0,e.parent_&&Ki(e.parent_))}function Hi(e){e.copy_||(e.copy_=zi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Mp=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let s=this;return function(f=o,...a){return s.produce(f,g=>r.call(this,g,...a))}}typeof r!="function"&&ue(6),n!==void 0&&typeof n!="function"&&ue(7);let i;if(me(t)){let o=ua(this),s=Ji(t,void 0),c=!0;try{i=r(s),c=!1}finally{c?Wi(o):Yi(o)}return ca(o,n),la(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Xi&&(i=void 0),this.autoFreeze_&&en(i,!0),n){let o=[],s=[];xt("Patches").generateReplacementPatches_(t,i,o,s),n(o,s)}return i}else ue(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...c)=>this.produceWithPatches(s,f=>t(f,...c));let n,i;return[this.produce(t,r,(s,c)=>{n=s,i=c}),n,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){me(e)||ue(8),ve(e)&&(e=ha(e));let t=ua(this),r=Ji(e,void 0);return r[ge].isManual_=!0,Yi(t),r}finishDraft(e,t){let r=e&&e[ge];(!r||!r.isManual_)&&ue(9);let{scope_:n}=r;return ca(n,t),la(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let n=xt("Patches").applyPatches_;return ve(e)?n(e,t):this.produce(e,i=>n(i,t))}};function Ji(e,t){let r=yr(e)?xt("MapSet").proxyMap_(e,t):Sr(e)?xt("MapSet").proxySet_(e,t):Tp(e,t);return(t?t.scope_:ga()).drafts_.push(r),r}function ha(e){return ve(e)||ue(10,e),ya(e)}function ya(e){if(!me(e)||tn(e))return e;let t=e[ge],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=zi(e,t.scope_.immer_.useStrictShallowCopy_)}else r=zi(e,!0);return fr(r,(n,i)=>{fa(r,n,ya(i))}),t&&(t.finalized_=!1),r}function Sa(){let t="replace",r="add",n="remove";function i(m,u,y,A){switch(m.type_){case 0:case 2:return s(m,u,y,A);case 1:return o(m,u,y,A);case 3:return c(m,u,y,A)}}function o(m,u,y,A){let{base_:w,assigned_:R}=m,S=m.copy_;S.length<w.length&&([w,S]=[S,w],[y,A]=[A,y]);for(let v=0;v<w.length;v++)if(R[v]&&S[v]!==w[v]){let C=u.concat([v]);y.push({op:t,path:C,value:h(S[v])}),A.push({op:t,path:C,value:h(w[v])})}for(let v=w.length;v<S.length;v++){let C=u.concat([v]);y.push({op:r,path:C,value:h(S[v])})}for(let v=S.length-1;w.length<=v;--v){let C=u.concat([v]);A.push({op:n,path:C})}}function s(m,u,y,A){let{base_:w,copy_:R}=m;fr(m.assigned_,(S,v)=>{let C=Qi(w,S),x=Qi(R,S),k=v?gr(w,S)?t:r:n;if(C===x&&k===t)return;let I=u.concat(S);y.push(k===n?{op:k,path:I}:{op:k,path:I,value:x}),A.push(k===r?{op:n,path:I}:k===n?{op:r,path:I,value:h(C)}:{op:t,path:I,value:h(C)})})}function c(m,u,y,A){let{base_:w,copy_:R}=m,S=0;w.forEach(v=>{if(!R.has(v)){let C=u.concat([S]);y.push({op:n,path:C,value:v}),A.unshift({op:r,path:C,value:v})}S++}),S=0,R.forEach(v=>{if(!w.has(v)){let C=u.concat([S]);y.push({op:r,path:C,value:v}),A.unshift({op:n,path:C,value:v})}S++})}function f(m,u,y,A){y.push({op:t,path:[],value:u===Xi?void 0:u}),A.push({op:t,path:[],value:m})}function a(m,u){return u.forEach(y=>{let{path:A,op:w}=y,R=m;for(let x=0;x<A.length-1;x++){let k=Rt(R),I=A[x];typeof I!="string"&&typeof I!="number"&&(I=""+I),(k===0||k===1)&&(I==="__proto__"||I==="constructor")&&ue(19),typeof R=="function"&&I==="prototype"&&ue(19),R=Qi(R,I),typeof R!="object"&&ue(18,A.join("/"))}let S=Rt(R),v=g(y.value),C=A[A.length-1];switch(w){case t:switch(S){case 2:return R.set(C,v);case 3:ue(16);default:return R[C]=v}case r:switch(S){case 1:return C==="-"?R.push(v):R.splice(C,0,v);case 2:return R.set(C,v);case 3:return R.add(v);default:return R[C]=v}case n:switch(S){case 1:return R.splice(C,1);case 2:return R.delete(C);case 3:return R.delete(y.value);default:return delete R[C]}default:ue(17,w)}}),m}function g(m){if(!me(m))return m;if(Array.isArray(m))return m.map(g);if(yr(m))return new Map(Array.from(m.entries()).map(([y,A])=>[y,g(A)]));if(Sr(m))return new Set(Array.from(m).map(g));let u=Object.create(wt(m));for(let y in m)u[y]=g(m[y]);return gr(m,pr)&&(u[pr]=m[pr]),u}function h(m){return ve(m)?g(m):m}Pp("Patches",{applyPatches_:a,generatePatches_:i,generateReplacementPatches_:f})}var Ce=new Mp,ze=Ce.produce,rn=Ce.produceWithPatches.bind(Ce),MC=Ce.setAutoFreeze.bind(Ce),qC=Ce.setUseStrictShallowCopy.bind(Ce),to=Ce.applyPatches.bind(Ce),NC=Ce.createDraft.bind(Ce),_C=Ce.finishDraft.bind(Ce);p();d();function qp(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Np(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function _p(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var va=e=>Array.isArray(e)?e:[e];function Lp(e){let t=Array.isArray(e[0])?e[0]:e;return _p(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jp(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var BC=Symbol();var QC=Object.getPrototypeOf({});var Up=class{constructor(e){this.value=e}deref(){return this.value}},Vp=typeof WeakRef<"u"?WeakRef:Up,Bp=0,Ca=1;function nn(){return{s:Bp,v:void 0,o:null,p:null}}function jt(e,t={}){let r=nn(),{resultEqualityCheck:n}=t,i,o=0;function s(){let c=r,{length:f}=arguments;for(let h=0,m=f;h<m;h++){let u=arguments[h];if(typeof u=="function"||typeof u=="object"&&u!==null){let y=c.o;y===null&&(c.o=y=new WeakMap);let A=y.get(u);A===void 0?(c=nn(),y.set(u,c)):c=A}else{let y=c.p;y===null&&(c.p=y=new Map);let A=y.get(u);A===void 0?(c=nn(),y.set(u,c)):c=A}}let a=c,g;if(c.s===Ca)g=c.v;else if(g=e.apply(null,arguments),o++,n){let h=i?.deref?.()??i;h!=null&&n(h,g)&&(g=h,o!==0&&o--),i=typeof g=="object"&&g!==null||typeof g=="function"?new Vp(g):g}return a.s=Ca,a.v=g,g}return s.clearCache=()=>{r=nn(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function Aa(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,s=0,c,f={},a=i.pop();typeof a=="object"&&(f=a,a=i.pop()),qp(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let g={...r,...f},{memoize:h,memoizeOptions:m=[],argsMemoize:u=jt,argsMemoizeOptions:y=[],devModeChecks:A={}}=g,w=va(m),R=va(y),S=Lp(i),v=h(function(){return o++,a.apply(null,arguments)},...w),C=!0,x=u(function(){s++;let I=jp(S,arguments);return c=v.apply(null,I),c},...R);return Object.assign(x,{resultFunc:a,memoizedResultFunc:v,dependencies:S,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:h,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}var ie=Aa(jt),Qp=Object.assign((e,t=ie)=>{Np(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(o=>e[o]);return t(n,(...o)=>o.reduce((s,c,f)=>(s[r[f]]=c,s),{}))},{withTypes:()=>Qp});p();d();function ba(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var wa=ba(),Ra=ba;var $p=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Lt:Lt.apply(null,arguments)},nA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Hp=e=>e&&typeof e.match=="function";function M(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Ae(0));return{type:e,payload:i.payload,...("meta"in i&&{meta:i.meta}),...("error"in i&&{error:i.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Jr(n)&&n.type===e,r}var ka=class vr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,vr.prototype)}static get[Symbol.species](){return vr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new vr(...t[0].concat(this)):new vr(...t.concat(this))}};function xa(e){return me(e)?ze(e,()=>{}):e}function Ia(e,t,r){if(e.has(t)){let i=e.get(t);return r.update&&(i=r.update(i,t,e),e.set(t,i)),i}if(!r.insert)throw new Error(Ae(10));let n=r.insert(t,e);return e.set(t,n),n}function zp(e){return typeof e=="boolean"}var Gp=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{},s=new ka;return r&&(zp(r)?s.push(wa):s.push(Ra(r.extraArgument))),s},Et="RTK_autoBatch",Vt=()=>e=>({payload:e,meta:{[Et]:!0}}),Pa=e=>t=>{setTimeout(t,e)},Wp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Pa(10),Yp=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,o=!1,s=!1,c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?Wp:e.type==="callback"?e.queueNotification:Pa(e.timeout),a=()=>{s=!1,o&&(o=!1,c.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let h=()=>i&&g(),m=n.subscribe(h);return c.add(g),()=>{m(),c.delete(g)}},dispatch(g){try{return i=!g?.meta?.[Et],o=!i,o&&(s||(s=!0,f(a))),n.dispatch(g)}finally{i=!0}}})},Kp=e=>function(r){let{autoBatch:n=!0}=r??{},i=new ka(e);return n&&i.push(Yp(typeof n=="object"?n:void 0)),i};function Oa(e){let t=Gp(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Me(r))c=_t(r);else throw new Error(Ae(1));let f;typeof n=="function"?f=n(t):f=t();let a=Lt;i&&(a=$p({trace:!1,...(typeof i=="object"&&i)}));let g=aa(...f),h=Kp(g),m=typeof s=="function"?s(h):h(),u=a(...m);return Bi(c,o,u)}function Fa(e){let t={},r=[],n,i={addCase(o,s){let c=typeof o=="string"?o:o.type;if(!c)throw new Error(Ae(28));if(c in t)throw new Error(Ae(29));return t[c]=s,i},addMatcher(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function Jp(e){return typeof e=="function"}function oe(e,t){let[r,n,i]=Fa(t),o;if(Jp(e))o=()=>xa(e());else{let c=xa(e);o=()=>c}function s(c=o(),f){let a=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return a.filter(g=>!!g).length===0&&(a=[i]),a.reduce((g,h)=>{if(h)if(ve(g)){let u=h(g,f);return u===void 0?g:u}else{if(me(g))return ze(g,m=>h(m,f));{let m=h(g,f);if(m===void 0){if(g===null)return g;throw new Error(Ae(9))}return m}}return g},c)}return s.getInitialState=o,s}var Ta=(e,t)=>Hp(e)?e.match(t):e(t);function qe(...e){return t=>e.some(r=>Ta(r,t))}function Ut(...e){return t=>e.every(r=>Ta(r,t))}function sn(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Cr(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function an(...e){return e.length===0?t=>sn(t,["pending"]):Cr(e)?qe(...e.map(t=>t.pending)):an()(e[0])}function It(...e){return e.length===0?t=>sn(t,["rejected"]):Cr(e)?qe(...e.map(t=>t.rejected)):It()(e[0])}function Ar(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Ut(It(...e),t):Cr(e)?Ut(It(...e),t):Ar()(e[0])}function Ge(...e){return e.length===0?t=>sn(t,["fulfilled"]):Cr(e)?qe(...e.map(t=>t.fulfilled)):Ge()(e[0])}function cn(...e){return e.length===0?t=>sn(t,["pending","fulfilled","rejected"]):Cr(e)?qe(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):cn()(e[0])}var Xp="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",no=(e=21)=>{let t="",r=e;for(;r--;)t+=Xp[Math.random()*64|0];return t},Zp=["name","message","stack","code"],ro=class{constructor(e,t){ee(this,"_type");this.payload=e,this.meta=t}},Ea=class{constructor(e,t){ee(this,"_type");this.payload=e,this.meta=t}},ef=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Zp)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},J=(()=>{function e(t,r,n){let i=M(t+"/fulfilled",(f,a,g,h)=>({payload:f,meta:{...(h||{}),arg:g,requestId:a,requestStatus:"fulfilled"}})),o=M(t+"/pending",(f,a,g)=>({payload:void 0,meta:{...(g||{}),arg:a,requestId:f,requestStatus:"pending"}})),s=M(t+"/rejected",(f,a,g,h,m)=>({payload:h,error:(n&&n.serializeError||ef)(f||"Rejected"),meta:{...(m||{}),arg:g,requestId:a,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function c(f){return(a,g,h)=>{let m=n?.idGenerator?n.idGenerator(f):no(),u=new l.AbortController,y,A;function w(S){A=S,u.abort()}let R=_asyncToGenerator(function*(){let S;try{let C=n?.condition?.(f,{getState:g,extra:h});if(rf(C)&&(C=yield C),C===!1||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let x=new Promise((k,I)=>{y=()=>{I({name:"AbortError",message:A||"Aborted"})},u.signal.addEventListener("abort",y)});a(o(m,f,n?.getPendingMeta?.({requestId:m,arg:f},{getState:g,extra:h}))),S=yield Promise.race([x,Promise.resolve(r(f,{dispatch:a,getState:g,extra:h,requestId:m,signal:u.signal,abort:w,rejectWithValue:(k,I)=>new ro(k,I),fulfillWithValue:(k,I)=>new Ea(k,I)})).then(k=>{if(k instanceof ro)throw k;return k instanceof Ea?i(k.payload,m,f,k.meta):i(k,m,f)})])}catch(C){S=C instanceof ro?s(null,m,f,C.payload,C.meta):s(C,m,f)}finally{y&&u.signal.removeEventListener("abort",y)}return n&&!n.dispatchConditionRejection&&s.match(S)&&S.meta.condition||a(S),S})();return Object.assign(R,{abort:w,requestId:m,arg:f,unwrap(){return R.then(tf)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:i,settled:qe(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function tf(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function rf(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Da=Symbol.for("rtk-slice-createasyncthunk"),cA={[Da]:J};function nf(e,t){return`${e}/${t}`}function of({creators:e}={}){let t=e?.asyncThunk?.[Da];return function(n){let{name:i,reducerPath:o=i}=n;if(!i)throw new Error(Ae(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(af()):n.reducers)||{},c=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(S,v){let C=typeof S=="string"?S:S.type;if(!C)throw new Error(Ae(12));if(C in f.sliceCaseReducersByType)throw new Error(Ae(13));return f.sliceCaseReducersByType[C]=v,a},addMatcher(S,v){return f.sliceMatchers.push({matcher:S,reducer:v}),a},exposeAction(S,v){return f.actionCreators[S]=v,a},exposeCaseReducer(S,v){return f.sliceCaseReducersByName[S]=v,a}};c.forEach(S=>{let v=s[S],C={reducerName:S,type:nf(i,S),createNotation:typeof n.reducers=="function"};uf(v)?df(C,v,a,t):cf(C,v,a)});function g(){let[S={},v=[],C=void 0]=typeof n.extraReducers=="function"?Fa(n.extraReducers):[n.extraReducers],x={...S,...f.sliceCaseReducersByType};return oe(n.initialState,k=>{for(let I in x)k.addCase(I,x[I]);for(let I of f.sliceMatchers)k.addMatcher(I.matcher,I.reducer);for(let I of v)k.addMatcher(I.matcher,I.reducer);C&&k.addDefaultCase(C)})}let h=S=>S,m=new Map,u;function y(S,v){return u||(u=g()),u(S,v)}function A(){return u||(u=g()),u.getInitialState()}function w(S,v=!1){function C(k){let I=k[S];return typeof I>"u"&&v&&(I=A()),I}function x(k=h){let I=Ia(m,v,{insert:()=>new WeakMap});return Ia(I,k,{insert:()=>{let O={};for(let[T,L]of Object.entries(n.selectors??{}))O[T]=sf(L,k,A,v);return O}})}return{reducerPath:S,getSelectors:x,get selectors(){return x(C)},selectSlice:C}}let R={name:i,reducer:y,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:A,...w(o),injectInto(S,{reducerPath:v,...C}={}){let x=v??o;return S.inject({reducerPath:x,reducer:y},C),{...R,...w(x,!0)}}};return R}}function sf(e,t,r,n){function i(o,...s){let c=t(o);return typeof c>"u"&&n&&(c=r()),e(c,...s)}return i.unwrapped=e,i}var kt=of();function af(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function cf({type:e,reducerName:t,createNotation:r},n,i){let o,s;if("reducer"in n){if(r&&!lf(n))throw new Error(Ae(17));o=n.reducer,s=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?M(e,s):M(e))}function uf(e){return e._reducerDefinitionType==="asyncThunk"}function lf(e){return e._reducerDefinitionType==="reducerWithPrepare"}function df({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Ae(18));let{payloadCreator:o,fulfilled:s,pending:c,rejected:f,settled:a,options:g}=r,h=i(e,o,g);n.exposeAction(t,h),s&&n.addCase(h.fulfilled,s),c&&n.addCase(h.pending,c),f&&n.addCase(h.rejected,f),a&&n.addMatcher(h.settled,a),n.exposeCaseReducer(t,{fulfilled:s||on,pending:c||on,rejected:f||on,settled:a||on})}function on(){}var Ma="listener",qa="completed",Na="cancelled",uA=`task-${Na}`,lA=`task-${qa}`,dA=`${Ma}-${Na}`,pA=`${Ma}-${qa}`;var{assign:_a}=Object;var io="listenerMiddleware";var pf=_a(M(`${io}/add`),{withTypes:()=>pf}),fA=M(`${io}/removeAll`),ff=_a(M(`${io}/remove`),{withTypes:()=>ff});var gA=Symbol.for("rtk-state-proxy-original");function Ae(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}p();d();var z=new Q({required:!0,emptyAllowed:!1}),re=new Q({required:!1,emptyAllowed:!1}),Oe=new Q({required:!0,emptyAllowed:!0}),xA=new Q({required:!1,emptyAllowed:!0}),La=new $e({each:z,required:!0}),ja=new Q({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),gf=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),oo=(e,t)=>{if("required"in t)return{payload:new Pe({value:t}).validate({value:e}).value};let i=new Z({options:{required:!0},values:t}).validate(e);if(i)throw new Ei(i);return{payload:e}},V=(e,t)=>{try{return oo(e,t)}catch(r){return{payload:e,error:gf(r)}}};var un=(e,t,r,n)=>{let i=`Check the options of ${n}`;return mf(e,t,r,i,"Controller initialization error")},mf=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,i),o}};var ln=M("caseAssistConfiguration/set",e=>V(e,{caseAssistId:z,locale:re,proxyBaseUrl:new Q({required:!1,url:!0})}));p();d();p();d();var Ua=()=>({caseAssistId:"",locale:"en-US"});var rt=oe(Ua(),e=>{e.addCase(ln,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});p();d();p();d();p();d();var Va={q:new Q,enableQuerySyntax:new te,aq:new Q,cq:new Q,firstResult:new fe({min:0}),numberOfResults:new fe({min:0}),sortCriteria:new Q,f:new Z,fExcluded:new Z,cf:new Z,nf:new Z,mnf:new Z,df:new Z,debug:new te,sf:new Z,tab:new Q,af:new Z};var dn=M("searchParameters/restore",e=>V(e,Va));p();d();var Ba=M("debug/enable"),Qa=M("debug/disable");p();d();var pn=()=>!1;var $a=oe(pn(),e=>{e.addCase(Ba,()=>!0).addCase(Qa,()=>!1).addCase(dn,(t,r)=>r.payload.debug??t)});p();d();var fn=M("searchHub/set",e=>V(e,new Q({required:!0,emptyAllowed:!0})));p();d();p();d();p();d();var Bt="3.10.1-pre.efee724163",Ha=["@coveo/atomic","@coveo/quantic"];var so=()=>re,za=()=>z,Qt=M("configuration/updateBasicConfiguration",e=>V(e,{accessToken:re,environment:new Q({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:re})),gn=M("configuration/updateSearchConfiguration",e=>V(e,{proxyBaseUrl:new Q({required:!1,url:!0}),pipeline:new Q({required:!1,emptyAllowed:!0}),searchHub:re,timezone:re,locale:re,authenticationProviders:new $e({required:!1,each:z})})),hf={enabled:new te({default:!0}),originContext:so(),originLevel2:so(),originLevel3:so(),proxyBaseUrl:new Q({required:!1,url:!0}),runtimeEnvironment:new vt,anonymous:new te({default:!1}),deviceId:re,userDisplayName:re,documentLocation:re,trackingId:re,analyticsMode:new Q({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new Z({options:{required:!1},values:Ha.reduce((e,t)=>(e[t]=ja,e),{})})},mn=M("configuration/updateAnalyticsConfiguration",e=>V(e,hf)),hn=M("configuration/analytics/disable"),yn=M("configuration/analytics/enable"),Ga=M("configuration/analytics/originlevel2",e=>V(e,{originLevel2:za()})),Wa=M("configuration/analytics/originlevel3",e=>V(e,{originLevel3:za()}));p();d();var yf=M("history/undo"),Sf=M("history/redo"),Ne=M("history/snapshot"),Mb=J("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(yf()),yield t(Sn())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),qb=J("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Sf()),yield t(Sn())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Sn=J("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());p();d();var nt=()=>"default";var Ya=oe(nt(),e=>{e.addCase(fn,(t,r)=>r.payload).addCase(Sn.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(gn,(t,r)=>r.payload.searchHub||t)});p();d();p();d();p();d();function vf({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:o,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(i,o,r))}var Cf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Af(e){return typeof e=="string"&&Cf.test(e)}function bf(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,i=n.getItem(t),o=i&&Af(i)?i:r.generateUUID();return n.setItem(t,o),o}}}var Ja="0.7.10";function wf(e){let{trackingId:t}=e;return{trackingId:t}}function Rf(e){return(e.source||[]).concat([`relay@${Ja}`])}function Xa(e,t,r,n){let{getReferrer:i,getLocation:o,getUserAgent:s}=r,c=wf(t),f=n.getClientId();return Object.freeze({type:e,config:c,ts:Date.now(),source:Rf(t),clientId:f,userAgent:s(),referrer:i(),location:o()})}function xf(e,t,r,n,i){return{...t,meta:Xa(e,r,n,i)}}var If="*";function Ef(){let e=[];function t({type:f,callback:a}){return e.findIndex(g=>g.type===f&&g.callback===a)}function r(f,a){return f.type==="*"||a===f.type}function n(f){return t(f)<0&&e.push(f),()=>c(f.type,f.callback)}function i(f){e.forEach(a=>{if(r(a,f.meta.type))try{a.callback(f)}catch(g){console.error(g)}})}function o(f){if(f===If)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===f&&e.splice(a,1)}function s(f){let a=t(f);a>=0&&e.splice(a,1)}function c(f,a){a?s({type:f,callback:a}):o(f)}return{add:n,call:i,remove:c}}function Ka({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source})})}function kf(e){let t=Ka(e);return{get:()=>t,update:r=>{t=Ka({...t,...r})}}}function Pf(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var ao=Of();function Of(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,i=document.cookie.split(";");for(let o of i){let s=o.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,i){let o=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+i).toUTCString()}`,c=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${s}${c};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Ff(){return{getItem(e){return ao.getItem(e)||localStorage.getItem(e)},removeItem(e){ao.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),ao.setItem(e,t,31556952e3)}}}function Tf(){let e=document.referrer;return e===""?null:e}function Df(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Pf().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>Tf(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:Ff()}}function Mf(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function qf(){return{getItem(){return null},removeItem(){},setItem(){}}}function Nf(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:qf()}}function _f(e){return e.get().mode!=="disabled"&&Lf()&&Mf()?Df():Nf()}function Lf(){try{return typeof window=="object"}catch{return!1}}function jf(e){return{get:()=>Object.freeze(_f(e))}}function Za(e){let t=kf(e),r=Ef(),n=jf(t),i=bf(n);return{emit:(o,s)=>{let c=t.get(),f=n.get(),a=xf(o,s,c,f,i);return vf({config:c,environment:f,event:a,listenerManager:r})},getMeta:o=>Xa(o,t.get(),n.get(),i),on:(o,s)=>r.add({type:o,callback:s}),off:(o,s)=>r.remove(o,s),updateConfig:o=>t.update(o),version:Ja}}p();d();var $t=ie(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Bt}`));var Ht=ie(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>$t(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:i,enabled:o},s)=>Za({mode:o?"emit":"disabled",url:i??$r(e,t),token:r,trackingId:n,source:s}));p();d();p();d();p();d();p();d();function tc(_x9,_x10){return _tc.apply(this,arguments)}function _tc(){_tc=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _tc.apply(this,arguments)}function rc(e){let t,r,n,i=!1;return function(s){t===void 0?(t=s,r=0,n=-1):t=Uf(t,s);let c=t.length,f=0;for(;r<c;){i&&(t[r]===10&&(f=++r),i=!1);let a=-1;for(;r<c&&a===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:i=!0;case 10:a=r;break}if(a===-1)break;e(t.subarray(f,a),n),f=r,n=-1}f===c?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function nc(e,t,r){let n=ec(),i=new TextDecoder;return function(s,c){if(s.length===0)r?.(n),n=ec();else if(c>0){let f=i.decode(s.subarray(0,c)),a=c+(s[c+1]===32?2:1),g=i.decode(s.subarray(a));switch(f){case"data":n.data=n.data?n.data+`
|
|
24
|
+
`;return new Ei(r)}var Ei=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Pe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let i in this.definition){let o=this.definition[i].validate(r[i]);o&&n.push(`${i}: ${o}`)}if(n.length)throw Fd(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},vt=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&$(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Dt(e){return e===void 0}function Td(e){return e===null}function $(e){return Dt(e)||Td(e)}var fe=class{constructor(e={}){ee(this,"value");this.config=e,this.value=new vt(e)}validate(e){let t=this.value.validate(e);return t||(Dd(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function Dd(e){return Dt(e)||qs(e)}function qs(e){return typeof e=="number"&&!isNaN(e)}var te=class{constructor(e={}){ee(this,"value");this.value=new vt(e)}validate(e){let t=this.value.validate(e);return t||(Md(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Md(e){return Dt(e)||Ns(e)}function Ns(e){return typeof e=="boolean"}var qd=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,Q=class{constructor(e={}){ee(this,"value");ee(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new vt(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:o}=this.config,s=this.value.validate(e);if(s)return s;if(Dt(e))return null;if(!_s(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:o&&!(qd.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function _s(e){return Object.prototype.toString.call(e)==="[object String]"}var Z=class{constructor(e={}){ee(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Dt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ls(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&$(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],o=n.validate(i);o!==null&&(t+=" "+o)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Ls(e){return e!==void 0&&typeof e=="object"}var $e=class{constructor(e={}){ee(this,"value");this.config=e,this.value=new vt(this.config)}validate(e){if(!$(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if($(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&$(n)&&(r=`value is null or undefined: ${e.join(",")}`);let i=this.validatePrimitiveValue(n,this.config.each);i!==null&&(r+=" "+i)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ns(e)||_s(e)||qs(e)||Ls(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function js(e){return Array.isArray(e)}var ki=class{constructor(e){ee(this,"value");this.config=e,this.value=new vt(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Dt(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};p();d();var Br=e=>e;p();d();p();d();var ta=Re(Gs(),1);p();d();p();d();var xe=new Error("Failed to load reducers."),Mt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var At=class extends Error{constructor(r,n){super();ee(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};p();d();function Ws(e){return Array.isArray(e)}function Ys(e,t){return[...e.reduce((r,n)=>{let i=t(n);return r.has(i)||r.set(i,n),r},new Map).values()]}var ap=new Set(["1",1,"yes",!0]);function Ks(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>ap.has(r))}function Js(e){let t={};for(let[r,n]of e)t[r]=n;return t}function dr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}p();d();function Xs(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}function Zs(e){return typeof e!="object"||!e?!1:Object.values(e).every(cp)}function cp(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ea(e){return e===429}var tt=class e{static call(t){return _asyncToGenerator(function*(){let r=up(t),{logger:n}=t,i=yield e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:o,...s}=i,c=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield b(o,s);if(ea(f.status))throw f;return f});return function c(){return _ref.apply(this,arguments)}}();try{let f=yield(0,ta.backOff)(c,{retry:a=>{let g=a&&ea(a.status);return g&&n.info("Platform retrying request"),g}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Mt;case 404:throw new At(o,f.status);default:return n.info({response:f,requestInfo:i},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new At(o):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:i,logger:o,requestMetadata:s}=r,{signal:c,...f}=t,a=dr(f);try{let g=yield i(t,n,s);return{...t,...g}}catch(g){o.error(g,"Platform request preprocessing failed. Returning default request options.")}return a})()}};function ne(e,t="prod",r="platform"){let n=t==="prod"?"":t,i=r==="platform"?"":`.${r}`;return`https://${e}${i}.org${n}.coveo.com`}function qt(e,t="prod"){return`${ne(e,t)}/rest/search/v2`}function $r(e,t="prod"){return`${ne(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function up(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:o,signal:s}=e,c=e.method==="POST"||e.method==="PUT",f=lp(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${o}`,...e.headers},...(c&&{body:f}),signal:s}}function lp(e,t){return t==="application/x-www-form-urlencoded"?Zs(e)?Xs(e):"":JSON.stringify(e)}p();d();p();d();var Nt=class{constructor(t){ee(this,"_basePath");ee(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};p();d();function _i(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...o}=e;return o}var Li=e=>{let{response:t}=e;return t.body?dp(e):pp(t)},dp=e=>gp(e)?mp(e):fp(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},pp=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function fp(e){return e.body.statusCode!==void 0}function gp(e){return e.body.exception!==void 0}var mp=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});p();d();function ra(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}p();d();var ji=(e,t,r,n)=>{let i=new Nt(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};var na=(e,t)=>{let r=new Nt(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},Ui=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield tt.call({...ji(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:_i(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ra(r),i=yield r.arrayBuffer(),s=new TextDecoder(n).decode(i);return hp(s)?{success:s}:{error:Li({response:r,body:s})}});return function Ui(_x,_x2){return _ref2.apply(this,arguments)}}();function hp(e){return typeof e=="string"}p();d();function yp(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Sp(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Hr(e,t){if(t&&e.name==="AbortError")return{error:Sp(e)};if(e instanceof At)return{error:yp(e)};throw e}p();d();p();d();var zr=(e,t,r,n,i={})=>{vp(e);let o=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=Cp(i),c=s?`${o}?${s}`:o;return{accessToken:e.accessToken,method:t,contentType:r,url:c,origin:"caseAssistApiFetch"}},Gr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r]}),{}),Wr=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r].value}),{}),vp=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},Cp=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var ia=e=>{let t=e.debug?{debug:"1"}:{};return{...zr(e,"POST","application/json","/classify",t),requestParams:Ap(e)}},Ap=e=>({clientId:e.clientId,locale:e.locale,fields:Gr(e.fields)});p();d();var oa=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...zr(e,"POST","application/json","/documents/suggest",t),requestParams:bp(e)}},bp=e=>({clientId:e.clientId,locale:e.locale,fields:Gr(e.fields),context:e.context});var Yr=class{constructor(t){this.options=t}getCaseClassifications(t){var _this=this;return _asyncToGenerator(function*(){let r=yield tt.call({...ia(t),..._this.options});if(r instanceof Error)return Hr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}getDocumentSuggestions(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield tt.call({...oa(t),..._this2.options});if(r instanceof Error)return Hr(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this3=this;return _asyncToGenerator(function*(){return Ui(t,_this3.options)})()}};p();d();p();d();p();d();function ce(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var wp=typeof Symbol=="function"&&Symbol.observable||"@@observable",sa=wp,Vi=()=>Math.random().toString(36).substring(7).split("").join("."),Rp={INIT:`@@redux/INIT${Vi()}`,REPLACE:`@@redux/REPLACE${Vi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Vi()}`},Kr=Rp;function Me(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Bi(e,t,r){if(typeof e!="function")throw new Error(ce(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ce(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ce(1));return r(Bi)(e,t)}let n=e,i=t,o=new Map,s=o,c=0,f=!1;function a(){s===o&&(s=new Map,o.forEach((w,R)=>{s.set(R,w)}))}function g(){if(f)throw new Error(ce(3));return i}function h(w){if(typeof w!="function")throw new Error(ce(4));if(f)throw new Error(ce(5));let R=!0;a();let S=c++;return s.set(S,w),function(){if(R){if(f)throw new Error(ce(6));R=!1,a(),s.delete(S),o=null}}}function m(w){if(!Me(w))throw new Error(ce(7));if(typeof w.type>"u")throw new Error(ce(8));if(typeof w.type!="string")throw new Error(ce(17));if(f)throw new Error(ce(9));try{f=!0,i=n(i,w)}finally{f=!1}return(o=s).forEach(S=>{S()}),w}function u(w){if(typeof w!="function")throw new Error(ce(10));n=w,m({type:Kr.REPLACE})}function y(){let w=h;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(ce(11));function S(){let C=R;C.next&&C.next(g())}return S(),{unsubscribe:w(S)}},[sa](){return this}}}return m({type:Kr.INIT}),{dispatch:m,subscribe:h,getState:g,replaceReducer:u,[sa]:y}}function xp(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Kr.INIT})>"u")throw new Error(ce(12));if(typeof r(void 0,{type:Kr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ce(13))})}function _t(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let c=t[s];typeof e[c]=="function"&&(r[c]=e[c])}let n=Object.keys(r),i,o;try{xp(r)}catch(s){o=s}return function(c={},f){if(o)throw o;let a=!1,g={};for(let h=0;h<n.length;h++){let m=n[h],u=r[m],y=c[m],A=u(y,f);if(typeof A>"u"){let w=f&&f.type;throw new Error(ce(14))}g[m]=A,a=a||A!==y}return a=a||n.length!==Object.keys(c).length,a?g:c}}function Lt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function aa(...e){return t=>(r,n)=>{let i=t(r,n),o=()=>{throw new Error(ce(15))},s={getState:i.getState,dispatch:(f,...a)=>o(f,...a)},c=e.map(f=>f(s));return o=Lt(...c)(i.dispatch),{...i,dispatch:o}}}function Jr(e){return Me(e)&&"type"in e&&typeof e.type=="string"}p();d();var Xi=Symbol.for("immer-nothing"),pr=Symbol.for("immer-draftable"),ge=Symbol.for("immer-state");function ue(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wt=Object.getPrototypeOf;function ve(e){return!!e&&!!e[ge]}function me(e){return e?pa(e)||Array.isArray(e)||!!e[pr]||!!e.constructor?.[pr]||yr(e)||Sr(e):!1}var Ip=Object.prototype.constructor.toString();function pa(e){if(!e||typeof e!="object")return!1;let t=wt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Ip}function Zi(e){return ve(e)||ue(15,e),e[ge].base_}function fr(e,t){Rt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Rt(e){let t=e[ge];return t?t.type_:Array.isArray(e)?1:yr(e)?2:Sr(e)?3:0}function gr(e,t){return Rt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Qi(e,t){return Rt(e)===2?e.get(t):e[t]}function fa(e,t,r){let n=Rt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ep(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function yr(e){return e instanceof Map}function Sr(e){return e instanceof Set}function bt(e){return e.copy_||e.base_}function zi(e,t){if(yr(e))return new Map(e);if(Sr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=pa(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ge];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){let s=i[o],c=n[s];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[s]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[s]})}return Object.create(wt(e),n)}else{let n=wt(e);if(n!==null&&r)return{...e};let i=Object.create(n);return Object.assign(i,e)}}function en(e,t=!1){return tn(e)||ve(e)||!me(e)||(Rt(e)>1&&(e.set=e.add=e.clear=e.delete=kp),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>en(n,!0))),e}function kp(){ue(2)}function tn(e){return Object.isFrozen(e)}var Gi={};function xt(e){let t=Gi[e];return t||ue(0,e),t}function Pp(e,t){Gi[e]||(Gi[e]=t)}var mr;function ga(){return mr}function Op(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ca(e,t){t&&(xt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wi(e){Yi(e),e.drafts_.forEach(Fp),e.drafts_=null}function Yi(e){e===mr&&(mr=e.parent_)}function ua(e){return mr=Op(mr,e)}function Fp(e){let t=e[ge];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function la(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ge].modified_&&(Wi(t),ue(4)),me(e)&&(e=Xr(t,e),t.parent_||Zr(t,e)),t.patches_&&xt("Patches").generateReplacementPatches_(r[ge].base_,e,t.patches_,t.inversePatches_)):e=Xr(t,r,[]),Wi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Xi?e:void 0}function Xr(e,t,r){if(tn(t))return t;let n=t[ge];if(!n)return fr(t,(i,o)=>da(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Zr(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let i=n.copy_,o=i,s=!1;n.type_===3&&(o=new Set(i),i.clear(),s=!0),fr(o,(c,f)=>da(e,n,i,c,f,r,s)),Zr(e,i,!1),r&&e.patches_&&xt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function da(e,t,r,n,i,o,s){if(ve(i)){let c=o&&t&&t.type_!==3&&!gr(t.assigned_,n)?o.concat(n):void 0,f=Xr(e,i,c);if(fa(r,n,f),ve(f))e.canAutoFreeze_=!1;else return}else s&&r.add(i);if(me(i)&&!tn(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Xr(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Zr(e,i)}}function Zr(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&en(t,r)}function Tp(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ga(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,o=eo;r&&(i=[n],o=hr);let{revoke:s,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=s,c}var eo={get(e,t){if(t===ge)return e;let r=bt(e);if(!gr(r,t))return Dp(e,r,t);let n=r[t];return e.finalized_||!me(n)?n:n===$i(e.base_,t)?(Hi(e),e.copy_[t]=Ji(n,e)):n},has(e,t){return t in bt(e)},ownKeys(e){return Reflect.ownKeys(bt(e))},set(e,t,r){let n=ma(bt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let i=$i(bt(e),t),o=i?.[ge];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ep(r,i)&&(r!==void 0||gr(e.base_,t)))return!0;Hi(e),Ki(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return $i(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Hi(e),Ki(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=bt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ue(11)},getPrototypeOf(e){return wt(e.base_)},setPrototypeOf(){ue(12)}},hr={};fr(eo,(e,t)=>{hr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});hr.deleteProperty=function(e,t){return hr.set.call(this,e,t,void 0)};hr.set=function(e,t,r){return eo.set.call(this,e[0],t,r,e[0])};function $i(e,t){let r=e[ge];return(r?bt(r):e)[t]}function Dp(e,t,r){let n=ma(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function ma(e,t){if(!(t in e))return;let r=wt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=wt(r)}}function Ki(e){e.modified_||(e.modified_=!0,e.parent_&&Ki(e.parent_))}function Hi(e){e.copy_||(e.copy_=zi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Mp=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let s=this;return function(f=o,...a){return s.produce(f,g=>r.call(this,g,...a))}}typeof r!="function"&&ue(6),n!==void 0&&typeof n!="function"&&ue(7);let i;if(me(t)){let o=ua(this),s=Ji(t,void 0),c=!0;try{i=r(s),c=!1}finally{c?Wi(o):Yi(o)}return ca(o,n),la(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Xi&&(i=void 0),this.autoFreeze_&&en(i,!0),n){let o=[],s=[];xt("Patches").generateReplacementPatches_(t,i,o,s),n(o,s)}return i}else ue(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...c)=>this.produceWithPatches(s,f=>t(f,...c));let n,i;return[this.produce(t,r,(s,c)=>{n=s,i=c}),n,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){me(e)||ue(8),ve(e)&&(e=ha(e));let t=ua(this),r=Ji(e,void 0);return r[ge].isManual_=!0,Yi(t),r}finishDraft(e,t){let r=e&&e[ge];(!r||!r.isManual_)&&ue(9);let{scope_:n}=r;return ca(n,t),la(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let n=xt("Patches").applyPatches_;return ve(e)?n(e,t):this.produce(e,i=>n(i,t))}};function Ji(e,t){let r=yr(e)?xt("MapSet").proxyMap_(e,t):Sr(e)?xt("MapSet").proxySet_(e,t):Tp(e,t);return(t?t.scope_:ga()).drafts_.push(r),r}function ha(e){return ve(e)||ue(10,e),ya(e)}function ya(e){if(!me(e)||tn(e))return e;let t=e[ge],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=zi(e,t.scope_.immer_.useStrictShallowCopy_)}else r=zi(e,!0);return fr(r,(n,i)=>{fa(r,n,ya(i))}),t&&(t.finalized_=!1),r}function Sa(){let t="replace",r="add",n="remove";function i(m,u,y,A){switch(m.type_){case 0:case 2:return s(m,u,y,A);case 1:return o(m,u,y,A);case 3:return c(m,u,y,A)}}function o(m,u,y,A){let{base_:w,assigned_:R}=m,S=m.copy_;S.length<w.length&&([w,S]=[S,w],[y,A]=[A,y]);for(let v=0;v<w.length;v++)if(R[v]&&S[v]!==w[v]){let C=u.concat([v]);y.push({op:t,path:C,value:h(S[v])}),A.push({op:t,path:C,value:h(w[v])})}for(let v=w.length;v<S.length;v++){let C=u.concat([v]);y.push({op:r,path:C,value:h(S[v])})}for(let v=S.length-1;w.length<=v;--v){let C=u.concat([v]);A.push({op:n,path:C})}}function s(m,u,y,A){let{base_:w,copy_:R}=m;fr(m.assigned_,(S,v)=>{let C=Qi(w,S),x=Qi(R,S),k=v?gr(w,S)?t:r:n;if(C===x&&k===t)return;let I=u.concat(S);y.push(k===n?{op:k,path:I}:{op:k,path:I,value:x}),A.push(k===r?{op:n,path:I}:k===n?{op:r,path:I,value:h(C)}:{op:t,path:I,value:h(C)})})}function c(m,u,y,A){let{base_:w,copy_:R}=m,S=0;w.forEach(v=>{if(!R.has(v)){let C=u.concat([S]);y.push({op:n,path:C,value:v}),A.unshift({op:r,path:C,value:v})}S++}),S=0,R.forEach(v=>{if(!w.has(v)){let C=u.concat([S]);y.push({op:r,path:C,value:v}),A.unshift({op:n,path:C,value:v})}S++})}function f(m,u,y,A){y.push({op:t,path:[],value:u===Xi?void 0:u}),A.push({op:t,path:[],value:m})}function a(m,u){return u.forEach(y=>{let{path:A,op:w}=y,R=m;for(let x=0;x<A.length-1;x++){let k=Rt(R),I=A[x];typeof I!="string"&&typeof I!="number"&&(I=""+I),(k===0||k===1)&&(I==="__proto__"||I==="constructor")&&ue(19),typeof R=="function"&&I==="prototype"&&ue(19),R=Qi(R,I),typeof R!="object"&&ue(18,A.join("/"))}let S=Rt(R),v=g(y.value),C=A[A.length-1];switch(w){case t:switch(S){case 2:return R.set(C,v);case 3:ue(16);default:return R[C]=v}case r:switch(S){case 1:return C==="-"?R.push(v):R.splice(C,0,v);case 2:return R.set(C,v);case 3:return R.add(v);default:return R[C]=v}case n:switch(S){case 1:return R.splice(C,1);case 2:return R.delete(C);case 3:return R.delete(y.value);default:return delete R[C]}default:ue(17,w)}}),m}function g(m){if(!me(m))return m;if(Array.isArray(m))return m.map(g);if(yr(m))return new Map(Array.from(m.entries()).map(([y,A])=>[y,g(A)]));if(Sr(m))return new Set(Array.from(m).map(g));let u=Object.create(wt(m));for(let y in m)u[y]=g(m[y]);return gr(m,pr)&&(u[pr]=m[pr]),u}function h(m){return ve(m)?g(m):m}Pp("Patches",{applyPatches_:a,generatePatches_:i,generateReplacementPatches_:f})}var Ce=new Mp,ze=Ce.produce,rn=Ce.produceWithPatches.bind(Ce),MC=Ce.setAutoFreeze.bind(Ce),qC=Ce.setUseStrictShallowCopy.bind(Ce),to=Ce.applyPatches.bind(Ce),NC=Ce.createDraft.bind(Ce),_C=Ce.finishDraft.bind(Ce);p();d();function qp(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Np(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function _p(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var va=e=>Array.isArray(e)?e:[e];function Lp(e){let t=Array.isArray(e[0])?e[0]:e;return _p(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jp(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var BC=Symbol();var QC=Object.getPrototypeOf({});var Up=class{constructor(e){this.value=e}deref(){return this.value}},Vp=typeof WeakRef<"u"?WeakRef:Up,Bp=0,Ca=1;function nn(){return{s:Bp,v:void 0,o:null,p:null}}function jt(e,t={}){let r=nn(),{resultEqualityCheck:n}=t,i,o=0;function s(){let c=r,{length:f}=arguments;for(let h=0,m=f;h<m;h++){let u=arguments[h];if(typeof u=="function"||typeof u=="object"&&u!==null){let y=c.o;y===null&&(c.o=y=new WeakMap);let A=y.get(u);A===void 0?(c=nn(),y.set(u,c)):c=A}else{let y=c.p;y===null&&(c.p=y=new Map);let A=y.get(u);A===void 0?(c=nn(),y.set(u,c)):c=A}}let a=c,g;if(c.s===Ca)g=c.v;else if(g=e.apply(null,arguments),o++,n){let h=i?.deref?.()??i;h!=null&&n(h,g)&&(g=h,o!==0&&o--),i=typeof g=="object"&&g!==null||typeof g=="function"?new Vp(g):g}return a.s=Ca,a.v=g,g}return s.clearCache=()=>{r=nn(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function Aa(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,s=0,c,f={},a=i.pop();typeof a=="object"&&(f=a,a=i.pop()),qp(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let g={...r,...f},{memoize:h,memoizeOptions:m=[],argsMemoize:u=jt,argsMemoizeOptions:y=[],devModeChecks:A={}}=g,w=va(m),R=va(y),S=Lp(i),v=h(function(){return o++,a.apply(null,arguments)},...w),C=!0,x=u(function(){s++;let I=jp(S,arguments);return c=v.apply(null,I),c},...R);return Object.assign(x,{resultFunc:a,memoizedResultFunc:v,dependencies:S,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:h,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}var ie=Aa(jt),Qp=Object.assign((e,t=ie)=>{Np(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(o=>e[o]);return t(n,(...o)=>o.reduce((s,c,f)=>(s[r[f]]=c,s),{}))},{withTypes:()=>Qp});p();d();function ba(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var wa=ba(),Ra=ba;var $p=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Lt:Lt.apply(null,arguments)},nA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Hp=e=>e&&typeof e.match=="function";function M(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Ae(0));return{type:e,payload:i.payload,...("meta"in i&&{meta:i.meta}),...("error"in i&&{error:i.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Jr(n)&&n.type===e,r}var ka=class vr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,vr.prototype)}static get[Symbol.species](){return vr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new vr(...t[0].concat(this)):new vr(...t.concat(this))}};function xa(e){return me(e)?ze(e,()=>{}):e}function Ia(e,t,r){if(e.has(t)){let i=e.get(t);return r.update&&(i=r.update(i,t,e),e.set(t,i)),i}if(!r.insert)throw new Error(Ae(10));let n=r.insert(t,e);return e.set(t,n),n}function zp(e){return typeof e=="boolean"}var Gp=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{},s=new ka;return r&&(zp(r)?s.push(wa):s.push(Ra(r.extraArgument))),s},Et="RTK_autoBatch",Vt=()=>e=>({payload:e,meta:{[Et]:!0}}),Pa=e=>t=>{setTimeout(t,e)},Wp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Pa(10),Yp=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,o=!1,s=!1,c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?Wp:e.type==="callback"?e.queueNotification:Pa(e.timeout),a=()=>{s=!1,o&&(o=!1,c.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let h=()=>i&&g(),m=n.subscribe(h);return c.add(g),()=>{m(),c.delete(g)}},dispatch(g){try{return i=!g?.meta?.[Et],o=!i,o&&(s||(s=!0,f(a))),n.dispatch(g)}finally{i=!0}}})},Kp=e=>function(r){let{autoBatch:n=!0}=r??{},i=new ka(e);return n&&i.push(Yp(typeof n=="object"?n:void 0)),i};function Oa(e){let t=Gp(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Me(r))c=_t(r);else throw new Error(Ae(1));let f;typeof n=="function"?f=n(t):f=t();let a=Lt;i&&(a=$p({trace:!1,...(typeof i=="object"&&i)}));let g=aa(...f),h=Kp(g),m=typeof s=="function"?s(h):h(),u=a(...m);return Bi(c,o,u)}function Fa(e){let t={},r=[],n,i={addCase(o,s){let c=typeof o=="string"?o:o.type;if(!c)throw new Error(Ae(28));if(c in t)throw new Error(Ae(29));return t[c]=s,i},addMatcher(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function Jp(e){return typeof e=="function"}function oe(e,t){let[r,n,i]=Fa(t),o;if(Jp(e))o=()=>xa(e());else{let c=xa(e);o=()=>c}function s(c=o(),f){let a=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return a.filter(g=>!!g).length===0&&(a=[i]),a.reduce((g,h)=>{if(h)if(ve(g)){let u=h(g,f);return u===void 0?g:u}else{if(me(g))return ze(g,m=>h(m,f));{let m=h(g,f);if(m===void 0){if(g===null)return g;throw new Error(Ae(9))}return m}}return g},c)}return s.getInitialState=o,s}var Ta=(e,t)=>Hp(e)?e.match(t):e(t);function qe(...e){return t=>e.some(r=>Ta(r,t))}function Ut(...e){return t=>e.every(r=>Ta(r,t))}function sn(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Cr(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function an(...e){return e.length===0?t=>sn(t,["pending"]):Cr(e)?qe(...e.map(t=>t.pending)):an()(e[0])}function It(...e){return e.length===0?t=>sn(t,["rejected"]):Cr(e)?qe(...e.map(t=>t.rejected)):It()(e[0])}function Ar(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Ut(It(...e),t):Cr(e)?Ut(It(...e),t):Ar()(e[0])}function Ge(...e){return e.length===0?t=>sn(t,["fulfilled"]):Cr(e)?qe(...e.map(t=>t.fulfilled)):Ge()(e[0])}function cn(...e){return e.length===0?t=>sn(t,["pending","fulfilled","rejected"]):Cr(e)?qe(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):cn()(e[0])}var Xp="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",no=(e=21)=>{let t="",r=e;for(;r--;)t+=Xp[Math.random()*64|0];return t},Zp=["name","message","stack","code"],ro=class{constructor(e,t){ee(this,"_type");this.payload=e,this.meta=t}},Ea=class{constructor(e,t){ee(this,"_type");this.payload=e,this.meta=t}},ef=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Zp)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},J=(()=>{function e(t,r,n){let i=M(t+"/fulfilled",(f,a,g,h)=>({payload:f,meta:{...(h||{}),arg:g,requestId:a,requestStatus:"fulfilled"}})),o=M(t+"/pending",(f,a,g)=>({payload:void 0,meta:{...(g||{}),arg:a,requestId:f,requestStatus:"pending"}})),s=M(t+"/rejected",(f,a,g,h,m)=>({payload:h,error:(n&&n.serializeError||ef)(f||"Rejected"),meta:{...(m||{}),arg:g,requestId:a,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function c(f){return(a,g,h)=>{let m=n?.idGenerator?n.idGenerator(f):no(),u=new l.AbortController,y,A;function w(S){A=S,u.abort()}let R=_asyncToGenerator(function*(){let S;try{let C=n?.condition?.(f,{getState:g,extra:h});if(rf(C)&&(C=yield C),C===!1||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let x=new Promise((k,I)=>{y=()=>{I({name:"AbortError",message:A||"Aborted"})},u.signal.addEventListener("abort",y)});a(o(m,f,n?.getPendingMeta?.({requestId:m,arg:f},{getState:g,extra:h}))),S=yield Promise.race([x,Promise.resolve(r(f,{dispatch:a,getState:g,extra:h,requestId:m,signal:u.signal,abort:w,rejectWithValue:(k,I)=>new ro(k,I),fulfillWithValue:(k,I)=>new Ea(k,I)})).then(k=>{if(k instanceof ro)throw k;return k instanceof Ea?i(k.payload,m,f,k.meta):i(k,m,f)})])}catch(C){S=C instanceof ro?s(null,m,f,C.payload,C.meta):s(C,m,f)}finally{y&&u.signal.removeEventListener("abort",y)}return n&&!n.dispatchConditionRejection&&s.match(S)&&S.meta.condition||a(S),S})();return Object.assign(R,{abort:w,requestId:m,arg:f,unwrap(){return R.then(tf)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:i,settled:qe(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function tf(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function rf(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Da=Symbol.for("rtk-slice-createasyncthunk"),cA={[Da]:J};function nf(e,t){return`${e}/${t}`}function of({creators:e}={}){let t=e?.asyncThunk?.[Da];return function(n){let{name:i,reducerPath:o=i}=n;if(!i)throw new Error(Ae(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(af()):n.reducers)||{},c=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(S,v){let C=typeof S=="string"?S:S.type;if(!C)throw new Error(Ae(12));if(C in f.sliceCaseReducersByType)throw new Error(Ae(13));return f.sliceCaseReducersByType[C]=v,a},addMatcher(S,v){return f.sliceMatchers.push({matcher:S,reducer:v}),a},exposeAction(S,v){return f.actionCreators[S]=v,a},exposeCaseReducer(S,v){return f.sliceCaseReducersByName[S]=v,a}};c.forEach(S=>{let v=s[S],C={reducerName:S,type:nf(i,S),createNotation:typeof n.reducers=="function"};uf(v)?df(C,v,a,t):cf(C,v,a)});function g(){let[S={},v=[],C=void 0]=typeof n.extraReducers=="function"?Fa(n.extraReducers):[n.extraReducers],x={...S,...f.sliceCaseReducersByType};return oe(n.initialState,k=>{for(let I in x)k.addCase(I,x[I]);for(let I of f.sliceMatchers)k.addMatcher(I.matcher,I.reducer);for(let I of v)k.addMatcher(I.matcher,I.reducer);C&&k.addDefaultCase(C)})}let h=S=>S,m=new Map,u;function y(S,v){return u||(u=g()),u(S,v)}function A(){return u||(u=g()),u.getInitialState()}function w(S,v=!1){function C(k){let I=k[S];return typeof I>"u"&&v&&(I=A()),I}function x(k=h){let I=Ia(m,v,{insert:()=>new WeakMap});return Ia(I,k,{insert:()=>{let O={};for(let[T,L]of Object.entries(n.selectors??{}))O[T]=sf(L,k,A,v);return O}})}return{reducerPath:S,getSelectors:x,get selectors(){return x(C)},selectSlice:C}}let R={name:i,reducer:y,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:A,...w(o),injectInto(S,{reducerPath:v,...C}={}){let x=v??o;return S.inject({reducerPath:x,reducer:y},C),{...R,...w(x,!0)}}};return R}}function sf(e,t,r,n){function i(o,...s){let c=t(o);return typeof c>"u"&&n&&(c=r()),e(c,...s)}return i.unwrapped=e,i}var kt=of();function af(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function cf({type:e,reducerName:t,createNotation:r},n,i){let o,s;if("reducer"in n){if(r&&!lf(n))throw new Error(Ae(17));o=n.reducer,s=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?M(e,s):M(e))}function uf(e){return e._reducerDefinitionType==="asyncThunk"}function lf(e){return e._reducerDefinitionType==="reducerWithPrepare"}function df({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Ae(18));let{payloadCreator:o,fulfilled:s,pending:c,rejected:f,settled:a,options:g}=r,h=i(e,o,g);n.exposeAction(t,h),s&&n.addCase(h.fulfilled,s),c&&n.addCase(h.pending,c),f&&n.addCase(h.rejected,f),a&&n.addMatcher(h.settled,a),n.exposeCaseReducer(t,{fulfilled:s||on,pending:c||on,rejected:f||on,settled:a||on})}function on(){}var Ma="listener",qa="completed",Na="cancelled",uA=`task-${Na}`,lA=`task-${qa}`,dA=`${Ma}-${Na}`,pA=`${Ma}-${qa}`;var{assign:_a}=Object;var io="listenerMiddleware";var pf=_a(M(`${io}/add`),{withTypes:()=>pf}),fA=M(`${io}/removeAll`),ff=_a(M(`${io}/remove`),{withTypes:()=>ff});var gA=Symbol.for("rtk-state-proxy-original");function Ae(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}p();d();var z=new Q({required:!0,emptyAllowed:!1}),re=new Q({required:!1,emptyAllowed:!1}),Oe=new Q({required:!0,emptyAllowed:!0}),xA=new Q({required:!1,emptyAllowed:!0}),La=new $e({each:z,required:!0}),ja=new Q({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),gf=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),oo=(e,t)=>{if("required"in t)return{payload:new Pe({value:t}).validate({value:e}).value};let i=new Z({options:{required:!0},values:t}).validate(e);if(i)throw new Ei(i);return{payload:e}},V=(e,t)=>{try{return oo(e,t)}catch(r){return{payload:e,error:gf(r)}}};var un=(e,t,r,n)=>{let i=`Check the options of ${n}`;return mf(e,t,r,i,"Controller initialization error")},mf=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,i),o}};var ln=M("caseAssistConfiguration/set",e=>V(e,{caseAssistId:z,locale:re,proxyBaseUrl:new Q({required:!1,url:!0})}));p();d();p();d();var Ua=()=>({caseAssistId:"",locale:"en-US"});var rt=oe(Ua(),e=>{e.addCase(ln,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});p();d();p();d();p();d();var Va={q:new Q,enableQuerySyntax:new te,aq:new Q,cq:new Q,firstResult:new fe({min:0}),numberOfResults:new fe({min:0}),sortCriteria:new Q,f:new Z,fExcluded:new Z,cf:new Z,nf:new Z,mnf:new Z,df:new Z,debug:new te,sf:new Z,tab:new Q,af:new Z};var dn=M("searchParameters/restore",e=>V(e,Va));p();d();var Ba=M("debug/enable"),Qa=M("debug/disable");p();d();var pn=()=>!1;var $a=oe(pn(),e=>{e.addCase(Ba,()=>!0).addCase(Qa,()=>!1).addCase(dn,(t,r)=>r.payload.debug??t)});p();d();var fn=M("searchHub/set",e=>V(e,new Q({required:!0,emptyAllowed:!0})));p();d();p();d();p();d();var Bt="3.11.0-pre.fa559154a7",Ha=["@coveo/atomic","@coveo/quantic"];var so=()=>re,za=()=>z,Qt=M("configuration/updateBasicConfiguration",e=>V(e,{accessToken:re,environment:new Q({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:re})),gn=M("configuration/updateSearchConfiguration",e=>V(e,{proxyBaseUrl:new Q({required:!1,url:!0}),pipeline:new Q({required:!1,emptyAllowed:!0}),searchHub:re,timezone:re,locale:re,authenticationProviders:new $e({required:!1,each:z})})),hf={enabled:new te({default:!0}),originContext:so(),originLevel2:so(),originLevel3:so(),proxyBaseUrl:new Q({required:!1,url:!0}),runtimeEnvironment:new vt,anonymous:new te({default:!1}),deviceId:re,userDisplayName:re,documentLocation:re,trackingId:re,analyticsMode:new Q({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new Z({options:{required:!1},values:Ha.reduce((e,t)=>(e[t]=ja,e),{})})},mn=M("configuration/updateAnalyticsConfiguration",e=>V(e,hf)),hn=M("configuration/analytics/disable"),yn=M("configuration/analytics/enable"),Ga=M("configuration/analytics/originlevel2",e=>V(e,{originLevel2:za()})),Wa=M("configuration/analytics/originlevel3",e=>V(e,{originLevel3:za()}));p();d();var yf=M("history/undo"),Sf=M("history/redo"),Ne=M("history/snapshot"),Mb=J("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(yf()),yield t(Sn())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),qb=J("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Sf()),yield t(Sn())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Sn=J("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());p();d();var nt=()=>"default";var Ya=oe(nt(),e=>{e.addCase(fn,(t,r)=>r.payload).addCase(Sn.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(gn,(t,r)=>r.payload.searchHub||t)});p();d();p();d();p();d();function vf({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:o,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(i,o,r))}var Cf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Af(e){return typeof e=="string"&&Cf.test(e)}function bf(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,i=n.getItem(t),o=i&&Af(i)?i:r.generateUUID();return n.setItem(t,o),o}}}var Ja="0.7.10";function wf(e){let{trackingId:t}=e;return{trackingId:t}}function Rf(e){return(e.source||[]).concat([`relay@${Ja}`])}function Xa(e,t,r,n){let{getReferrer:i,getLocation:o,getUserAgent:s}=r,c=wf(t),f=n.getClientId();return Object.freeze({type:e,config:c,ts:Date.now(),source:Rf(t),clientId:f,userAgent:s(),referrer:i(),location:o()})}function xf(e,t,r,n,i){return{...t,meta:Xa(e,r,n,i)}}var If="*";function Ef(){let e=[];function t({type:f,callback:a}){return e.findIndex(g=>g.type===f&&g.callback===a)}function r(f,a){return f.type==="*"||a===f.type}function n(f){return t(f)<0&&e.push(f),()=>c(f.type,f.callback)}function i(f){e.forEach(a=>{if(r(a,f.meta.type))try{a.callback(f)}catch(g){console.error(g)}})}function o(f){if(f===If)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===f&&e.splice(a,1)}function s(f){let a=t(f);a>=0&&e.splice(a,1)}function c(f,a){a?s({type:f,callback:a}):o(f)}return{add:n,call:i,remove:c}}function Ka({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source})})}function kf(e){let t=Ka(e);return{get:()=>t,update:r=>{t=Ka({...t,...r})}}}function Pf(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var ao=Of();function Of(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,i=document.cookie.split(";");for(let o of i){let s=o.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,i){let o=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+i).toUTCString()}`,c=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${s}${c};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Ff(){return{getItem(e){return ao.getItem(e)||localStorage.getItem(e)},removeItem(e){ao.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),ao.setItem(e,t,31556952e3)}}}function Tf(){let e=document.referrer;return e===""?null:e}function Df(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Pf().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>Tf(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:Ff()}}function Mf(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function qf(){return{getItem(){return null},removeItem(){},setItem(){}}}function Nf(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:qf()}}function _f(e){return e.get().mode!=="disabled"&&Lf()&&Mf()?Df():Nf()}function Lf(){try{return typeof window=="object"}catch{return!1}}function jf(e){return{get:()=>Object.freeze(_f(e))}}function Za(e){let t=kf(e),r=Ef(),n=jf(t),i=bf(n);return{emit:(o,s)=>{let c=t.get(),f=n.get(),a=xf(o,s,c,f,i);return vf({config:c,environment:f,event:a,listenerManager:r})},getMeta:o=>Xa(o,t.get(),n.get(),i),on:(o,s)=>r.add({type:o,callback:s}),off:(o,s)=>r.remove(o,s),updateConfig:o=>t.update(o),version:Ja}}p();d();var $t=ie(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Bt}`));var Ht=ie(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>$t(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:i,enabled:o},s)=>Za({mode:o?"emit":"disabled",url:i??$r(e,t),token:r,trackingId:n,source:s}));p();d();p();d();p();d();p();d();function tc(_x9,_x10){return _tc.apply(this,arguments)}function _tc(){_tc=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _tc.apply(this,arguments)}function rc(e){let t,r,n,i=!1;return function(s){t===void 0?(t=s,r=0,n=-1):t=Uf(t,s);let c=t.length,f=0;for(;r<c;){i&&(t[r]===10&&(f=++r),i=!1);let a=-1;for(;r<c&&a===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:i=!0;case 10:a=r;break}if(a===-1)break;e(t.subarray(f,a),n),f=r,n=-1}f===c?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function nc(e,t,r){let n=ec(),i=new TextDecoder;return function(s,c){if(s.length===0)r?.(n),n=ec();else if(c>0){let f=i.decode(s.subarray(0,c)),a=c+(s[c+1]===32?2:1),g=i.decode(s.subarray(a));switch(f){case"data":n.data=n.data?n.data+`
|
|
25
25
|
`+g:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":let h=parseInt(g,10);isNaN(h)||t(n.retry=h);break}}}}function Uf(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function ec(){return{data:"",event:"",id:"",retry:void 0}}var Vf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},vn="text/event-stream",Bf=1e3,ic="last-event-id";function oc(){typeof window<"u"}function co(e,t){var{signal:r,headers:n,onopen:i,onmessage:o,onclose:s,onerror:c,openWhenHidden:f,fetch:a}=t,g=Vf(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((h,m)=>{let u=Object.assign({},n);u.accept||(u.accept=vn);let y;function A(){y?.abort(),document.hidden||x()}!f&&oc()&&document.addEventListener("visibilitychange",A);let w=Bf,R=0;function S(){oc()&&document.removeEventListener("visibilitychange",A),clearTimeout(R),y?.abort()}r?.addEventListener("abort",()=>{S(),h()});let v=a??v,C=i??Qf;function x(){return _x11.apply(this,arguments)}function _x11(){_x11=_asyncToGenerator(function*(){var k;y=typeof l.AbortController>"u"?null:new l.AbortController;try{let I=yield v(e,Object.assign(Object.assign({},g),{headers:u,signal:y?.signal}));yield C(I),yield tc(I.body,rc(nc(O=>{O?u[ic]=O:delete u[ic]},O=>{w=O},o))),s?.(),S(),h()}catch(I){if(!y?.signal.aborted)try{let O=(k=c?.(I))!==null&&k!==void 0?k:w;clearTimeout(R),R=setTimeout(x,O)}catch(O){S(),m(O)}}});return _x11.apply(this,arguments)}x()})}function Qf(e){let t=e.headers.get("content-type");if(!t?.startsWith(vn))throw new Error(`Expected content-type to be ${vn}, Actual: ${t}`)}p();d();p();d();p();d();p();d();p();d();function We(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function E(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function c(g){try{a(n.next(g))}catch(h){s(h)}}function f(g){try{a(n.throw(g))}catch(h){s(h)}}function a(g){g.done?o(g.value):i(g.value).then(c,f)}a((n=n.apply(e,t||[])).next())})}var W;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(W||(W={}));function po(){return typeof window<"u"}function xo(){return typeof navigator<"u"}function zt(){return typeof document<"u"}function fo(){try{return typeof localStorage<"u"}catch{return!1}}function $f(){try{return typeof sessionStorage<"u"}catch{return!1}}function vc(){return xo()&&navigator.cookieEnabled}var Hf=[W.click,W.custom,W.search,W.view],zf=(e,t)=>Hf.indexOf(e)!==-1?Object.assign({language:zt()?document.documentElement.lang:"unknown",userAgent:xo()?navigator.userAgent:"unknown"},t):t,Rr=class e{static set(t,r,n){var i,o,s,c;n&&(o=new Date,o.setTime(o.getTime()+n)),c=window.location.hostname,c.indexOf(".")===-1?sc(t,r,o):(s=c.split("."),i=s[s.length-2]+"."+s[s.length-1],sc(t,r,o,i))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){var o=n[i];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function sc(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Gf(){return fo()?localStorage:vc()?new xr:$f()?sessionStorage:new Wt}var xr=class e{getItem(t){return Rr.get(`${e.prefix}${t}`)}removeItem(t){Rr.erase(`${e.prefix}${t}`)}setItem(t,r,n){Rr.set(`${e.prefix}${t}`,r,n)}};xr.prefix="coveo_";var go=class{constructor(){this.cookieStorage=new xr}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Wt=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},br="__coveo.analytics.history",Cc=20,Ac=1e3*60,bc=75,Yt=class{constructor(t){this.store=t||Gf()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return E(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return E(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(br);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return E(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(br);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(br,JSON.stringify(t.slice(0,Cc)))}catch{}}clear(){try{this.store.removeItem(br)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,i)=>(i.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,bc)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Ac:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:i,value:o}=r;return{name:n,time:i,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:i}=t;return r&&typeof i=="string"&&r.toLowerCase()==="query"&&i.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},wc=Object.freeze({__proto__:null,HistoryStore:Yt,MAX_NUMBER_OF_HISTORY_ELEMENTS:Cc,MAX_VALUE_SIZE:bc,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:Ac,STORE_KEY:br,default:Yt}),Wf=(e,t)=>E(void 0,void 0,void 0,function*(){return e===W.view?(yield Yf(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Yf=e=>E(void 0,void 0,void 0,function*(){let t=new Yt,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Cn,Kf=new Uint8Array(16);function Jf(){if(!Cn&&(Cn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cn(Kf)}var Xf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function bn(e){return typeof e=="string"&&Xf.test(e)}var le=[];for(let e=0;e<256;++e)le.push((e+256).toString(16).slice(1));function Rc(e,t=0){return(le[e[t+0]]+le[e[t+1]]+le[e[t+2]]+le[e[t+3]]+"-"+le[e[t+4]]+le[e[t+5]]+"-"+le[e[t+6]]+le[e[t+7]]+"-"+le[e[t+8]]+le[e[t+9]]+"-"+le[e[t+10]]+le[e[t+11]]+le[e[t+12]]+le[e[t+13]]+le[e[t+14]]+le[e[t+15]]).toLowerCase()}function Zf(e){if(!bn(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function eg(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var tg="6ba7b810-9dad-11d1-80b4-00c04fd430c8",rg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function ng(e,t,r){function n(i,o,s,c){var f;if(typeof i=="string"&&(i=eg(i)),typeof o=="string"&&(o=Zf(o)),((f=o)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+i.length);if(a.set(o),a.set(i,o.length),a=r(a),a[6]=a[6]&15|t,a[8]=a[8]&63|128,s){c=c||0;for(let g=0;g<16;++g)s[c+g]=a[g];return s}return Rc(a)}try{n.name=e}catch{}return n.DNS=tg,n.URL=rg,n}var ig=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ac={randomUUID:ig};function Pt(e,t,r){if(ac.randomUUID&&!t&&!e)return ac.randomUUID();e=e||{};let n=e.random||(e.rng||Jf)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return Rc(n)}function og(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function uo(e,t){return e<<t|e>>>32-t}function sg(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let s=unescape(encodeURIComponent(e));e=[];for(let c=0;c<s.length;++c)e.push(s.charCodeAt(c))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,i=Math.ceil(n/16),o=new Array(i);for(let s=0;s<i;++s){let c=new Uint32Array(16);for(let f=0;f<16;++f)c[f]=e[s*64+f*4]<<24|e[s*64+f*4+1]<<16|e[s*64+f*4+2]<<8|e[s*64+f*4+3];o[s]=c}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let c=new Uint32Array(80);for(let u=0;u<16;++u)c[u]=o[s][u];for(let u=16;u<80;++u)c[u]=uo(c[u-3]^c[u-8]^c[u-14]^c[u-16],1);let f=r[0],a=r[1],g=r[2],h=r[3],m=r[4];for(let u=0;u<80;++u){let y=Math.floor(u/20),A=uo(f,5)+og(y,a,g,h)+m+t[y]+c[u]>>>0;m=h,h=g,g=uo(a,30)>>>0,a=f,f=A}r[0]=r[0]+f>>>0,r[1]=r[1]+a>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+m>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var ag=ng("v5",80,sg),cc=ag,xc="2.30.42",uc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,wr={pageview:"pageview",event:"event"},wn=class{constructor({client:t,uuidGenerator:r=Pt}){this.client=t,this.uuidGenerator=r}},mo=class extends wn{constructor({client:t,uuidGenerator:r=Pt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=uc(window.location),this.lastReferrer=zt()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:zt()?document.title:"",encoding:zt()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},i={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},o),n),i),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:i,location:o}=this.getNextValues(t,r);this.lastReferrer=i,this.pageViewId=n,this.currentLocation=o,t===wr.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===wr.pageview?this.nextPageViewId:this.pageViewId,referrer:t===wr.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===wr.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=i=>i.replace(/^\/?(.*)$/,"/$1");return`${(i=>i.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return uc(window.location)}},it=class e{constructor(t,r){if(!bn(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(i=>new RegExp(i.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,i]=r;if(n.length!==32||isNaN(parseInt(i)))return null;let o=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return bn(o)?new e(o,Number.parseInt(i)*1e3):null}};it.cvo_cid="cvo_cid";it.expirationTime=120;var ho=class extends wn{constructor({client:t,uuidGenerator:r=Pt}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return E(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(it.cvo_cid,new it(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ho.Id="link";var Ie=Object.keys;function An(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var lo=128,Ic=192,lc=224,dc=240;function cg(e){return(e&248)===dc?4:(e&dc)===lc?3:(e&lc)===Ic?2:1}function ug(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&lo)!=lo)break;if(r-=3,(n&Ic)!=lo){t-r>=cg(n)*3&&(r=t);break}}return e.substring(0,r)}var yo={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},lg=Ie(yo).map(e=>yo[e]),dg=[...lg].join("|"),pg=new RegExp(`^(${dg}$)`),fg={svcAction:"svc_action",svcActionData:"svc_action_data"},gg=e=>Ie(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=yo[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),mg=e=>pg.test(e),hg=[mg],pc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},fc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},de={action:"pa",list:"pal",listSource:"pls"},Rn={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},yg=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],So={id:"quoteId",affiliation:"quoteAffiliation"},vo={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Sg={add:de,bookmark_add:de,bookmark_remove:de,click:de,checkout:de,checkout_option:de,detail:de,impression:de,remove:de,refund:Object.assign(Object.assign({},de),Rn),purchase:Object.assign(Object.assign({},de),Rn),quickview:de,quote:Object.assign(Object.assign({},de),So),review:Object.assign(Object.assign({},de),vo)},vg=Ie(pc).map(e=>pc[e]),Cg=Ie(fc).map(e=>fc[e]),Ag=Ie(de).map(e=>de[e]),bg=Ie(Rn).map(e=>Rn[e]),wg=Ie(vo).map(e=>vo[e]),Rg=Ie(So).map(e=>So[e]),xg=[...vg,"custom"].join("|"),Ig=[...Cg,"custom"].join("|"),Ec="(pr[0-9]+)",kc="(il[0-9]+pi[0-9]+)",Eg=new RegExp(`^${Ec}(${xg})$`),kg=new RegExp(`^(${kc}(${Ig}))|(il[0-9]+nm)$`),Pg=new RegExp(`^(${Ag.join("|")})$`),Og=new RegExp(`^(${bg.join("|")})$`),Fg=new RegExp(`^${Ec}custom$`),Tg=new RegExp(`^${kc}custom$`),Dg=new RegExp(`^(${[...yg,...wg,...Rg].join("|")})$`),Mg=e=>Eg.test(e),qg=e=>kg.test(e),Ng=e=>Pg.test(e),_g=e=>Og.test(e),Lg=e=>Dg.test(e),jg=[qg,Mg,Ng,_g,Lg],Ug=[Fg,Tg],Vg={anonymizeIp:"aip"},Bg={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Qg={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},$g=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Hg=Object.assign(Object.assign(Object.assign(Object.assign({},Vg),Bg),Qg),$g.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Co=Object.assign(Object.assign({},Hg),fg),zg=e=>{let t=!!e.action&&Sg[e.action]||{};return Ie(e).reduce((r,n)=>{let i=t[n]||Co[n]||n;return Object.assign(Object.assign({},r),{[i]:e[n]})},{})},Gg=Ie(Co).map(e=>Co[e]),Wg=e=>Gg.indexOf(e)!==-1,Yg=e=>e==="custom",Kg=e=>[...jg,...hg,Wg,Yg].some(t=>t(e)),Jg=e=>Ie(e).reduce((t,r)=>{let n=Xg(r);return n?Object.assign(Object.assign({},t),Zg(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Xg=e=>{let t;return[...Ug].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Zg=(e,t)=>Ie(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Ao=class{constructor(t){this.opts=t}sendEvent(t,r){return E(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:i}=this.opts,o=yield this.getQueryParamsForEventType(t),{url:s,payload:c}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${o}`,r,i),f=this.encodeForEventType(t,c),a=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(s,a)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return E(this,void 0,void 0,function*(){let i=t,o=r;if(n){let s=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:c,body:f}=s;i=c||t;try{o=JSON.parse(f)}catch(a){console.error("Unable to process the request body as a JSON string",a)}}return{payload:o,url:i}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return E(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,i=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",i?`visitorId=${i}`:"","discardVisitInfo=true"].filter(o=>!!o).join("&")})}isEventTypeLegacy(t){return[W.click,W.custom,W.search,W.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let i=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(i=`access_token=${encodeURIComponent(n)}&${i}`),i}},bo=class{sendEvent(t,r){return E(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return E(this,void 0,void 0,function*(){return Promise.resolve()})}},gc=globalThis.fetch,xn=class{constructor(t){this.opts=t}sendEvent(t,r){return E(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:i,preprocessRequest:o}=this.opts,s=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",c={url:`${n}/analytics/${t}${s}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},c),o?yield o(c,"analyticsFetch"):{}),{url:a}=f,g=We(f,["url"]),h;try{h=yield gc(a,g)}catch(m){console.error("An error has occured when sending the event.",m);return}if(h.ok){let m=yield h.json();return m.visitorId&&i.setCurrentVisitorId(m.visitorId),m}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return E(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield gc(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[W.click,W.custom,W.search,W.view].indexOf(t)!==-1}getVisitorIdParam(){return E(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},wo=class{constructor(t,r){fo()&&vc()?this.storage=new go:fo()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Wt),this.client=new xn(t),this.beaconClient=new Ao(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:i,payload:o}of n)this.beaconClient.sendEvent(i,o)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ro=class{constructor(t,r){this.storage=r||new Wt,this.client=new xn(t)}getClientDependingOnEventType(t){return this.client}},In=class{constructor(){this.storage=new Wt,this.client=new bo}getClientDependingOnEventType(t){return this.client}},em="xx",tm=e=>e?.startsWith(em)||!1,rm=`
|
|
26
26
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
27
27
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|