@coveo/quantic 3.33.4 → 3.33.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/lwc/quanticHeadlessLoader/quanticHeadlessLoader.js +4 -1
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +4 -28
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +8 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +2 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/generator/headless-commerce-facet-generator.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/types/engine.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/build.d.ts +75 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +52 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/types/engine.d.ts +53 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/engine/search-engine.ssr.d.ts +17 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/factories/standalone-static-state-factory.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/engine.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -10
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -9
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -7
- package/package.json +2 -2
|
@@ -14,21 +14,21 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,m=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){m=!0,i=f},f:function(){try{a||r.return==null||r.return()}finally{if(m)throw i}}}}function zi(){return zi=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=hm(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},zi.apply(null,arguments)}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cr(e)}function gm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gi(e,t)}function fc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fc=function(){return!!e})()}function ym(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fm(e)}function Gi(e,t){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Gi(e,t)}function hm(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=cr(e))!==null;);return e}function Sm(e,t,r,n){var o=zi(cr(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function vm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Am(e){var t=vm(e,"string");return typeof t=="symbol"?t:t+""}function Cm(e,t){if(e){if(typeof e=="string")return uc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uc(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function bm(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function wm(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var pc=function(){function e(){Wi(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Yi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var g=i[m];try{g.callback.call(n,r)}catch(h){Promise.resolve().then(function(){throw h})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},m=0,f=i.length;m<f;m++)a();return!r.defaultPrevented}}}])}(),Ki=function(e){function t(){var r;return Wi(this,t),r=mm(this,t),r.listeners||pc.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return gm(t,e),Yi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),Sm(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new Kn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new Kn;function i(){o.abort(this.reason),a()}function a(){var g=dc(n),h;try{for(g.s();!(h=g.n()).done;){var S=h.value;S.removeEventListener("abort",i)}}catch(y){g.e(y)}finally{g.f()}}var m=dc(n),f;try{for(m.s();!(f=m.n()).done;){var s=f.value;if(s.aborted){o.abort(s.reason);break}else s.addEventListener("abort",i)}}catch(g){m.e(g)}finally{m.f()}return o.signal}}])}(pc),Kn=function(){function e(){Wi(this,e),Object.defineProperty(this,"signal",{value:new Ki,writable:!0,configurable:!0})}return Yi(e,[{key:"abort",value:function(r){var n=wm(r),o=bm(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Kn.prototype[Symbol.toStringTag]="AbortController",Ki.prototype[Symbol.toStringTag]="AbortSignal");function xm(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Rm(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,m=a===void 0?!1:a;if(!xm({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:m}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||m)&&(f=function(S,y){var b;y&&y.signal&&(b=y.signal,delete y.signal);var R=new o(S,y);return b&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:b}),R},f.prototype=o.prototype);var s=r,g=function(S,y){var b=f&&f.prototype.isPrototypeOf(S)?S.signal:y?y.signal:void 0;if(b){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(b.aborted)return Promise.reject(R);var F=new Promise(function(x,I){b.addEventListener("abort",function(){return I(R)},{once:!0})});return y&&y.signal&&delete y.signal,Promise.race([F,s(S,y)])}return s(S,y)};return{fetch:g,Request:f}}nn.AbortController=Kn;nn.AbortSignal=Ki;nn.abortableFetch=Rm});var mc,c,v,d=rn(()=>{"use strict";mc=Wn(Ji(),1),c=Wn(Ji(),1),{fetch:v}=(0,mc.abortableFetch)({fetch})});function on(e){if(Mm.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Xi(e){return e.replace(Nm,"")}function an(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!jm(r))return!1}return!0}function jm(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function yc(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Em,Cc,Im,bc,Fm,Pm,km,Om,Tm,Dm,qm,Mm,gc,Nm,ur,Zi,hc,Sc,vc,Ac,C,xc=rn(()=>{"use strict";p();u();d();l();Em=Object.create,Cc=Object.defineProperty,Im=Object.getOwnPropertyDescriptor,bc=Object.getOwnPropertyNames,Fm=Object.getPrototypeOf,Pm=Object.prototype.hasOwnProperty,km=(e,t)=>function(){return t||(0,e[bc(e)[0]])((t={exports:{}}).exports,t),t.exports},Om=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bc(t))!Pm.call(e,o)&&o!==r&&Cc(e,o,{get:()=>t[o],enumerable:!(n=Im(t,o))||n.enumerable});return e},Tm=(e,t,r)=>(r=e!=null?Em(Fm(e)):{},Om(t||!e||!e.__esModule?Cc(r,"default",{value:e,enumerable:!0}):r,e)),Dm=km({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,s){var g=f.split(";").filter(n),h=g.shift(),S=i(h),y=S.name,b=S.value;s=s?Object.assign({},r,s):r;try{b=s.decodeValues?decodeURIComponent(b):b}catch(F){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+b+"'. Set options.decodeValues to false to disable this feature.",F)}var R={name:y,value:b};return g.forEach(function(F){var x=F.split("="),I=x.shift().trimLeft().toLowerCase(),w=x.join("=");I==="expires"?R.expires=new Date(w):I==="max-age"?R.maxAge=parseInt(w,10):I==="secure"?R.secure=!0:I==="httponly"?R.httpOnly=!0:I==="samesite"?R.sameSite=w:R[I]=w}),R}function i(f){var s="",g="",h=f.split("=");return h.length>1?(s=h.shift(),g=h.join("=")):g=f,{name:s,value:g}}function a(f,s){if(s=s?Object.assign({},r,s):r,!f)return s.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!s.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=g}if(Array.isArray(f)||(f=[f]),s=s?Object.assign({},r,s):r,s.map){var h={};return f.filter(n).reduce(function(S,y){var b=o(y,s);return S[b.name]=b,S},h)}else return f.filter(n).map(function(S){return o(S,s)})}function m(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var s=[],g=0,h,S,y,b,R;function F(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function x(){return S=f.charAt(g),S!=="="&&S!==";"&&S!==","}for(;g<f.length;){for(h=g,R=!1;F();)if(S=f.charAt(g),S===","){for(y=g,g+=1,F(),b=g;g<f.length&&x();)g+=1;g<f.length&&f.charAt(g)==="="?(R=!0,g=b,s.push(f.substring(h,y)),h=g):g=y+1}else g+=1;(!R||g>=f.length)&&s.push(f.substring(h,f.length))}return s}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=m}}),qm=Tm(Dm()),Mm=/[^a-z0-9\-#$%&'*+.^_`|~]/i;gc=[`
|
|
19
|
-
`,"\r","\t"," "],Nm=new RegExp(`(^[${gc.join("")}]|$[${gc.join("")}])`,"g");ur=Symbol("normalizedHeaders"),Zi=Symbol("rawHeaderNames"),hc=", ",C=class wc{constructor(t){this[Sc]={},this[vc]=new Map,this[Ac]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof wc||typeof A.Headers<"u"&&t instanceof A.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(hc):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(hc):n)})}[(Sc=ur,vc=Zi,Ac=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[ur]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!an(t))throw new TypeError(`Invalid header name "${t}"`);return this[ur].hasOwnProperty(on(t))}get(t){if(!an(t))throw TypeError(`Invalid header name "${t}"`);return this[ur][on(t)]??null}set(t,r){if(!an(t)||!yc(r))return;let n=on(t),o=Xi(r);this[ur][n]=Xi(o),this[Zi].set(n,t)}append(t,r){if(!an(t)||!yc(r))return;let n=on(t),o=Xi(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!an(t)||!this.has(t))return;let r=on(t);delete this[ur][r],this[Zi].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,qm.splitCookiesString)(t)}}});var p=rn(()=>{"use strict";xc()});var Tc=Ue(un=>{"use strict";p();u();d();l();var eo=un&&un.__assign||function(){return eo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},eo.apply(this,arguments)};Object.defineProperty(un,"__esModule",{value:!0});var zm={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Gm(e){var t=eo(eo({},zm),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}un.getSanitizedOptions=Gm});var Dc=Ue(na=>{"use strict";p();u();d();l();Object.defineProperty(na,"__esModule",{value:!0});function Wm(e){var t=Math.random()*e;return Math.round(t)}na.fullJitter=Wm});var qc=Ue(oa=>{"use strict";p();u();d();l();Object.defineProperty(oa,"__esModule",{value:!0});function Ym(e){return e}oa.noJitter=Ym});var Mc=Ue(ia=>{"use strict";p();u();d();l();Object.defineProperty(ia,"__esModule",{value:!0});var Km=Dc(),Jm=qc();function Xm(e){switch(e.jitter){case"full":return Km.fullJitter;case"none":default:return Jm.noJitter}}ia.JitterFactory=Xm});var sa=Ue(aa=>{"use strict";p();u();d();l();Object.defineProperty(aa,"__esModule",{value:!0});var Zm=Mc(),eg=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=Zm.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();aa.Delay=eg});var Nc=Ue(it=>{"use strict";p();u();d();l();var tg=it&&it.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),rg=it&&it.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})},ng=it&&it.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(s){return function(g){return f([s,g])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(g){s=[6,g],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}};Object.defineProperty(it,"__esModule",{value:!0});var og=sa(),ig=function(e){tg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return rg(this,void 0,void 0,function(){return ng(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(og.Delay);it.SkipFirstDelay=ig});var jc=Ue(ln=>{"use strict";p();u();d();l();var ag=ln&&ln.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ln,"__esModule",{value:!0});var sg=sa(),cg=function(e){ag(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sg.Delay);ln.AlwaysDelay=cg});var _c=Ue(ca=>{"use strict";p();u();d();l();Object.defineProperty(ca,"__esModule",{value:!0});var ug=Nc(),lg=jc();function dg(e,t){var r=pg(e);return r.setAttemptNumber(t),r}ca.DelayFactory=dg;function pg(e){return e.delayFirstAttempt?new lg.AlwaysDelay(e):new ug.SkipFirstDelay(e)}});var Vc=Ue(Qt=>{"use strict";p();u();d();l();var ua=Qt&&Qt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})},la=Qt&&Qt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(s){return function(g){return f([s,g])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(g){s=[6,g],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}};Object.defineProperty(Qt,"__esModule",{value:!0});var fg=Tc(),mg=_c();function gg(e,t){return t===void 0&&(t={}),ua(this,void 0,void 0,function(){var r,n;return la(this,function(o){switch(o.label){case 0:return r=fg.getSanitizedOptions(t),n=new yg(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Qt.backOff=gg;var yg=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return ua(this,void 0,void 0,function(){var t,r;return la(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return ua(this,void 0,void 0,function(){var t;return la(this,function(r){switch(r.label){case 0:return t=mg.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Lp=Ue((yQ,Vp)=>{"use strict";p();u();d();l();function nC(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Vp.exports=oC;function oC(e,t,r){var n=r&&r.stringify||nC,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var m=1;m<i;m++)a[m]=n(t[m]);return a.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var s="",g=1-o,h=-1,S=e&&e.length||0,y=0;y<S;){if(e.charCodeAt(y)===37&&y+1<S){switch(h=h>-1?h:0,e.charCodeAt(y+1)){case 100:case 102:if(g>=f||t[g]==null)break;h<y&&(s+=e.slice(h,y)),s+=Number(t[g]),h=y+2,y++;break;case 105:if(g>=f||t[g]==null)break;h<y&&(s+=e.slice(h,y)),s+=Math.floor(Number(t[g])),h=y+2,y++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;h<y&&(s+=e.slice(h,y));var b=typeof t[g];if(b==="string"){s+="'"+t[g]+"'",h=y+2,y++;break}if(b==="function"){s+=t[g].name||"<anonymous>",h=y+2,y++;break}s+=n(t[g]),h=y+2,y++;break;case 115:if(g>=f)break;h<y&&(s+=e.slice(h,y)),s+=String(t[g]),h=y+2,y++;break;case 37:h<y&&(s+=e.slice(h,y)),s+="%",h=y+2,y++,g--;break}++g}++y}return h===-1?e:(h<S&&(s+=e.slice(h)),s)}});var zp=Ue((CQ,yi)=>{"use strict";p();u();d();l();var Up=Lp();yi.exports=mt;var Un=vC().console||{},iC={mapHttpRequest:gi,mapHttpResponse:gi,wrapRequestSerializer:Bs,wrapResponseSerializer:Bs,wrapErrorSerializer:Bs,req:gi,res:gi,err:Bp,errWithCause:Bp};function qt(e,t){return e==="silent"?1/0:t.levels.values[e]}var zs=Symbol("pino.logFuncs"),$s=Symbol("pino.hierarchy"),aC={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Qp(e,t){let r={logger:t,parent:e[$s]};t[$s]=r}function sC(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Un[o]||Un[aC[o]||"log"]||zr}),e[zs]=n}function cC(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function mt(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Un;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=cC(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),m=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&m.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",s=Object.create(r);s.log||(s.log=zr),sC(s,m,r),Qp({},s),Object.defineProperty(s,"levelVal",{get:h}),Object.defineProperty(s,"level",{get:S,set:y});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:m,timestamp:yC(e),messageKey:e.messageKey||"msg",onChild:e.onChild||zr};s.levels=uC(e),s.level=f,s.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},s.setMaxListeners=s.getMaxListeners=s.emit=s.addListener=s.on=s.prependListener=s.once=s.prependOnceListener=s.removeListener=s.removeAllListeners=s.listeners=s.listenerCount=s.eventNames=s.write=s.flush=zr,s.serializers=n,s._serialize=o,s._stdErrSerialize=i,s.child=function(...R){return b.call(this,g,...R)},t&&(s._logEvent=Hs());function h(){return qt(this.level,this)}function S(){return this._level}function y(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,or(this,g,s,"error"),or(this,g,s,"fatal"),or(this,g,s,"warn"),or(this,g,s,"info"),or(this,g,s,"debug"),or(this,g,s,"trace"),a.forEach(F=>{or(this,g,s,F)})}function b(R,F,x){if(!F)throw new Error("missing bindings for child Pino");x=x||{},o&&F.serializers&&(x.serializers=F.serializers);let I=x.serializers;if(o&&I){var w=Object.assign({},n,I),E=e.browser.serialize===!0?Object.keys(w):o;delete F.serializers,Gs([F],E,w,this._stdErrSerialize)}function M(P){this._childLevel=(P._childLevel|0)+1,this.bindings=F,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=Hs([].concat(P._logEvent.bindings,F)))}M.prototype=this;let k=new M(this);return Qp(this,k),k.child=function(...P){return b.call(this,R,...P)},k.level=x.level||this.level,R.onChild(k),k}return s}function uC(e){let t=e.customLevels||{},r=Object.assign({},mt.levels.values,t),n=Object.assign({},mt.levels.labels,lC(t));return{values:r,labels:n}}function lC(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}mt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};mt.stdSerializers=iC;mt.stdTimeFunctions=Object.assign({},{nullTime:$p,epochTime:Hp,unixTime:hC,isoTime:SC});function dC(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[$s];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function or(e,t,r,n){if(Object.defineProperty(e,n,{value:qt(e.level,r)>qt(n,r)?zr:r[zs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===zr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=qt(i,r);if(qt(n,r)<a)return}e[n]=fC(e,t,r,n);let o=dC(e);o.length!==0&&(e[n]=pC(o,e[n]))}function pC(e,t){return function(){return t.apply(this,[...e,...arguments])}}function fC(e,t,r,n){return function(o){return function(){let a=t.timestamp(),m=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Un?Un:this;for(var s=0;s<m.length;s++)m[s]=arguments[s];var g=!1;if(t.serialize&&(Gs(m,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?o.call(f,...mC(this,n,m,a,t)):o.apply(f,m),t.transmit){let h=t.transmit.level||e._level,S=qt(h,r),y=qt(n,r);if(y<S)return;gC(this,{ts:a,methodLevel:n,methodValue:y,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:qt(e._level,r)},m,g)}}}(e[zs][n])}function mC(e,t,r,n,o){let{level:i,log:a=h=>h}=o.formatters||{},m=r.slice(),f=m[0],s={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(s.time=n),i){let h=i(t,e.levels.values[t]);Object.assign(s,h)}else s.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof m[0]=="object";)Object.assign(s,m.shift());return[a(s),...m]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof m[0]=="object";)Object.assign(s,m.shift());f=m.length?Up(m.shift(),m):void 0}else typeof f=="string"&&(f=Up(m.shift(),m));return f!==void 0&&(s[o.messageKey]=f),[a(s)]}}function Gs(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=mt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function gC(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,m=t.methodValue,f=t.val,s=e._logEvent.bindings;n||Gs(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(g){return s.indexOf(g)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=m,o(a,e._logEvent,f),e._logEvent=Hs(s)}function Hs(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Bp(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function yC(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?$p:Hp}function gi(){return{}}function Bs(e){return e}function zr(){}function $p(){return!1}function Hp(){return Date.now()}function hC(){return Math.round(Date.now()/1e3)}function SC(){return new Date(Date.now()).toISOString()}function vC(){function e(t){return typeof t<"u"&&t}try{return typeof A<"u"?A:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),A)}catch{return e(self)||e(window)||e(this)||{}}}yi.exports.default=mt;yi.exports.pino=mt});var Ob={};sc(Ob,{DefaultFieldsToInclude:()=>ic,EcommerceDefaultFieldsToInclude:()=>Kf,HighlightUtils:()=>ra,MinimumFieldsToInclude:()=>Qi,ResultTemplatesHelpers:()=>Yd,buildContext:()=>rf,buildController:()=>Mt,buildDictionaryFieldContext:()=>nf,buildInteractiveResult:()=>zf,buildRecommendationEngine:()=>Zp,buildRecommendationList:()=>$f,buildResultTemplatesManager:()=>Zf,getAnalyticsNextApiBaseUrl:()=>to,getOrganizationEndpoint:()=>Ie,getSampleRecommendationEngineConfiguration:()=>Ws,loadAdvancedSearchQueryActions:()=>yb,loadClickAnalyticsActions:()=>Ib,loadConfigurationActions:()=>hb,loadContextActions:()=>vb,loadDebugActions:()=>Ab,loadDictionaryFieldContextActions:()=>Cb,loadFieldActions:()=>xb,loadPaginationActions:()=>oc,loadPipelineActions:()=>Rb,loadRecommendationActions:()=>Eb,loadSearchConfigurationActions:()=>Sb,loadSearchHubActions:()=>kb});module.exports=cm(Ob);p();u();d();l();var ra={};sc(ra,{escapeHtml:()=>lr,getHighlightedSuggestion:()=>Hm,highlightString:()=>$m});p();u();d();l();p();u();d();l();function _m(e,t){let r=`
|
|
17
|
+
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var nm=Object.create;var tn=Object.defineProperty;var om=Object.getOwnPropertyDescriptor;var im=Object.getOwnPropertyNames;var am=Object.getPrototypeOf,sm=Object.prototype.hasOwnProperty;var cm=(e,t,r)=>t in e?tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sc=(e,t)=>{for(var r in t)tn(e,r,{get:t[r],enumerable:!0})},cc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of im(t))!sm.call(e,o)&&o!==r&&tn(e,o,{get:()=>t[o],enumerable:!(n=om(t,o))||n.enumerable});return e};var Wn=(e,t,r)=>(r=e!=null?nm(am(e)):{},cc(t||!e||!e.__esModule?tn(r,"default",{value:e,enumerable:!0}):r,e)),um=e=>cc(tn({},"__esModule",{value:!0}),e);var oe=(e,t,r)=>cm(e,typeof t!="symbol"?t+"":t,r);var A,u=rn(()=>{"use strict";A=typeof globalThis<"u"?globalThis:window});function Yn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yn=function(t){return typeof t}:Yn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function pm(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=fm.bind(this))}function fm(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),lm(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):dm(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var lm,dm,l=rn(()=>{"use strict";lm=function(t){return typeof t=="string"},dm=function(t){return t instanceof Blob};pm.call((typeof window>"u"?"undefined":Yn(window))==="object"?window:{})});var Ji=Ue(nn=>{"use strict";p();u();d();l();Object.defineProperty(nn,"__esModule",{value:!0});function uc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function mm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gm(e,t,r){return t=sr(t),hm(e,fc()?Reflect.construct(t,r||[],sr(e).constructor):t.apply(e,r))}function Wi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cm(n.key),n)}}function Yi(e,t,r){return t&&lc(e.prototype,t),r&&lc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function dc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=bm(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,m=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){m=!0,i=f},f:function(){try{a||r.return==null||r.return()}finally{if(m)throw i}}}}function zi(){return zi=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Sm(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},zi.apply(null,arguments)}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sr(e)}function ym(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gi(e,t)}function fc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fc=function(){return!!e})()}function hm(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mm(e)}function Gi(e,t){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Gi(e,t)}function Sm(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=sr(e))!==null;);return e}function vm(e,t,r,n){var o=zi(sr(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Am(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cm(e){var t=Am(e,"string");return typeof t=="symbol"?t:t+""}function bm(e,t){if(e){if(typeof e=="string")return uc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uc(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function wm(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function xm(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var pc=function(){function e(){Wi(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Yi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var g=i[m];try{g.callback.call(n,r)}catch(h){Promise.resolve().then(function(){throw h})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},m=0,f=i.length;m<f;m++)a();return!r.defaultPrevented}}}])}(),Ki=function(e){function t(){var r;return Wi(this,t),r=gm(this,t),r.listeners||pc.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return ym(t,e),Yi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),vm(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new Kn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new Kn;function i(){o.abort(this.reason),a()}function a(){var g=dc(n),h;try{for(g.s();!(h=g.n()).done;){var S=h.value;S.removeEventListener("abort",i)}}catch(y){g.e(y)}finally{g.f()}}var m=dc(n),f;try{for(m.s();!(f=m.n()).done;){var s=f.value;if(s.aborted){o.abort(s.reason);break}else s.addEventListener("abort",i)}}catch(g){m.e(g)}finally{m.f()}return o.signal}}])}(pc),Kn=function(){function e(){Wi(this,e),Object.defineProperty(this,"signal",{value:new Ki,writable:!0,configurable:!0})}return Yi(e,[{key:"abort",value:function(r){var n=xm(r),o=wm(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Kn.prototype[Symbol.toStringTag]="AbortController",Ki.prototype[Symbol.toStringTag]="AbortSignal");function Rm(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Em(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,m=a===void 0?!1:a;if(!Rm({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:m}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||m)&&(f=function(S,y){var b;y&&y.signal&&(b=y.signal,delete y.signal);var R=new o(S,y);return b&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:b}),R},f.prototype=o.prototype);var s=r,g=function(S,y){var b=f&&f.prototype.isPrototypeOf(S)?S.signal:y?y.signal:void 0;if(b){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(b.aborted)return Promise.reject(R);var F=new Promise(function(x,I){b.addEventListener("abort",function(){return I(R)},{once:!0})});return y&&y.signal&&delete y.signal,Promise.race([F,s(S,y)])}return s(S,y)};return{fetch:g,Request:f}}nn.AbortController=Kn;nn.AbortSignal=Ki;nn.abortableFetch=Em});var mc,c,v,d=rn(()=>{"use strict";mc=Wn(Ji(),1),c=Wn(Ji(),1),{fetch:v}=(0,mc.abortableFetch)({fetch})});function on(e){if(Nm.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Xi(e){return e.replace(jm,"")}function an(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!_m(r))return!1}return!0}function _m(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function yc(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Im,Cc,Fm,bc,Pm,km,Om,Tm,Dm,qm,Mm,Nm,gc,jm,cr,Zi,hc,Sc,vc,Ac,C,xc=rn(()=>{"use strict";p();u();d();l();Im=Object.create,Cc=Object.defineProperty,Fm=Object.getOwnPropertyDescriptor,bc=Object.getOwnPropertyNames,Pm=Object.getPrototypeOf,km=Object.prototype.hasOwnProperty,Om=(e,t)=>function(){return t||(0,e[bc(e)[0]])((t={exports:{}}).exports,t),t.exports},Tm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bc(t))!km.call(e,o)&&o!==r&&Cc(e,o,{get:()=>t[o],enumerable:!(n=Fm(t,o))||n.enumerable});return e},Dm=(e,t,r)=>(r=e!=null?Im(Pm(e)):{},Tm(t||!e||!e.__esModule?Cc(r,"default",{value:e,enumerable:!0}):r,e)),qm=Om({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,s){var g=f.split(";").filter(n),h=g.shift(),S=i(h),y=S.name,b=S.value;s=s?Object.assign({},r,s):r;try{b=s.decodeValues?decodeURIComponent(b):b}catch(F){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+b+"'. Set options.decodeValues to false to disable this feature.",F)}var R={name:y,value:b};return g.forEach(function(F){var x=F.split("="),I=x.shift().trimLeft().toLowerCase(),w=x.join("=");I==="expires"?R.expires=new Date(w):I==="max-age"?R.maxAge=parseInt(w,10):I==="secure"?R.secure=!0:I==="httponly"?R.httpOnly=!0:I==="samesite"?R.sameSite=w:R[I]=w}),R}function i(f){var s="",g="",h=f.split("=");return h.length>1?(s=h.shift(),g=h.join("=")):g=f,{name:s,value:g}}function a(f,s){if(s=s?Object.assign({},r,s):r,!f)return s.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!s.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=g}if(Array.isArray(f)||(f=[f]),s=s?Object.assign({},r,s):r,s.map){var h={};return f.filter(n).reduce(function(S,y){var b=o(y,s);return S[b.name]=b,S},h)}else return f.filter(n).map(function(S){return o(S,s)})}function m(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var s=[],g=0,h,S,y,b,R;function F(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function x(){return S=f.charAt(g),S!=="="&&S!==";"&&S!==","}for(;g<f.length;){for(h=g,R=!1;F();)if(S=f.charAt(g),S===","){for(y=g,g+=1,F(),b=g;g<f.length&&x();)g+=1;g<f.length&&f.charAt(g)==="="?(R=!0,g=b,s.push(f.substring(h,y)),h=g):g=y+1}else g+=1;(!R||g>=f.length)&&s.push(f.substring(h,f.length))}return s}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=m}}),Mm=Dm(qm()),Nm=/[^a-z0-9\-#$%&'*+.^_`|~]/i;gc=[`
|
|
19
|
+
`,"\r","\t"," "],jm=new RegExp(`(^[${gc.join("")}]|$[${gc.join("")}])`,"g");cr=Symbol("normalizedHeaders"),Zi=Symbol("rawHeaderNames"),hc=", ",C=class wc{constructor(t){this[Sc]={},this[vc]=new Map,this[Ac]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof wc||typeof A.Headers<"u"&&t instanceof A.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(hc):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(hc):n)})}[(Sc=cr,vc=Zi,Ac=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[cr]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!an(t))throw new TypeError(`Invalid header name "${t}"`);return this[cr].hasOwnProperty(on(t))}get(t){if(!an(t))throw TypeError(`Invalid header name "${t}"`);return this[cr][on(t)]??null}set(t,r){if(!an(t)||!yc(r))return;let n=on(t),o=Xi(r);this[cr][n]=Xi(o),this[Zi].set(n,t)}append(t,r){if(!an(t)||!yc(r))return;let n=on(t),o=Xi(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!an(t)||!this.has(t))return;let r=on(t);delete this[cr][r],this[Zi].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,Mm.splitCookiesString)(t)}}});var p=rn(()=>{"use strict";xc()});var Tc=Ue(un=>{"use strict";p();u();d();l();var eo=un&&un.__assign||function(){return eo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},eo.apply(this,arguments)};Object.defineProperty(un,"__esModule",{value:!0});var Gm={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Wm(e){var t=eo(eo({},Gm),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}un.getSanitizedOptions=Wm});var Dc=Ue(na=>{"use strict";p();u();d();l();Object.defineProperty(na,"__esModule",{value:!0});function Ym(e){var t=Math.random()*e;return Math.round(t)}na.fullJitter=Ym});var qc=Ue(oa=>{"use strict";p();u();d();l();Object.defineProperty(oa,"__esModule",{value:!0});function Km(e){return e}oa.noJitter=Km});var Mc=Ue(ia=>{"use strict";p();u();d();l();Object.defineProperty(ia,"__esModule",{value:!0});var Jm=Dc(),Xm=qc();function Zm(e){switch(e.jitter){case"full":return Jm.fullJitter;case"none":default:return Xm.noJitter}}ia.JitterFactory=Zm});var sa=Ue(aa=>{"use strict";p();u();d();l();Object.defineProperty(aa,"__esModule",{value:!0});var eg=Mc(),tg=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=eg.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();aa.Delay=tg});var Nc=Ue(it=>{"use strict";p();u();d();l();var rg=it&&it.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ng=it&&it.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})},og=it&&it.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(s){return function(g){return f([s,g])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(g){s=[6,g],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}};Object.defineProperty(it,"__esModule",{value:!0});var ig=sa(),ag=function(e){rg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return ng(this,void 0,void 0,function(){return og(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(ig.Delay);it.SkipFirstDelay=ag});var jc=Ue(ln=>{"use strict";p();u();d();l();var sg=ln&&ln.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ln,"__esModule",{value:!0});var cg=sa(),ug=function(e){sg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(cg.Delay);ln.AlwaysDelay=ug});var _c=Ue(ca=>{"use strict";p();u();d();l();Object.defineProperty(ca,"__esModule",{value:!0});var lg=Nc(),dg=jc();function pg(e,t){var r=fg(e);return r.setAttemptNumber(t),r}ca.DelayFactory=pg;function fg(e){return e.delayFirstAttempt?new dg.AlwaysDelay(e):new lg.SkipFirstDelay(e)}});var Vc=Ue(Qt=>{"use strict";p();u();d();l();var ua=Qt&&Qt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})},la=Qt&&Qt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function m(s){return function(g){return f([s,g])}}function f(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(g){s=[6,g],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}};Object.defineProperty(Qt,"__esModule",{value:!0});var mg=Tc(),gg=_c();function yg(e,t){return t===void 0&&(t={}),ua(this,void 0,void 0,function(){var r,n;return la(this,function(o){switch(o.label){case 0:return r=mg.getSanitizedOptions(t),n=new hg(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Qt.backOff=yg;var hg=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return ua(this,void 0,void 0,function(){var t,r;return la(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return ua(this,void 0,void 0,function(){var t;return la(this,function(r){switch(r.label){case 0:return t=gg.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Up=Ue((SQ,Lp)=>{"use strict";p();u();d();l();function iC(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Lp.exports=aC;function aC(e,t,r){var n=r&&r.stringify||iC,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var m=1;m<i;m++)a[m]=n(t[m]);return a.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var s="",g=1-o,h=-1,S=e&&e.length||0,y=0;y<S;){if(e.charCodeAt(y)===37&&y+1<S){switch(h=h>-1?h:0,e.charCodeAt(y+1)){case 100:case 102:if(g>=f||t[g]==null)break;h<y&&(s+=e.slice(h,y)),s+=Number(t[g]),h=y+2,y++;break;case 105:if(g>=f||t[g]==null)break;h<y&&(s+=e.slice(h,y)),s+=Math.floor(Number(t[g])),h=y+2,y++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;h<y&&(s+=e.slice(h,y));var b=typeof t[g];if(b==="string"){s+="'"+t[g]+"'",h=y+2,y++;break}if(b==="function"){s+=t[g].name||"<anonymous>",h=y+2,y++;break}s+=n(t[g]),h=y+2,y++;break;case 115:if(g>=f)break;h<y&&(s+=e.slice(h,y)),s+=String(t[g]),h=y+2,y++;break;case 37:h<y&&(s+=e.slice(h,y)),s+="%",h=y+2,y++,g--;break}++g}++y}return h===-1?e:(h<S&&(s+=e.slice(h)),s)}});var Gp=Ue((wQ,yi)=>{"use strict";p();u();d();l();var Qp=Up();yi.exports=mt;var Un=CC().console||{},sC={mapHttpRequest:gi,mapHttpResponse:gi,wrapRequestSerializer:Bs,wrapResponseSerializer:Bs,wrapErrorSerializer:Bs,req:gi,res:gi,err:$p,errWithCause:$p};function qt(e,t){return e==="silent"?1/0:t.levels.values[e]}var zs=Symbol("pino.logFuncs"),$s=Symbol("pino.hierarchy"),cC={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Bp(e,t){let r={logger:t,parent:e[$s]};t[$s]=r}function uC(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Un[o]||Un[cC[o]||"log"]||zr}),e[zs]=n}function lC(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function mt(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Un;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=lC(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),m=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&m.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",s=Object.create(r);s.log||(s.log=zr),uC(s,m,r),Bp({},s),Object.defineProperty(s,"levelVal",{get:h}),Object.defineProperty(s,"level",{get:S,set:y});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:m,timestamp:SC(e),messageKey:e.messageKey||"msg",onChild:e.onChild||zr};s.levels=dC(e),s.level=f,s.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},s.setMaxListeners=s.getMaxListeners=s.emit=s.addListener=s.on=s.prependListener=s.once=s.prependOnceListener=s.removeListener=s.removeAllListeners=s.listeners=s.listenerCount=s.eventNames=s.write=s.flush=zr,s.serializers=n,s._serialize=o,s._stdErrSerialize=i,s.child=function(...R){return b.call(this,g,...R)},t&&(s._logEvent=Hs());function h(){return qt(this.level,this)}function S(){return this._level}function y(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,nr(this,g,s,"error"),nr(this,g,s,"fatal"),nr(this,g,s,"warn"),nr(this,g,s,"info"),nr(this,g,s,"debug"),nr(this,g,s,"trace"),a.forEach(F=>{nr(this,g,s,F)})}function b(R,F,x){if(!F)throw new Error("missing bindings for child Pino");x=x||{},o&&F.serializers&&(x.serializers=F.serializers);let I=x.serializers;if(o&&I){var w=Object.assign({},n,I),E=e.browser.serialize===!0?Object.keys(w):o;delete F.serializers,Gs([F],E,w,this._stdErrSerialize)}function M(P){this._childLevel=(P._childLevel|0)+1,this.bindings=F,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=Hs([].concat(P._logEvent.bindings,F)))}M.prototype=this;let k=new M(this);return Bp(this,k),k.child=function(...P){return b.call(this,R,...P)},k.level=x.level||this.level,R.onChild(k),k}return s}function dC(e){let t=e.customLevels||{},r=Object.assign({},mt.levels.values,t),n=Object.assign({},mt.levels.labels,pC(t));return{values:r,labels:n}}function pC(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}mt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};mt.stdSerializers=sC;mt.stdTimeFunctions=Object.assign({},{nullTime:Hp,epochTime:zp,unixTime:vC,isoTime:AC});function fC(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[$s];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function nr(e,t,r,n){if(Object.defineProperty(e,n,{value:qt(e.level,r)>qt(n,r)?zr:r[zs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===zr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=qt(i,r);if(qt(n,r)<a)return}e[n]=gC(e,t,r,n);let o=fC(e);o.length!==0&&(e[n]=mC(o,e[n]))}function mC(e,t){return function(){return t.apply(this,[...e,...arguments])}}function gC(e,t,r,n){return function(o){return function(){let a=t.timestamp(),m=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Un?Un:this;for(var s=0;s<m.length;s++)m[s]=arguments[s];var g=!1;if(t.serialize&&(Gs(m,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?o.call(f,...yC(this,n,m,a,t)):o.apply(f,m),t.transmit){let h=t.transmit.level||e._level,S=qt(h,r),y=qt(n,r);if(y<S)return;hC(this,{ts:a,methodLevel:n,methodValue:y,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:qt(e._level,r)},m,g)}}}(e[zs][n])}function yC(e,t,r,n,o){let{level:i,log:a=h=>h}=o.formatters||{},m=r.slice(),f=m[0],s={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(s.time=n),i){let h=i(t,e.levels.values[t]);Object.assign(s,h)}else s.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof m[0]=="object";)Object.assign(s,m.shift());return[a(s),...m]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof m[0]=="object";)Object.assign(s,m.shift());f=m.length?Qp(m.shift(),m):void 0}else typeof f=="string"&&(f=Qp(m.shift(),m));return f!==void 0&&(s[o.messageKey]=f),[a(s)]}}function Gs(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=mt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function hC(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,m=t.methodValue,f=t.val,s=e._logEvent.bindings;n||Gs(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(g){return s.indexOf(g)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=m,o(a,e._logEvent,f),e._logEvent=Hs(s)}function Hs(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function $p(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function SC(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Hp:zp}function gi(){return{}}function Bs(e){return e}function zr(){}function Hp(){return!1}function zp(){return Date.now()}function vC(){return Math.round(Date.now()/1e3)}function AC(){return new Date(Date.now()).toISOString()}function CC(){function e(t){return typeof t<"u"&&t}try{return typeof A<"u"?A:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),A)}catch{return e(self)||e(window)||e(this)||{}}}yi.exports.default=mt;yi.exports.pino=mt});var Db={};sc(Db,{DefaultFieldsToInclude:()=>ic,EcommerceDefaultFieldsToInclude:()=>Jf,HighlightUtils:()=>ra,MinimumFieldsToInclude:()=>Qi,ResultTemplatesHelpers:()=>Kd,buildContext:()=>nf,buildController:()=>Mt,buildDictionaryFieldContext:()=>of,buildInteractiveResult:()=>Gf,buildRecommendationEngine:()=>ef,buildRecommendationList:()=>Hf,buildResultTemplatesManager:()=>em,getAnalyticsNextApiBaseUrl:()=>to,getOrganizationEndpoint:()=>Ie,getSampleRecommendationEngineConfiguration:()=>Ws,loadAdvancedSearchQueryActions:()=>Sb,loadClickAnalyticsActions:()=>Pb,loadConfigurationActions:()=>vb,loadContextActions:()=>Cb,loadDebugActions:()=>bb,loadDictionaryFieldContextActions:()=>wb,loadFieldActions:()=>Eb,loadPaginationActions:()=>oc,loadPipelineActions:()=>Ib,loadRecommendationActions:()=>Fb,loadSearchConfigurationActions:()=>Ab,loadSearchHubActions:()=>Tb});module.exports=um(Db);p();u();d();l();var ra={};sc(ra,{escapeHtml:()=>ur,getHighlightedSuggestion:()=>zm,highlightString:()=>Hm});p();u();d();l();p();u();d();l();function Vm(e,t){let r=`
|
|
20
20
|
The following properties are invalid:
|
|
21
21
|
|
|
22
22
|
${e.join(`
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new sn(r)}var sn=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ke=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw _m(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}},ce=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&H(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 ge(e){return e===void 0}function Vm(e){return e===null}function H(e){return ge(e)||Vm(e)}var K=class{constructor(e={}){oe(this,"value");this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t||(Lm(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Lm(e){return ge(e)||Rc(e)}function Rc(e){return typeof e=="boolean"}var $=class{constructor(e={}){oe(this,"value");this.config=e,this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t||(Um(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 Um(e){return ge(e)||Ec(e)}function Ec(e){return typeof e=="number"&&!Number.isNaN(e)}var Qm=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,V=class{constructor(e={}){oe(this,"value");oe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new ce(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ge(e))return null;if(!Jn(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}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Qm.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 Jn(e){return Object.prototype.toString.call(e)==="[object String]"}var Q=class{constructor(e={}){oe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ge(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ic(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&H(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Ic(e){return e!==void 0&&typeof e=="object"}var J=class{constructor(e={}){oe(this,"value");this.config=e,this.value=new ce(this.config)}validate(e){if(!H(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(H(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&&H(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Rc(e)||Jn(e)||Ec(e)||Ic(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Fc(e){return Array.isArray(e)}var ea=class{constructor(e){oe(this,"value");this.config=e,this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ge(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();u();d();l();function Pc(e){return Array.isArray(e)}function Xn(e){return e.trim()===""}var Bm=new Set(["1",1,"yes",!0]);function kc(){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=>Bm.has(r))}function Oc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function cn(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Zn(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function $m(e){if(Xn(e.openingDelimiter)||Xn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(H(e.content)||Xn(e.content))return e.content;if(e.highlights.length===0)return lr(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,m=a+i.length;if(m>t)break;r+=lr(e.content.slice(n,a)),r+=e.openingDelimiter,r+=lr(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=lr(e.content.slice(n))),r}function Hm(e,t){return e=lr(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?ta(n,t.notMatchDelimiters):o?ta(o,t.exactMatchDelimiters):i?ta(i,t.correctionDelimiters):r)}function ta(e,t){return t?t.open+e+t.close:e}function lr(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}p();u();d();l();var Bc=Wn(Vc(),1);p();u();d();l();var Ke=new Error("Failed to load reducers."),dr=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},Bt=class extends Error{constructor(r,n){super();oe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};p();u();d();l();function Lc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Uc(e){return typeof e!="object"||!e?!1:Object.values(e).every(hg)}function hg(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Qc(e){return e===429}var ze=class e{static call(t){return _asyncToGenerator(function*(){let r=Sg(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(i,a);if(Qc(f.status))throw f;return f});return function m(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Bc.backOff)(m,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(s){let g=s&&Qc(s.status);return g&&(n.info("Platform retrying request"),yield new Promise(h=>setTimeout(h,1e3))),g});return function retry(_x){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new dr;case 404:throw new Bt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new Bt(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,s=cn(f);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return s})()}};function Ie(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function yt(e,t="prod"){return`${Ie(e,t)}/rest/search/v2`}function to(e,t="prod"){return`${Ie(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Sg(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=vg(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(m&&{body:f}),signal:a}}function vg(e,t){return t==="application/x-www-form-urlencoded"?Uc(e)?Lc(e):"":JSON.stringify(e)}p();u();d();l();p();u();d();l();var ro=e=>e;p();u();d();l();p();u();d();l();function no(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Je(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:no(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:no(),extendedResults:{},searchAction:void 0}}p();u();d();l();function ht(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var St=e=>{let{response:t}=e;return t.body?Ag(e):Cg(t)},Ag=e=>wg(e)?xg(e):bg(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Cg=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function bg(e){return e.body.statusCode!==void 0}function wg(e){return e.body.exception!==void 0}var xg=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});p();u();d();l();var vt=class{constructor(){oe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new c.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};p();u();d();l();p();u();d();l();var dn=class{constructor(t){oe(this,"_basePath");oe(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();u();d();l();function $c(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}p();u();d();l();var at=(e,t,r,n)=>{let o=new dn(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Hc=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield ze.call({...at(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ht(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=$c(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Rg(a)?{success:a}:{error:St({response:r,body:a})}});return function Hc(_x2,_x3){return _ref3.apply(this,arguments)}}();function Rg(e){return typeof e=="string"}p();u();d();l();function Eg(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Ig(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function oo(e,t){if(t&&e.name==="AbortError")return{error:Ig(e)};if(e instanceof Bt)return{error:Eg(e)};throw e}var io=class{constructor(t){this.options=t;oe(this,"apiCallsQueues",{unknown:new vt,mainSearch:new vt,facetValues:new vt,foldingCollection:new vt,instantResults:new vt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/plan"),requestParams:ht(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return oo(r);let n=yield r.json();return Pg(n)?{success:n}:{error:St({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ht(t),..._this3.options});if(r instanceof Error)return oo(r);let n=yield r.json(),o={response:r,body:n};return Fg(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:St(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(m=>ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:m??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return oo(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return zc(i)?(a.body=Gc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:St(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/facet"),requestParams:ht(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(zc(n)){let o={response:r,body:n};return o.body=Gc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:St({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Hc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return kg(n)?{success:n}:{error:St({response:r,body:n})}})()}},ao=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function zc(e){return e.results!==void 0}function Gc(e){let t=no();return H(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Fg(e){return e.completions!==void 0}function Pg(e){return e.preprocessingOutput!==void 0}function kg(e){return e.fields!==void 0}p();u();d();l();var Wc=e=>e,Yc=e=>e,Kc=e=>e;p();u();d();l();p();u();d();l();p();u();d();l();function ye(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 Og=typeof Symbol=="function"&&Symbol.observable||"@@observable",Jc=Og,da=()=>Math.random().toString(36).substring(7).split("").join("."),Tg={INIT:`@@redux/INIT${da()}`,REPLACE:`@@redux/REPLACE${da()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${da()}`},so=Tg;function Xe(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 pa(e,t,r){if(typeof e!="function")throw new Error(ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ye(1));return r(pa)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function s(){a===i&&(a=new Map,i.forEach((F,x)=>{a.set(x,F)}))}function g(){if(f)throw new Error(ye(3));return o}function h(F){if(typeof F!="function")throw new Error(ye(4));if(f)throw new Error(ye(5));let x=!0;s();let I=m++;return a.set(I,F),function(){if(x){if(f)throw new Error(ye(6));x=!1,s(),a.delete(I),i=null}}}function S(F){if(!Xe(F))throw new Error(ye(7));if(typeof F.type>"u")throw new Error(ye(8));if(typeof F.type!="string")throw new Error(ye(17));if(f)throw new Error(ye(9));try{f=!0,o=n(o,F)}finally{f=!1}return(i=a).forEach(I=>{I()}),F}function y(F){if(typeof F!="function")throw new Error(ye(10));n=F,S({type:so.REPLACE})}function b(){let F=h;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(ye(11));function I(){let E=x;E.next&&E.next(g())}return I(),{unsubscribe:F(I)}},[Jc](){return this}}}return S({type:so.INIT}),{dispatch:S,subscribe:h,getState:g,replaceReducer:y,[Jc]:b}}function Dg(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:so.INIT})>"u")throw new Error(ye(12));if(typeof r(void 0,{type:so.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ye(13))})}function pr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let m=t[a];typeof e[m]=="function"&&(r[m]=e[m])}let n=Object.keys(r),o,i;try{Dg(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let s=!1,g={};for(let h=0;h<n.length;h++){let S=n[h],y=r[S],b=m[S],R=y(b,f);if(typeof R>"u"){let F=f&&f.type;throw new Error(ye(14))}g[S]=R,s=s||R!==b}return s=s||n.length!==Object.keys(m).length,s?g:m}}function fr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Xc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(ye(15))},a={getState:o.getState,dispatch:(f,...s)=>i(f,...s)},m=e.map(f=>f(a));return i=fr(...m)(o.dispatch),{...o,dispatch:i}}}function co(e){return Xe(e)&&"type"in e&&typeof e.type=="string"}p();u();d();l();var ba=Symbol.for("immer-nothing"),pn=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function he(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ht=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[Te]}function De(e){return e?nu(e)||Array.isArray(e)||!!e[pn]||!!e.constructor?.[pn]||mr(e)||Sn(e):!1}var qg=Object.prototype.constructor.toString();function nu(e){if(!e||typeof e!="object")return!1;let t=Ht(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)===qg}function wa(e){return Ne(e)||he(15,e),e[Te].base_}function fn(e,t){zt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function zt(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:mr(e)?2:Sn(e)?3:0}function mn(e,t){return zt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fa(e,t){return zt(e)===2?e.get(t):e[t]}function ou(e,t,r){let n=zt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Mg(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mr(e){return e instanceof Map}function Sn(e){return e instanceof Set}function $t(e){return e.copy_||e.base_}function ya(e,t){if(mr(e))return new Map(e);if(Sn(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=nu(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],m=n[a];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(n[a]={configurable:!0,writable:!0,enumerable:m.enumerable,value:e[a]})}return Object.create(Ht(e),n)}else{let n=Ht(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function fo(e,t=!1){return mo(e)||Ne(e)||!De(e)||(zt(e)>1&&Object.defineProperties(e,{set:{value:uo},add:{value:uo},clear:{value:uo},delete:{value:uo}}),Object.freeze(e),t&&Object.values(e).forEach(r=>fo(r,!0))),e}function uo(){he(2)}function mo(e){return Object.isFrozen(e)}var ha={};function Gt(e){let t=ha[e];return t||he(0,e),t}function Ng(e,t){ha[e]||(ha[e]=t)}var gn;function iu(){return gn}function jg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zc(e,t){t&&(Gt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sa(e){va(e),e.drafts_.forEach(_g),e.drafts_=null}function va(e){e===gn&&(gn=e.parent_)}function eu(e){return gn=jg(gn,e)}function _g(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tu(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(Sa(t),he(4)),De(e)&&(e=lo(t,e),t.parent_||po(t,e)),t.patches_&&Gt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=lo(t,r,[]),Sa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ba?e:void 0}function lo(e,t,r){if(mo(t))return t;let n=t[Te];if(!n)return fn(t,(o,i)=>ru(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return po(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),fn(i,(m,f)=>ru(e,n,o,m,f,r,a)),po(e,o,!1),r&&e.patches_&&Gt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function ru(e,t,r,n,o,i,a){if(Ne(o)){let m=i&&t&&t.type_!==3&&!mn(t.assigned_,n)?i.concat(n):void 0,f=lo(e,o,m);if(ou(r,n,f),Ne(f))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!mo(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;lo(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(mr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&po(e,o)}}function po(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fo(t,r)}function Vg(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:iu(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=xa;r&&(o=[n],i=yn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var xa={get(e,t){if(t===Te)return e;let r=$t(e);if(!mn(r,t))return Lg(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===ma(e.base_,t)?(ga(e),e.copy_[t]=Ca(n,e)):n},has(e,t){return t in $t(e)},ownKeys(e){return Reflect.ownKeys($t(e))},set(e,t,r){let n=au($t(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ma($t(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Mg(r,o)&&(r!==void 0||mn(e.base_,t)))return!0;ga(e),Aa(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 ma(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ga(e),Aa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$t(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){he(11)},getPrototypeOf(e){return Ht(e.base_)},setPrototypeOf(){he(12)}},yn={};fn(xa,(e,t)=>{yn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});yn.deleteProperty=function(e,t){return yn.set.call(this,e,t,void 0)};yn.set=function(e,t,r){return xa.set.call(this,e[0],t,r,e[0])};function ma(e,t){let r=e[Te];return(r?$t(r):e)[t]}function Lg(e,t,r){let n=au(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function au(e,t){if(!(t in e))return;let r=Ht(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ht(r)}}function Aa(e){e.modified_||(e.modified_=!0,e.parent_&&Aa(e.parent_))}function ga(e){e.copy_||(e.copy_=ya(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ug=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...s){return a.produce(f,g=>r.call(this,g,...s))}}typeof r!="function"&&he(6),n!==void 0&&typeof n!="function"&&he(7);let o;if(De(t)){let i=eu(this),a=Ca(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?Sa(i):va(i)}return Zc(i,n),tu(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===ba&&(o=void 0),this.autoFreeze_&&fo(o,!0),n){let i=[],a=[];Gt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else he(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...m)=>this.produceWithPatches(a,f=>t(f,...m));let n,o;return[this.produce(t,r,(a,m)=>{n=a,o=m}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||he(8),Ne(e)&&(e=su(e));let t=eu(this),r=Ca(e,void 0);return r[Te].isManual_=!0,va(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&he(9);let{scope_:n}=r;return Zc(n,t),tu(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 o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Gt("Patches").applyPatches_;return Ne(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Ca(e,t){let r=mr(e)?Gt("MapSet").proxyMap_(e,t):Sn(e)?Gt("MapSet").proxySet_(e,t):Vg(e,t);return(t?t.scope_:iu()).drafts_.push(r),r}function su(e){return Ne(e)||he(10,e),cu(e)}function cu(e){if(!De(e)||mo(e))return e;let t=e[Te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ya(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ya(e,!0);return fn(r,(n,o)=>{ou(r,n,cu(o))}),t&&(t.finalized_=!1),r}function uu(){let t="replace",r="add",n="remove";function o(S,y,b,R){switch(S.type_){case 0:case 2:return a(S,y,b,R);case 1:return i(S,y,b,R);case 3:return m(S,y,b,R)}}function i(S,y,b,R){let{base_:F,assigned_:x}=S,I=S.copy_;I.length<F.length&&([F,I]=[I,F],[b,R]=[R,b]);for(let w=0;w<F.length;w++)if(x[w]&&I[w]!==F[w]){let E=y.concat([w]);b.push({op:t,path:E,value:h(I[w])}),R.push({op:t,path:E,value:h(F[w])})}for(let w=F.length;w<I.length;w++){let E=y.concat([w]);b.push({op:r,path:E,value:h(I[w])})}for(let w=I.length-1;F.length<=w;--w){let E=y.concat([w]);R.push({op:n,path:E})}}function a(S,y,b,R){let{base_:F,copy_:x}=S;fn(S.assigned_,(I,w)=>{let E=fa(F,I),M=fa(x,I),k=w?mn(F,I)?t:r:n;if(E===M&&k===t)return;let P=y.concat(I);b.push(k===n?{op:k,path:P}:{op:k,path:P,value:M}),R.push(k===r?{op:n,path:P}:k===n?{op:r,path:P,value:h(E)}:{op:t,path:P,value:h(E)})})}function m(S,y,b,R){let{base_:F,copy_:x}=S,I=0;F.forEach(w=>{if(!x.has(w)){let E=y.concat([I]);b.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}I++}),I=0,x.forEach(w=>{if(!F.has(w)){let E=y.concat([I]);b.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}I++})}function f(S,y,b,R){b.push({op:t,path:[],value:y===ba?void 0:y}),R.push({op:t,path:[],value:S})}function s(S,y){return y.forEach(b=>{let{path:R,op:F}=b,x=S;for(let M=0;M<R.length-1;M++){let k=zt(x),P=R[M];typeof P!="string"&&typeof P!="number"&&(P=""+P),(k===0||k===1)&&(P==="__proto__"||P==="constructor")&&he(19),typeof x=="function"&&P==="prototype"&&he(19),x=fa(x,P),typeof x!="object"&&he(18,R.join("/"))}let I=zt(x),w=g(b.value),E=R[R.length-1];switch(F){case t:switch(I){case 2:return x.set(E,w);case 3:he(16);default:return x[E]=w}case r:switch(I){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(I){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(b.value);default:return delete x[E]}default:he(17,F)}}),S}function g(S){if(!De(S))return S;if(Array.isArray(S))return S.map(g);if(mr(S))return new Map(Array.from(S.entries()).map(([b,R])=>[b,g(R)]));if(Sn(S))return new Set(Array.from(S).map(g));let y=Object.create(Ht(S));for(let b in S)y[b]=g(S[b]);return mn(S,pn)&&(y[pn]=S[pn]),y}function h(S){return Ne(S)?g(S):S}Ng("Patches",{applyPatches_:s,generatePatches_:o,generateReplacementPatches_:f})}var hn=new Ug,st=hn.produce,go=hn.produceWithPatches.bind(hn);var Ra=hn.applyPatches.bind(hn);p();u();d();l();function Qg(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Bg(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $g(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 lu=e=>Array.isArray(e)?e:[e];function Hg(e){let t=Array.isArray(e[0])?e[0]:e;return $g(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function zg(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var iE=Symbol();var aE=Object.getPrototypeOf({});var Gg=class{constructor(e){this.value=e}deref(){return this.value}},Wg=typeof WeakRef<"u"?WeakRef:Gg,Yg=0,du=1;function yo(){return{s:Yg,v:void 0,o:null,p:null}}function gr(e,t={}){let r=yo(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let y=arguments[h];if(typeof y=="function"||typeof y=="object"&&y!==null){let b=m.o;b===null&&(m.o=b=new WeakMap);let R=b.get(y);R===void 0?(m=yo(),b.set(y,m)):m=R}else{let b=m.p;b===null&&(m.p=b=new Map);let R=b.get(y);R===void 0?(m=yo(),b.set(y,m)):m=R}}let s=m,g;if(m.s===du)g=m.v;else if(g=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,g)&&(g=h,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Wg(g):g}return s.s=du,s.v=g,g}return a.clearCache=()=>{r=yo(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function pu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},s=o.pop();typeof s=="object"&&(f=s,s=o.pop()),Qg(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);let g={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:y=gr,argsMemoizeOptions:b=[],devModeChecks:R={}}=g,F=lu(S),x=lu(b),I=Hg(o),w=h(function(){return i++,s.apply(null,arguments)},...F),E=!0,M=y(function(){a++;let P=zg(I,arguments);return m=w.apply(null,P),m},...x);return Object.assign(M,{resultFunc:s,memoizedResultFunc:w,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var de=pu(gr),Kg=Object.assign((e,t=de)=>{Bg(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(i=>e[i]);return t(n,(...i)=>i.reduce((a,m,f)=>(a[r[f]]=m,a),{}))},{withTypes:()=>Kg});p();u();d();l();function fu(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var mu=fu(),gu=fu;var Jg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?fr:fr.apply(null,arguments)},xE=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Xg=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ge(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>co(n)&&n.type===e,r}var Au=class vn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,vn.prototype)}static get[Symbol.species](){return vn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new vn(...t[0].concat(this)):new vn(...t.concat(this))}};function yu(e){return De(e)?st(e,()=>{}):e}function hu(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Zg(e){return typeof e=="boolean"}var ey=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Au;return r&&(Zg(r)?a.push(mu):a.push(gu(r.extraArgument))),a},An="RTK_autoBatch",hr=()=>e=>({payload:e,meta:{[An]:!0}}),Su=e=>t=>{setTimeout(t,e)},ty=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,m=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Su(10):e.type==="callback"?e.queueNotification:Su(e.timeout),s=()=>{a=!1,i&&(i=!1,m.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let h=()=>o&&g(),S=n.subscribe(h);return m.add(g),()=>{S(),m.delete(g)}},dispatch(g){try{return o=!g?.meta?.[An],i=!o,i&&(a||(a=!0,f(s))),n.dispatch(g)}finally{o=!0}}})},ry=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Au(e);return n&&o.push(ty(typeof n=="object"?n:void 0)),o};function Cu(e){let t=ey(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},m;if(typeof r=="function")m=r;else if(Xe(r))m=pr(r);else throw new Error(Ge(1));let f;typeof n=="function"?f=n(t):f=t();let s=fr;o&&(s=Jg({trace:!1,...(typeof o=="object"&&o)}));let g=Xc(...f),h=ry(g),S=typeof a=="function"?a(h):h(),y=s(...S);return pa(m,i,y)}function bu(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error(Ge(28));if(m in t)throw new Error(Ge(29));return t[m]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function ny(e){return typeof e=="function"}function le(e,t){let[r,n,o]=bu(t),i;if(ny(e))i=()=>yu(e());else{let m=yu(e);i=()=>m}function a(m=i(),f){let s=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return s.filter(g=>!!g).length===0&&(s=[o]),s.reduce((g,h)=>{if(h)if(Ne(g)){let y=h(g,f);return y===void 0?g:y}else{if(De(g))return st(g,S=>h(S,f));{let S=h(g,f);if(S===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return g},m)}return a.getInitialState=i,a}var wu=(e,t)=>Xg(e)?e.match(t):e(t);function Ze(...e){return t=>e.some(r=>wu(r,t))}function yr(...e){return t=>e.every(r=>wu(r,t))}function So(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 Cn(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function vo(...e){return e.length===0?t=>So(t,["pending"]):Cn(e)?Ze(...e.map(t=>t.pending)):vo()(e[0])}function Wt(...e){return e.length===0?t=>So(t,["rejected"]):Cn(e)?Ze(...e.map(t=>t.rejected)):Wt()(e[0])}function bn(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?yr(Wt(...e),t):Cn(e)?yr(Wt(...e),t):bn()(e[0])}function ct(...e){return e.length===0?t=>So(t,["fulfilled"]):Cn(e)?Ze(...e.map(t=>t.fulfilled)):ct()(e[0])}function Ao(...e){return e.length===0?t=>So(t,["pending","fulfilled","rejected"]):Cn(e)?Ze(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Ao()(e[0])}var oy="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Co=(e=21)=>{let t="",r=e;for(;r--;)t+=oy[Math.random()*64|0];return t},iy=["name","message","stack","code"],Ea=class{constructor(e,t){oe(this,"_type");this.payload=e,this.meta=t}},vu=class{constructor(e,t){oe(this,"_type");this.payload=e,this.meta=t}},ay=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of iy)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},re=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,s,g,h)=>({payload:f,meta:{...(h||{}),arg:g,requestId:s,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,s,g)=>({payload:void 0,meta:{...(g||{}),arg:s,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,s,g,h,S)=>({payload:h,error:(n&&n.serializeError||ay)(f||"Rejected"),meta:{...(S||{}),arg:g,requestId:s,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(s,g,h)=>{let S=n?.idGenerator?n.idGenerator(f):Co(),y=new c.AbortController,b,R;function F(I){R=I,y.abort()}let x=_asyncToGenerator(function*(){let I;try{let E=n?.condition?.(f,{getState:g,extra:h});if(cy(E)&&(E=yield E),E===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((k,P)=>{b=()=>{P({name:"AbortError",message:R||"Aborted"})},y.signal.addEventListener("abort",b)});s(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:g,extra:h}))),I=yield Promise.race([M,Promise.resolve(r(f,{dispatch:s,getState:g,extra:h,requestId:S,signal:y.signal,abort:F,rejectWithValue:(k,P)=>new Ea(k,P),fulfillWithValue:(k,P)=>new vu(k,P)})).then(k=>{if(k instanceof Ea)throw k;return k instanceof vu?o(k.payload,S,f,k.meta):o(k,S,f)})])}catch(E){I=E instanceof Ea?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{b&&y.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||s(I),I})();return Object.assign(x,{abort:F,requestId:S,arg:f,unwrap(){return x.then(sy)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ze(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function sy(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function cy(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var xu=Symbol.for("rtk-slice-createasyncthunk"),PE={[xu]:re};function uy(e,t){return`${e}/${t}`}function ly({creators:e}={}){let t=e?.asyncThunk?.[xu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ge(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(py()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(I,w){let E=typeof I=="string"?I:I.type;if(!E)throw new Error(Ge(12));if(E in f.sliceCaseReducersByType)throw new Error(Ge(13));return f.sliceCaseReducersByType[E]=w,s},addMatcher(I,w){return f.sliceMatchers.push({matcher:I,reducer:w}),s},exposeAction(I,w){return f.actionCreators[I]=w,s},exposeCaseReducer(I,w){return f.sliceCaseReducersByName[I]=w,s}};m.forEach(I=>{let w=a[I],E={reducerName:I,type:uy(o,I),createNotation:typeof n.reducers=="function"};my(w)?yy(E,w,s,t):fy(E,w,s)});function g(){let[I={},w=[],E=void 0]=typeof n.extraReducers=="function"?bu(n.extraReducers):[n.extraReducers],M={...I,...f.sliceCaseReducersByType};return le(n.initialState,k=>{for(let P in M)k.addCase(P,M[P]);for(let P of f.sliceMatchers)k.addMatcher(P.matcher,P.reducer);for(let P of w)k.addMatcher(P.matcher,P.reducer);E&&k.addDefaultCase(E)})}let h=I=>I,S=new Map,y;function b(I,w){return y||(y=g()),y(I,w)}function R(){return y||(y=g()),y.getInitialState()}function F(I,w=!1){function E(k){let P=k[I];return typeof P>"u"&&w&&(P=R()),P}function M(k=h){let P=hu(S,w,()=>new WeakMap);return hu(P,k,()=>{let O={};for(let[j,_]of Object.entries(n.selectors??{}))O[j]=dy(_,k,R,w);return O})}return{reducerPath:I,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let x={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:R,...F(i),injectInto(I,{reducerPath:w,...E}={}){let M=w??i;return I.inject({reducerPath:M,reducer:b},E),{...x,...F(M,!0)}}};return x}}function dy(e,t,r,n){function o(i,...a){let m=t(i);return typeof m>"u"&&n&&(m=r()),e(m,...a)}return o.unwrapped=e,o}var Yt=ly();function py(){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 fy({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!gy(n))throw new Error(Ge(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function my(e){return e._reducerDefinitionType==="asyncThunk"}function gy(e){return e._reducerDefinitionType==="reducerWithPrepare"}function yy({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ge(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:s,options:g}=r,h=o(e,i,g);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),s&&n.addMatcher(h.settled,s),n.exposeCaseReducer(t,{fulfilled:a||ho,pending:m||ho,rejected:f||ho,settled:s||ho})}function ho(){}var Ru="listener",Eu="completed",Iu="cancelled",kE=`task-${Iu}`,OE=`task-${Eu}`,TE=`${Ru}-${Iu}`,DE=`${Ru}-${Eu}`;var{assign:Fu}=Object;var Ia="listenerMiddleware";var hy=Fu(T(`${Ia}/add`),{withTypes:()=>hy}),qE=T(`${Ia}/removeAll`),Sy=Fu(T(`${Ia}/remove`),{withTypes:()=>Sy});var ME=Symbol.for("rtk-state-proxy-original");function Ge(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();u();d();l();var U=new V({required:!0,emptyAllowed:!1}),Se=new V({required:!1,emptyAllowed:!1}),ve=new V({required:!0,emptyAllowed:!0}),zE=new V({required:!1,emptyAllowed:!0}),bo=new J({each:U,required:!0}),Pu=new V({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),ku=new V({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),GE=new V({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),ut=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Qe=(e,t)=>{if("required"in t)return{payload:new ke({value:t}).validate({value:e}).value};let o=new Q({options:{required:!0},values:t}).validate(e);if(o)throw new sn(o);return{payload:e}},N=(e,t)=>{try{return Qe(e,t)}catch(r){return{payload:e,error:ut(r)}}},Ou=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Du(e,t,r,o,"Controller initialization error")},Tu=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Du(e,t,r,o,"Controller initialization error")},Du=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};p();u();d();l();var Sr="3.35.1",qu=["@coveo/atomic","@coveo/quantic"];var Fa=()=>Se,Mu=()=>U,At=T("configuration/updateBasicConfiguration",e=>N(e,{accessToken:Se,environment:new V({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Se})),et=T("configuration/updateSearchConfiguration",e=>N(e,{proxyBaseUrl:new V({required:!1,url:!0}),pipeline:new V({required:!1,emptyAllowed:!0}),searchHub:Se,timezone:Se,locale:Se,authenticationProviders:new J({required:!1,each:U})})),vy={enabled:new K({default:!0}),originContext:Fa(),originLevel2:Fa(),originLevel3:Fa(),proxyBaseUrl:new V({required:!1,url:!0}),runtimeEnvironment:new ce,anonymous:new K({default:!1}),deviceId:Se,userDisplayName:Se,documentLocation:Se,trackingId:ku,analyticsMode:new V({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new Q({options:{required:!1},values:qu.reduce((e,t)=>(e[t]=Pu,e),{})})},vr=T("configuration/updateAnalyticsConfiguration",e=>N(e,vy)),Ar=T("configuration/analytics/disable"),Cr=T("configuration/analytics/enable"),wo=T("configuration/analytics/originlevel2",e=>N(e,{originLevel2:Mu()})),xo=T("configuration/analytics/originlevel3",e=>N(e,{originLevel3:Mu()}));p();u();d();l();p();u();d();l();p();u();d();l();var Nu={q:new V,enableQuerySyntax:new K,aq:new V,cq:new V,firstResult:new $({min:0}),numberOfResults:new $({min:0}),sortCriteria:new V,f:new Q,fExcluded:new Q,cf:new Q,nf:new Q,mnf:new Q,df:new Q,debug:new K,sf:new Q,tab:new V,af:new Q};var Ct=T("searchParameters/restore",e=>N(e,Nu)),ju=T("searchParameters/restoreTab",e=>N(e,U));p();u();d();l();var Ro=T("debug/enable"),Eo=T("debug/disable");p();u();d();l();var Io=()=>!1;var Fo=le(Io(),e=>{e.addCase(Ro,()=>!0).addCase(Eo,()=>!1).addCase(Ct,(t,r)=>r.payload.debug??t)});p();u();d();l();var br=T("pipeline/set",e=>N(e,new V({required:!0,emptyAllowed:!0})));p();u();d();l();p();u();d();l();var Ay=T("history/undo"),Cy=T("history/redo"),tt=T("history/snapshot"),rF=re("history/back",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Ay()),yield t(qe())});return function(_x4,_x5){return _ref5.apply(this,arguments)}}()),nF=re("history/forward",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{dispatch:t}){t(Cy()),yield t(qe())});return function(_x6,_x7){return _ref6.apply(this,arguments)}}()),qe=re("history/change",/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x8,_x9){return _ref7.apply(this,arguments)}}());p();u();d();l();var wr=()=>"";var xr=le(wr(),e=>{e.addCase(br,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(et,(t,r)=>r.payload.pipeline||t)});p();u();d();l();p();u();d();l();var Po=T("app/setError");p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var Rr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let m=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,s=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||s.test(m)||m.indexOf(".")===-1?Pa(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Pa(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Pa(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}p();u();d();l();function by(){return typeof navigator<"u"}function _u(){try{return typeof localStorage<"u"}catch{return!1}}function Vu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Lu(){return!!(by()&&navigator.cookieEnabled)}var Uu=null;function Qu(){return Uu||(_u()?localStorage:Lu()?new ka:Vu()?sessionStorage:new Oa)}var Er=class Er{getItem(t){return Rr.get(`${Er.prefix}${t}`)}removeItem(t){Rr.erase(`${Er.prefix}${t}`)}setItem(t,r,n){Rr.set(`${Er.prefix}${t}`,r,n)}};oe(Er,"prefix","coveo_");var ka=Er;var Oa=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ko="__coveo.analytics.history",wy=20,xy=1e3*60,Ry=75,Kt=class Kt{constructor(t){oe(this,"store");this.store=t||Qu()}static getInstance(t){return Kt.instance||(Kt.instance=new Kt(t)),Kt.instance}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){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(ko);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ko);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ko,JSON.stringify(t.slice(0,wy)))}catch{}}clear(){try{this.store.removeItem(ko)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Ry)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>xy:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};oe(Kt,"instance",null);var Ta=Kt,Be=Ta;p();u();d();l();p();u();d();l();var Ir=de(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Sr}`));p();u();d();l();p();u();d();l();function lt(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 o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function D(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})}var X;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(X||(X={}));function Ma(){return typeof window<"u"}function Wa(){return typeof navigator<"u"}function Fr(){return typeof document<"u"}function Na(){try{return typeof localStorage<"u"}catch{return!1}}function Ey(){try{return typeof sessionStorage<"u"}catch{return!1}}function rl(){return Wa()&&navigator.cookieEnabled}var Iy=[X.click,X.custom,X.search,X.view],Fy=(e,t)=>Iy.indexOf(e)!==-1?Object.assign({language:Fr()?document.documentElement.lang:"unknown",userAgent:Wa()?navigator.userAgent:"unknown"},t):t,xn=class e{static set(t,r,n){var o,i,a,m;n&&(i=new Date,i.setTime(i.getTime()+n)),m=window.location.hostname,m.indexOf(".")===-1?Bu(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Bu(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Bu(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Py(){return Na()?localStorage:rl()?new Rn:Ey()?sessionStorage:new kr}var Rn=class e{getItem(t){return xn.get(`${e.prefix}${t}`)}removeItem(t){xn.erase(`${e.prefix}${t}`)}setItem(t,r,n){xn.set(`${e.prefix}${t}`,r,n)}};Rn.prefix="coveo_";var ja=class{constructor(){this.cookieStorage=new Rn}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)}},kr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Oo="__coveo.analytics.history",ky=20,Oy=1e3*60,Ty=75,qo=class{constructor(t){this.store=t||Py()}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 D(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 D(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Oo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return D(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Oo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Oo,JSON.stringify(t.slice(0,ky)))}catch{}}clear(){try{this.store.removeItem(Oo)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Ty)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Oy:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Dy=(e,t)=>D(void 0,void 0,void 0,function*(){return e===X.view?(yield qy(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),qy=e=>D(void 0,void 0,void 0,function*(){let t=new qo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),To,My=new Uint8Array(16);function Ny(){if(!To&&(To=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!To))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return To(My)}var jy=/^(?:[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 Mo(e){return typeof e=="string"&&jy.test(e)}var Ae=[];for(let e=0;e<256;++e)Ae.push((e+256).toString(16).slice(1));function nl(e,t=0){return Ae[e[t+0]]+Ae[e[t+1]]+Ae[e[t+2]]+Ae[e[t+3]]+"-"+Ae[e[t+4]]+Ae[e[t+5]]+"-"+Ae[e[t+6]]+Ae[e[t+7]]+"-"+Ae[e[t+8]]+Ae[e[t+9]]+"-"+Ae[e[t+10]]+Ae[e[t+11]]+Ae[e[t+12]]+Ae[e[t+13]]+Ae[e[t+14]]+Ae[e[t+15]]}function _y(e){if(!Mo(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 Vy(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Ly="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Uy="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Qy(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=Vy(o)),typeof i=="string"&&(i=_y(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+o.length);if(s.set(i),s.set(o,i.length),s=r(s),s[6]=s[6]&15|t,s[8]=s[8]&63|128,a){m=m||0;for(let g=0;g<16;++g)a[m+g]=s[g];return a}return nl(s)}try{n.name=e}catch{}return n.DNS=Ly,n.URL=Uy,n}var By=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$u={randomUUID:By};function Jt(e,t,r){if($u.randomUUID&&!t&&!e)return $u.randomUUID();e=e||{};let n=e.random||(e.rng||Ny)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return nl(n)}function $y(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 Da(e,t){return e<<t|e>>>32-t}function Hy(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let m=0;m<a.length;++m)e.push(a.charCodeAt(m))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=m}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let m=new Uint32Array(80);for(let y=0;y<16;++y)m[y]=i[a][y];for(let y=16;y<80;++y)m[y]=Da(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);let f=r[0],s=r[1],g=r[2],h=r[3],S=r[4];for(let y=0;y<80;++y){let b=Math.floor(y/20),R=Da(f,5)+$y(b,s,g,h)+S+t[b]+m[y]>>>0;S=h,h=g,g=Da(s,30)>>>0,s=f,f=R}r[0]=r[0]+f>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+S>>>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 zy=Qy("v5",80,Hy),Hu=zy,ol="2.30.49",zu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,wn={pageview:"pageview",event:"event"},No=class{constructor({client:t,uuidGenerator:r=Jt}){this.client=t,this.uuidGenerator=r}},_a=class extends No{constructor({client:t,uuidGenerator:r=Jt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=zu(window.location),this.lastReferrer=Fr()?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:Fr()?document.title:"",encoding:Fr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===wn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===wn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===wn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===wn.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return zu(window.location)}},bt=class e{constructor(t,r){if(!Mo(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(o=>new RegExp(o.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,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Mo(i)?new e(i,Number.parseInt(o)*1e3):null}};bt.cvo_cid="cvo_cid";bt.expirationTime=120;var Va=class extends No{constructor({client:t,uuidGenerator:r=Jt}){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 D(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(bt.cvo_cid,new bt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Va.Id="link";var He=Object.keys;function Do(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qa=128,il=192,Gu=224,Wu=240;function Gy(e){return(e&248)===Wu?4:(e&Wu)===Gu?3:(e&Gu)===il?2:1}function Wy(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&qa)!=qa)break;if(r-=3,(n&il)!=qa){t-r>=Gy(n)*3&&(r=t);break}}return e.substring(0,r)}var La={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"},Yy=He(La).map(e=>La[e]),Ky=[...Yy].join("|"),Jy=new RegExp(`^(${Ky}$)`),Xy={svcAction:"svc_action",svcActionData:"svc_action_data"},Zy=e=>He(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=La[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),eh=e=>Jy.test(e),th=[eh],Yu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Ku={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},xe={action:"pa",list:"pal",listSource:"pls"},jo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},rh=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ua={id:"quoteId",affiliation:"quoteAffiliation"},Qa={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},nh={add:xe,bookmark_add:xe,bookmark_remove:xe,click:xe,checkout:xe,checkout_option:xe,detail:xe,impression:xe,remove:xe,refund:Object.assign(Object.assign({},xe),jo),purchase:Object.assign(Object.assign({},xe),jo),quickview:xe,quote:Object.assign(Object.assign({},xe),Ua),review:Object.assign(Object.assign({},xe),Qa)},oh=He(Yu).map(e=>Yu[e]),ih=He(Ku).map(e=>Ku[e]),ah=He(xe).map(e=>xe[e]),sh=He(jo).map(e=>jo[e]),ch=He(Qa).map(e=>Qa[e]),uh=He(Ua).map(e=>Ua[e]),lh=[...oh,"custom"].join("|"),dh=[...ih,"custom"].join("|"),al="(pr[0-9]+)",sl="(il[0-9]+pi[0-9]+)",ph=new RegExp(`^${al}(${lh})$`),fh=new RegExp(`^(${sl}(${dh}))|(il[0-9]+nm)$`),mh=new RegExp(`^(${ah.join("|")})$`),gh=new RegExp(`^(${sh.join("|")})$`),yh=new RegExp(`^${al}custom$`),hh=new RegExp(`^${sl}custom$`),Sh=new RegExp(`^(${[...rh,...ch,...uh].join("|")})$`),vh=e=>ph.test(e),Ah=e=>fh.test(e),Ch=e=>mh.test(e),bh=e=>gh.test(e),wh=e=>Sh.test(e),xh=[Ah,vh,Ch,bh,wh],Rh=[yh,hh],Eh={anonymizeIp:"aip"},Ih={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Fh={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Ph=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],kh=Object.assign(Object.assign(Object.assign(Object.assign({},Eh),Ih),Fh),Ph.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Ba=Object.assign(Object.assign({},kh),Xy),Oh=e=>{let t=!!e.action&&nh[e.action]||{};return He(e).reduce((r,n)=>{let o=t[n]||Ba[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Th=He(Ba).map(e=>Ba[e]),Dh=e=>Th.indexOf(e)!==-1,qh=e=>e==="custom",Mh=e=>[...xh,...th,Dh,qh].some(t=>t(e)),Nh=e=>He(e).reduce((t,r)=>{let n=jh(r);return n?Object.assign(Object.assign({},t),_h(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),jh=e=>{let t;return[...Rh].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},_h=(e,t)=>He(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),$a=class{constructor(t){this.opts=t}sendEvent(t,r){return D(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:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:m}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,m),s=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,s)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:m,body:f}=a;o=m||t;try{i=JSON.parse(f)}catch(s){console.error("Unable to process the request body as a JSON string",s)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return D(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Ha=class{sendEvent(t,r){return D(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){return Promise.resolve()})}},Ju=A.fetch,_o=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",m={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},m),i?yield i(m,"analyticsFetch"):{}),{url:s}=f,g=lt(f,["url"]),h;try{h=yield Ju(s,g)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}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 D(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Ju(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return D(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"})}},za=class{constructor(t,r){Na()&&rl()?this.storage=new ja:Na()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new kr),this.client=new _o(t),this.beaconClient=new $a(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ga=class{constructor(t,r){this.storage=r||new kr,this.client=new _o(t)}getClientDependingOnEventType(t){return this.client}},Vo=class{constructor(){this.storage=new kr,this.client=new Ha}getClientDependingOnEventType(t){return this.client}},Vh="xx",Lh=e=>e?.startsWith(Vh)||!1,Uh=`
|
|
26
|
+
`;return new sn(r)}var sn=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ke=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw Vm(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}},ce=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&H(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 ge(e){return e===void 0}function Lm(e){return e===null}function H(e){return ge(e)||Lm(e)}var K=class{constructor(e={}){oe(this,"value");this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t||(Um(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Um(e){return ge(e)||Rc(e)}function Rc(e){return typeof e=="boolean"}var $=class{constructor(e={}){oe(this,"value");this.config=e,this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t||(Qm(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 Qm(e){return ge(e)||Ec(e)}function Ec(e){return typeof e=="number"&&!Number.isNaN(e)}var Bm=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,V=class{constructor(e={}){oe(this,"value");oe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new ce(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ge(e))return null;if(!Jn(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}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Bm.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 Jn(e){return Object.prototype.toString.call(e)==="[object String]"}var Q=class{constructor(e={}){oe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ge(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ic(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&H(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Ic(e){return e!==void 0&&typeof e=="object"}var J=class{constructor(e={}){oe(this,"value");this.config=e,this.value=new ce(this.config)}validate(e){if(!H(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(H(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&&H(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Rc(e)||Jn(e)||Ec(e)||Ic(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Fc(e){return Array.isArray(e)}var ea=class{constructor(e){oe(this,"value");this.config=e,this.value=new ce(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ge(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();u();d();l();function Pc(e){return Array.isArray(e)}function Xn(e){return e.trim()===""}var $m=new Set(["1",1,"yes",!0]);function kc(){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=>$m.has(r))}function Oc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function cn(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Zn(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function Hm(e){if(Xn(e.openingDelimiter)||Xn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(H(e.content)||Xn(e.content))return e.content;if(e.highlights.length===0)return ur(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,m=a+i.length;if(m>t)break;r+=ur(e.content.slice(n,a)),r+=e.openingDelimiter,r+=ur(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=ur(e.content.slice(n))),r}function zm(e,t){return e=ur(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?ta(n,t.notMatchDelimiters):o?ta(o,t.exactMatchDelimiters):i?ta(i,t.correctionDelimiters):r)}function ta(e,t){return t?t.open+e+t.close:e}function ur(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}p();u();d();l();var Bc=Wn(Vc(),1);p();u();d();l();var Ke=new Error("Failed to load reducers."),lr=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},Bt=class extends Error{constructor(r,n){super();oe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};p();u();d();l();function Lc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Uc(e){return typeof e!="object"||!e?!1:Object.values(e).every(Sg)}function Sg(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Qc(e){return e===429}var ze=class e{static call(t){return _asyncToGenerator(function*(){let r=vg(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(i,a);if(Qc(f.status))throw f;return f});return function m(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Bc.backOff)(m,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(s){let g=s&&Qc(s.status);return g&&(n.info("Platform retrying request"),yield new Promise(h=>setTimeout(h,1e3))),g});return function retry(_x){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new lr;case 404:throw new Bt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new Bt(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,s=cn(f);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return s})()}};function Ie(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function yt(e,t="prod"){return`${Ie(e,t)}/rest/search/v2`}function to(e,t="prod"){return`${Ie(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function vg(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=Ag(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(m&&{body:f}),signal:a}}function Ag(e,t){return t==="application/x-www-form-urlencoded"?Uc(e)?Lc(e):"":JSON.stringify(e)}p();u();d();l();p();u();d();l();var ro=e=>e;p();u();d();l();p();u();d();l();function no(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Je(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:no(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:no(),extendedResults:{},searchAction:void 0}}p();u();d();l();function ht(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var St=e=>{let{response:t}=e;return t.body?Cg(e):bg(t)},Cg=e=>xg(e)?Rg(e):wg(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},bg=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function wg(e){return e.body.statusCode!==void 0}function xg(e){return e.body.exception!==void 0}var Rg=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});p();u();d();l();var vt=class{constructor(){oe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new c.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};p();u();d();l();p();u();d();l();var dn=class{constructor(t){oe(this,"_basePath");oe(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();u();d();l();function $c(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}p();u();d();l();var at=(e,t,r,n)=>{let o=new dn(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Hc=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield ze.call({...at(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ht(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=$c(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Eg(a)?{success:a}:{error:St({response:r,body:a})}});return function Hc(_x2,_x3){return _ref3.apply(this,arguments)}}();function Eg(e){return typeof e=="string"}p();u();d();l();function Ig(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Fg(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function oo(e,t){if(t&&e.name==="AbortError")return{error:Fg(e)};if(e instanceof Bt)return{error:Ig(e)};throw e}var io=class{constructor(t){this.options=t;oe(this,"apiCallsQueues",{unknown:new vt,mainSearch:new vt,facetValues:new vt,foldingCollection:new vt,instantResults:new vt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/plan"),requestParams:ht(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return oo(r);let n=yield r.json();return kg(n)?{success:n}:{error:St({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ht(t),..._this3.options});if(r instanceof Error)return oo(r);let n=yield r.json(),o={response:r,body:n};return Pg(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:St(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(m=>ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:m??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return oo(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return zc(i)?(a.body=Gc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:St(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json","/facet"),requestParams:ht(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(zc(n)){let o={response:r,body:n};return o.body=Gc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:St({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Hc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield ze.call({...at(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Og(n)?{success:n}:{error:St({response:r,body:n})}})()}},ao=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function zc(e){return e.results!==void 0}function Gc(e){let t=no();return H(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Pg(e){return e.completions!==void 0}function kg(e){return e.preprocessingOutput!==void 0}function Og(e){return e.fields!==void 0}p();u();d();l();var Wc=e=>e,Yc=e=>e,Kc=e=>e;p();u();d();l();p();u();d();l();p();u();d();l();function ye(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 Tg=typeof Symbol=="function"&&Symbol.observable||"@@observable",Jc=Tg,da=()=>Math.random().toString(36).substring(7).split("").join("."),Dg={INIT:`@@redux/INIT${da()}`,REPLACE:`@@redux/REPLACE${da()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${da()}`},so=Dg;function Xe(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 pa(e,t,r){if(typeof e!="function")throw new Error(ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ye(1));return r(pa)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function s(){a===i&&(a=new Map,i.forEach((F,x)=>{a.set(x,F)}))}function g(){if(f)throw new Error(ye(3));return o}function h(F){if(typeof F!="function")throw new Error(ye(4));if(f)throw new Error(ye(5));let x=!0;s();let I=m++;return a.set(I,F),function(){if(x){if(f)throw new Error(ye(6));x=!1,s(),a.delete(I),i=null}}}function S(F){if(!Xe(F))throw new Error(ye(7));if(typeof F.type>"u")throw new Error(ye(8));if(typeof F.type!="string")throw new Error(ye(17));if(f)throw new Error(ye(9));try{f=!0,o=n(o,F)}finally{f=!1}return(i=a).forEach(I=>{I()}),F}function y(F){if(typeof F!="function")throw new Error(ye(10));n=F,S({type:so.REPLACE})}function b(){let F=h;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(ye(11));function I(){let E=x;E.next&&E.next(g())}return I(),{unsubscribe:F(I)}},[Jc](){return this}}}return S({type:so.INIT}),{dispatch:S,subscribe:h,getState:g,replaceReducer:y,[Jc]:b}}function qg(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:so.INIT})>"u")throw new Error(ye(12));if(typeof r(void 0,{type:so.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ye(13))})}function dr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let m=t[a];typeof e[m]=="function"&&(r[m]=e[m])}let n=Object.keys(r),o,i;try{qg(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let s=!1,g={};for(let h=0;h<n.length;h++){let S=n[h],y=r[S],b=m[S],R=y(b,f);if(typeof R>"u"){let F=f&&f.type;throw new Error(ye(14))}g[S]=R,s=s||R!==b}return s=s||n.length!==Object.keys(m).length,s?g:m}}function pr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Xc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(ye(15))},a={getState:o.getState,dispatch:(f,...s)=>i(f,...s)},m=e.map(f=>f(a));return i=pr(...m)(o.dispatch),{...o,dispatch:i}}}function co(e){return Xe(e)&&"type"in e&&typeof e.type=="string"}p();u();d();l();var ba=Symbol.for("immer-nothing"),pn=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function he(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fr=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[Te]}function De(e){return e?ou(e)||Array.isArray(e)||!!e[pn]||!!e.constructor?.[pn]||mr(e)||Sn(e):!1}var Mg=Object.prototype.constructor.toString(),Zc=new WeakMap;function ou(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Zc.get(r);return n===void 0&&(n=Function.toString.call(r),Zc.set(r,n)),n===Mg}function wa(e){return Ne(e)||he(15,e),e[Te].base_}function fn(e,t,r=!0){Ht(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Ht(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:mr(e)?2:Sn(e)?3:0}function mn(e,t){return Ht(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fa(e,t){return Ht(e)===2?e.get(t):e[t]}function iu(e,t,r){let n=Ht(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ng(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mr(e){return e instanceof Map}function Sn(e){return e instanceof Set}function $t(e){return e.copy_||e.base_}function ya(e,t){if(mr(e))return new Map(e);if(Sn(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=ou(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],m=n[a];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(n[a]={configurable:!0,writable:!0,enumerable:m.enumerable,value:e[a]})}return Object.create(fr(e),n)}else{let n=fr(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function fo(e,t=!1){return mo(e)||Ne(e)||!De(e)||(Ht(e)>1&&Object.defineProperties(e,{set:uo,add:uo,clear:uo,delete:uo}),Object.freeze(e),t&&Object.values(e).forEach(r=>fo(r,!0))),e}function jg(){he(2)}var uo={value:jg};function mo(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var ha={};function zt(e){let t=ha[e];return t||he(0,e),t}function _g(e,t){ha[e]||(ha[e]=t)}var gn;function au(){return gn}function Vg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function eu(e,t){t&&(zt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sa(e){va(e),e.drafts_.forEach(Lg),e.drafts_=null}function va(e){e===gn&&(gn=e.parent_)}function tu(e){return gn=Vg(gn,e)}function Lg(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ru(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(Sa(t),he(4)),De(e)&&(e=lo(t,e),t.parent_||po(t,e)),t.patches_&&zt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=lo(t,r,[]),Sa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ba?e:void 0}function lo(e,t,r){if(mo(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[Te];if(!o)return fn(t,(i,a)=>nu(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return po(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,m=!1;o.type_===3&&(a=new Set(i),i.clear(),m=!0),fn(a,(f,s)=>nu(e,o,i,f,s,r,m),n),po(e,i,!1),r&&e.patches_&&zt("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function nu(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let m=mo(o);if(!(m&&!a)){if(Ne(o)){let f=i&&t&&t.type_!==3&&!mn(t.assigned_,n)?i.concat(n):void 0,s=lo(e,o,f);if(iu(r,n,s),Ne(s))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!m){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&m)return;lo(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(mr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&po(e,o)}}}function po(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fo(t,r)}function Ug(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:au(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=xa;r&&(o=[n],i=yn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var xa={get(e,t){if(t===Te)return e;let r=$t(e);if(!mn(r,t))return Qg(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===ma(e.base_,t)?(ga(e),e.copy_[t]=Ca(n,e)):n},has(e,t){return t in $t(e)},ownKeys(e){return Reflect.ownKeys($t(e))},set(e,t,r){let n=su($t(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ma($t(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ng(r,o)&&(r!==void 0||mn(e.base_,t)))return!0;ga(e),Aa(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 ma(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ga(e),Aa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$t(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){he(11)},getPrototypeOf(e){return fr(e.base_)},setPrototypeOf(){he(12)}},yn={};fn(xa,(e,t)=>{yn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});yn.deleteProperty=function(e,t){return yn.set.call(this,e,t,void 0)};yn.set=function(e,t,r){return xa.set.call(this,e[0],t,r,e[0])};function ma(e,t){let r=e[Te];return(r?$t(r):e)[t]}function Qg(e,t,r){let n=su(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function su(e,t){if(!(t in e))return;let r=fr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fr(r)}}function Aa(e){e.modified_||(e.modified_=!0,e.parent_&&Aa(e.parent_))}function ga(e){e.copy_||(e.copy_=ya(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...s){return a.produce(f,g=>r.call(this,g,...s))}}typeof r!="function"&&he(6),n!==void 0&&typeof n!="function"&&he(7);let o;if(De(t)){let i=tu(this),a=Ca(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?Sa(i):va(i)}return eu(i,n),ru(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===ba&&(o=void 0),this.autoFreeze_&&fo(o,!0),n){let i=[],a=[];zt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else he(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...m)=>this.produceWithPatches(a,f=>t(f,...m));let n,o;return[this.produce(t,r,(a,m)=>{n=a,o=m}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){De(e)||he(8),Ne(e)&&(e=cu(e));let t=tu(this),r=Ca(e,void 0);return r[Te].isManual_=!0,va(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&he(9);let{scope_:n}=r;return eu(n,t),ru(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=zt("Patches").applyPatches_;return Ne(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Ca(e,t){let r=mr(e)?zt("MapSet").proxyMap_(e,t):Sn(e)?zt("MapSet").proxySet_(e,t):Ug(e,t);return(t?t.scope_:au()).drafts_.push(r),r}function cu(e){return Ne(e)||he(10,e),uu(e)}function uu(e){if(!De(e)||mo(e))return e;let t=e[Te],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ya(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ya(e,!0);return fn(r,(o,i)=>{iu(r,o,uu(i))},n),t&&(t.finalized_=!1),r}function lu(){let t="replace",r="add",n="remove";function o(S,y,b,R){switch(S.type_){case 0:case 2:return a(S,y,b,R);case 1:return i(S,y,b,R);case 3:return m(S,y,b,R)}}function i(S,y,b,R){let{base_:F,assigned_:x}=S,I=S.copy_;I.length<F.length&&([F,I]=[I,F],[b,R]=[R,b]);for(let w=0;w<F.length;w++)if(x[w]&&I[w]!==F[w]){let E=y.concat([w]);b.push({op:t,path:E,value:h(I[w])}),R.push({op:t,path:E,value:h(F[w])})}for(let w=F.length;w<I.length;w++){let E=y.concat([w]);b.push({op:r,path:E,value:h(I[w])})}for(let w=I.length-1;F.length<=w;--w){let E=y.concat([w]);R.push({op:n,path:E})}}function a(S,y,b,R){let{base_:F,copy_:x}=S;fn(S.assigned_,(I,w)=>{let E=fa(F,I),M=fa(x,I),k=w?mn(F,I)?t:r:n;if(E===M&&k===t)return;let P=y.concat(I);b.push(k===n?{op:k,path:P}:{op:k,path:P,value:M}),R.push(k===r?{op:n,path:P}:k===n?{op:r,path:P,value:h(E)}:{op:t,path:P,value:h(E)})})}function m(S,y,b,R){let{base_:F,copy_:x}=S,I=0;F.forEach(w=>{if(!x.has(w)){let E=y.concat([I]);b.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}I++}),I=0,x.forEach(w=>{if(!F.has(w)){let E=y.concat([I]);b.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}I++})}function f(S,y,b,R){b.push({op:t,path:[],value:y===ba?void 0:y}),R.push({op:t,path:[],value:S})}function s(S,y){return y.forEach(b=>{let{path:R,op:F}=b,x=S;for(let M=0;M<R.length-1;M++){let k=Ht(x),P=R[M];typeof P!="string"&&typeof P!="number"&&(P=""+P),(k===0||k===1)&&(P==="__proto__"||P==="constructor")&&he(19),typeof x=="function"&&P==="prototype"&&he(19),x=fa(x,P),typeof x!="object"&&he(18,R.join("/"))}let I=Ht(x),w=g(b.value),E=R[R.length-1];switch(F){case t:switch(I){case 2:return x.set(E,w);case 3:he(16);default:return x[E]=w}case r:switch(I){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(I){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(b.value);default:return delete x[E]}default:he(17,F)}}),S}function g(S){if(!De(S))return S;if(Array.isArray(S))return S.map(g);if(mr(S))return new Map(Array.from(S.entries()).map(([b,R])=>[b,g(R)]));if(Sn(S))return new Set(Array.from(S).map(g));let y=Object.create(fr(S));for(let b in S)y[b]=g(S[b]);return mn(S,pn)&&(y[pn]=S[pn]),y}function h(S){return Ne(S)?g(S):S}_g("Patches",{applyPatches_:s,generatePatches_:o,generateReplacementPatches_:f})}var hn=new Bg,st=hn.produce,go=hn.produceWithPatches.bind(hn);var Ra=hn.applyPatches.bind(hn);p();u();d();l();function $g(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Hg(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function zg(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 du=e=>Array.isArray(e)?e:[e];function Gg(e){let t=Array.isArray(e[0])?e[0]:e;return zg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Wg(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var sE=Symbol();var cE=Object.getPrototypeOf({});var Yg=class{constructor(e){this.value=e}deref(){return this.value}},Kg=typeof WeakRef<"u"?WeakRef:Yg,Jg=0,pu=1;function yo(){return{s:Jg,v:void 0,o:null,p:null}}function gr(e,t={}){let r=yo(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let y=arguments[h];if(typeof y=="function"||typeof y=="object"&&y!==null){let b=m.o;b===null&&(m.o=b=new WeakMap);let R=b.get(y);R===void 0?(m=yo(),b.set(y,m)):m=R}else{let b=m.p;b===null&&(m.p=b=new Map);let R=b.get(y);R===void 0?(m=yo(),b.set(y,m)):m=R}}let s=m,g;if(m.s===pu)g=m.v;else if(g=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,g)&&(g=h,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Kg(g):g}return s.s=pu,s.v=g,g}return a.clearCache=()=>{r=yo(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function fu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},s=o.pop();typeof s=="object"&&(f=s,s=o.pop()),$g(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);let g={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:y=gr,argsMemoizeOptions:b=[],devModeChecks:R={}}=g,F=du(S),x=du(b),I=Gg(o),w=h(function(){return i++,s.apply(null,arguments)},...F),E=!0,M=y(function(){a++;let P=Wg(I,arguments);return m=w.apply(null,P),m},...x);return Object.assign(M,{resultFunc:s,memoizedResultFunc:w,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var de=fu(gr),Xg=Object.assign((e,t=de)=>{Hg(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(i=>e[i]);return t(n,(...i)=>i.reduce((a,m,f)=>(a[r[f]]=m,a),{}))},{withTypes:()=>Xg});p();u();d();l();function mu(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var gu=mu(),yu=mu;var Zg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pr:pr.apply(null,arguments)},EE=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ey=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ge(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>co(n)&&n.type===e,r}var Cu=class vn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,vn.prototype)}static get[Symbol.species](){return vn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new vn(...t[0].concat(this)):new vn(...t.concat(this))}};function hu(e){return De(e)?st(e,()=>{}):e}function Su(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ty(e){return typeof e=="boolean"}var ry=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Cu;return r&&(ty(r)?a.push(gu):a.push(yu(r.extraArgument))),a},An="RTK_autoBatch",hr=()=>e=>({payload:e,meta:{[An]:!0}}),vu=e=>t=>{setTimeout(t,e)},ny=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,m=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:vu(10):e.type==="callback"?e.queueNotification:vu(e.timeout),s=()=>{a=!1,i&&(i=!1,m.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let h=()=>o&&g(),S=n.subscribe(h);return m.add(g),()=>{S(),m.delete(g)}},dispatch(g){try{return o=!g?.meta?.[An],i=!o,i&&(a||(a=!0,f(s))),n.dispatch(g)}finally{o=!0}}})},oy=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Cu(e);return n&&o.push(ny(typeof n=="object"?n:void 0)),o};function bu(e){let t=ry(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},m;if(typeof r=="function")m=r;else if(Xe(r))m=dr(r);else throw new Error(Ge(1));let f;typeof n=="function"?f=n(t):f=t();let s=pr;o&&(s=Zg({trace:!1,...(typeof o=="object"&&o)}));let g=Xc(...f),h=oy(g),S=typeof a=="function"?a(h):h(),y=s(...S);return pa(m,i,y)}function wu(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error(Ge(28));if(m in t)throw new Error(Ge(29));return t[m]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function iy(e){return typeof e=="function"}function le(e,t){let[r,n,o]=wu(t),i;if(iy(e))i=()=>hu(e());else{let m=hu(e);i=()=>m}function a(m=i(),f){let s=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return s.filter(g=>!!g).length===0&&(s=[o]),s.reduce((g,h)=>{if(h)if(Ne(g)){let y=h(g,f);return y===void 0?g:y}else{if(De(g))return st(g,S=>h(S,f));{let S=h(g,f);if(S===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return g},m)}return a.getInitialState=i,a}var xu=(e,t)=>ey(e)?e.match(t):e(t);function Ze(...e){return t=>e.some(r=>xu(r,t))}function yr(...e){return t=>e.every(r=>xu(r,t))}function So(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 Cn(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function vo(...e){return e.length===0?t=>So(t,["pending"]):Cn(e)?Ze(...e.map(t=>t.pending)):vo()(e[0])}function Gt(...e){return e.length===0?t=>So(t,["rejected"]):Cn(e)?Ze(...e.map(t=>t.rejected)):Gt()(e[0])}function bn(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?yr(Gt(...e),t):Cn(e)?yr(Gt(...e),t):bn()(e[0])}function ct(...e){return e.length===0?t=>So(t,["fulfilled"]):Cn(e)?Ze(...e.map(t=>t.fulfilled)):ct()(e[0])}function Ao(...e){return e.length===0?t=>So(t,["pending","fulfilled","rejected"]):Cn(e)?Ze(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Ao()(e[0])}var ay="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Co=(e=21)=>{let t="",r=e;for(;r--;)t+=ay[Math.random()*64|0];return t},sy=["name","message","stack","code"],Ea=class{constructor(e,t){oe(this,"_type");this.payload=e,this.meta=t}},Au=class{constructor(e,t){oe(this,"_type");this.payload=e,this.meta=t}},cy=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of sy)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},re=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,s,g,h)=>({payload:f,meta:{...(h||{}),arg:g,requestId:s,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,s,g)=>({payload:void 0,meta:{...(g||{}),arg:s,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,s,g,h,S)=>({payload:h,error:(n&&n.serializeError||cy)(f||"Rejected"),meta:{...(S||{}),arg:g,requestId:s,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(s,g,h)=>{let S=n?.idGenerator?n.idGenerator(f):Co(),y=new c.AbortController,b,R;function F(I){R=I,y.abort()}let x=_asyncToGenerator(function*(){let I;try{let E=n?.condition?.(f,{getState:g,extra:h});if(ly(E)&&(E=yield E),E===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((k,P)=>{b=()=>{P({name:"AbortError",message:R||"Aborted"})},y.signal.addEventListener("abort",b)});s(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:g,extra:h}))),I=yield Promise.race([M,Promise.resolve(r(f,{dispatch:s,getState:g,extra:h,requestId:S,signal:y.signal,abort:F,rejectWithValue:(k,P)=>new Ea(k,P),fulfillWithValue:(k,P)=>new Au(k,P)})).then(k=>{if(k instanceof Ea)throw k;return k instanceof Au?o(k.payload,S,f,k.meta):o(k,S,f)})])}catch(E){I=E instanceof Ea?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{b&&y.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||s(I),I})();return Object.assign(x,{abort:F,requestId:S,arg:f,unwrap(){return x.then(uy)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ze(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function uy(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function ly(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Ru=Symbol.for("rtk-slice-createasyncthunk"),OE={[Ru]:re};function dy(e,t){return`${e}/${t}`}function py({creators:e}={}){let t=e?.asyncThunk?.[Ru];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ge(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(my()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(I,w){let E=typeof I=="string"?I:I.type;if(!E)throw new Error(Ge(12));if(E in f.sliceCaseReducersByType)throw new Error(Ge(13));return f.sliceCaseReducersByType[E]=w,s},addMatcher(I,w){return f.sliceMatchers.push({matcher:I,reducer:w}),s},exposeAction(I,w){return f.actionCreators[I]=w,s},exposeCaseReducer(I,w){return f.sliceCaseReducersByName[I]=w,s}};m.forEach(I=>{let w=a[I],E={reducerName:I,type:dy(o,I),createNotation:typeof n.reducers=="function"};yy(w)?Sy(E,w,s,t):gy(E,w,s)});function g(){let[I={},w=[],E=void 0]=typeof n.extraReducers=="function"?wu(n.extraReducers):[n.extraReducers],M={...I,...f.sliceCaseReducersByType};return le(n.initialState,k=>{for(let P in M)k.addCase(P,M[P]);for(let P of f.sliceMatchers)k.addMatcher(P.matcher,P.reducer);for(let P of w)k.addMatcher(P.matcher,P.reducer);E&&k.addDefaultCase(E)})}let h=I=>I,S=new Map,y;function b(I,w){return y||(y=g()),y(I,w)}function R(){return y||(y=g()),y.getInitialState()}function F(I,w=!1){function E(k){let P=k[I];return typeof P>"u"&&w&&(P=R()),P}function M(k=h){let P=Su(S,w,()=>new WeakMap);return Su(P,k,()=>{let O={};for(let[j,_]of Object.entries(n.selectors??{}))O[j]=fy(_,k,R,w);return O})}return{reducerPath:I,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let x={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:R,...F(i),injectInto(I,{reducerPath:w,...E}={}){let M=w??i;return I.inject({reducerPath:M,reducer:b},E),{...x,...F(M,!0)}}};return x}}function fy(e,t,r,n){function o(i,...a){let m=t(i);return typeof m>"u"&&n&&(m=r()),e(m,...a)}return o.unwrapped=e,o}var Wt=py();function my(){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 gy({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!hy(n))throw new Error(Ge(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function yy(e){return e._reducerDefinitionType==="asyncThunk"}function hy(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sy({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ge(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:s,options:g}=r,h=o(e,i,g);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),s&&n.addMatcher(h.settled,s),n.exposeCaseReducer(t,{fulfilled:a||ho,pending:m||ho,rejected:f||ho,settled:s||ho})}function ho(){}var Eu="listener",Iu="completed",Fu="cancelled",TE=`task-${Fu}`,DE=`task-${Iu}`,qE=`${Eu}-${Fu}`,ME=`${Eu}-${Iu}`;var{assign:Pu}=Object;var Ia="listenerMiddleware";var vy=Pu(T(`${Ia}/add`),{withTypes:()=>vy}),NE=T(`${Ia}/removeAll`),Ay=Pu(T(`${Ia}/remove`),{withTypes:()=>Ay});var jE=Symbol.for("rtk-state-proxy-original");function Ge(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();u();d();l();var U=new V({required:!0,emptyAllowed:!1}),Se=new V({required:!1,emptyAllowed:!1}),ve=new V({required:!0,emptyAllowed:!0}),WE=new V({required:!1,emptyAllowed:!0}),bo=new J({each:U,required:!0}),ku=new V({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Ou=new V({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),YE=new V({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),ut=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Qe=(e,t)=>{if("required"in t)return{payload:new ke({value:t}).validate({value:e}).value};let o=new Q({options:{required:!0},values:t}).validate(e);if(o)throw new sn(o);return{payload:e}},N=(e,t)=>{try{return Qe(e,t)}catch(r){return{payload:e,error:ut(r)}}},Tu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return qu(e,t,r,o,"Controller initialization error")},Du=(e,t,r,n)=>{let o=`Check the options of ${n}`;return qu(e,t,r,o,"Controller initialization error")},qu=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};p();u();d();l();var Sr="3.35.4",Mu=["@coveo/atomic","@coveo/quantic"];var Fa=()=>Se,Nu=()=>U,At=T("configuration/updateBasicConfiguration",e=>N(e,{accessToken:Se,environment:new V({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Se})),et=T("configuration/updateSearchConfiguration",e=>N(e,{proxyBaseUrl:new V({required:!1,url:!0}),pipeline:new V({required:!1,emptyAllowed:!0}),searchHub:Se,timezone:Se,locale:Se,authenticationProviders:new J({required:!1,each:U})})),Cy={enabled:new K({default:!0}),originContext:Fa(),originLevel2:Fa(),originLevel3:Fa(),proxyBaseUrl:new V({required:!1,url:!0}),runtimeEnvironment:new ce,anonymous:new K({default:!1}),deviceId:Se,userDisplayName:Se,documentLocation:Se,trackingId:Ou,analyticsMode:new V({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new Q({options:{required:!1},values:Mu.reduce((e,t)=>(e[t]=ku,e),{})})},vr=T("configuration/updateAnalyticsConfiguration",e=>N(e,Cy)),Ar=T("configuration/analytics/disable"),Cr=T("configuration/analytics/enable"),wo=T("configuration/analytics/originlevel2",e=>N(e,{originLevel2:Nu()})),xo=T("configuration/analytics/originlevel3",e=>N(e,{originLevel3:Nu()}));p();u();d();l();p();u();d();l();p();u();d();l();var ju={q:new V,enableQuerySyntax:new K,aq:new V,cq:new V,firstResult:new $({min:0}),numberOfResults:new $({min:0}),sortCriteria:new V,f:new Q,fExcluded:new Q,cf:new Q,nf:new Q,mnf:new Q,df:new Q,debug:new K,sf:new Q,tab:new V,af:new Q};var Ct=T("searchParameters/restore",e=>N(e,ju)),_u=T("searchParameters/restoreTab",e=>N(e,U));p();u();d();l();var Ro=T("debug/enable"),Eo=T("debug/disable");p();u();d();l();var Io=()=>!1;var Fo=le(Io(),e=>{e.addCase(Ro,()=>!0).addCase(Eo,()=>!1).addCase(Ct,(t,r)=>r.payload.debug??t)});p();u();d();l();var br=T("pipeline/set",e=>N(e,new V({required:!0,emptyAllowed:!0})));p();u();d();l();p();u();d();l();var by=T("history/undo"),wy=T("history/redo"),tt=T("history/snapshot"),oF=re("history/back",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(by()),yield t(qe())});return function(_x4,_x5){return _ref5.apply(this,arguments)}}()),iF=re("history/forward",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{dispatch:t}){t(wy()),yield t(qe())});return function(_x6,_x7){return _ref6.apply(this,arguments)}}()),qe=re("history/change",/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x8,_x9){return _ref7.apply(this,arguments)}}());p();u();d();l();var wr=()=>"";var xr=le(wr(),e=>{e.addCase(br,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(et,(t,r)=>r.payload.pipeline||t)});p();u();d();l();p();u();d();l();var Po=T("app/setError");p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var Rr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let m=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,s=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||s.test(m)||m.indexOf(".")===-1?Pa(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Pa(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Pa(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}p();u();d();l();function xy(){return typeof navigator<"u"}function Vu(){try{return typeof localStorage<"u"}catch{return!1}}function Lu(){try{return typeof sessionStorage<"u"}catch{return!1}}function Uu(){return!!(xy()&&navigator.cookieEnabled)}var Qu=null;function Bu(){return Qu||(Vu()?localStorage:Uu()?new ka:Lu()?sessionStorage:new Oa)}var Er=class Er{getItem(t){return Rr.get(`${Er.prefix}${t}`)}removeItem(t){Rr.erase(`${Er.prefix}${t}`)}setItem(t,r,n){Rr.set(`${Er.prefix}${t}`,r,n)}};oe(Er,"prefix","coveo_");var ka=Er;var Oa=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ko="__coveo.analytics.history",Ry=20,Ey=1e3*60,Iy=75,Yt=class Yt{constructor(t){oe(this,"store");this.store=t||Bu()}static getInstance(t){return Yt.instance||(Yt.instance=new Yt(t)),Yt.instance}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){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(ko);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ko);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ko,JSON.stringify(t.slice(0,Ry)))}catch{}}clear(){try{this.store.removeItem(ko)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,Iy)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Ey:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};oe(Yt,"instance",null);var Ta=Yt,Be=Ta;p();u();d();l();p();u();d();l();var Ir=de(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Sr}`));p();u();d();l();p();u();d();l();function lt(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 o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function D(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(g){try{s(n.next(g))}catch(h){a(h)}}function f(g){try{s(n.throw(g))}catch(h){a(h)}}function s(g){g.done?i(g.value):o(g.value).then(m,f)}s((n=n.apply(e,t||[])).next())})}var X;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(X||(X={}));function Ma(){return typeof window<"u"}function Wa(){return typeof navigator<"u"}function Fr(){return typeof document<"u"}function Na(){try{return typeof localStorage<"u"}catch{return!1}}function Fy(){try{return typeof sessionStorage<"u"}catch{return!1}}function nl(){return Wa()&&navigator.cookieEnabled}var Py=[X.click,X.custom,X.search,X.view],ky=(e,t)=>Py.indexOf(e)!==-1?Object.assign({language:Fr()?document.documentElement.lang:"unknown",userAgent:Wa()?navigator.userAgent:"unknown"},t):t,xn=class e{static set(t,r,n){var o,i,a,m;n&&(i=new Date,i.setTime(i.getTime()+n)),m=window.location.hostname,m.indexOf(".")===-1?$u(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],$u(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function $u(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Oy(){return Na()?localStorage:nl()?new Rn:Fy()?sessionStorage:new kr}var Rn=class e{getItem(t){return xn.get(`${e.prefix}${t}`)}removeItem(t){xn.erase(`${e.prefix}${t}`)}setItem(t,r,n){xn.set(`${e.prefix}${t}`,r,n)}};Rn.prefix="coveo_";var ja=class{constructor(){this.cookieStorage=new Rn}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)}},kr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Oo="__coveo.analytics.history",Ty=20,Dy=1e3*60,qy=75,qo=class{constructor(t){this.store=t||Oy()}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 D(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 D(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Oo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return D(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Oo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Oo,JSON.stringify(t.slice(0,Ty)))}catch{}}clear(){try{this.store.removeItem(Oo)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,qy)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Dy:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var My=(e,t)=>D(void 0,void 0,void 0,function*(){return e===X.view?(yield Ny(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Ny=e=>D(void 0,void 0,void 0,function*(){let t=new qo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),To,jy=new Uint8Array(16);function _y(){if(!To&&(To=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!To))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return To(jy)}var Vy=/^(?:[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 Mo(e){return typeof e=="string"&&Vy.test(e)}var Ae=[];for(let e=0;e<256;++e)Ae.push((e+256).toString(16).slice(1));function ol(e,t=0){return Ae[e[t+0]]+Ae[e[t+1]]+Ae[e[t+2]]+Ae[e[t+3]]+"-"+Ae[e[t+4]]+Ae[e[t+5]]+"-"+Ae[e[t+6]]+Ae[e[t+7]]+"-"+Ae[e[t+8]]+Ae[e[t+9]]+"-"+Ae[e[t+10]]+Ae[e[t+11]]+Ae[e[t+12]]+Ae[e[t+13]]+Ae[e[t+14]]+Ae[e[t+15]]}function Ly(e){if(!Mo(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 Uy(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Qy="6ba7b810-9dad-11d1-80b4-00c04fd430c8",By="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function $y(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=Uy(o)),typeof i=="string"&&(i=Ly(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+o.length);if(s.set(i),s.set(o,i.length),s=r(s),s[6]=s[6]&15|t,s[8]=s[8]&63|128,a){m=m||0;for(let g=0;g<16;++g)a[m+g]=s[g];return a}return ol(s)}try{n.name=e}catch{}return n.DNS=Qy,n.URL=By,n}var Hy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Hu={randomUUID:Hy};function Kt(e,t,r){if(Hu.randomUUID&&!t&&!e)return Hu.randomUUID();e=e||{};let n=e.random||(e.rng||_y)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return ol(n)}function zy(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 Da(e,t){return e<<t|e>>>32-t}function Gy(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let m=0;m<a.length;++m)e.push(a.charCodeAt(m))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=m}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let m=new Uint32Array(80);for(let y=0;y<16;++y)m[y]=i[a][y];for(let y=16;y<80;++y)m[y]=Da(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);let f=r[0],s=r[1],g=r[2],h=r[3],S=r[4];for(let y=0;y<80;++y){let b=Math.floor(y/20),R=Da(f,5)+zy(b,s,g,h)+S+t[b]+m[y]>>>0;S=h,h=g,g=Da(s,30)>>>0,s=f,f=R}r[0]=r[0]+f>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+S>>>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 Wy=$y("v5",80,Gy),zu=Wy,il="2.30.49",Gu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,wn={pageview:"pageview",event:"event"},No=class{constructor({client:t,uuidGenerator:r=Kt}){this.client=t,this.uuidGenerator=r}},_a=class extends No{constructor({client:t,uuidGenerator:r=Kt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Gu(window.location),this.lastReferrer=Fr()?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:Fr()?document.title:"",encoding:Fr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===wn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===wn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===wn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===wn.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Gu(window.location)}},bt=class e{constructor(t,r){if(!Mo(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(o=>new RegExp(o.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,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Mo(i)?new e(i,Number.parseInt(o)*1e3):null}};bt.cvo_cid="cvo_cid";bt.expirationTime=120;var Va=class extends No{constructor({client:t,uuidGenerator:r=Kt}){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 D(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(bt.cvo_cid,new bt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Va.Id="link";var He=Object.keys;function Do(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qa=128,al=192,Wu=224,Yu=240;function Yy(e){return(e&248)===Yu?4:(e&Yu)===Wu?3:(e&Wu)===al?2:1}function Ky(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&qa)!=qa)break;if(r-=3,(n&al)!=qa){t-r>=Yy(n)*3&&(r=t);break}}return e.substring(0,r)}var La={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"},Jy=He(La).map(e=>La[e]),Xy=[...Jy].join("|"),Zy=new RegExp(`^(${Xy}$)`),eh={svcAction:"svc_action",svcActionData:"svc_action_data"},th=e=>He(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=La[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),rh=e=>Zy.test(e),nh=[rh],Ku={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Ju={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},xe={action:"pa",list:"pal",listSource:"pls"},jo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},oh=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ua={id:"quoteId",affiliation:"quoteAffiliation"},Qa={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ih={add:xe,bookmark_add:xe,bookmark_remove:xe,click:xe,checkout:xe,checkout_option:xe,detail:xe,impression:xe,remove:xe,refund:Object.assign(Object.assign({},xe),jo),purchase:Object.assign(Object.assign({},xe),jo),quickview:xe,quote:Object.assign(Object.assign({},xe),Ua),review:Object.assign(Object.assign({},xe),Qa)},ah=He(Ku).map(e=>Ku[e]),sh=He(Ju).map(e=>Ju[e]),ch=He(xe).map(e=>xe[e]),uh=He(jo).map(e=>jo[e]),lh=He(Qa).map(e=>Qa[e]),dh=He(Ua).map(e=>Ua[e]),ph=[...ah,"custom"].join("|"),fh=[...sh,"custom"].join("|"),sl="(pr[0-9]+)",cl="(il[0-9]+pi[0-9]+)",mh=new RegExp(`^${sl}(${ph})$`),gh=new RegExp(`^(${cl}(${fh}))|(il[0-9]+nm)$`),yh=new RegExp(`^(${ch.join("|")})$`),hh=new RegExp(`^(${uh.join("|")})$`),Sh=new RegExp(`^${sl}custom$`),vh=new RegExp(`^${cl}custom$`),Ah=new RegExp(`^(${[...oh,...lh,...dh].join("|")})$`),Ch=e=>mh.test(e),bh=e=>gh.test(e),wh=e=>yh.test(e),xh=e=>hh.test(e),Rh=e=>Ah.test(e),Eh=[bh,Ch,wh,xh,Rh],Ih=[Sh,vh],Fh={anonymizeIp:"aip"},Ph={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},kh={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Oh=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Th=Object.assign(Object.assign(Object.assign(Object.assign({},Fh),Ph),kh),Oh.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Ba=Object.assign(Object.assign({},Th),eh),Dh=e=>{let t=!!e.action&&ih[e.action]||{};return He(e).reduce((r,n)=>{let o=t[n]||Ba[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},qh=He(Ba).map(e=>Ba[e]),Mh=e=>qh.indexOf(e)!==-1,Nh=e=>e==="custom",jh=e=>[...Eh,...nh,Mh,Nh].some(t=>t(e)),_h=e=>He(e).reduce((t,r)=>{let n=Vh(r);return n?Object.assign(Object.assign({},t),Lh(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Vh=e=>{let t;return[...Ih].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Lh=(e,t)=>He(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),$a=class{constructor(t){this.opts=t}sendEvent(t,r){return D(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:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:m}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,m),s=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,s)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:m,body:f}=a;o=m||t;try{i=JSON.parse(f)}catch(s){console.error("Unable to process the request body as a JSON string",s)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return D(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Ha=class{sendEvent(t,r){return D(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){return Promise.resolve()})}},Xu=A.fetch,_o=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",m={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},m),i?yield i(m,"analyticsFetch"):{}),{url:s}=f,g=lt(f,["url"]),h;try{h=yield Xu(s,g)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}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 D(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Xu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return D(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"})}},za=class{constructor(t,r){Na()&&nl()?this.storage=new ja:Na()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new kr),this.client=new _o(t),this.beaconClient=new $a(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ga=class{constructor(t,r){this.storage=r||new kr,this.client=new _o(t)}getClientDependingOnEventType(t){return this.client}},Vo=class{constructor(){this.storage=new kr,this.client=new Ha}getClientDependingOnEventType(t){return this.client}},Uh="xx",Qh=e=>e?.startsWith(Uh)||!1,Bh=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
30
|
-
`;function Qh(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Bh=["1",1,"yes",!0];function Lo(){let e=[];return Ma()&&e.push(window.doNotTrack),Wa()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Bh.indexOf(t)!==-1)}var cl="v15",ul={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function $h(e=ul.default,t=cl,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Hh="38824e1f-37f5-42d3-8372-a4b8fa9df946",rt=class{get defaultOptions(){return{endpoint:ul.default,isCustomEndpoint:!1,token:"",version:cl,beforeSendHooks:[],afterSendHooks:[]}}get version(){return ol}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Dy,Fy].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Lo()?this.runtime=new Vo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(X.view,{newEventType:X.view,addClientIdParameter:!0}),this.addEventTypeMapping(X.click,{newEventType:X.click,addClientIdParameter:!0}),this.addEventTypeMapping(X.custom,{newEventType:X.custom,addClientIdParameter:!0}),this.addEventTypeMapping(X.search,{newEventType:X.search,addClientIdParameter:!0})}initRuntime(t){return Ma()&&Fr()?new za(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Qh()&&console.warn(Uh),new Ga(t))}get storage(){return this.runtime.storage}determineVisitorId(){return D(this,void 0,void 0,function*(){try{return Ma()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Jt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Jt()}})}getCurrentVisitorId(){return D(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return D(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return D(this,void 0,void 0,function*(){if(Mo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Hu(t,Hu(r,Hh)))}})}getParameters(t,...r){return D(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return D(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Jt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Lo())return null;try{let r=new URL(t).searchParams.get(bt.cvo_cid);if(r==null)return null;let n=bt.fromString(r);return!n||!Fr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return D(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>D(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>D(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>i?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((b,R)=>D(this,void 0,void 0,function*(){let F=yield b;return yield R(t,F)}),y)].reduce((y,b)=>D(this,void 0,void 0,function*(){let R=yield y;return yield b(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return D(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?Oh(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>D(this,void 0,void 0,function*(){let y=yield h;return yield S(y)}),Promise.resolve(r))})}makeEvent(t,...r){return D(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>D(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(m=>m(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return D(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return D(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new qo().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.search,t)})}sendSearchEvent(t){return D(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lt(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.click,t)})}sendClickEvent(t){return D(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lt(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.custom,t)})}sendCustomEvent(t){return D(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=lt(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.view,t)})}sendViewEvent(t){return D(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return D(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return D(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[X.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Mh(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=lt(t,["custom"]),o={};r&&Do(r)&&(o=this.lowercaseKeys(r));let i=Nh(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=lt(t,["custom"]);if(r&&Do(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=lt(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==X.view||r==X.click||r==X.search||r==X.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==X.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=lt(t,["userId"]);return Lh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=lt(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Do(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Do(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?Wy(t,r):t}get baseUrl(){return $h(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},dt;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(dt||(dt={}));var q;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(q||(q={}));var Xu={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[q.queryErrorBack]:"errors",[q.queryErrorClear]:"errors",[q.queryErrorRetry]:"errors",[q.pagerNext]:"getMoreResults",[q.pagerPrevious]:"getMoreResults",[q.pagerNumber]:"getMoreResults",[q.pagerResize]:"getMoreResults",[q.pagerScrolling]:"getMoreResults",[q.facetSearch]:"facet",[q.facetShowLess]:"facet",[q.facetShowMore]:"facet",[q.recommendation]:"recommendation",[q.likeSmartSnippet]:"smartSnippet",[q.dislikeSmartSnippet]:"smartSnippet",[q.expandSmartSnippet]:"smartSnippet",[q.collapseSmartSnippet]:"smartSnippet",[q.openSmartSnippetFeedbackModal]:"smartSnippet",[q.closeSmartSnippetFeedbackModal]:"smartSnippet",[q.sendSmartSnippetReason]:"smartSnippet",[q.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.clearRecentQueries]:"recentQueries",[q.recentResultClick]:"recentlyClickedDocuments",[q.clearRecentResults]:"recentlyClickedDocuments",[q.showLessFoldedResults]:"folding",[q.caseDetach]:"case",[q.likeGeneratedAnswer]:"generatedAnswer",[q.dislikeGeneratedAnswer]:"generatedAnswer",[q.openGeneratedAnswerSource]:"generatedAnswer",[q.generatedAnswerStreamEnd]:"generatedAnswer",[q.generatedAnswerSourceHover]:"generatedAnswer",[q.generatedAnswerCopyToClipboard]:"generatedAnswer",[q.generatedAnswerHideAnswers]:"generatedAnswer",[q.generatedAnswerShowAnswers]:"generatedAnswer",[q.generatedAnswerExpand]:"generatedAnswer",[q.generatedAnswerCollapse]:"generatedAnswer",[q.generatedAnswerFeedbackSubmit]:"generatedAnswer",[q.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[dt.expandToFullUI]:"interface",[dt.openUserActions]:"User Actions",[dt.showPrecedingSessions]:"User Actions",[dt.showFollowingSessions]:"User Actions",[dt.clickViewedDocument]:"User Actions",[dt.clickPageView]:"User Actions",[dt.createArticle]:"createArticle"},Or=class{constructor(){this.runtime=new Vo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(X.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(X.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(X.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(X.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return ol}};function zh(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function Gh(e){return e.map(t=>t.replace(/;/g,""))}function ll(e){let r=e.join(";");return r.length<=256?r:ll(e.slice(1))}var Zu=e=>{let t=Gh(e),r=zh(t);return ll(r)};function el(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Zu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Zu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Uo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Lo();this.coveoAnalyticsClient=n?new Or:new rt(t)}disable(){this.coveoAnalyticsClient=new Or}enable(){this.coveoAnalyticsClient=new rt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(q.interfaceLoad)}logInterfaceLoad(){return D(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(q.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(q.recommendation)}logRecommendation(){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(q.recommendationOpen,t,r)}logRecommendationOpen(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(q.staticFilterClearAll,t)}logStaticFilterClearAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(q.staticFilterSelect,t)}logStaticFilterSelect(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(q.staticFilterDeselect,t)}logStaticFilterDeselect(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(q.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return D(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(q.interfaceChange,t)}logInterfaceChange(t){return D(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(q.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return D(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(q.didyoumeanClick)}logDidYouMeanClick(){return D(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(q.resultsSort,t)}logResultsSort(t){return D(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(q.searchboxSubmit)}logSearchboxSubmit(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(q.searchboxClear)}logSearchboxClear(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(q.searchboxAsYouType)}logSearchboxAsYouType(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(q.breadcrumbFacet,t)}logBreadcrumbFacet(t){return D(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(q.breadcrumbResetAll)}logBreadcrumbResetAll(){return D(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(q.documentQuickview,t,r)}logDocumentQuickview(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(q.documentOpen,t,r)}logDocumentOpen(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(q.omniboxAnalytics,el(t))}logOmniboxAnalytics(t){return D(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(q.omniboxFromLink,el(t))}logOmniboxFromLink(t){return D(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(q.searchFromLink)}logSearchFromLink(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(q.triggerNotify,t)}logTriggerNotify(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(q.triggerExecute,t)}logTriggerExecute(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(q.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(q.undoTriggerQuery,t)}logUndoTriggerQuery(t){return D(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(q.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(q.pagerResize,t)}logPagerResize(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(q.pagerNumber,t)}logPagerNumber(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(q.pagerNext,t)}logPagerNext(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(q.pagerPrevious,t)}logPagerPrevious(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(q.pagerScrolling)}logPagerScrolling(){return D(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(q.facetClearAll,t)}logFacetClearAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(q.facetSearch,t)}logFacetSearch(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(q.facetSelect,t)}logFacetSelect(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(q.facetDeselect,t)}logFacetDeselect(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(q.facetExclude,t)}logFacetExclude(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(q.facetUnexclude,t)}logFacetUnexclude(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(q.facetSelectAll,t)}logFacetSelectAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(q.facetUpdateSort,t)}logFacetUpdateSort(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(q.facetShowMore,t)}logFacetShowMore(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(q.facetShowLess,t)}logFacetShowLess(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(q.queryError,t)}logQueryError(t){return D(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorBack);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorBack)})}})}logQueryErrorBack(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorRetry);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorRetry)})}})}logQueryErrorRetry(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorClear);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorClear)})}})}logQueryErrorClear(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(q.likeSmartSnippet)}logLikeSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(q.dislikeSmartSnippet)}logDislikeSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(q.expandSmartSnippet)}logExpandSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(q.collapseSmartSnippet)}logCollapseSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return D(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(q.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(q.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(q.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(q.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(q.copyToClipboard,t,r)}logCopyToClipboard(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(q.recentQueryClick)}logRecentQueryClick(){return D(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(q.clearRecentQueries)}logClearRecentQueries(){return D(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(q.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(q.clearRecentResults)}logClearRecentResults(){return D(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(q.noResultsBack)}logNoResultsBack(){return D(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(q.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(q.showLessFoldedResults)}logShowLessFoldedResults(){return D(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return D(this,arguments,void 0,function*(n,o,i=Xu[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),m=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(m);return{description:this.makeEventDescription(f,n),log:({searchUID:s})=>f.log({lastSearchQueryUid:s})}})}logCustomEvent(t,r){return D(this,arguments,void 0,function*(n,o,i=Xu[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return D(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({searchQueryUid:m})}})}logClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return D(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return D(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof rt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(q.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(q.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(q.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return D(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(q.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(q.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(q.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(q.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(q.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(q.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(q.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(q.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(q.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return D(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(q.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Qo=Object.assign({},wn),tl=Object.keys(Qo).map(e=>Qo[e]),Pr=class extends _a{constructor({client:t,uuidGenerator:r=Jt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>tl.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(tl.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Qo.pageview,{newEventType:X.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Qo.event,{newEventType:X.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return Zy(this.ticket)}};Pr.Id="svc";var Bo;(function(e){e.click="click",e.flowStart="flowStart"})(Bo||(Bo={}));var $e;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})($e||($e={}));var $o;(function(e){e.quit="Quit",e.solved="Solved"})($o||($o={}));var Ho=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Lo();this.coveoAnalyticsClient=o?new rt(t):new Or,this.svc=new Pr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Or,this.svc=new Pr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new rt(this.options),this.svc=new Pr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction($e.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction($e.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction($e.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent($e.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent($e.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction($e.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction($e.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction($e.caseCancelled,{reason:$o.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction($e.caseSolved,{reason:$o.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction($e.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Bo.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Bo.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return D(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof rt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){var i,a;let m=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(m)})}};var dl=e=>new rt(e).getCurrentVisitorId(),En=(e,t)=>typeof t=="function"?(...r)=>{let n=cn(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,In=(e,t)=>(...r)=>{let n=cn(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();function zo(){return{desiredCount:5,numberOfValues:8,set:{}}}p();u();d();l();p();u();d();l();p();u();d();l();function pl(e){let{activeValue:t,ancestryMap:r}=Wh(e);return t?Yh(t,r):[]}function Wh(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function Yh(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var Kh=(e,t)=>e.categoryFacetSet[t]?.request;var Ja=(e,t)=>{let r=Kh(e,t);return pl(r?.currentValues??[])};p();u();d();l();function Go(){return{}}p();u();d();l();function Wo(){return{}}p();u();d();l();function Yo(){return{}}p();u();d();l();function Ko(){return{}}function Xa(e){return{facetSet:e.facetSet??Ko(),categoryFacetSet:e.categoryFacetSet??Go(),dateFacetSet:e.dateFacetSet??Wo(),numericFacetSet:e.numericFacetSet??Yo(),automaticFacetSet:e.automaticFacetSet??zo()}}var Za=e=>{let t=[];return Zh(e).forEach((r,n)=>{let o=sS(e,r.facetId),i=iS(r,n+1);if(Xh(r)){if(!!!Ja(e,r.facetId).length)return;t.push({...i,...nS(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,m)=>{if(a.state==="idle")return;let f=fl(a,m+1,o),s=Jh(r)?ml(a):tS(a);t.push({...i,...f,...s})})}),eS(e).forEach((r,n)=>{let o=oS(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let m=fl(i,a+1,"specific"),f=ml(i);t.push({...o,...m,...f})})}),t},Jh=e=>e.type==="specific",Xh=e=>e.type==="hierarchical",Zh=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),eS=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),fl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),tS=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),ml=e=>({displayValue:e.value,value:e.value}),rS=(e,t)=>Ja(e,t).map(n=>n.value).join(";"),nS=(e,t)=>{let n=rS(e,t);return{value:n,valuePosition:1,displayValue:n}},oS=(e,t)=>({title:gl(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),iS=(e,t)=>({title:gl(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),gl=(e,t)=>`${e}_${t}`,aS=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,sS=(e,t)=>{let r=aS(e,t);return r?r.type:"specific"};p();u();d();l();var Xt=e=>{if(cS(e))return e.generatedAnswer?.answerId;if(uS(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},cS=e=>"answer"in e&&"generatedAnswer"in e&&!H(e.generatedAnswer?.answerConfigurationId),uS=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",yl=e=>e.generatedAnswer?.fieldsToIncludeInCitations,lS=de(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));p();u();d();l();var je=()=>({q:"",enableQuerySyntax:!1});p();u();d();l();p();u();d();l();var hl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(hl||{}),Sl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(Sl||{}),es=e=>{if(Fc(e))return e.map(t=>es(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},vl=()=>({by:"relevancy"});var Vk=new Q({values:{by:new ea({enum:Sl,required:!0}),order:new ea({enum:hl}),field:new V}});function Jo(){return es(vl())}p();u();d();l();p();u();d();l();var Tr=()=>"default";var dS=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},pt=class{constructor(t){this.getState=t;oe(this,"state");this.state=t()}getLanguage(){return dS(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let m=`context_${i}`;o[m]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Sr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Tr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Fn=class Fn extends pt{constructor(){super(...arguments);oe(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Za(Xa(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Fn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||Je().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Fn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Xt(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Jo()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(s=>s.expression),a=o.partialQueries.length-1,m=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:m,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||je().q}get responseTime(){return this.state.search?.duration||Je().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Je().response.totalCountFiltered}};oe(Fn,"fallbackPipelineName","default");var wt=Fn,Al=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Ie(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,s=i.configuration.analytics.enabled,g=new Uo({token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:En(e,n),beforeSendHooks:[In(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return s||g.disable(),g},ts=()=>{let t=Be.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Xo=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield dl(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(ts()&&{pageId:ts()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Ir(e)})}}});return function Xo(_x0,_x1){return _ref8.apply(this,arguments)}}();p();u();d();l();p();u();d();l();p();u();d();l();var Dr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Pn=class extends pt{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:je().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||Dr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||Dr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||Dr().recommendations.length}};p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var Cl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function pS(e){return typeof e=="string"&&Cl.test(e)}var rs=pS;p();u();d();l();var Ce=[];for(let e=0;e<256;++e)Ce.push((e+256).toString(16).slice(1));function bl(e,t=0){return(Ce[e[t+0]]+Ce[e[t+1]]+Ce[e[t+2]]+Ce[e[t+3]]+"-"+Ce[e[t+4]]+Ce[e[t+5]]+"-"+Ce[e[t+6]]+Ce[e[t+7]]+"-"+Ce[e[t+8]]+Ce[e[t+9]]+"-"+Ce[e[t+10]]+Ce[e[t+11]]+Ce[e[t+12]]+Ce[e[t+13]]+Ce[e[t+14]]+Ce[e[t+15]]).toLowerCase()}p();u();d();l();var ns,fS=new Uint8Array(16);function os(){if(!ns){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ns=crypto.getRandomValues.bind(crypto)}return ns(fS)}p();u();d();l();p();u();d();l();var mS=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),is={randomUUID:mS};function gS(e,t,r){if(is.randomUUID&&!t&&!e)return is.randomUUID();e=e||{};let n=e.random??e.rng?.()??os();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return bl(n)}var as=gS;p();u();d();l();function wl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function yS({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var xl="visitorId";function hS(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(xl),o=n&&rs(n)?n:t.generateUUID();return r.setItem(xl,o),o}}}var Pl="1.2.7",ss=128,kl=192,Rl=224,El=240,SS=248;function vS(e){return(e&SS)===El?4:(e&El)===Rl?3:(e&Rl)===kl?2:1}function AS(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&ss)!=ss)break;if(r-=3,(n&kl)!=ss){t-r>=vS(n)*3&&(r=t);break}}return e.substring(0,r)}function CS(e){let{trackingId:t}=e;return{trackingId:t}}function bS(e){return(e.source||[]).concat([`relay@${Pl}`])}function Ol(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,m=CS(t),f=n.getClientId();return Object.freeze({type:e,config:m,ts:Date.now(),source:bS(t),clientId:f,userAgent:a(),referrer:Il(o()),location:Il(i())})}function Il(e){return e!==null?AS(e,1024):null}function wS(e,t,r,n,o){return{...t,meta:Ol(e,r,n,o)}}var xS="*";function RS(){let e=[];function t({type:f,callback:s}){return e.findIndex(g=>g.type===f&&g.callback===s)}function r(f,s){return f.type==="*"||s===f.type}function n(f){return t(f)<0&&e.push(f),()=>m(f.type,f.callback)}function o(f){e.forEach(s=>{if(r(s,f.meta.type))try{s.callback(f)}catch(g){console.error(g)}})}function i(f){if(f===xS)e.length=0;else for(let s=e.length-1;s>=0;s--)e[s].type===f&&e.splice(s,1)}function a(f){let s=t(f);s>=0&&e.splice(s,1)}function m(f,s){s?a({type:f,callback:s}):i(f)}return{add:n,call:o,remove:m}}function Fl({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}),...(!!n.environment&&{environment:n.environment})})}function ES(e){let t=Fl(e);return{get:()=>t,update:r=>{t=Fl({...t,...r})}}}var cs=IS();function IS(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,m=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${m};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function FS(){return{getItem(e){return cs.getItem(e)||localStorage.getItem(e)},removeItem(e){cs.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),cs.setItem(e,t,31556952e3)}}}function PS(){let e=document.referrer;return e===""?null:e}function us(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(wl().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:()=>PS(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>as(),storage:FS()}}function kS(){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 OS(){return{getItem(){return null},removeItem(){},setItem(){}}}function TS(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:OS()}}function DS(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=TS();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&qS()&&kS()?us():n}function qS(){try{return typeof window=="object"}catch{return!1}}function MS(e){return{get:()=>Object.freeze(DS(e))}}function Tl(e){let t=ES(e),r=RS(),n=MS(t),o=hS(n);return{emit:(i,a)=>{let m=t.get(),f=n.get(),s=wS(i,a,m,f,o);return yS({config:m,environment:f,event:s,listenerManager:r})},getMeta:i=>Ol(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:Pl}}p();u();d();l();function Dl(){return typeof window<"u"&&typeof document<"u"}var kn=de(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Ir(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,m)=>{let f=jS(m);return Tl({mode:i?"emit":"disabled",url:o??to(e,t),token:r,trackingId:n??null,source:a,environment:f})}),NS={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},jS=e=>{if(!e)return;let t=e();return{...(Dl()?us():NS),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};p();u();d();l();var On=class extends pt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},ql=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new On(t)})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Ie(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,s=i.configuration.analytics.enabled,g=new Ho({enableAnalytics:s,token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:En(e,n),beforeSendHooks:[In(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return s||g.disable(),g};p();u();d();l();p();u();d();l();function Ml(e,t){return{...new wt(t).getBaseMetadata(),actionCause:e,type:e}}function _S(e){return Object.assign(e,{instantlyCallable:!0})}function VS(e,t){let r=i=>_S(re(e,i)),n=r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(i,{getState:a,extra:m}){let{analyticsClientMiddleware:f,preprocessRequest:s,logger:g}=m;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:s,logger:g})).log({state:a(),extra:m})});return function(_x10,_x11){return _ref9.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref0=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f}){let{description:s,log:g}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f});return{description:s,action:r(/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(h,{getState:S,extra:y}){return yield g({state:S(),extra:y})});return function(_x13,_x14){return _ref1.apply(this,arguments)}}())}});return function prepare(_x12){return _ref0.apply(this,arguments)}}()}),n}var Nl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return QS(i)}return n},LS=e=>e.configuration.analytics.analyticsMode==="legacy",US=e=>e.configuration.analytics.analyticsMode==="next",QS=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=m=>new a(m)),VS(e,/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*({getState:m,analyticsClientMiddleware:f,preprocessRequest:s,logger:g}){let h=[],S={log:function(){var _ref11=_asyncToGenerator(function*({state:x}){for(let I of h)yield I(x)});return function log(_x16){return _ref11.apply(this,arguments)}}()},y=m(),b=i({getState:m,logger:g,analyticsClientMiddleware:f,preprocessRequest:s,provider:r(m)}),R=yield t(b,m());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){LS(x)&&(yield BS(R,r,x,g,b.coveoAnalyticsClient))});return function(_x17){return _ref12.apply(this,arguments)}}());let{emit:F}=kn(y);return h.push(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(x){if(US(x)&&o&&n){let I=n(x);yield KS(F,o,I)}});return function(_x18){return _ref13.apply(this,arguments)}}()),S});return function(_x15){return _ref10.apply(this,arguments)}}()));function BS(_x19,_x20,_x21,_x22,_x23){return _BS.apply(this,arguments)}function _BS(){_BS=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _BS.apply(this,arguments)}var $S=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref14=_asyncToGenerator(function*(i){r(n,o)});return function log(_x24){return _ref14.apply(this,arguments)}}()}),Fe=Nl(e=>Al({...e,provider:e.provider||new wt(e.getState)}),e=>e,wt),YD=Nl(ql,$S("caseAssist"),On);var ls=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return HS(e,r,t)};function HS(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:WS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:YS(e),queryPipeline:r.pipeline||wr()}}var Zo=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),jl={urihash:new V,sourcetype:new V,permanentid:new V},_l={uniqueId:U,raw:new Q({values:jl}),title:U,uri:U,clickUri:U,rankingModifier:new V({required:!1,emptyAllowed:!0})};function zS(e){return Object.assign({},...Object.keys(jl).map(t=>({[t]:e[t]})))}function GS(e){return Object.assign({},...Object.keys(_l).map(t=>({[t]:e[t]})),{raw:zS(e.raw)})}function WS(e){let t=e.raw.author;return H(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function YS(e){let t=e.raw.source;return H(t)?"unknown":t}var ds=e=>new ke(_l).validate(GS(e));function KS(_x25,_x26,_x27){return _KS.apply(this,arguments)}function _KS(){_KS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _KS.apply(this,arguments)}p();u();d();l();var Vl=()=>Fe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Pn(e)),Ll=()=>({actionCause:"recommendationInterfaceLoad"}),ti=e=>Fe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(ds(e),t.makeRecommendationOpen(ls(e,r),Zo(e))),__legacy__provider:t=>new Pn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=ls(e,t),n=Zo(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var qr=T("recommendation/set",e=>N(e,{id:U})),xt=re("recommendation/get",/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield JS(o),m=yield n.recommendations(a),f=Date.now()-i;return Oe(m)?r(m.error):{recommendations:m.success.results,analyticsAction:Vl(),duration:f,searchUid:m.success.searchUid,splitTestRun:m.success.splitTestRun,pipeline:m.success.pipeline}});return function(_x28,_x29){return _ref15.apply(this,arguments)}}()),JS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Be.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield XS(e,Ll()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function JS(_x30){return _ref16.apply(this,arguments)}}(),XS=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Xo(e.configuration.analytics,r)});return function XS(_x31,_x32){return _ref17.apply(this,arguments)}}();var Mr=le(Dr(),e=>{e.addCase(qr,(t,r)=>{t.id=r.payload.id}).addCase(xt.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(xt.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(xt.pending,t=>{t.isLoading=!0}).addCase(Po,(t,r)=>{t.error=r.payload,t.isLoading=!1})});p();u();d();l();var Nr=T("searchHub/set",e=>N(e,new V({required:!0,emptyAllowed:!0})));p();u();d();l();var jr=le(Tr(),e=>{e.addCase(Nr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(et,(t,r)=>r.payload.searchHub||t)});p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();function Ul(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Ql=Xe;function ed(e,t){if(e===t||!(Ql(e)&&Ql(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=ed(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function _r(e){let t=0;for(let r in e)t++;return t}var Bl=e=>[].concat(...e);function ZS(e){return new RegExp("(^|:)//").test(e)}function ev(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function oi(e){return e!=null}function tv(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var rv=e=>e.replace(/\/$/,""),nv=e=>e.replace(/^\//,"");function ov(e,t){if(!e)return t;if(!t)return e;if(ZS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=rv(e),t=nv(t),`${e}${r}${t}`}function iv(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var $l=(...e)=>v(...e),av=e=>e.status>=200&&e.status<=299,sv=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Hl(e){if(!Xe(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function td({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=$l,paramsSerializer:n,isJsonContentType:o=sv,jsonContentType:i="application/json",jsonReplacer:a,timeout:m,responseHandler:f,validateStatus:s,...g}={}){return typeof v>"u"&&r===$l&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(S,y,b){let{getState:R,extra:F,endpoint:x,forced:I,type:w}=y,E,{url:M,headers:k=new C(g.headers),params:P=void 0,responseHandler:O=f??"json",validateStatus:j=s??av,timeout:_=m,...L}=typeof S=="string"?{url:S}:S,B,z=y.signal;_&&(B=new c.AbortController,y.signal.addEventListener("abort",B.abort),z=B.signal);let W={...g,signal:z,...L};k=new C(Hl(k)),W.headers=(yield t(k,{getState:R,arg:S,extra:F,endpoint:x,forced:I,type:w,extraOptions:b}))||k;let G=ee=>typeof ee=="object"&&(Xe(ee)||Array.isArray(ee)||typeof ee.toJSON=="function");if(!W.headers.has("content-type")&&G(W.body)&&W.headers.set("content-type",i),G(W.body)&&o(W.headers)&&(W.body=JSON.stringify(W.body,a)),P){let ee=~M.indexOf("?")?"&":"?",ie=n?n(P):new URLSearchParams(Hl(P));M+=ee+ie}M=ov(e,M);let Y=new Request(M,W);E={request:new Request(M,W)};let Z,fe=!1,we=B&&setTimeout(()=>{fe=!0,B.abort()},_);try{Z=yield r(Y)}catch(ee){return{error:{status:fe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ee)},meta:E}}finally{we&&clearTimeout(we),B?.signal.removeEventListener("abort",B.abort)}let Me=Z.clone();E.response=Me;let ue,se="";try{let ee;if(yield Promise.all([h(Z,O).then(ie=>ue=ie,ie=>ee=ie),Me.text().then(ie=>se=ie,()=>{})]),ee)throw ee}catch(ee){return{error:{status:"PARSING_ERROR",originalStatus:Z.status,data:se,error:String(ee)},meta:E}}return j(Z,ue)?{data:ue,meta:E}:{error:{status:Z.status,data:ue},meta:E}});return function(_x33,_x34,_x35){return _ref18.apply(this,arguments)}}());function h(_x36,_x37){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,y){if(typeof y=="function")return y(S);if(y==="content-type"&&(y=o(S.headers)?"json":"text"),y==="json"){let b=yield S.text();return b.length?JSON.parse(b):null}return S.text()});return _h2.apply(this,arguments)}}var Vr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function cv(){return _cv.apply(this,arguments)}function _cv(){_cv=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _cv.apply(this,arguments)}function uv(e,t){throw Object.assign(new Vr({error:e,meta:t}),{throwImmediately:!0})}var zl={},lv=(e,t)=>(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(r,n,o){let i=[5,(t||zl).maxRetries,(o||zl).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:cv,retryCondition:(g,h,{attempt:S})=>S<=a,...t,...o},s=0;for(;;)try{let g=yield e(r,n,o);if(g.error)throw new Vr(g);return g}catch(g){if(s++,g.throwImmediately){if(g instanceof Vr)return g.value;throw g}if(g instanceof Vr&&!f.retryCondition(g.value.error,r,{attempt:s,baseQueryApi:n,extraOptions:o}))return g.value;yield f.backoff(s,f.maxRetries)}});return function(_x38,_x39,_x40){return _ref19.apply(this,arguments)}}()),rd=Object.assign(lv,{fail:uv}),gs=T("__rtkq/focused"),nd=T("__rtkq/unfocused"),ys=T("__rtkq/online"),od=T("__rtkq/offline");function hs(e){return e.type==="query"}function dv(e){return e.type==="mutation"}function Ss(e){return e.type==="infinitequery"}function vs(e,t,r,n,o,i){return pv(e)?e(t,r,n,o).filter(oi).map(ps).map(i):Array.isArray(e)?e.map(ps).map(i):[]}function pv(e){return typeof e=="function"}function ps(e){return typeof e=="string"?{type:e}:e}function fv(e,t){return e.catch(t)}var qn=Symbol("forceQueryFn"),fs=e=>typeof e[qn]=="function";function mv({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,m=new Map,{unsubscribeQueryResult:f,removeMutationResult:s,updateSubscriptionOptions:g}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:I,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:y,getRunningMutationsThunk:b};function h(E,M){return k=>{let P=i.endpointDefinitions[E],O=e({queryArgs:M,endpointDefinition:P,endpointName:E});return a.get(k)?.[O]}}function S(E,M){return k=>m.get(k)?.[M]}function y(){return E=>Object.values(a.get(E)||{}).filter(oi)}function b(){return E=>Object.values(m.get(E)||{}).filter(oi)}function R(E){}function F(E,M){let k=(P,{subscribe:O=!0,forceRefetch:j,subscriptionOptions:_,[qn]:L,...B}={})=>(z,W)=>{let G=e({queryArgs:P,endpointDefinition:M,endpointName:E}),Y,te={...B,type:"query",subscribe:O,forceRefetch:j,subscriptionOptions:_,endpointName:E,originalArgs:P,queryCacheKey:G,[qn]:L};if(hs(M))Y=t(te);else{let{direction:pe,initialPageParam:en}=B;Y=r({...te,direction:pe,initialPageParam:en})}let Z=o.endpoints[E].select(P),fe=z(Y),we=Z(W());let{requestId:Me,abort:ue}=fe,se=we.requestId!==Me,ee=a.get(z)?.[G],ie=()=>Z(W()),Pe=Object.assign(L?fe.then(ie):se&&!ee?Promise.resolve(we):Promise.all([ee,fe]).then(ie),{arg:P,requestId:Me,subscriptionOptions:_,queryCacheKey:G,abort:ue,unwrap(){return _asyncToGenerator(function*(){let pe=yield Pe;if(pe.isError)throw pe.error;return pe.data})()},refetch:()=>z(k(P,{subscribe:!1,forceRefetch:!0})),unsubscribe(){O&&z(f({queryCacheKey:G,requestId:Me}))},updateSubscriptionOptions(pe){Pe.subscriptionOptions=pe,z(g({endpointName:E,requestId:Me,queryCacheKey:G,options:pe}))}});if(!ee&&!se&&!L){let pe=iv(a,z,{});pe[G]=Pe,Pe.then(()=>{delete pe[G],_r(pe)||a.delete(z)})}return Pe};return k}function x(E,M){return F(E,M)}function I(E,M){return F(E,M)}function w(E){return(M,{track:k=!0,fixedCacheKey:P}={})=>(O,j)=>{let _=n({type:"mutation",endpointName:E,originalArgs:M,track:k,fixedCacheKey:P}),L=O(_);let{requestId:B,abort:z,unwrap:W}=L,G=fv(L.unwrap().then(fe=>({data:fe})),fe=>({error:fe})),Y=()=>{O(s({requestId:B,fixedCacheKey:P}))},te=Object.assign(G,{arg:L.arg,requestId:B,abort:z,unwrap:W,reset:Y}),Z=m.get(O)||{};return m.set(O,Z),Z[B]=te,te.then(()=>{delete Z[B],_r(Z)||m.delete(O)}),P&&(Z[P]=te,te.then(()=>{Z[P]===te&&(delete Z[P],_r(Z)||m.delete(O))})),te}}}function gv(e){return e}var ri=(e={})=>({...e,[An]:!0});function yv({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let m=(O,j,_,L)=>(B,z)=>{let W=r[O],G=n({queryArgs:j,endpointDefinition:W,endpointName:O});if(B(o.internalActions.queryResultPatched({queryCacheKey:G,patches:_})),!L)return;let Y=o.endpoints[O].select(j)(z()),te=vs(W.providesTags,Y.data,void 0,j,{},i);B(o.internalActions.updateProvidedBy({queryCacheKey:G,providedTags:te}))};function f(O,j,_=0){let L=[j,...O];return _&&L.length>_?L.slice(0,-1):L}function s(O,j,_=0){let L=[...O,j];return _&&L.length>_?L.slice(1):L}let g=(O,j,_,L=!0)=>(B,z)=>{let G=o.endpoints[O].select(j)(z()),Y={patches:[],inversePatches:[],undo:()=>B(o.util.patchQueryData(O,j,Y.inversePatches,L))};if(G.status==="uninitialized")return Y;let te;if("data"in G)if(De(G.data)){let[Z,fe,we]=go(G.data,_);Y.patches.push(...fe),Y.inversePatches.push(...we),te=Z}else te=_(G.data),Y.patches.push({op:"replace",path:[],value:te}),Y.inversePatches.push({op:"replace",path:[],value:G.data});return Y.patches.length===0||B(o.util.patchQueryData(O,j,Y.patches,L)),Y},h=(O,j,_)=>L=>L(o.endpoints[O].initiate(j,{subscribe:!1,forceRefetch:!0,[qn]:()=>({data:_})})),S=(O,j)=>O.query&&O[j]?O[j]:gv,y=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(O,{signal:j,abort:_,rejectWithValue:L,fulfillWithValue:B,dispatch:z,getState:W,extra:G}){let Y=r[O.endpointName];try{let te=S(Y,"transformResponse"),Z={signal:j,abort:_,dispatch:z,getState:W,extra:G,endpoint:O.endpointName,type:O.type,forced:O.type==="query"?b(O,W()):void 0,queryCacheKey:O.type==="query"?O.queryCacheKey:void 0},fe=O.type==="query"?O[qn]:void 0,we,Me=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(se,ee,ie,Pe){if(ee==null&&se.pages.length)return Promise.resolve({data:se});let pe={queryArg:O.originalArgs,pageParam:ee},en=yield ue(pe),gt=Pe?f:s;return{data:{pages:gt(se.pages,en.data,ie),pageParams:gt(se.pageParams,ee,ie)}}});return function Me(_x43,_x44,_x45,_x46){return _ref21.apply(this,arguments)}}();function ue(_x47){return _ue.apply(this,arguments)}function _ue(){_ue=_asyncToGenerator(function*(se){let ee,{extraOptions:ie}=Y;if(fe?ee=fe():Y.query?ee=yield t(Y.query(se),Z,ie):ee=yield Y.queryFn(se,Z,ie,pe=>t(pe,Z,ie)),typeof process<"u",ee.error)throw new Vr(ee.error,ee.meta);let Pe=yield te(ee.data,ee.meta,se);return{...ee,data:Pe}});return _ue.apply(this,arguments)}if(O.type==="query"&&"infiniteQueryOptions"in Y){let{infiniteQueryOptions:se}=Y,{maxPages:ee=1/0}=se,ie,Pe={pages:[],pageParams:[]},pe=a.selectQueryEntry(W(),O.queryCacheKey)?.data,gt=b(O,W())&&!O.direction||!pe?Pe:pe;if("direction"in O&&O.direction&>.pages.length){let Gn=O.direction==="backward",Hi=(Gn?id:ms)(se,gt);ie=yield Me(gt,Hi,ee,Gn)}else{let{initialPageParam:Gn=se.initialPageParam}=O,$i=pe?.pageParams??[],Hi=$i[0]??Gn,em=$i.length;ie=yield Me(gt,Hi,ee),fe&&(ie={data:ie.data.pages[0]});for(let ac=1;ac<em;ac++){let tm=ms(se,ie.data);ie=yield Me(ie.data,tm,ee)}}we=ie}else we=yield ue(O.originalArgs);return B(we.data,ri({fulfilledTimeStamp:Date.now(),baseQueryMeta:we.meta}))}catch(te){let Z=te;if(Z instanceof Vr){let fe=S(Y,"transformErrorResponse");try{return L(yield fe(Z.value,Z.meta,O.originalArgs),ri({baseQueryMeta:Z.meta}))}catch(we){Z=we}}throw typeof process<"u",console.error(Z),Z}});return function y(_x41,_x42){return _ref20.apply(this,arguments)}}();function b(O,j){let _=a.selectQueryEntry(j,O.queryCacheKey),L=a.selectConfig(j).refetchOnMountOrArgChange,B=_?.fulfilledTimeStamp,z=O.forceRefetch??(O.subscribe&&L);return z?z===!0||(Number(new Date)-Number(B))/1e3>=z:!1}let R=()=>re(`${e}/executeQuery`,y,{getPendingMeta({arg:j}){let _=r[j.endpointName];return ri({startedTimeStamp:Date.now(),...(Ss(_)?{direction:j.direction}:{})})},condition(j,{getState:_}){let L=_(),B=a.selectQueryEntry(L,j.queryCacheKey),z=B?.fulfilledTimeStamp,W=j.originalArgs,G=B?.originalArgs,Y=r[j.endpointName],te=j.direction;return fs(j)?!0:B?.status==="pending"?!1:b(j,L)||hs(Y)&&Y?.forceRefetch?.({currentArg:W,previousArg:G,endpointState:B,state:L})?!0:!(z&&!te)},dispatchConditionRejection:!0}),F=R(),x=R(),I=re(`${e}/executeMutation`,y,{getPendingMeta(){return ri({startedTimeStamp:Date.now()})}}),w=O=>"force"in O,E=O=>"ifOlderThan"in O,M=(O,j,_)=>(L,B)=>{let z=w(_)&&_.force,W=E(_)&&_.ifOlderThan,G=(te=!0)=>{let Z={forceRefetch:te,isPrefetch:!0};return o.endpoints[O].initiate(j,Z)},Y=o.endpoints[O].select(j)(B());if(z)L(G());else if(W){let te=Y?.fulfilledTimeStamp;if(!te){L(G());return}(Number(new Date)-Number(new Date(te)))/1e3>=W&&L(G())}else L(G(!1))};function k(O){return j=>j?.meta?.arg?.endpointName===O}function P(O,j){return{matchPending:yr(vo(O),k(j)),matchFulfilled:yr(ct(O),k(j)),matchRejected:yr(Wt(O),k(j))}}return{queryThunk:F,mutationThunk:I,infiniteQueryThunk:x,prefetch:M,updateQueryData:g,upsertQueryData:h,patchQueryData:m,buildMatchThunkActions:P}}function ms(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function id(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function ad(e,t,r,n){return vs(r[e.meta.arg.endpointName][t],ct(e)?e.payload:void 0,bn(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function ni(e,t,r){let n=e[t];n&&r(n)}function Mn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Gl(e,t,r){let n=e[Mn(t)];n&&r(n)}var Tn={};function hv({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:m},assertTagType:f,config:s}){let g=T(`${e}/resetApiState`);function h(k,P,O,j){var _;k[_=P.queryCacheKey]??(k[_]={status:"uninitialized",endpointName:P.endpointName}),ni(k,P.queryCacheKey,L=>{L.status="pending",L.requestId=O&&L.requestId?L.requestId:j.requestId,P.originalArgs!==void 0&&(L.originalArgs=P.originalArgs),L.startedTimeStamp=j.startedTimeStamp;let B=o[j.arg.endpointName];Ss(B)&&"direction"in P&&(L.direction=P.direction)})}function S(k,P,O,j){ni(k,P.arg.queryCacheKey,_=>{if(_.requestId!==P.requestId&&!j)return;let{merge:L}=o[P.arg.endpointName];if(_.status="fulfilled",L){if(_.data!==void 0){let{fulfilledTimeStamp:B,arg:z,baseQueryMeta:W,requestId:G}=P,Y=st(_.data,te=>L(te,O,{arg:z.originalArgs,baseQueryMeta:W,fulfilledTimeStamp:B,requestId:G}));_.data=Y}else _.data=O;}else _.data=o[P.arg.endpointName].structuralSharing??!0?ed(Ne(_.data)?wa(_.data):_.data,O):O;delete _.error,_.fulfilledTimeStamp=P.fulfilledTimeStamp})}let y=Yt({name:`${e}/queries`,initialState:Tn,reducers:{removeQueryResult:{reducer(k,{payload:{queryCacheKey:P}}){delete k[P]},prepare:hr()},cacheEntriesUpserted:{reducer(k,P){for(let O of P.payload){let{queryDescription:j,value:_}=O;h(k,j,!0,{arg:j,requestId:P.meta.requestId,startedTimeStamp:P.meta.timestamp}),S(k,{arg:j,requestId:P.meta.requestId,fulfilledTimeStamp:P.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:k=>({payload:k.map(j=>{let{endpointName:_,arg:L,value:B}=j,z=o[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:j.arg,queryCacheKey:n({queryArgs:L,endpointDefinition:z,endpointName:_})},value:B}}),meta:{[An]:!0,requestId:Co(),timestamp:Date.now()}})},queryResultPatched:{reducer(k,{payload:{queryCacheKey:P,patches:O}}){ni(k,P,j=>{j.data=Ra(j.data,O.concat())})},prepare:hr()}},extraReducers(k){k.addCase(t.pending,(P,{meta:O,meta:{arg:j}})=>{let _=fs(j);h(P,j,_,O)}).addCase(t.fulfilled,(P,{meta:O,payload:j})=>{let _=fs(O.arg);S(P,O,j,_)}).addCase(t.rejected,(P,{meta:{condition:O,arg:j,requestId:_},error:L,payload:B})=>{ni(P,j.queryCacheKey,z=>{if(!O){if(z.requestId!==_)return;z.status="rejected",z.error=B??L}})}).addMatcher(m,(P,O)=>{let{queries:j}=a(O);for(let[_,L]of Object.entries(j))(L?.status==="fulfilled"||L?.status==="rejected")&&(P[_]=L)})}}),b=Yt({name:`${e}/mutations`,initialState:Tn,reducers:{removeMutationResult:{reducer(k,{payload:P}){let O=Mn(P);O in k&&delete k[O]},prepare:hr()}},extraReducers(k){k.addCase(r.pending,(P,{meta:O,meta:{requestId:j,arg:_,startedTimeStamp:L}})=>{_.track&&(P[Mn(O)]={requestId:j,status:"pending",endpointName:_.endpointName,startedTimeStamp:L})}).addCase(r.fulfilled,(P,{payload:O,meta:j})=>{j.arg.track&&Gl(P,j,_=>{_.requestId===j.requestId&&(_.status="fulfilled",_.data=O,_.fulfilledTimeStamp=j.fulfilledTimeStamp)})}).addCase(r.rejected,(P,{payload:O,error:j,meta:_})=>{_.arg.track&&Gl(P,_,L=>{L.requestId===_.requestId&&(L.status="rejected",L.error=O??j)})}).addMatcher(m,(P,O)=>{let{mutations:j}=a(O);for(let[_,L]of Object.entries(j))(L?.status==="fulfilled"||L?.status==="rejected")&&_!==L?.requestId&&(P[_]=L)})}}),R=Yt({name:`${e}/invalidation`,initialState:Tn,reducers:{updateProvidedBy:{reducer(k,P){var _,L;let{queryCacheKey:O,providedTags:j}=P.payload;for(let B of Object.values(k))for(let z of Object.values(B)){let W=z.indexOf(O);W!==-1&&z.splice(W,1)}for(let{type:B,id:z}of j){let W=(_=k[B]??(k[B]={}))[L=z||"__internal_without_id"]??(_[L]=[]);W.includes(O)||W.push(O)}},prepare:hr()}},extraReducers(k){k.addCase(y.actions.removeQueryResult,(P,{payload:{queryCacheKey:O}})=>{for(let j of Object.values(P))for(let _ of Object.values(j)){let L=_.indexOf(O);L!==-1&&_.splice(L,1)}}).addMatcher(m,(P,O)=>{var _,L;let{provided:j}=a(O);for(let[B,z]of Object.entries(j))for(let[W,G]of Object.entries(z)){let Y=(_=P[B]??(P[B]={}))[L=W||"__internal_without_id"]??(_[L]=[]);for(let te of G)Y.includes(te)||Y.push(te)}}).addMatcher(Ze(ct(t),bn(t)),(P,O)=>{let j=ad(O,"providesTags",o,f),{queryCacheKey:_}=O.meta.arg;R.caseReducers.updateProvidedBy(P,R.actions.updateProvidedBy({queryCacheKey:_,providedTags:j}))})}}),F=Yt({name:`${e}/subscriptions`,initialState:Tn,reducers:{updateSubscriptionOptions(k,P){},unsubscribeQueryResult(k,P){},internal_getRTKQSubscriptions(){}}}),x=Yt({name:`${e}/internalSubscriptions`,initialState:Tn,reducers:{subscriptionsUpdated:{reducer(k,P){return Ra(k,P.payload)},prepare:hr()}}}),I=Yt({name:`${e}/config`,initialState:{online:tv(),focused:ev(),middlewareRegistered:!1,...s},reducers:{middlewareRegistered(k,{payload:P}){k.middlewareRegistered=k.middlewareRegistered==="conflict"||i!==P?"conflict":!0}},extraReducers:k=>{k.addCase(ys,P=>{P.online=!0}).addCase(od,P=>{P.online=!1}).addCase(gs,P=>{P.focused=!0}).addCase(nd,P=>{P.focused=!1}).addMatcher(m,P=>({...P}))}}),w=pr({queries:y.reducer,mutations:b.reducer,provided:R.reducer,subscriptions:x.reducer,config:I.reducer}),E=(k,P)=>w(g.match(P)?void 0:k,P),M={...I.actions,...y.actions,...F.actions,...x.actions,...b.actions,...R.actions,resetApiState:g};return{reducer:E,actions:M}}var Dn=Symbol.for("RTKQ/skipToken"),sd={status:"uninitialized"},Wl=st(sd,()=>{}),Yl=st(sd,()=>{});function Sv({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>Wl,o=w=>Yl;return{buildQuerySelector:S,buildInfiniteQuerySelector:y,buildMutationSelector:b,selectInvalidatedBy:R,selectCachedArgsForQuery:F,selectApiState:a,selectQueries:m,selectMutations:s,selectQueryEntry:f,selectConfig:g};function i(w){return{...w,...Ul(w.status)}}function a(w){return w[t]}function m(w){return a(w)?.queries}function f(w,E){return m(w)?.[E]}function s(w){return a(w)?.mutations}function g(w){return a(w)?.config}function h(w,E,M){return k=>{if(k===Dn)return r(n,M);let P=e({queryArgs:k,endpointDefinition:E,endpointName:w});return r(j=>f(j,P)??Wl,M)}}function S(w,E){return h(w,E,i)}function y(w,E){let{infiniteQueryOptions:M}=E;function k(P){let O={...P,...Ul(P.status)},{isLoading:j,isError:_,direction:L}=O,B=L==="forward",z=L==="backward";return{...O,hasNextPage:x(M,O.data),hasPreviousPage:I(M,O.data),isFetchingNextPage:j&&B,isFetchingPreviousPage:j&&z,isFetchNextPageError:_&&B,isFetchPreviousPageError:_&&z}}return h(w,E,k)}function b(){return w=>{let E;return typeof w=="object"?E=Mn(w)??Dn:E=w,r(E===Dn?o:P=>a(P)?.mutations?.[E]??Yl,i)}}function R(w,E){let M=w[t],k=new Set;for(let P of E.filter(oi).map(ps)){let O=M.provided[P.type];if(!O)continue;let j=(P.id!==void 0?O[P.id]:Bl(Object.values(O)))??[];for(let _ of j)k.add(_)}return Bl(Array.from(k.values()).map(P=>{let O=M.queries[P];return O?[{queryCacheKey:P,endpointName:O.endpointName,originalArgs:O.originalArgs}]:[]}))}function F(w,E){return Object.values(m(w)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function x(w,E){return E?ms(w,E)!=null:!1}function I(w,E){return!E||!w.getPreviousPageParam?!1:id(w,E)!=null}}var Kl=WeakMap?new WeakMap:void 0,Jl=({endpointName:e,queryArgs:t})=>{let r="",n=Kl?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Xe(a)?Object.keys(a).sort().reduce((m,f)=>(m[f]=a[f],m),{}):a,a));Xe(t)&&Kl?.set(t,o),r=o}return`${e}(${r})`};function vv(...e){return function(r){let n=gr(s=>r.extractRehydrationInfo?.(s,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(s){let g=Jl;if("serializeQueryArgs"in s.endpointDefinition){let h=s.endpointDefinition.serializeQueryArgs;g=S=>{let y=h(S);return typeof y=="string"?y:Jl({...S,queryArgs:y})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(s)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(s){s()},apiUid:Co(),extractRehydrationInfo:n,hasRehydrationInfo:gr(s=>n(s)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:s,endpoints:g}){if(s)for(let h of s)o.tagTypes.includes(h)||o.tagTypes.push(h);if(g)for(let[h,S]of Object.entries(g))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},m=e.map(s=>s.init(a,o,i));function f(s){let g=s.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(g)){if(s.overrideExisting!==!0&&h in i.endpointDefinitions){if(s.overrideExisting==="throw")throw new Error(Ge(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let y of m)y.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ft(e,...t){return Object.assign(e,...t)}var Av=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:m}=e.internalActions,f=(y,b)=>{var F,x;if(a.match(b)){let{queryCacheKey:I,requestId:w,options:E}=b.payload;return y?.[I]?.[w]&&(y[I][w]=E),!0}if(m.match(b)){let{queryCacheKey:I,requestId:w}=b.payload;return y[I]&&delete y[I][w],!0}if(e.internalActions.removeQueryResult.match(b))return delete y[b.payload.queryCacheKey],!0;if(t.pending.match(b)){let{meta:{arg:I,requestId:w}}=b,E=y[F=I.queryCacheKey]??(y[F]={});return E[`${w}_running`]={},I.subscribe&&(E[w]=I.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(b)||t.rejected.match(b)){let I=y[b.meta.arg.queryCacheKey]||{},w=`${b.meta.requestId}_running`;R||(R=!!I[w]),delete I[w]}if(t.rejected.match(b)){let{meta:{condition:I,arg:w,requestId:E}}=b;if(I&&w.subscribe){let M=y[x=w.queryCacheKey]??(y[x]={});M[E]=w.subscriptionOptions??M[E]??{},R=!0}}return R},s=()=>r.currentSubscriptions,S={getSubscriptions:s,getSubscriptionCount:y=>{let R=s()[y]??{};return _r(R)},isRequestSubscribed:(y,b)=>!!s()?.[y]?.[b]};return(y,b)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(y))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(y))return[!1,S];let R=f(r.currentSubscriptions,y),F=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=go(o,()=>w);b.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof y.type=="string"&&!!y.type.startsWith(n),I=t.rejected.match(y)&&y.meta.condition&&!!y.meta.arg.subscribe;F=!x&&!I}return[F,!1]}};function Cv(e){for(let t in e)return!1;return!0}var bv=2147483647/1e3-1,wv=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:m,unsubscribeQueryResult:f,cacheEntriesUpserted:s}=t.internalActions,g=Ze(f.match,r.fulfilled,r.rejected,s.match);function h(F){let x=o.currentSubscriptions[F];return!!x&&!Cv(x)}let S={},y=(F,x,I)=>{let w=x.getState(),E=a(w);if(g(F)){let M;if(s.match(F))M=F.payload.map(k=>k.queryDescription.queryCacheKey);else{let{queryCacheKey:k}=f.match(F)?F.payload:F.meta.arg;M=[k]}b(M,x,E)}if(t.util.resetApiState.match(F))for(let[M,k]of Object.entries(S))k&&clearTimeout(k),delete S[M];if(n.hasRehydrationInfo(F)){let{queries:M}=n.extractRehydrationInfo(F);b(Object.keys(M),x,E)}};function b(F,x,I){let w=x.getState();for(let E of F){let M=i(w,E);R(E,M?.endpointName,x,I)}}function R(F,x,I,w){let M=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(M===1/0)return;let k=Math.max(0,Math.min(M,bv));if(!h(F)){let P=S[F];P&&clearTimeout(P),S[F]=setTimeout(()=>{h(F)||I.dispatch(m({queryCacheKey:F})),delete S[F]},k*1e3)}}return y},Xl=new Error("Promise never resolved before cacheEntryRemoved."),xv=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:m}})=>{let f=Ao(n),s=Ao(o),g=ct(n,o),h={};function S(x,I,w){let E=h[x];E?.valueResolved&&(E.valueResolved({data:I,meta:w}),delete E.valueResolved)}function y(x){let I=h[x];I&&(delete h[x],I.cacheEntryRemoved())}let b=(x,I,w)=>{let E=R(x);function M(k,P,O,j){let _=a(w,P),L=a(I.getState(),P);!_&&L&&F(k,j,P,I,O)}if(n.pending.match(x))M(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:k,value:P}of x.payload){let{endpointName:O,originalArgs:j,queryCacheKey:_}=k;M(O,_,x.meta.requestId,j),S(_,P,{})}else if(o.pending.match(x))I.getState()[t].mutations[E]&&F(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,I,x.meta.requestId);else if(g(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))y(E);else if(e.util.resetApiState.match(x))for(let k of Object.keys(h))y(k)};function R(x){return f(x)?x.meta.arg.queryCacheKey:s(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?Mn(x.payload):""}function F(x,I,w,E,M){let k=r.endpointDefinitions[x],P=k?.onCacheEntryAdded;if(!P)return;let O={},j=new Promise(G=>{O.cacheEntryRemoved=G}),_=Promise.race([new Promise(G=>{O.valueResolved=G}),j.then(()=>{throw Xl})]);_.catch(()=>{}),h[w]=O;let L=e.endpoints[x].select(k.type==="query"?I:w),B=E.dispatch((G,Y,te)=>te),z={...E,getCacheEntry:()=>L(E.getState()),requestId:M,extra:B,updateCachedData:k.type==="query"?G=>E.dispatch(e.util.updateQueryData(x,I,G)):void 0,cacheDataLoaded:_,cacheEntryRemoved:j},W=P(I,z);Promise.resolve(W).catch(G=>{if(G!==Xl)throw G})}return b},Rv=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Ev=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:m,internalState:f})=>{let{removeQueryResult:s}=i.internalActions,g=Ze(ct(n),bn(n)),h=Ze(ct(n,o),Wt(n,o)),S=[],y=(F,x)=>{g(F)?R(ad(F,"invalidatesTags",r,a),x):h(F)?R([],x):i.util.invalidateTags.match(F)&&R(vs(F.payload,void 0,void 0,void 0,void 0,a),x)};function b(F){let{queries:x,mutations:I}=F;for(let w of[x,I])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(F,x){let I=x.getState(),w=I[e];if(S.push(...F),w.config.invalidationBehavior==="delayed"&&b(w))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(I,E);t.batch(()=>{let k=Array.from(M.values());for(let{queryCacheKey:P}of k){let O=w.queries[P],j=f.currentSubscriptions[P]??{};O&&(_r(j)===0?x.dispatch(s({queryCacheKey:P})):O.status!=="uninitialized"&&x.dispatch(m(O)))}})}return y},Iv=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(y,b)=>{(r.internalActions.updateSubscriptionOptions.match(y)||r.internalActions.unsubscribeQueryResult.match(y))&&s(y.payload,b),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&s(y.meta.arg,b),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&f(y.meta.arg,b),r.util.resetApiState.match(y)&&h()};function m(y,b){let F=b.getState()[e].queries[y],x=o.currentSubscriptions[y];if(!(!F||F.status==="uninitialized"))return x}function f({queryCacheKey:y},b){let R=b.getState()[e],F=R.queries[y],x=o.currentSubscriptions[y];if(!F||F.status==="uninitialized")return;let{lowestPollingInterval:I,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(I))return;let E=i[y];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+I;i[y]={nextPollTimestamp:M,pollingInterval:I,timeout:setTimeout(()=>{(R.config.focused||!w)&&b.dispatch(n(F)),f({queryCacheKey:y},b)},I)}}function s({queryCacheKey:y},b){let F=b.getState()[e].queries[y],x=o.currentSubscriptions[y];if(!F||F.status==="uninitialized")return;let{lowestPollingInterval:I}=S(x);if(!Number.isFinite(I)){g(y);return}let w=i[y],E=Date.now()+I;(!w||E<w.nextPollTimestamp)&&f({queryCacheKey:y},b)}function g(y){let b=i[y];b?.timeout&&clearTimeout(b.timeout),delete i[y]}function h(){for(let y of Object.keys(i))g(y)}function S(y={}){let b=!1,R=Number.POSITIVE_INFINITY;for(let F in y)y[F].pollingInterval&&(R=Math.min(y[F].pollingInterval,R),b=y[F].skipPollingIfUnfocused||b);return{lowestPollingInterval:R,skipPollingIfUnfocused:b}}return a},Fv=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=vo(r,n),i=Wt(r,n),a=ct(r,n),m={};return(s,g)=>{if(o(s)){let{requestId:h,arg:{endpointName:S,originalArgs:y}}=s.meta,b=t.endpointDefinitions[S],R=b?.onQueryStarted;if(R){let F={},x=new Promise((M,k)=>{F.resolve=M,F.reject=k});x.catch(()=>{}),m[h]=F;let I=e.endpoints[S].select(b.type==="query"?y:h),w=g.dispatch((M,k,P)=>P),E={...g,getCacheEntry:()=>I(g.getState()),requestId:h,extra:w,updateCachedData:b.type==="query"?M=>g.dispatch(e.util.updateQueryData(S,y,M)):void 0,queryFulfilled:x};R(y,E)}}else if(a(s)){let{requestId:h,baseQueryMeta:S}=s.meta;m[h]?.resolve({data:s.payload,meta:S}),delete m[h]}else if(i(s)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:y}=s.meta;m[h]?.reject({error:s.payload??s.error,isUnhandledError:!S,meta:y}),delete m[h]}}},Pv=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,s)=>{gs.match(f)&&m(s,"refetchOnFocus"),ys.match(f)&&m(s,"refetchOnReconnect")};function m(f,s){let g=f.getState()[e],h=g.queries,S=o.currentSubscriptions;t.batch(()=>{for(let y of Object.keys(S)){let b=h[y],R=S[y];if(!R||!b)continue;(Object.values(R).some(x=>x[s]===!0)||Object.values(R).every(x=>x[s]===void 0)&&g.config[s])&&(_r(R)===0?f.dispatch(i({queryCacheKey:y})):b.status!=="uninitialized"&&f.dispatch(n(b)))}})}return a};function kv(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},m=h=>h.type.startsWith(`${t}/`),f=[Rv,wv,Ev,Iv,xv,Fv];return{middleware:h=>{let S=!1,b={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:m},R=f.map(I=>I(b)),F=Av(b),x=Pv(b);return I=>w=>{if(!co(w))return I(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:I},M=h.getState(),[k,P]=F(w,E,M),O;if(k?O=I(w):O=P,h.getState()[t]&&(x(w,E,M),m(w)||o.hasRehydrationInfo(w)))for(let j of R)j(w,E,M);return O}},actions:a};function g(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Zl=Symbol(),Ov=({createSelector:e=de}={})=>({name:Zl,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:m,refetchOnFocus:f,refetchOnReconnect:s,invalidationBehavior:g},h){uu();let S=ue=>(typeof process<"u",ue);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:ys,onOffline:od,onFocus:gs,onFocusLost:nd},util:{}});let y=Sv({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:b,selectCachedArgsForQuery:R,buildQuerySelector:F,buildInfiniteQuerySelector:x,buildMutationSelector:I}=y;ft(t.util,{selectInvalidatedBy:b,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:k,updateQueryData:P,upsertQueryData:O,prefetch:j,buildMatchThunkActions:_}=yv({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:y}),{reducer:L,actions:B}=hv({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:f,refetchOnReconnect:s,refetchOnMountOrArgChange:m,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});ft(t.util,{patchQueryData:k,updateQueryData:P,upsertQueryData:O,prefetch:j,resetApiState:B.resetApiState,upsertQueryEntries:B.cacheEntriesUpserted}),ft(t.internalActions,B);let{middleware:z,actions:W}=kv({reducerPath:o,context:h,queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:y});ft(t.util,W),ft(t,{reducer:L,middleware:z});let{buildInitiateQuery:G,buildInitiateInfiniteQuery:Y,buildInitiateMutation:te,getRunningMutationThunk:Z,getRunningMutationsThunk:fe,getRunningQueriesThunk:we,getRunningQueryThunk:Me}=mv({queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return ft(t.util,{getRunningMutationThunk:Z,getRunningMutationsThunk:fe,getRunningQueryThunk:Me,getRunningQueriesThunk:we}),{name:Zl,injectEndpoint(ue,se){var Pe;let ie=(Pe=t.endpoints)[ue]??(Pe[ue]={});hs(se)&&ft(ie,{name:ue,select:F(ue,se),initiate:G(ue,se)},_(w,ue)),dv(se)&&ft(ie,{name:ue,select:I(),initiate:te(ue)},_(M,ue)),Ss(se)&&ft(ie,{name:ue,select:x(ue,se),initiate:Y(ue,se)},_(w,ue))}}}}),cd=vv(Ov());p();u();d();l();var ii=e=>e.query,ud=e=>e.query?.enableQuerySyntax;var wq=de(e=>ii(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),Tv=de(e=>e.generatedAnswer?.answerApiQueryParams,e=>e??Dn);p();u();d();l();p();u();d();l();var ai=e=>Fe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Xt(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Xt(t)??"",answerGenerated:e??!1})}),si=()=>Fe({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Xt(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});p();u();d();l();p();u();d();l();var ld=de(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});p();u();d();l();var ci=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:Ir(e)}});p();u();d();l();var dd=e=>e.context;p();u();d();l();var pd=e=>e.pipeline;p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var fd=60,md=fd*60,gd=md*24,Dv=gd*7,Zt=1e3,Lr=fd*Zt,As=md*Zt,yd=gd*Zt,hd=Dv*Zt,er="millisecond",Rt="second",_e="minute",Et="hour",Ve="day",Ur="week",be="month",tr="quarter",nt="year",It="date",Sd="YYYY-MM-DDTHH:mm:ssZ",Cs="Invalid Date",vd=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Ad=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;p();u();d();l();var bd={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var r=["th","st","nd","rd"],n=t%100;return"["+t+(r[(n-20)%10]||r[n]||r[0])+"]"}};p();u();d();l();var bs=function(t,r,n){var o=String(t);return!o||o.length>=r?t:""+Array(r+1-o.length).join(n)+t},qv=function(t){var r=-t.utcOffset(),n=Math.abs(r),o=Math.floor(n/60),i=n%60;return(r<=0?"+":"-")+bs(o,2,"0")+":"+bs(i,2,"0")},Mv=function e(t,r){if(t.date()<r.date())return-e(r,t);var n=(r.year()-t.year())*12+(r.month()-t.month()),o=t.clone().add(n,be),i=r-o<0,a=t.clone().add(n+(i?-1:1),be);return+(-(n+(r-o)/(i?o-a:a-o))||0)},Nv=function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},jv=function(t){var r={M:be,y:nt,w:Ur,d:Ve,D:It,h:Et,m:_e,s:Rt,ms:er,Q:tr};return r[t]||String(t||"").toLowerCase().replace(/s$/,"")},_v=function(t){return t===void 0},wd={s:bs,z:qv,m:Mv,a:Nv,p:jv,u:_v};var Nn="en",rr={};rr[Nn]=bd;var xd="$isDayjsObject",ws=function(t){return t instanceof li||!!(t&&t[xd])},ui=function e(t,r,n){var o;if(!t)return Nn;if(typeof t=="string"){var i=t.toLowerCase();rr[i]&&(o=i),r&&(rr[i]=r,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var m=t.name;rr[m]=t,o=m}return!n&&o&&(Nn=o),o||!n&&Nn},me=function(t,r){if(ws(t))return t.clone();var n=typeof r=="object"?r:{};return n.date=t,n.args=arguments,new li(n)},Vv=function(t,r){return me(t,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})},ae=wd;ae.l=ui;ae.i=ws;ae.w=Vv;var Lv=function(t){var r=t.date,n=t.utc;if(r===null)return new Date(NaN);if(ae.u(r))return new Date;if(r instanceof Date)return new Date(r);if(typeof r=="string"&&!/Z$/i.test(r)){var o=r.match(vd);if(o){var i=o[2]-1||0,a=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)}}return new Date(r)},li=function(){function e(r){this.$L=ui(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[xd]=!0}var t=e.prototype;return t.parse=function(n){this.$d=Lv(n),this.init()},t.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},t.$utils=function(){return ae},t.isValid=function(){return this.$d.toString()!==Cs},t.isSame=function(n,o){var i=me(n);return this.startOf(o)<=i&&i<=this.endOf(o)},t.isAfter=function(n,o){return me(n)<this.startOf(o)},t.isBefore=function(n,o){return this.endOf(o)<me(n)},t.$g=function(n,o,i){return ae.u(n)?this[o]:this.set(i,n)},t.unix=function(){return Math.floor(this.valueOf()/1e3)},t.valueOf=function(){return this.$d.getTime()},t.startOf=function(n,o){var i=this,a=ae.u(o)?!0:o,m=ae.p(n),f=function(x,I){var w=ae.w(i.$u?Date.UTC(i.$y,I,x):new Date(i.$y,I,x),i);return a?w:w.endOf(Ve)},s=function(x,I){var w=[0,0,0,0],E=[23,59,59,999];return ae.w(i.toDate()[x].apply(i.toDate("s"),(a?w:E).slice(I)),i)},g=this.$W,h=this.$M,S=this.$D,y="set"+(this.$u?"UTC":"");switch(m){case nt:return a?f(1,0):f(31,11);case be:return a?f(1,h):f(0,h+1);case Ur:{var b=this.$locale().weekStart||0,R=(g<b?g+7:g)-b;return f(a?S-R:S+(6-R),h)}case Ve:case It:return s(y+"Hours",0);case Et:return s(y+"Minutes",1);case _e:return s(y+"Seconds",2);case Rt:return s(y+"Milliseconds",3);default:return this.clone()}},t.endOf=function(n){return this.startOf(n,!1)},t.$set=function(n,o){var i,a=ae.p(n),m="set"+(this.$u?"UTC":""),f=(i={},i[Ve]=m+"Date",i[It]=m+"Date",i[be]=m+"Month",i[nt]=m+"FullYear",i[Et]=m+"Hours",i[_e]=m+"Minutes",i[Rt]=m+"Seconds",i[er]=m+"Milliseconds",i)[a],s=a===Ve?this.$D+(o-this.$W):o;if(a===be||a===nt){var g=this.clone().set(It,1);g.$d[f](s),g.init(),this.$d=g.set(It,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](s);return this.init(),this},t.set=function(n,o){return this.clone().$set(n,o)},t.get=function(n){return this[ae.p(n)]()},t.add=function(n,o){var i=this,a;n=Number(n);var m=ae.p(o),f=function(S){var y=me(i);return ae.w(y.date(y.date()+Math.round(S*n)),i)};if(m===be)return this.set(be,this.$M+n);if(m===nt)return this.set(nt,this.$y+n);if(m===Ve)return f(1);if(m===Ur)return f(7);var s=(a={},a[_e]=Lr,a[Et]=As,a[Rt]=Zt,a)[m]||1,g=this.$d.getTime()+n*s;return ae.w(g,this)},t.subtract=function(n,o){return this.add(n*-1,o)},t.format=function(n){var o=this,i=this.$locale();if(!this.isValid())return i.invalidDate||Cs;var a=n||Sd,m=ae.z(this),f=this.$H,s=this.$m,g=this.$M,h=i.weekdays,S=i.months,y=i.meridiem,b=function(w,E,M,k){return w&&(w[E]||w(o,a))||M[E].slice(0,k)},R=function(w){return ae.s(f%12||12,w,"0")},F=y||function(I,w,E){var M=I<12?"AM":"PM";return E?M.toLowerCase():M},x=function(w){switch(w){case"YY":return String(o.$y).slice(-2);case"YYYY":return ae.s(o.$y,4,"0");case"M":return g+1;case"MM":return ae.s(g+1,2,"0");case"MMM":return b(i.monthsShort,g,S,3);case"MMMM":return b(S,g);case"D":return o.$D;case"DD":return ae.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return b(i.weekdaysMin,o.$W,h,2);case"ddd":return b(i.weekdaysShort,o.$W,h,3);case"dddd":return h[o.$W];case"H":return String(f);case"HH":return ae.s(f,2,"0");case"h":return R(1);case"hh":return R(2);case"a":return F(f,s,!0);case"A":return F(f,s,!1);case"m":return String(s);case"mm":return ae.s(s,2,"0");case"s":return String(o.$s);case"ss":return ae.s(o.$s,2,"0");case"SSS":return ae.s(o.$ms,3,"0");case"Z":return m;default:break}return null};return a.replace(Ad,function(I,w){return w||x(I)||m.replace(":","")})},t.utcOffset=function(){return-Math.round(this.$d.getTimezoneOffset()/15)*15},t.diff=function(n,o,i){var a=this,m=ae.p(o),f=me(n),s=(f.utcOffset()-this.utcOffset())*Lr,g=this-f,h=function(){return ae.m(a,f)},S;switch(m){case nt:S=h()/12;break;case be:S=h();break;case tr:S=h()/3;break;case Ur:S=(g-s)/hd;break;case Ve:S=(g-s)/yd;break;case Et:S=g/As;break;case _e:S=g/Lr;break;case Rt:S=g/Zt;break;default:S=g;break}return i?S:ae.a(S)},t.daysInMonth=function(){return this.endOf(be).$D},t.$locale=function(){return rr[this.$L]},t.locale=function(n,o){if(!n)return this.$L;var i=this.clone(),a=ui(n,o,!0);return a&&(i.$L=a),i},t.clone=function(){return ae.w(this.$d,this)},t.toDate=function(){return new Date(this.valueOf())},t.toJSON=function(){return this.isValid()?this.toISOString():null},t.toISOString=function(){return this.$d.toISOString()},t.toString=function(){return this.$d.toUTCString()},e}(),Rd=li.prototype;me.prototype=Rd;[["$ms",er],["$s",Rt],["$m",_e],["$H",Et],["$W",Ve],["$M",be],["$y",nt],["$D",It]].forEach(function(e){Rd[e[1]]=function(t){return this.$g(t,e[0],e[1])}});me.extend=function(e,t){return e.$i||(e(t,li,me),e.$i=!0),me};me.locale=ui;me.isDayjs=ws;me.unix=function(e){return me(e*1e3)};me.en=rr[Nn];me.Ls=rr;me.p={};var Le=me;p();u();d();l();var Ed=function(e,t){var r=t.prototype;r.quarter=function(i){return this.$utils().u(i)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+(i-1)*3)};var n=r.add;r.add=function(i,a){i=Number(i);var m=this.$utils().p(a);return m===tr?this.add(i*3,be):n.bind(this)(i,a)};var o=r.startOf;r.startOf=function(i,a){var m=this.$utils(),f=m.u(a)?!0:a,s=m.p(i);if(s===tr){var g=this.quarter()-1;return f?this.month(g*3).startOf(be).startOf(Ve):this.month(g*3+2).endOf(be).endOf(Ve)}return o.bind(this)(i,a)}};p();u();d();l();p();u();d();l();p();u();d();l();var Uv=function(t){return t.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(r,n,o){return n||o.slice(1)})},Qv={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Id=function(t,r){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(n,o,i){var a=i&&i.toUpperCase();return o||r[i]||Qv[i]||Uv(r[a])})};var Bv=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,Fd=/\d/,jn=/\d\d/,$v=/\d{3}/,Hv=/\d{4}/,We=/\d\d?/,zv=/[+-]?\d+/,Gv=/[+-]\d\d:?(\d\d)?|Z/,_n=/\d*[^-_:/,()\s\d]+/,Ft={},Od=function(t){return t=+t,t+(t>68?1900:2e3)};function Wv(e){if(!e||e==="Z")return 0;var t=e.match(/([+-]|\d\d)/g),r=+(t[1]*60)+(+t[2]||0);return r===0?0:t[0]==="+"?-r:r}var Re=function(t){return function(r){this[t]=+r}},Pd=[Gv,function(e){var t=this.zone||(this.zone={});t.offset=Wv(e)}],xs=function(t){var r=Ft[t];return r&&(r.indexOf?r:r.s.concat(r.f))},kd=function(t,r){var n,o=Ft,i=o.meridiem;if(!i)n=t===(r?"pm":"PM");else for(var a=1;a<=24;a+=1)if(t.indexOf(i(a,0,r))>-1){n=a>12;break}return n},Yv={A:[_n,function(e){this.afternoon=kd(e,!1)}],a:[_n,function(e){this.afternoon=kd(e,!0)}],Q:[Fd,function(e){this.month=(e-1)*3+1}],S:[Fd,function(e){this.milliseconds=+e*100}],SS:[jn,function(e){this.milliseconds=+e*10}],SSS:[$v,function(e){this.milliseconds=+e}],s:[We,Re("seconds")],ss:[We,Re("seconds")],m:[We,Re("minutes")],mm:[We,Re("minutes")],H:[We,Re("hours")],h:[We,Re("hours")],HH:[We,Re("hours")],hh:[We,Re("hours")],D:[We,Re("day")],DD:[jn,Re("day")],Do:[_n,function(e){var t=Ft,r=t.ordinal,n=e.match(/\d+/);if(this.day=n[0],!!r)for(var o=1;o<=31;o+=1)r(o).replace(/\[|\]/g,"")===e&&(this.day=o)}],w:[We,Re("week")],ww:[jn,Re("week")],M:[We,Re("month")],MM:[jn,Re("month")],MMM:[_n,function(e){var t=xs("months"),r=xs("monthsShort"),n=(r||t.map(function(o){return o.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[_n,function(e){var t=xs("months"),r=t.indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],Y:[zv,Re("year")],YY:[jn,function(e){this.year=Od(e)}],YYYY:[Hv,Re("year")],Z:Pd,ZZ:Pd};function Kv(e){var t=e.afternoon;if(t!==void 0){var r=e.hours;t?r<12&&(e.hours+=12):r===12&&(e.hours=0),delete e.afternoon}}function Jv(e){e=Id(e,Ft&&Ft.formats);for(var t=e.match(Bv),r=t.length,n=0;n<r;n+=1){var o=t[n],i=Yv[o],a=i&&i[0],m=i&&i[1];m?t[n]={regex:a,parser:m}:t[n]=o.replace(/^\[|\]$/g,"")}return function(f){for(var s={},g=0,h=0;g<r;g+=1){var S=t[g];if(typeof S=="string")h+=S.length;else{var y=S.regex,b=S.parser,R=f.slice(h),F=y.exec(R),x=F[0];b.call(s,x),f=f.replace(x,"")}}return Kv(s),s}}var Xv=function(t,r,n,o){try{if(["x","X"].indexOf(r)>-1)return new Date((r==="X"?1e3:1)*t);var i=Jv(r),a=i(t),m=a.year,f=a.month,s=a.day,g=a.hours,h=a.minutes,S=a.seconds,y=a.milliseconds,b=a.zone,R=a.week,F=new Date,x=s||(!m&&!f?F.getDate():1),I=m||F.getFullYear(),w=0;m&&!f||(w=f>0?f-1:F.getMonth());var E=g||0,M=h||0,k=S||0,P=y||0;if(b)return new Date(Date.UTC(I,w,x,E,M,k,P+b.offset*60*1e3));if(n)return new Date(Date.UTC(I,w,x,E,M,k,P));var O;return O=new Date(I,w,x,E,M,k,P),R&&(O=o(O).week(R).toDate()),O}catch{return new Date("")}},Td=function(e,t,r){r.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(Od=e.parseTwoDigitYear);var n=t.prototype,o=n.parse;n.parse=function(i){var a=i.date,m=i.utc,f=i.args;this.$u=m;var s=f[1];if(typeof s=="string"){var g=f[2]===!0,h=f[3]===!0,S=g||h,y=f[2];h&&(y=f[2]),Ft=this.$locale(),!g&&y&&(Ft=r.Ls[y]),this.$d=Xv(a,s,m,r),this.init(),y&&y!==!0&&(this.$L=this.locale(y).$L),S&&a!=this.format(s)&&(this.$d=new Date("")),Ft={}}else if(s instanceof Array)for(var b=s.length,R=1;R<=b;R+=1){f[1]=s[R-1];var F=r.apply(this,f);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}R===b&&(this.$d=new Date(""))}else o.call(this,i)}};Le.extend(Td);var Dd="YYYY/MM/DD@HH:mm:ss",Zv="1401-01-01";function Qr(e,t){let r=Le(e,t);return!r.isValid()&&!t?Le(e,Dd):r}function di(e){return e.format(Dd)}function qd(e,t){let r=Qr(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}Rs(r)}function Rs(e){if(e.isBefore(Zv))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Le.extend(Ed);var Md=["past","now","next"],Nd=["minute","hour","day","week","month","quarter","year"],eA=e=>{let t=e==="now";return{amount:new $({required:!t,min:1}),unit:new V({required:!t,constrainTo:Nd}),period:new V({required:!0,constrainTo:Md})}};function Es(e){if(typeof e=="string"&&!Pt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Ud(e):e;new ke(eA(t.period)).validate(t);let r=_d(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Rs(r)}function jd(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function _d(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return Le().subtract(r,n);case"next":return Le().add(r,n);case"now":return Le()}}function Vn(e){return di(_d(Ud(e)))}function Vd(e){return e.toLocaleLowerCase().split("-")}function Pt(e){let[t,r,n]=Vd(e);if(t==="now")return!0;if(!Md.includes(t)||!Nd.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Ld(e){return!!e&&typeof e=="object"&&"period"in e}function Ud(e){let[t,r,n]=Vd(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}p();u();d();l();function Qd(e){return e.type==="dateRange"}function Bd(e){return`start${e}`}function $d(e){return`end${e}`}var Is=()=>({dateFacetValueMap:{}});function tA(e,t,r){let n=e.start,o=e.end;return Pt(n)&&(n=Vn(n),r.dateFacetValueMap[t][Bd(n)]=e.start),Pt(o)&&(o=Vn(o),r.dateFacetValueMap[t][$d(o)]=e.end),{...e,start:n,end:o}}function Fs(e,t){if(Qd(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>tA(o,r,t))}}return e}function kt(e){let t=Is();return{request:{...e,facets:e.facets?.map(n=>Fs(n,t))},mappings:t}}function rA(e,t,r){return{...e,start:r.dateFacetValueMap[t][Bd(e.start)]||e.start,end:r.dateFacetValueMap[t][$d(e.end)]||e.end}}function nA(e,t){return e.facetId in t.dateFacetValueMap}function oA(e,t){return nA(e,t)?{...e,values:e.values.map(r=>rA(r,e.facetId,t))}:e}function pi(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>oA(n,t))}}:e}p();u();d();l();p();u();d();l();p();u();d();l();function Ot(e){return Object.values(e).map(t=>t.request)}function Ps(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Hd(e){return Ot(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ks={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function iA(e){return Ot(e).map(t=>{let r=ks[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function aA(e){return[...iA(e.facetSet??{}),...Hd(e.numericFacetSet??{}),...Hd(e.dateFacetSet??{}),...Ot(e.categoryFacetSet??{})]}function sA(e){return aA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function fi(e){return Ps(sA(e),e.facetOrder??[])}p();u();d();l();p();u();d();l();var Tt=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Be.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Xo(e.configuration.analytics,t))),...(e.excerptLength&&!H(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Tt(_x48,_x49){return _ref22.apply(this,arguments)}}();p();u();d();l();var Br=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&ci(e.configuration.analytics,t,r)),...(e.excerptLength&&!H(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});p();u();d();l();var zd=de(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Dt=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t,r){let n=Ts(e),o=cA(e),i=uA(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Tt(e,r):Br(e,t,r);return kt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Os(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Dt(_x50,_x51,_x52){return _ref23.apply(this,arguments)}}();function Os(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function cA(e){return Ps(dA(e),e.facetOrder??[])}function uA(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(lA).filter(r=>r.currentValues.length>0):void 0}function lA(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function dA(e){return pA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function pA(e){return[...fA(e.facetSet??{}),...Gd(e.numericFacetSet??{}),...Gd(e.dateFacetSet??{}),...Ot(e.categoryFacetSet??{})]}function fA(e){return Ot(e).map(t=>{let r=ks[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Gd(e){return Ot(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Ts(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=zd(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}p();u();d();l();p();u();d();l();var Ln=(e,t)=>{let r=e;return H(r[t])?H(e.raw[t])?null:e.raw[t]:r[t]},mA=e=>t=>e.every(r=>!H(Ln(t,r))),gA=e=>t=>e.every(r=>H(Ln(t,r))),yA=(e,t)=>r=>{let n=Wd(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},hA=(e,t)=>r=>{let n=Wd(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Wd=(e,t)=>{let r=Ln(t,e);return Pc(r)?r:[r]},Yd={getResultProperty:Ln,fieldsMustBeDefined:mA,fieldsMustNotBeDefined:gA,fieldMustMatch:yA,fieldMustNotMatch:hA};var Kd=de(e=>e.search,e=>e?.searchAction?.actionCause||"");p();u();d();l();var Jd=e=>e.searchHub;p();u();d();l();var Ds=de(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),Nj=de(e=>e,e=>{let t=Ds(e);return t&&e?e[t].expression:""});p();u();d();l();var Xd=e=>e.configuration.search.locale,Zd=e=>e.configuration.search.timezone;p();u();d();l();var ep=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};p();u();d();l();var tp=e=>e.excerptLength?.length;p();u();d();l();var rp=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};p();u();d();l();var np=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};p();u();d();l();var op=e=>e.sortCriteria;var ip=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Ie(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function ip(_x53){return _ref24.apply(this,arguments)}}(),ap=(e,t)=>{let r=ii(e)?.q,{aq:n,cq:o,dq:i,lq:a}=AA(e),m=dd(e),f=ci(e.configuration.analytics,t,{actionCause:Kd(e)}),s=Jd(e),g=pd(e),h=yl(e)??[],S=SA(e),y=Ds(e.tabSet)||"default",b=Xd(e),R=Zd(e),F=t.referrer||"",x=rp(e),I=op(e),w=vA(e),E=tp(e),M=np(e),k=ep(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:ud(e)}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:h}},...(s?.length&&{searchHub:s}),...(g?.length&&{pipeline:g}),...(S.length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Os(e),firstResult:e.pagination.firstResult}),tab:y,locale:b,timezone:R,...(e.debug!==void 0&&{debug:e.debug}),referrer:F,...w,...(M??{}),...(E&&{excerptLength:E}),...(k&&{dictionaryFieldContext:k}),sortCriteria:I,...(x&&{facetOptions:x}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},SA=e=>fi(e)?.map(t=>Fs(t,Is())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),vA=e=>({actionsHistory:e.configuration.analytics.enabled?Be.getInstance().getHistory():[]}),AA=e=>{let t=ld(e),r=Ts(e);return{...t,...(r&&{cq:r})}};p();u();d();l();var sp=["text/plain","text/markdown"];var $r=new V({required:!0}),up=new V,Hr=new K({required:!0}),CA={id:$r,title:$r,uri:$r,permanentid:$r,clickUri:up},lp=new V({required:!0,constrainTo:sp}),tV=T("generatedAnswer/setIsVisible",e=>N(e,Hr)),dp=T("generatedAnswer/setAnswerId",e=>N(e,U)),rV=T("generatedAnswer/setAnswerGenerationMode",e=>N(e,new V({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),nV=T("generatedAnswer/setIsEnabled",e=>N(e,Hr)),Ms=T("generatedAnswer/updateMessage",e=>N(e,{textDelta:$r})),Ns=T("generatedAnswer/updateCitations",e=>N(e,{citations:new J({required:!0,each:new Q({values:CA})})})),bA=T("generatedAnswer/updateError",e=>N(e,{message:up,code:new $({min:0})})),pp=T("generatedAnswer/resetAnswer"),oV=T("generatedAnswer/like"),iV=T("generatedAnswer/dislike"),aV=T("generatedAnswer/feedbackModal/open"),sV=T("generatedAnswer/expand"),cV=T("generatedAnswer/collapse"),uV=T("generatedAnswer/setId",e=>N(e,{id:new V({required:!0})})),lV=T("generatedAnswer/feedbackModal/close"),dV=T("generatedAnswer/sendFeedback"),qs=T("generatedAnswer/setIsLoading",e=>N(e,Hr)),cp=T("generatedAnswer/setIsStreaming",e=>N(e,Hr)),js=T("generatedAnswer/setAnswerContentFormat",e=>N(e,lp)),pV=T("generatedAnswer/updateResponseFormat",e=>N(e,{contentFormat:new J({each:lp,default:["text/plain"]})})),fV=T("knowledge/updateAnswerConfigurationId",e=>N(e,$r)),mV=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>N(e,bo)),wA=T("generatedAnswer/setIsAnswerGenerated",e=>N(e,Hr)),_s=T("generatedAnswer/setCannotAnswer",e=>N(e,Hr)),xA=T("generatedAnswer/setAnswerApiQueryParams",e=>N(e,new Q({}))),gV=re("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:m}=a,{setAbortControllerRef:f}=e,s=yield ip(r),g=(y,b)=>{switch(y){case"genqa.headerMessageType":{let R=JSON.parse(b);n(js(R.contentFormat));break}case"genqa.messageType":n(Ms(JSON.parse(b)));break;case"genqa.citationsType":n(Ns(JSON.parse(b)));break;case"genqa.endOfStreamType":{let R=JSON.parse(b).answerGenerated,F=m.length!==0&&!R;n(_s(F)),n(cp(!1)),n(wA(R)),n(ai(R)),n(si());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(qs(!0));let h=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(s,{write:y=>{h(s)&&(n(qs(!1)),y.payload&&y.payloadType&&g(y.payloadType,y.payload))},abort:y=>{h(s)&&n(bA(y))},close:()=>{h(s)&&n(cp(!1))},resetAnswer:()=>{h(s)&&n(pp())}});S?f(S):n(qs(!1))});return function(_x54,_x55){return _ref25.apply(this,arguments)}}()),yV=re("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(pp());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=ap(i,n);r(xA(a)),yield r(fp(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x56,_x57){return _ref26.apply(this,arguments)}}());p();u();d();l();p();u();d();l();function gp(_x58,_x59){return _gp.apply(this,arguments)}function _gp(){_gp=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _gp.apply(this,arguments)}function yp(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=EA(t,a);let m=t.length,f=0;for(;r<m;){o&&(t[r]===10&&(f=++r),o=!1);let s=-1;for(;r<m&&s===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,s=r;break;case 10:s=r;break}if(s===-1)break;e(t.subarray(f,s),n),f=r,n=-1}f===m?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function hp(e,t,r){let n=mp(),o=new TextDecoder;return function(a,m){if(a.length===0)r?.(n),n=mp();else if(m>0){let f=o.decode(a.subarray(0,m)),s=m+(a[m+1]===32?2:1),g=o.decode(a.subarray(s));switch(f){case"data":n.data=n.data?`${n.data}
|
|
31
|
-
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":RA(g,n,t);break}}}}function RA(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function EA(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function mp(){return{data:"",event:"",id:"",retry:void 0}}var Vs="text/event-stream",IA=1e3,Sp="last-event-id";function vp(){return typeof window<"u"}function Ap(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:m,fetch:f,...s}){return new Promise((g,h)=>{let S={...r};S.accept||(S.accept=Vs);let y;function b(){y?.abort(),document.hidden||E()}!m&&vp()&&document.addEventListener("visibilitychange",b);let R=IA,F;function x(){vp()&&document.removeEventListener("visibilitychange",b),clearTimeout(F),y?.abort()}t?.addEventListener("abort",()=>{x(),g()});let I=f??v,w=n??FA;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){y=c.AbortController?new c.AbortController:null;try{let M=yield I(e,{...s,headers:S,signal:y?.signal});yield w(M),yield gp(M.body,yp(hp(k=>{k?S[Sp]=k:delete S[Sp]},k=>{R=k},o))),i?.(),x(),g()}catch(M){if(!y?.signal?.aborted)try{let k=a?.(M)??R;clearTimeout(F),F=setTimeout(E,k)}catch(k){x(),h(k)}}});return _E.apply(this,arguments)}E()})}function FA(e){let t=e.headers.get("content-type");if(!t?.startsWith(Vs))throw new Error(`Expected content-type to be ${Vs}, Actual: ${t}`)}p();u();d();l();var PA=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,m=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let s=Ie(a,i);return{data:td({baseUrl:`${s}/rest/organizations/${a}/answer/v1/configs/${m}`,fetchFn:function(){var _ref28=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,y={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(b=>{y[b]=h[b]}),y.duplex="half",y.body=yield h.text(),v(S,y)});return function fetchFn(_x63){return _ref28.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(s){return{error:s}}});return function PA(_x60,_x61,_x62){return _ref27.apply(this,arguments)}}(),Cp=cd({reducerPath:"answer",baseQuery:rd(PA,{maxRetries:3}),endpoints:()=>({})});var kA=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},OA=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},TA=(e,t)=>{e.citations=t.citations},DA=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},qA=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},MA=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&qA(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(kA(t,o),r(js(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(OA(t,o),r(Ms({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(TA(t,o),r(Ns({citations:o.citations})));break;case"genqa.endOfStreamType":DA(t,o),r(ai(o.answerGenerated??!1)),r(si());break}},NA=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},Ls=Cp.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x64,_x65){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:m,insightConfiguration:f}=r(),{organizationId:s,environment:g,accessToken:h}=a,S=Ie(s,g),y=NA(S,s,m.answerConfigurationId,f?.insightId);yield Ap(y,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref29=_asyncToGenerator(function*(b){let R=b.headers.get("x-answer-id");R&&o(F=>{F.answerId=R,i(dp(R))})});return function onopen(_x66){return _ref29.apply(this,arguments)}}(),onmessage:b=>{o(R=>{MA(b,R,i)})},onerror:b=>{throw b},onclose:()=>{o(b=>{i(_s(!b.generated))})}})}).apply(this,arguments)}})})}),fp=e=>Ls.endpoints.getAnswer.initiate(e);p();u();d();l();var bp=le(Sr,e=>e);p();u();d();l();function jA(e){let t=e.payload?.analyticsAction;return wp(e)&&!H(t)}function wp(e){return"type"in e}var xp=e=>t=>r=>{let n;jA(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return wp(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};p();u();d();l();p();u();d();l();p();u();d();l();var fL=T("tab/register",e=>{let t=new Q({values:{id:U,expression:ve}});return N(e,t)}),mi=T("tab/updateActiveTab",e=>N(e,U));p();u();d();l();p();u();d();l();var _A={year:0,month:1,day:2,hour:3,minute:4,second:5},Rp={},VA=function(t,r){r===void 0&&(r={});var n=r.timeZoneName||"short",o=t+"|"+n,i=Rp[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),Rp[o]=i),i},Ep=function(e,t,r){var n,o=function(g,h,S){S===void 0&&(S={});var y=new Date(g),b=VA(h,S);return b.formatToParts(y)},i=function(g,h){for(var S=o(g,h),y=[],b=0;b<S.length;b+=1){var R=S[b],F=R.type,x=R.value,I=_A[F];I>=0&&(y[I]=parseInt(x,10))}var w=y[3],E=w===24?0:w,M=y[0]+"-"+y[1]+"-"+y[2]+" "+E+":"+y[4]+":"+y[5]+":000",k=r.utc(M).valueOf(),P=+g,O=P%1e3;return P-=O,(k-P)/6e4},a=function(g,h,S){var y=g-h*60*1e3,b=i(y,S);if(h===b)return[y,h];y-=(b-h)*60*1e3;var R=i(y,S);return b===R?[y,b]:[g-Math.min(b,R)*60*1e3,Math.max(b,R)]},m=t.prototype;m.tz=function(s,g){s===void 0&&(s=n);var h=this.utcOffset(),S=this.toDate(),y=S.toLocaleString("en-US",{timeZone:s}),b=Math.round((S-new Date(y))/1e3/60),R=-Math.round(S.getTimezoneOffset()/15)*15-b,F=!Number(R),x;if(F)x=this.utcOffset(0,g);else if(x=r(y,{locale:this.$L}).$set(er,this.$ms).utcOffset(R,!0),g){var I=x.utcOffset();x=x.add(h-I,_e)}return x.$x.$timezone=s,x},m.offsetName=function(s){var g=this.$x.$timezone||r.tz.guess(),h=o(this.valueOf(),g,{timeZoneName:s}).find(function(S){return S.type.toLowerCase()==="timezonename"});return h&&h.value};var f=m.startOf;m.startOf=function(s,g){if(!this.$x||!this.$x.$timezone)return f.call(this,s,g);var h=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L}),S=f.call(h,s,g);return S.tz(this.$x.$timezone,!0)},r.tz=function(s,g,h){var S=h&&g,y=h||g||n,b=i(+r(),y);if(typeof s!="string")return r(s).tz(y);var R=r.utc(s,S).valueOf(),F=a(R,b,y),x=F[0],I=F[1],w=r(x).utcOffset(I);return w.$x.$timezone=y,w},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(s){n=s}};p();u();d();l();var LA=/[+-]\d\d(?::?\d\d)?/g,UA=/([+-]|\d\d)/g;function QA(e){e===void 0&&(e="");var t=e.match(LA);if(!t)return null;var r=(""+t[0]).match(UA)||["-",0,0],n=r[0],o=r[1],i=r[2],a=+o*60+ +i;return a===0?0:n==="+"?a:-a}var Ip=function(e,t,r){var n=t.prototype;r.utc=function(h){var S={date:h,utc:!0,args:arguments};return new t(S)},n.utc=function(h){var S=r(this.toDate(),{locale:this.$L,utc:!0});return h?S.add(this.utcOffset(),_e):S},n.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var o=n.parse;n.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),o.call(this,h)};var i=n.init;n.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else i.call(this)};var a=n.utcOffset;n.utcOffset=function(h,S){var y=this.$utils(),b=y.u;if(b(h))return this.$u?0:b(this.$offset)?a.call(this):this.$offset;if(typeof h=="string"&&(h=QA(h),h===null))return this;var R=Math.abs(h)<=16?h*60:h,F=this;if(S)return F.$offset=R,F.$u=h===0,F;if(h!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();F=this.local().add(R+x,_e),F.$offset=R,F.$x.$localOffset=x}else F=this.utc();return F};var m=n.format,f="YYYY-MM-DDTHH:mm:ss[Z]";n.format=function(h){var S=h||(this.$u?f:"");return m.call(this,S)},n.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-h*Lr},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var s=n.toDate;n.toDate=function(h){return h==="s"&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():s.call(this)};var g=n.diff;n.diff=function(h,S,y){if(h&&this.$u===h.$u)return g.call(this,h,S,y);var b=this.local(),R=r(h).local();return g.call(b,R,S,y)}};Le.extend(Ip);Le.extend(Ep);var Fp=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Le.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});p();u();d();l();var BA=/(^|; )Coveo-Pendragon=([^;]*)/;function Us(){return typeof window>"u"?!1:BA.exec(document.cookie)?.pop()||null}var Pp=le(Fp(),e=>e.addCase(At,(t,r)=>{$A(t,r.payload)}).addCase(et,(t,r)=>{HA(t,r.payload)}).addCase(vr,(t,r)=>{zA(t,r.payload)}).addCase(Ar,t=>{t.analytics.enabled=!1}).addCase(Cr,t=>{t.analytics.enabled=!0}).addCase(wo,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(xo,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(mi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ju,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Ct,(t,r)=>{H(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function $A(e,t){H(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",H(t.organizationId)||(e.organizationId=t.organizationId)}function HA(e,t){H(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),H(t.locale)||(e.search.locale=t.locale),H(t.timezone)||(e.search.timezone=t.timezone),H(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function zA(e,t){H(t.enabled)||(e.analytics.enabled=t.enabled),H(t.originContext)||(e.analytics.originContext=t.originContext),H(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),H(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),H(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),H(t.trackingId)||(e.analytics.trackingId=t.trackingId),H(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),H(t.source)||(e.analytics.source=t.source);try{let r=Us();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}H(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),H(t.anonymous)||(e.analytics.anonymous=t.anonymous),H(t.deviceId)||(e.analytics.deviceId=t.deviceId),H(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),H(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Ye=Pp;p();u();d();l();function GA(e){return e.instantlyCallable}var kp=()=>e=>t=>e(GA(t)?t():t);p();u();d();l();var Op=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},Tp=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));p();u();d();l();var Qs=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};p();u();d();l();function Dp(e,t){let r={...e},n,o=i=>(a,m)=>{let f=i(a,m);return n?n(f,m):f};return{get combinedReducer(){let i=Oc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,m])=>[a,()=>m]));return o(pr({...i,...r}))},containsAll(i){return Object.keys(i).every(m=>m in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}p();u();d();l();p();u();d();l();function WA(e){if(!e||!YA(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function qp(e,t=60){if(!e)return!1;let r=WA(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function YA(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Np(e,t){let r=0,n=null,o=Zn(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(f,s=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){return s&&JA(t),yield t()})().finally(()=>{n=null}));let h=yield n;return g&&h&&f.dispatch(At({accessToken:h})),h});return function i(_x67){return _ref30.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(f){let s=f.getState(),g=XA(s);if(!(!g||!qp(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(h){e.warn(h,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x68){return _ref32.apply(this,arguments)}}(),m=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(f,s,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Mp(f,s.error),s;r++,o(),yield i(f,!0),f.dispatch(g)});return function m(_x69,_x70,_x71){return _ref33.apply(this,arguments)}}();return f=>s=>(/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(g){let h=typeof g=="function",S=typeof t=="function";if(!h)return s(g);S&&(yield a(f));let y=yield s(g);return KA(y)?S?yield m(f,y,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Mp(f,y.error),y):y});return function(_x72){return _ref34.apply(this,arguments)}}())}function KA(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new dr().name}function Mp(e,t){e.dispatch(Po({status:401,statusCode:401,message:t.message,type:t.name}))}function JA(_x73){return _JA.apply(this,arguments)}function _JA(){_JA=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _JA.apply(this,arguments)}function XA(e){return e.configuration.accessToken}p();u();d();l();function jp({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return Cu({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Tp(n.logger))})}function ZA(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&kc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function _p(e,t){let r={...e.reducers,configuration:Ye,version:bp},n=eC({...e,reducers:r},t,Ye),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(At({accessToken:o,environment:i,organizationId:a}));let m=ZA(e.configuration,n.logger);return m&&n.dispatch(vr(m)),n}function eC(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=Dp({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,m={...t,get relay(){return kn(s.state,o)},get navigatorContext(){return Qs(this.relay,o)}},f=tC(e,m,i),s={addReducers(g){i.containsAll(g)||(i.add(g),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(Cr())},disableAnalytics(){f.dispatch(Ar())},get state(){return f.getState()},get relay(){return kn(this.state,o)},get navigatorContext(){return Qs(this.relay,o)},logger:a,store:f};return s}function tC(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=rC(e,t.logger);return jp({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function rC(e,t){let{renewAccessToken:r}=e.configuration,n=Np(t,r);return[kp,n,Op(t),xp].concat(Ls.middleware,e.middlewares||[])}p();u();d();l();var Gp=Wn(zp(),1);function Wp(e){return(0,Gp.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}p();u();d();l();function Yp(e,t){let r=AC(e),n=Qe,o=CC(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function AC(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function CC(e){return e.preprocessRequest||ro}p();u();d();l();p();u();d();l();var Kp={organizationId:U,accessToken:U,name:new V({required:!1,emptyAllowed:!1}),analytics:new Q({options:{required:!1},values:{enabled:new K({required:!1}),originContext:new V({required:!1}),originLevel2:new V({required:!1}),originLevel3:new V({required:!1}),analyticsMode:new V({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new V({required:!1,url:!0}),trackingId:new V({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new V({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Jp(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Xp=new ke({...Kp,pipeline:new V({required:!1,emptyAllowed:!0}),searchHub:Se,locale:Se,timezone:Se});function Ws(){return{...Jp(),searchHub:"default"}}var bC={debug:Fo,pipeline:xr,searchHub:jr,recommendation:Mr};function Zp(e){let t=Wp(e.loggerOptions);wC(e.configuration,t);let r=xC(e.configuration,t),n={...Yp(e.configuration,t),apiClient:r},o={...e,reducers:bC},i=_p(o,n),{pipeline:a,searchHub:m,timezone:f,locale:s,proxyBaseUrl:g}=e.configuration;return i.dispatch(et({timezone:f,locale:s,proxyBaseUrl:g})),H(a)||i.dispatch(br(a)),H(m)||i.dispatch(Nr(m)),{...i,get state(){return i.state}}}function wC(e,t){try{Xp.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function xC(e,t){return new io({logger:t,preprocessRequest:e.preprocessRequest||ro,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Wc,postprocessFacetSearchResponseMiddleware:Yc,postprocessQuerySuggestResponseMiddleware:Kc})}p();u();d();l();p();u();d();l();p();u();d();l();var RC=new J({each:U,required:!0}),ef=(e,t)=>(N(e,U),Jn(t)?N(t,U):N(t,RC),{payload:{contextKey:e,contextValue:t}}),ir=T("context/set",e=>{for(let[t,r]of Object.entries(e))ef(t,r);return{payload:e}}),ar=T("context/add",e=>ef(e.contextKey,e.contextValue)),sr=T("context/remove",e=>N(e,U));p();u();d();l();p();u();d();l();function hi(){return{contextValues:{}}}var Si=le(hi(),e=>{e.addCase(ir,(t,r)=>{t.contextValues=r.payload}).addCase(ar,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(sr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});p();u();d();l();function Mt(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),m=t!==a;return t=a,m}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),m;return n()&&(t=JSON.stringify(this.state),m=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&m?.()}},get state(){return{}}}}p();u();d();l();var EC=["caseId","caseNumber"],IC={caseId:"caseContext",caseNumber:"caseContext"},Qn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${IC[t]} to set this value.}`)}};function Ys(e){return EC.includes(e)}var FC=new ke({values:new Q({options:{required:!1}})});function tf(e,t={}){if(!OC(e))throw Ke;let r=Mt(e),{dispatch:n}=e,o=()=>e.state,i=Ou(e,FC,t.initialState,"buildContext");return i.values&&n(ir(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(ir(a))},...(o().configuration.analytics.analyticsMode==="legacy"?PC(n):kC(n))}}var PC=e=>({add(t,r){e(ar({contextKey:t,contextValue:r}))},remove(t){e(sr(t))}}),kC=e=>({add(t,r){if(Ys(t))throw new Qn(t);e(ar({contextKey:t,contextValue:r}))},remove(t){if(Ys(t))throw new Qn(t);e(sr(t))}});function OC(e){return e.addReducers({context:Si}),!0}function rf(e,t){return tf(e,t)}p();u();d();l();p();u();d();l();var Gr=T("dictionaryFieldContext/set",e=>{let t=new Q({options:{required:!0}}),r=N(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new J({each:ve}),i=N(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Wr=T("dictionaryFieldContext/add",e=>{let t=new Q({options:{required:!0},values:{field:ve,key:ve}});return N(e,t)}),Yr=T("dictionaryFieldContext/remove",e=>N(e,ve));p();u();d();l();p();u();d();l();function vi(){return{contextValues:{}}}var Ai=le(vi(),e=>{e.addCase(Gr,(t,r)=>{t.contextValues=r.payload}).addCase(Wr,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Yr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function nf(e){if(!TC(e))throw Ke;let t=Mt(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Gr(o))},add(o,i){r(Wr({field:o,key:i}))},remove(o){r(Yr(o))}}}function TC(e){return e.addReducers({dictionaryFieldContext:Ai}),!0}p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var Ci=T("breadcrumb/deselectAll"),of=T("breadcrumb/deselectAllNonBreadcrumbs");p();u();d();l();p();u();d();l();var Bn={value:U,numberOfResults:new $({min:0}),state:U};p();u();d();l();var ne=U;var NC=new $({min:1,default:8,required:!1}),jC=new $({min:1,max:20,default:5,required:!1}),_C={desiredCount:jC,numberOfValues:NC},h$=T("automaticFacet/setOptions",e=>N(e,_C)),S$=T("automaticFacet/deselectAll",e=>N(e,ne)),VC=U,af=T("automaticFacet/toggleSelectValue",e=>N(e,{field:VC,selection:new Q({values:Bn})}));p();u();d();l();p();u();d();l();var LC={state:new ce({required:!0}),numberOfResults:new $({required:!0,min:0}),value:new V({required:!0,emptyAllowed:!0}),path:new J({required:!0,each:U}),moreValuesAvailable:new K({required:!1})};function Ks(e){e.children.forEach(t=>{Ks(t)}),Qe({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},LC)}var Kr={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),delimitingCharacter:new V({required:!1,emptyAllowed:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),basePath:new J({required:!1,each:U}),filterByBasePath:new K({required:!1})};var N$=T("categoryFacet/register",e=>N(e,Kr)),sf=T("categoryFacet/toggleSelectValue",e=>{try{return Qe(e.facetId,U),Ks(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),cf=T("categoryFacet/deselectAll",e=>N(e,Kr.facetId)),j$=T("categoryFacet/updateNumberOfValues",e=>N(e,{facetId:Kr.facetId,numberOfValues:Kr.numberOfValues})),_$=T("categoryFacet/updateSortCriterion",e=>N(e,{facetId:Kr.facetId,criterion:new ce})),V$=T("categoryFacet/updateBasePath",e=>N(e,{facetId:Kr.facetId,basePath:new J({each:U})}));p();u();d();l();p();u();d();l();var $n={facetId:ne,captions:new Q({options:{required:!1}}),numberOfValues:new $({required:!1,min:1}),query:new V({required:!1,emptyAllowed:!0})};var UC={path:new J({required:!0,each:U}),displayValue:ve,rawValue:ve,count:new $({required:!0,min:0})},uf=T("categoryFacet/selectSearchResult",e=>N(e,{facetId:ne,value:new Q({values:UC})})),nH=T("categoryFacetSearch/register",e=>N(e,$n));p();u();d();l();var lf={facetId:ne,value:new Q({values:{displayValue:ve,rawValue:ve,count:new $({required:!0,min:0})}})},mH=T("facetSearch/register",e=>N(e,$n)),gH=T("facetSearch/update",e=>N(e,$n)),df=T("facetSearch/toggleSelectValue",e=>N(e,lf)),pf=T("facetSearch/toggleExcludeValue",e=>N(e,lf));p();u();d();l();p();u();d();l();var bH=new V({regex:/^[a-zA-Z0-9-_]+$/}),wH=new V({required:!0}),xH=new J({each:new V}),RH=new V,EH=new K,IH=new K,FH=new $({min:0}),QC=new $({min:1}),PH=new K({required:!0}),BC=new Q,$C=new V,HC={captions:BC,numberOfValues:QC,query:$C},kH=new Q({values:HC}),ff=new Q({options:{required:!1},values:{type:new V({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new J({required:!0,max:25,each:new V({emptyAllowed:!1,required:!0})})}}),OH=new K,mf=new J({min:1,max:25,required:!1,each:new V({emptyAllowed:!1,required:!0})});var zC={facetId:ne,field:new V({required:!0,emptyAllowed:!0}),tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),resultsMustMatch:new ce({required:!1}),allowedValues:ff,customSort:mf},BH=T("facet/register",e=>N(e,zC)),gf=T("facet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:Bn})})),yf=T("facet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:Bn})})),bi=T("facet/deselectAll",e=>N(e,ne)),$H=T("facet/updateSortCriterion",e=>N(e,{facetId:ne,criterion:new ce({required:!0})})),HH=T("facet/updateNumberOfValues",e=>N(e,{facetId:ne,numberOfValues:new $({required:!0,min:1})})),zH=T("facet/updateIsFieldExpanded",e=>N(e,{facetId:ne,isFieldExpanded:new K({required:!0})})),GH=T("facet/updateFreezeCurrentValues",e=>N(e,{facetId:ne,freezeCurrentValues:new K({required:!0})}));p();u();d();l();p();u();d();l();function Sf(e){let t=hf(e.start,e),r=hf(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function hf(e,t){let{dateFormat:r}=t;return Ld(e)?(Es(e),jd(e)):typeof e=="string"&&Pt(e)?(Es(e),e):(qd(e,r),di(Qr(e,r)))}p();u();d();l();var vf=T("rangeFacet/updateSortCriterion",e=>N(e,{facetId:ne,criterion:new ce({required:!0})}));p();u();d();l();var wi={state:U,start:new $({required:!0}),end:new $({required:!0}),endInclusive:new K({required:!0}),numberOfResults:new $({required:!0,min:0})},xi={start:U,end:U,endInclusive:new K({required:!0}),state:U,numberOfResults:new $({required:!0,min:0})};var GC={start:U,end:U,endInclusive:new K({required:!0}),state:U},WC={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),currentValues:new J({required:!1,each:new Q({values:GC})}),generateAutomaticRanges:new K({required:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),rangeAlgorithm:new ce({required:!1})};function Af(e){return Pt(e)?Vn(e):e}function Cf(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Sf(t);if(Qr(Af(r)).isAfter(Qr(Af(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Dz=T("dateFacet/register",e=>{try{return Qe(e,WC),Cf(e),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),bf=T("dateFacet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:xi})})),wf=T("dateFacet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:xi})})),xf=T("dateFacet/updateFacetValues",e=>{try{return Qe(e,{facetId:ne,values:new J({each:new Q({values:xi})})}),Cf({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}});p();u();d();l();var YC={state:U,start:new $({required:!0}),end:new $({required:!0}),endInclusive:new K({required:!0})},KC={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),currentValues:new J({required:!1,each:new Q({values:YC})}),generateAutomaticRanges:new K({required:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),rangeAlgorithm:new ce({required:!1})};function Rf(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var zz=T("numericFacet/register",e=>{try{return N(e,KC),Rf(e),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),Ef=T("numericFacet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:wi})})),If=T("numericFacet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:wi})})),Ff=T("numericFacet/updateFacetValues",e=>{try{return Qe(e,{facetId:ne,values:new J({each:new Q({values:wi})})}),Rf({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}});p();u();d();l();p();u();d();l();var Pf=T("facet/updateFacetAutoSelection",e=>N(e,{allow:new K({required:!0})}));p();u();d();l();p();u();d();l();var Ri=class extends wt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??je().q}get responseTime(){return this.activeInstantResultCache?.duration??Je().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Je().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var kf=()=>Fe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Ri(e)),Of=()=>({actionCause:"searchboxAsYouType"});p();u();d();l();var Js={id:U},JC={...Js,q:ve},R2=T("instantResults/register",e=>N(e,Js)),Ei=T("instantResults/updateQuery",e=>N(e,JC)),E2=T("instantResults/clearExpired",e=>N(e,Js));p();u();d();l();var Ii=new $({required:!0,min:0}),Fi=T("pagination/registerNumberOfResults",e=>N(e,Ii)),Pi=T("pagination/updateNumberOfResults",e=>N(e,Ii)),ki=T("pagination/registerPage",e=>N(e,Ii)),Jr=T("pagination/updatePage",e=>N(e,Ii)),Oi=T("pagination/nextPage"),Ti=T("pagination/previousPage");p();u();d();l();var Xr=T("query/updateQuery",e=>N(e,{q:new V,enableQuerySyntax:new K}));p();u();d();l();p();u();d();l();p();u();d();l();var Nt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Xs=()=>Fe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),jt=e=>Fe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||je().q,aq:r.advancedSearchQueries?.aq||Nt().aq,cq:r.advancedSearchQueries?.cq||Nt().cq,dq:r.advancedSearchQueries?.dq||Nt().dq,errorType:e.type,errorMessage:e.message}));p();u();d();l();p();u();d();l();var lG=T("didYouMean/enable"),dG=T("didYouMean/disable"),pG=T("didYouMean/automaticCorrections/disable"),fG=T("didYouMean/automaticCorrections/enable"),Di=T("didYouMean/correction",e=>N(e,U)),mG=T("didYouMean/automaticCorrections/mode",e=>N(e,new V({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));p();u();d();l();var Zs=()=>Fe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Tf=()=>({actionCause:"didYouMeanAutomatic"});p();u();d();l();p();u();d();l();function Df(){return{freezeFacetOrder:!1,facets:{}}}p();u();d();l();function qf(){return[]}p();u();d();l();function Hn(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}p();u();d();l();function Mf(){return{}}p();u();d();l();function Nf(){return{}}p();u();d();l();function jf(){return{}}function ot(e){return{context:e.context||hi(),dictionaryFieldContext:e.dictionaryFieldContext||vi(),facetSet:e.facetSet||Ko(),numericFacetSet:e.numericFacetSet||Yo(),dateFacetSet:e.dateFacetSet||Wo(),categoryFacetSet:e.categoryFacetSet||Go(),automaticFacetSet:e.automaticFacetSet??zo(),pagination:e.pagination||Hn(),query:e.query||je(),tabSet:e.tabSet||jf(),advancedSearchQueries:e.advancedSearchQueries||Nt(),staticFilterSet:e.staticFilterSet||Nf(),querySet:e.querySet||Mf(),sortCriteria:e.sortCriteria||Jo(),pipeline:e.pipeline||wr(),searchHub:e.searchHub||Tr(),facetOptions:e.facetOptions||Df(),facetOrder:e.facetOrder??qf(),debug:e.debug??Io()}}p();u();d();l();var kW=new Q({values:{undoneQuery:ve},options:{required:!0}}),_f=()=>Fe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);p();u();d();l();var qi=T("trigger/query/ignore",e=>N(e,new V({emptyAllowed:!0,required:!0}))),Mi=T("trigger/query/modification",e=>N(e,new Q({values:{originalQuery:Se,modification:Se}})));p();u();d();l();var _t=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=eb(e),n=fi(e),o=XC(e),i=yield Tt(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return kt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function _t(_x74,_x75){return _ref35.apply(this,arguments)}}();function XC(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(ZC).filter(r=>r.currentValues.length>0):void 0}function ZC(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function eb(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=tb(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function tb(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Vt=class{constructor(t,r=n=>{this.dispatch(Xr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x76,_x77){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=pi(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(jt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let s=a.length===0&&m&&m.length!==0,g=!H(f)&&!H(f.correctedQuery);if(!s&&!g)return null;let S=s?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(tt(ot(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this13.dispatch(jt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(tt(ot(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Zs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Zs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(qi("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this14.dispatch(jt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(tt(ot(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:_f()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??je().enableQuerySyntax},search:{...Je(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(tt(ot(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return ao(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield _t(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Di(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Mi({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield _t(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var PY=re("search/executeSearch",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ni(r,t,e)});return function(_x78,_x79){return _ref36.apply(this,arguments)}}()),kY=re("search/fetchPage",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();return yield tc(r,t,e)});return function(_x80,_x81){return _ref37.apply(this,arguments)}}()),OY=re("search/fetchMoreResults",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=t.getState();return yield rc(t,r)});return function(_x82,_x83){return _ref38.apply(this,arguments)}}()),TY=re("search/fetchFacetValues",/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=t.getState();return yield ib(t,e,r)});return function(_x84,_x85){return _ref39.apply(this,arguments)}}()),DY=re("search/fetchInstantResults",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){return ec(e,t)});return function(_x86,_x87){return _ref40.apply(this,arguments)}}()),rb=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=yield _t(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function rb(_x88,_x89){return _ref41.apply(this,arguments)}}(),nb=/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t,r){let n=yield Tt(e);return kt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function nb(_x90,_x91,_x92){return _ref42.apply(this,arguments)}}(),ob=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=yield _t(e,t);return r.request.numberOfResults=0,r});return function ob(_x93,_x94){return _ref43.apply(this,arguments)}}(),Vf=e=>{e.configuration.analytics.enabled&&Be.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function ec(_x95,_x96){return _ec.apply(this,arguments)}function _ec(){_ec=_asyncToGenerator(function*(e,t){N(e,{id:U,q:U,maxResultsPerQuery:new $({required:!0,min:1}),cacheTimeout:new $});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Vt({...t,analyticsAction:kf()},s=>{t.dispatch(Ei({q:s,id:e.id}))}),a=yield nb(o,r,n),m=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(m);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _ec.apply(this,arguments)}function tc(_x97,_x98,_x99){return _tc.apply(this,arguments)}function _tc(){_tc=_asyncToGenerator(function*(e,t,r){Vf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Vt({...t,analyticsAction:r}),f=yield _t(e,a),s=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(s)});return _tc.apply(this,arguments)}function rc(_x100,_x101){return _rc.apply(this,arguments)}function _rc(){_rc=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Xs().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Vt({...e,analyticsAction:Xs()}),m=yield rb(t,i),f=yield a.fetchFromAPI(m,{origin:"mainSearch"});return yield a.process(f)});return _rc.apply(this,arguments)}function ib(_x102,_x103,_x104){return _ib.apply(this,arguments)}function _ib(){_ib=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Vt({...e,analyticsAction:t}),f=yield ob(r,a),s=yield m.fetchFromAPI(f,{origin:"facetValues"});return yield m.process(s)});return _ib.apply(this,arguments)}function Ni(_x105,_x106,_x107){return _Ni.apply(this,arguments)}function _Ni(){_Ni=_asyncToGenerator(function*(e,t,r){Vf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=yield _t(e,a),f=new Vt({...t,analyticsAction:r}),s=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(s)});return _Ni.apply(this,arguments)}p();u();d();l();var Lt=class{constructor(t,r=n=>{this.dispatch(Xr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x108,_x109){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=pi(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(jt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let s=a.length===0&&m&&m.length!==0,g=!H(f)&&!H(f.correctedQuery);if(!s&&!g)return null;let S=s?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(tt(ot(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this20.dispatch(jt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(tt(ot(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(qi("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this21.dispatch(jt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(tt(ot(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(tt(ot(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return ao(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Tf(),o=yield _this22.fetchFromAPI(yield Dt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Di(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Mi({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Dt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var SK=re("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;N(e,{q:new V,enableQuerySyntax:new K,clearFilters:new K}),e.clearFilters&&(r(Ci()),r(of())),r(Pf({allow:!0})),r(Xr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Jr(1))}),vK=T("search/updateSearchAction"),Lf=re("search/executeSearch",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ni(r,t,e.legacy);Uf(r);let n=e.next?Qf(e.next):void 0,o=yield Dt(r,t.extra.navigatorContext,n),i=new Lt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x110,_x111){return _ref44.apply(this,arguments)}}()),AK=re("search/fetchPage",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=t.getState();if(Uf(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return tc(r,t,e.legacy);let n=new Lt({...t,analyticsAction:e.next}),o=yield Dt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x112,_x113){return _ref45.apply(this,arguments)}}()),CK=re("search/fetchMoreResults",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return rc(t,r);let n=Ml("browseResults",t.getState),o=new Lt({...t,analyticsAction:n}),i=yield ab(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x114,_x115){return _ref46.apply(this,arguments)}}()),bK=re("search/fetchFacetValues",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ni(r,t,e.legacy);let n=new Lt({...t,analyticsAction:{}}),o=yield cb(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x116,_x117){return _ref47.apply(this,arguments)}}()),wK=re("search/fetchInstantResults",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return ec(e,t);N(e,{id:U,q:U,maxResultsPerQuery:new $({required:!0,min:1}),cacheTimeout:new $});let{q:n,maxResultsPerQuery:o}=e,i=Qf(Of()),a=yield sb(r,t.extra.navigatorContext,n,o,i),m=new Lt({...t,analyticsAction:i},g=>{t.dispatch(Ei({q:g,id:e.id}))}),f=yield m.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),s=yield m.process(f);return"response"in s?{results:s.response.results,searchUid:s.response.searchUid,totalCountFiltered:s.response.totalCountFiltered,duration:s.duration}:s});return function(_x118,_x119){return _ref48.apply(this,arguments)}}()),ab=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t,r){let n=yield Dt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function ab(_x120,_x121,_x122){return _ref49.apply(this,arguments)}}(),sb=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t,r,n,o){let i=Br(e,t,o);return kt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function sb(_x123,_x124,_x125,_x126,_x127){return _ref50.apply(this,arguments)}}(),cb=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t,r){let n=yield Dt(e,t,r);return n.request.numberOfResults=0,n});return function cb(_x128,_x129,_x130){return _ref51.apply(this,arguments)}}(),Uf=e=>{e.configuration.analytics.enabled&&Be.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Qf=e=>({actionCause:e.actionCause,type:e.actionCause});var Bf=le(Hn(),e=>{e.addCase(Fi,(t,r)=>{let n=nc(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=zn(n,o)}).addCase(Pi,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(mi,t=>{t.firstResult=0}).addCase(ki,(t,r)=>{let n=r.payload;t.firstResult=zn(n,t.numberOfResults)}).addCase(Jr,(t,r)=>{let n=r.payload;t.firstResult=zn(n,t.numberOfResults)}).addCase(Ti,t=>{let r=nc(t),n=Math.max(r-1,1);t.firstResult=zn(n,t.numberOfResults)}).addCase(Oi,t=>{let r=nc(t),n=lb(t),o=Math.min(r+1,n);t.firstResult=zn(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Ct,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Lf.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(bi,t=>{Ee(t)}).addCase(wf,t=>{Ee(t)}).addCase(yf,t=>{Ee(t)}).addCase(If,t=>{Ee(t)}).addCase(pf,t=>{Ee(t)}).addCase(gf,t=>{Ee(t)}).addCase(cf,t=>{Ee(t)}).addCase(sf,t=>{Ee(t)}).addCase(uf,t=>{Ee(t)}).addCase(bf,t=>{Ee(t)}).addCase(Ef,t=>{Ee(t)}).addCase(Ci,t=>{Ee(t)}).addCase(xf,t=>{Ee(t)}).addCase(Ff,t=>{Ee(t)}).addCase(df,t=>{Ee(t)}).addCase(af,t=>{Ee(t)})});function Ee(e){e.firstResult=Hn().firstResult}function nc(e){let{firstResult:t,numberOfResults:r}=e;return db(t,r)}function lb(e){let{totalCountFiltered:t,numberOfResults:r}=e;return pb(t,r)}function zn(e,t){return(e-1)*t}function db(e,t){return Math.round(e/t)+1}function pb(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function oc(e){return e.addReducers({pagination:Bf}),{nextPage:Oi,previousPage:Ti,registerNumberOfResults:Fi,registerPage:ki,updateNumberOfResults:Pi,updatePage:Jr}}var fb=new ke({id:new V({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new $({min:0})});function $f(e,t={}){if(!mb(e))throw Ke;let r=Mt(e),{dispatch:n}=e,o=()=>e.state,i=Tu(e,fb,t.options,"buildRecommendationList");return i.id!==""&&n(qr({id:i.id})),i.numberOfRecommendations&&n(oc(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(xt())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function mb(e){return e.addReducers({recommendation:Mr,configuration:Ye}),!0}p();u();d();l();p();u();d();l();function Hf(e,t,r){if(!gb(e))throw Ke;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Zn(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function gb(e){return e.addReducers({configuration:Ye}),!0}function zf(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(ti(t.options.result)))};return Hf(e,t,()=>{n()})}p();u();d();l();p();u();d();l();p();u();d();l();var Ut=()=>new V({required:!1,emptyAllowed:!0}),ji=T("advancedSearchQueries/update",e=>N(e,{aq:Ut(),cq:Ut(),lq:Ut(),dq:Ut()})),_i=T("advancedSearchQueries/register",e=>N(e,{aq:Ut(),cq:Ut(),lq:Ut(),dq:Ut()}));var Gf=le(Nt(),e=>{e.addCase(ji,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ge(n)||(t.aq=n,t.aqWasSet=!0),ge(o)||(t.cq=o,t.cqWasSet=!0),ge(i)||(t.lq=i,t.lqWasSet=!0),ge(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(_i,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ge(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ge(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ge(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ge(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Ct,(t,r)=>{let{aq:n,cq:o}=r.payload;ge(n)||(t.aq=n,t.aqWasSet=!0),ge(o)||(t.cq=o,t.cqWasSet=!0)})});function yb(e){return e.addReducers({advancedSearchQueries:Gf}),{updateAdvancedSearchQueries:ji,registerAdvancedSearchQueries:_i}}p();u();d();l();function hb(e){return e.addReducers({configuration:Ye}),{disableAnalytics:Ar,enableAnalytics:Cr,setOriginLevel2:wo,setOriginLevel3:xo,updateAnalyticsConfiguration:vr,updateBasicConfiguration:At}}p();u();d();l();function Sb(e){return e.addReducers({configuration:Ye,pipeline:xr,searchHub:jr}),{updateSearchConfiguration:et}}p();u();d();l();function vb(e){return e.addReducers({context:Si}),{addContext:ar,removeContext:sr,setContext:ir}}p();u();d();l();function Ab(e){return e.addReducers({debug:Fo}),{disableDebug:Eo,enableDebug:Ro}}p();u();d();l();function Cb(e){return e.addReducers({dictionaryFieldContext:Ai}),{addContext:Wr,removeContext:Yr,setContext:Gr}}p();u();d();l();p();u();d();l();p();u();d();l();var bb={collectionField:new V({emptyAllowed:!1,required:!1}),parentField:new V({emptyAllowed:!1,required:!1}),childField:new V({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new $({min:0,required:!1})},Wf=T("folding/register",e=>N(e,bb)),z4=re("folding/loadCollection",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Tt(i):Br(i,o),m=yield n.search({...a,q:wb(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Oe(m)?r(m.error):{collectionId:e,results:m.success.results,searchUid:m.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x131,_x132){return _ref52.apply(this,arguments)}}());function wb(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}p();u();d();l();var Yf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});p();u();d();l();var Zr=T("fields/registerFieldsToInclude",e=>N(e,bo)),Vi=T("fields/fetchall/enable"),Li=T("fields/fetchall/disable"),Ui=re("fields/fetchDescription",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:m}=o.configuration,{apiBaseUrl:f}=o.configuration.search,s=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:m,url:f??yt(m,a)});return Oe(s)?n(s.error):s.success.fields});return function(_x133,_x134){return _ref53.apply(this,arguments)}}());p();u();d();l();var Qi=["author","language","urihash","objecttype","collection","source","permanentid"],ic=[...Qi,"date","filetype","parents"],Kf=[...ic,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],Jf=()=>({fieldsToInclude:Qi,fetchAllFields:!1,fieldsDescription:[]});var Bi=le(Jf(),e=>e.addCase(Zr,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Vi,t=>{t.fetchAllFields=!0}).addCase(Li,t=>{t.fetchAllFields=!1}).addCase(Ui.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Wf,(t,{payload:r})=>{let n=Yf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function xb(e){return e.addReducers({fields:Bi}),{registerFieldsToInclude:Zr,enableFetchAllFields:Vi,disableFetchAllFields:Li,fetchFieldsDescription:Ui}}p();u();d();l();function Rb(e){return e.addReducers({pipeline:xr}),{setPipeline:br}}p();u();d();l();function Eb(e){return e.addReducers({recommendation:Mr}),{getRecommendations:xt,setRecommendationId:qr}}p();u();d();l();function Ib(e){return e.addReducers({}),{logRecommendationOpen:ti}}p();u();d();l();p();u();d();l();var Fb=new ke({content:new ce({required:!0}),conditions:new ce({required:!0}),priority:new $({required:!1,default:0,min:0}),fields:new J({required:!1,each:U})});function Xf(){let e=[],t=r=>{let n=Fb.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new sn("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function Zf(e){if(!Pb(e))throw Ke;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Xf();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Zr(i))},selectTemplate:r,selectLinkTemplate:n}}function Pb(e){return e.addReducers({fields:Bi}),!0}p();u();d();l();function kb(e){return e.addReducers({searchHub:jr}),{setSearchHub:Nr}}/**
|
|
30
|
+
`;function $h(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Hh=["1",1,"yes",!0];function Lo(){let e=[];return Ma()&&e.push(window.doNotTrack),Wa()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Hh.indexOf(t)!==-1)}var ul="v15",ll={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function zh(e=ll.default,t=ul,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Gh="38824e1f-37f5-42d3-8372-a4b8fa9df946",rt=class{get defaultOptions(){return{endpoint:ll.default,isCustomEndpoint:!1,token:"",version:ul,beforeSendHooks:[],afterSendHooks:[]}}get version(){return il}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[My,ky].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Lo()?this.runtime=new Vo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(X.view,{newEventType:X.view,addClientIdParameter:!0}),this.addEventTypeMapping(X.click,{newEventType:X.click,addClientIdParameter:!0}),this.addEventTypeMapping(X.custom,{newEventType:X.custom,addClientIdParameter:!0}),this.addEventTypeMapping(X.search,{newEventType:X.search,addClientIdParameter:!0})}initRuntime(t){return Ma()&&Fr()?new za(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):($h()&&console.warn(Bh),new Ga(t))}get storage(){return this.runtime.storage}determineVisitorId(){return D(this,void 0,void 0,function*(){try{return Ma()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Kt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Kt()}})}getCurrentVisitorId(){return D(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return D(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return D(this,void 0,void 0,function*(){if(Mo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(zu(t,zu(r,Gh)))}})}getParameters(t,...r){return D(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return D(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Kt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Lo())return null;try{let r=new URL(t).searchParams.get(bt.cvo_cid);if(r==null)return null;let n=bt.fromString(r);return!n||!Fr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return D(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>D(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>D(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>i?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((b,R)=>D(this,void 0,void 0,function*(){let F=yield b;return yield R(t,F)}),y)].reduce((y,b)=>D(this,void 0,void 0,function*(){let R=yield y;return yield b(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return D(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?Dh(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>D(this,void 0,void 0,function*(){let y=yield h;return yield S(y)}),Promise.resolve(r))})}makeEvent(t,...r){return D(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>D(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(m=>m(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return D(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return D(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new qo().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.search,t)})}sendSearchEvent(t){return D(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lt(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.click,t)})}sendClickEvent(t){return D(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lt(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.custom,t)})}sendCustomEvent(t){return D(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=lt(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return D(this,void 0,void 0,function*(){return this.makeEvent(X.view,t)})}sendViewEvent(t){return D(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return D(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return D(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[X.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(jh(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=lt(t,["custom"]),o={};r&&Do(r)&&(o=this.lowercaseKeys(r));let i=_h(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=lt(t,["custom"]);if(r&&Do(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=lt(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==X.view||r==X.click||r==X.search||r==X.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==X.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=lt(t,["userId"]);return Qh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=lt(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Do(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Do(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?Ky(t,r):t}get baseUrl(){return zh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},dt;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(dt||(dt={}));var q;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(q||(q={}));var Zu={[q.triggerNotify]:"queryPipelineTriggers",[q.triggerExecute]:"queryPipelineTriggers",[q.triggerQuery]:"queryPipelineTriggers",[q.triggerRedirect]:"queryPipelineTriggers",[q.queryErrorBack]:"errors",[q.queryErrorClear]:"errors",[q.queryErrorRetry]:"errors",[q.pagerNext]:"getMoreResults",[q.pagerPrevious]:"getMoreResults",[q.pagerNumber]:"getMoreResults",[q.pagerResize]:"getMoreResults",[q.pagerScrolling]:"getMoreResults",[q.facetSearch]:"facet",[q.facetShowLess]:"facet",[q.facetShowMore]:"facet",[q.recommendation]:"recommendation",[q.likeSmartSnippet]:"smartSnippet",[q.dislikeSmartSnippet]:"smartSnippet",[q.expandSmartSnippet]:"smartSnippet",[q.collapseSmartSnippet]:"smartSnippet",[q.openSmartSnippetFeedbackModal]:"smartSnippet",[q.closeSmartSnippetFeedbackModal]:"smartSnippet",[q.sendSmartSnippetReason]:"smartSnippet",[q.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[q.clearRecentQueries]:"recentQueries",[q.recentResultClick]:"recentlyClickedDocuments",[q.clearRecentResults]:"recentlyClickedDocuments",[q.showLessFoldedResults]:"folding",[q.caseDetach]:"case",[q.likeGeneratedAnswer]:"generatedAnswer",[q.dislikeGeneratedAnswer]:"generatedAnswer",[q.openGeneratedAnswerSource]:"generatedAnswer",[q.generatedAnswerStreamEnd]:"generatedAnswer",[q.generatedAnswerSourceHover]:"generatedAnswer",[q.generatedAnswerCopyToClipboard]:"generatedAnswer",[q.generatedAnswerHideAnswers]:"generatedAnswer",[q.generatedAnswerShowAnswers]:"generatedAnswer",[q.generatedAnswerExpand]:"generatedAnswer",[q.generatedAnswerCollapse]:"generatedAnswer",[q.generatedAnswerFeedbackSubmit]:"generatedAnswer",[q.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[dt.expandToFullUI]:"interface",[dt.openUserActions]:"User Actions",[dt.showPrecedingSessions]:"User Actions",[dt.showFollowingSessions]:"User Actions",[dt.clickViewedDocument]:"User Actions",[dt.clickPageView]:"User Actions",[dt.createArticle]:"createArticle"},Or=class{constructor(){this.runtime=new Vo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(X.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(X.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(X.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(X.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return il}};function Wh(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function Yh(e){return e.map(t=>t.replace(/;/g,""))}function dl(e){let r=e.join(";");return r.length<=256?r:dl(e.slice(1))}var el=e=>{let t=Yh(e),r=Wh(t);return dl(r)};function tl(e){let t=typeof e.partialQueries=="string"?e.partialQueries:el(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:el(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Uo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Lo();this.coveoAnalyticsClient=n?new Or:new rt(t)}disable(){this.coveoAnalyticsClient=new Or}enable(){this.coveoAnalyticsClient=new rt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(q.interfaceLoad)}logInterfaceLoad(){return D(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(q.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(q.recommendation)}logRecommendation(){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(q.recommendationOpen,t,r)}logRecommendationOpen(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(q.staticFilterClearAll,t)}logStaticFilterClearAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(q.staticFilterSelect,t)}logStaticFilterSelect(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(q.staticFilterDeselect,t)}logStaticFilterDeselect(t){return D(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(q.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return D(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(q.interfaceChange,t)}logInterfaceChange(t){return D(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(q.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return D(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(q.didyoumeanClick)}logDidYouMeanClick(){return D(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(q.resultsSort,t)}logResultsSort(t){return D(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(q.searchboxSubmit)}logSearchboxSubmit(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(q.searchboxClear)}logSearchboxClear(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(q.searchboxAsYouType)}logSearchboxAsYouType(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(q.breadcrumbFacet,t)}logBreadcrumbFacet(t){return D(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(q.breadcrumbResetAll)}logBreadcrumbResetAll(){return D(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(q.documentQuickview,t,r)}logDocumentQuickview(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(q.documentOpen,t,r)}logDocumentOpen(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(q.omniboxAnalytics,tl(t))}logOmniboxAnalytics(t){return D(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(q.omniboxFromLink,tl(t))}logOmniboxFromLink(t){return D(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(q.searchFromLink)}logSearchFromLink(){return D(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(q.triggerNotify,t)}logTriggerNotify(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(q.triggerExecute,t)}logTriggerExecute(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(q.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(q.undoTriggerQuery,t)}logUndoTriggerQuery(t){return D(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(q.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return D(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(q.pagerResize,t)}logPagerResize(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(q.pagerNumber,t)}logPagerNumber(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(q.pagerNext,t)}logPagerNext(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(q.pagerPrevious,t)}logPagerPrevious(t){return D(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(q.pagerScrolling)}logPagerScrolling(){return D(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(q.facetClearAll,t)}logFacetClearAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(q.facetSearch,t)}logFacetSearch(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(q.facetSelect,t)}logFacetSelect(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(q.facetDeselect,t)}logFacetDeselect(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(q.facetExclude,t)}logFacetExclude(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(q.facetUnexclude,t)}logFacetUnexclude(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(q.facetSelectAll,t)}logFacetSelectAll(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(q.facetUpdateSort,t)}logFacetUpdateSort(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(q.facetShowMore,t)}logFacetShowMore(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(q.facetShowLess,t)}logFacetShowLess(t){return D(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(q.queryError,t)}logQueryError(t){return D(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorBack);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorBack)})}})}logQueryErrorBack(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorRetry);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorRetry)})}})}logQueryErrorRetry(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return D(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(q.queryErrorClear);return{description:t.description,log:()=>D(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(q.queryErrorClear)})}})}logQueryErrorClear(){return D(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(q.likeSmartSnippet)}logLikeSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(q.dislikeSmartSnippet)}logDislikeSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(q.expandSmartSnippet)}logExpandSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(q.collapseSmartSnippet)}logCollapseSmartSnippet(){return D(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(q.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return D(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(q.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(q.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(q.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(q.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return D(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(q.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(q.copyToClipboard,t,r)}logCopyToClipboard(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(q.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(q.recentQueryClick)}logRecentQueryClick(){return D(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(q.clearRecentQueries)}logClearRecentQueries(){return D(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(q.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(q.clearRecentResults)}logClearRecentResults(){return D(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(q.noResultsBack)}logNoResultsBack(){return D(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(q.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(q.showLessFoldedResults)}logShowLessFoldedResults(){return D(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return D(this,arguments,void 0,function*(n,o,i=Zu[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),m=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(m);return{description:this.makeEventDescription(f,n),log:({searchUID:s})=>f.log({lastSearchQueryUid:s})}})}logCustomEvent(t,r){return D(this,arguments,void 0,function*(n,o,i=Zu[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEventWithType(t,r,n){return D(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return D(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({searchQueryUid:m})}})}logClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return D(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return D(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof rt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(q.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(q.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(q.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return D(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(q.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(q.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(q.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(q.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(q.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(q.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(q.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(q.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(q.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return D(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(q.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return D(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(q.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return D(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Qo=Object.assign({},wn),rl=Object.keys(Qo).map(e=>Qo[e]),Pr=class extends _a{constructor({client:t,uuidGenerator:r=Kt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>rl.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(rl.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Qo.pageview,{newEventType:X.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Qo.event,{newEventType:X.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return th(this.ticket)}};Pr.Id="svc";var Bo;(function(e){e.click="click",e.flowStart="flowStart"})(Bo||(Bo={}));var $e;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})($e||($e={}));var $o;(function(e){e.quit="Quit",e.solved="Solved"})($o||($o={}));var Ho=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Lo();this.coveoAnalyticsClient=o?new rt(t):new Or,this.svc=new Pr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Or,this.svc=new Pr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new rt(this.options),this.svc=new Pr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction($e.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction($e.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction($e.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent($e.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent($e.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction($e.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction($e.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction($e.caseCancelled,{reason:$o.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction($e.caseSolved,{reason:$o.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction($e.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Bo.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Bo.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return D(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof rt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return D(this,void 0,void 0,function*(){var i,a;let m=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(m)})}};var pl=e=>new rt(e).getCurrentVisitorId(),En=(e,t)=>typeof t=="function"?(...r)=>{let n=cn(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,In=(e,t)=>(...r)=>{let n=cn(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();function zo(){return{desiredCount:5,numberOfValues:8,set:{}}}p();u();d();l();p();u();d();l();p();u();d();l();function fl(e){let{activeValue:t,ancestryMap:r}=Kh(e);return t?Jh(t,r):[]}function Kh(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function Jh(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var Xh=(e,t)=>e.categoryFacetSet[t]?.request;var Ja=(e,t)=>{let r=Xh(e,t);return fl(r?.currentValues??[])};p();u();d();l();function Go(){return{}}p();u();d();l();function Wo(){return{}}p();u();d();l();function Yo(){return{}}p();u();d();l();function Ko(){return{}}function Xa(e){return{facetSet:e.facetSet??Ko(),categoryFacetSet:e.categoryFacetSet??Go(),dateFacetSet:e.dateFacetSet??Wo(),numericFacetSet:e.numericFacetSet??Yo(),automaticFacetSet:e.automaticFacetSet??zo()}}var Za=e=>{let t=[];return tS(e).forEach((r,n)=>{let o=uS(e,r.facetId),i=sS(r,n+1);if(eS(r)){if(!!!Ja(e,r.facetId).length)return;t.push({...i,...iS(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,m)=>{if(a.state==="idle")return;let f=ml(a,m+1,o),s=Zh(r)?gl(a):nS(a);t.push({...i,...f,...s})})}),rS(e).forEach((r,n)=>{let o=aS(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let m=ml(i,a+1,"specific"),f=gl(i);t.push({...o,...m,...f})})}),t},Zh=e=>e.type==="specific",eS=e=>e.type==="hierarchical",tS=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),rS=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),ml=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),nS=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),gl=e=>({displayValue:e.value,value:e.value}),oS=(e,t)=>Ja(e,t).map(n=>n.value).join(";"),iS=(e,t)=>{let n=oS(e,t);return{value:n,valuePosition:1,displayValue:n}},aS=(e,t)=>({title:yl(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),sS=(e,t)=>({title:yl(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),yl=(e,t)=>`${e}_${t}`,cS=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,uS=(e,t)=>{let r=cS(e,t);return r?r.type:"specific"};p();u();d();l();var Jt=e=>{if(lS(e))return e.generatedAnswer?.answerId;if(dS(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},lS=e=>"answer"in e&&"generatedAnswer"in e&&!H(e.generatedAnswer?.answerConfigurationId),dS=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",hl=e=>e.generatedAnswer?.fieldsToIncludeInCitations,pS=de(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));p();u();d();l();var je=()=>({q:"",enableQuerySyntax:!1});p();u();d();l();p();u();d();l();var Sl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Sl||{}),vl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(vl||{}),es=e=>{if(Fc(e))return e.map(t=>es(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},Al=()=>({by:"relevancy"});var Uk=new Q({values:{by:new ea({enum:vl,required:!0}),order:new ea({enum:Sl}),field:new V}});function Jo(){return es(Al())}p();u();d();l();p();u();d();l();var Tr=()=>"default";var fS=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},pt=class{constructor(t){this.getState=t;oe(this,"state");this.state=t()}getLanguage(){return fS(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let m=`context_${i}`;o[m]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Sr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Tr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Fn=class Fn extends pt{constructor(){super(...arguments);oe(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Za(Xa(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Fn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||Je().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Fn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Jt(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Jo()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(s=>s.expression),a=o.partialQueries.length-1,m=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:m,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||je().q}get responseTime(){return this.state.search?.duration||Je().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Je().response.totalCountFiltered}};oe(Fn,"fallbackPipelineName","default");var wt=Fn,Cl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Ie(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,s=i.configuration.analytics.enabled,g=new Uo({token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:En(e,n),beforeSendHooks:[In(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return s||g.disable(),g},ts=()=>{let t=Be.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Xo=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield pl(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(ts()&&{pageId:ts()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Ir(e)})}}});return function Xo(_x0,_x1){return _ref8.apply(this,arguments)}}();p();u();d();l();p();u();d();l();p();u();d();l();var Dr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Pn=class extends pt{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:je().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||Dr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||Dr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||Dr().recommendations.length}};p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var bl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function mS(e){return typeof e=="string"&&bl.test(e)}var rs=mS;p();u();d();l();var Ce=[];for(let e=0;e<256;++e)Ce.push((e+256).toString(16).slice(1));function wl(e,t=0){return(Ce[e[t+0]]+Ce[e[t+1]]+Ce[e[t+2]]+Ce[e[t+3]]+"-"+Ce[e[t+4]]+Ce[e[t+5]]+"-"+Ce[e[t+6]]+Ce[e[t+7]]+"-"+Ce[e[t+8]]+Ce[e[t+9]]+"-"+Ce[e[t+10]]+Ce[e[t+11]]+Ce[e[t+12]]+Ce[e[t+13]]+Ce[e[t+14]]+Ce[e[t+15]]).toLowerCase()}p();u();d();l();var ns,gS=new Uint8Array(16);function os(){if(!ns){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ns=crypto.getRandomValues.bind(crypto)}return ns(gS)}p();u();d();l();p();u();d();l();var yS=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),is={randomUUID:yS};function hS(e,t,r){if(is.randomUUID&&!t&&!e)return is.randomUUID();e=e||{};let n=e.random??e.rng?.()??os();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return wl(n)}var as=hS;p();u();d();l();function xl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function SS({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var Rl="visitorId";function vS(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(Rl),o=n&&rs(n)?n:t.generateUUID();return r.setItem(Rl,o),o}}}var kl="1.2.7",ss=128,Ol=192,El=224,Il=240,AS=248;function CS(e){return(e&AS)===Il?4:(e&Il)===El?3:(e&El)===Ol?2:1}function bS(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&ss)!=ss)break;if(r-=3,(n&Ol)!=ss){t-r>=CS(n)*3&&(r=t);break}}return e.substring(0,r)}function wS(e){let{trackingId:t}=e;return{trackingId:t}}function xS(e){return(e.source||[]).concat([`relay@${kl}`])}function Tl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,m=wS(t),f=n.getClientId();return Object.freeze({type:e,config:m,ts:Date.now(),source:xS(t),clientId:f,userAgent:a(),referrer:Fl(o()),location:Fl(i())})}function Fl(e){return e!==null?bS(e,1024):null}function RS(e,t,r,n,o){return{...t,meta:Tl(e,r,n,o)}}var ES="*";function IS(){let e=[];function t({type:f,callback:s}){return e.findIndex(g=>g.type===f&&g.callback===s)}function r(f,s){return f.type==="*"||s===f.type}function n(f){return t(f)<0&&e.push(f),()=>m(f.type,f.callback)}function o(f){e.forEach(s=>{if(r(s,f.meta.type))try{s.callback(f)}catch(g){console.error(g)}})}function i(f){if(f===ES)e.length=0;else for(let s=e.length-1;s>=0;s--)e[s].type===f&&e.splice(s,1)}function a(f){let s=t(f);s>=0&&e.splice(s,1)}function m(f,s){s?a({type:f,callback:s}):i(f)}return{add:n,call:o,remove:m}}function Pl({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}),...(!!n.environment&&{environment:n.environment})})}function FS(e){let t=Pl(e);return{get:()=>t,update:r=>{t=Pl({...t,...r})}}}var cs=PS();function PS(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,m=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${m};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function kS(){return{getItem(e){return cs.getItem(e)||localStorage.getItem(e)},removeItem(e){cs.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),cs.setItem(e,t,31556952e3)}}}function OS(){let e=document.referrer;return e===""?null:e}function us(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(xl().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:()=>OS(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>as(),storage:kS()}}function TS(){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 DS(){return{getItem(){return null},removeItem(){},setItem(){}}}function qS(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:DS()}}function MS(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=qS();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&NS()&&TS()?us():n}function NS(){try{return typeof window=="object"}catch{return!1}}function jS(e){return{get:()=>Object.freeze(MS(e))}}function Dl(e){let t=FS(e),r=IS(),n=jS(t),o=vS(n);return{emit:(i,a)=>{let m=t.get(),f=n.get(),s=RS(i,a,m,f,o);return SS({config:m,environment:f,event:s,listenerManager:r})},getMeta:i=>Tl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:kl}}p();u();d();l();function ql(){return typeof window<"u"&&typeof document<"u"}var kn=de(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Ir(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,m)=>{let f=VS(m);return Dl({mode:i?"emit":"disabled",url:o??to(e,t),token:r,trackingId:n??null,source:a,environment:f})}),_S={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},VS=e=>{if(!e)return;let t=e();return{...(ql()?us():_S),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};p();u();d();l();var On=class extends pt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Ml=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new On(t)})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??Ie(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,s=i.configuration.analytics.enabled,g=new Ho({enableAnalytics:s,token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:En(e,n),beforeSendHooks:[In(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return s||g.disable(),g};p();u();d();l();p();u();d();l();function Nl(e,t){return{...new wt(t).getBaseMetadata(),actionCause:e,type:e}}function LS(e){return Object.assign(e,{instantlyCallable:!0})}function US(e,t){let r=i=>LS(re(e,i)),n=r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(i,{getState:a,extra:m}){let{analyticsClientMiddleware:f,preprocessRequest:s,logger:g}=m;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:s,logger:g})).log({state:a(),extra:m})});return function(_x10,_x11){return _ref9.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref0=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f}){let{description:s,log:g}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f});return{description:s,action:r(/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(h,{getState:S,extra:y}){return yield g({state:S(),extra:y})});return function(_x13,_x14){return _ref1.apply(this,arguments)}}())}});return function prepare(_x12){return _ref0.apply(this,arguments)}}()}),n}var jl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return $S(i)}return n},QS=e=>e.configuration.analytics.analyticsMode==="legacy",BS=e=>e.configuration.analytics.analyticsMode==="next",$S=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=m=>new a(m)),US(e,/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*({getState:m,analyticsClientMiddleware:f,preprocessRequest:s,logger:g}){let h=[],S={log:function(){var _ref11=_asyncToGenerator(function*({state:x}){for(let I of h)yield I(x)});return function log(_x16){return _ref11.apply(this,arguments)}}()},y=m(),b=i({getState:m,logger:g,analyticsClientMiddleware:f,preprocessRequest:s,provider:r(m)}),R=yield t(b,m());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){QS(x)&&(yield HS(R,r,x,g,b.coveoAnalyticsClient))});return function(_x17){return _ref12.apply(this,arguments)}}());let{emit:F}=kn(y);return h.push(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(x){if(BS(x)&&o&&n){let I=n(x);yield XS(F,o,I)}});return function(_x18){return _ref13.apply(this,arguments)}}()),S});return function(_x15){return _ref10.apply(this,arguments)}}()));function HS(_x19,_x20,_x21,_x22,_x23){return _HS.apply(this,arguments)}function _HS(){_HS=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _HS.apply(this,arguments)}var zS=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref14=_asyncToGenerator(function*(i){r(n,o)});return function log(_x24){return _ref14.apply(this,arguments)}}()}),Fe=jl(e=>Cl({...e,provider:e.provider||new wt(e.getState)}),e=>e,wt),JD=jl(Ml,zS("caseAssist"),On);var ls=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return GS(e,r,t)};function GS(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:KS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:JS(e),queryPipeline:r.pipeline||wr()}}var Zo=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),_l={urihash:new V,sourcetype:new V,permanentid:new V},Vl={uniqueId:U,raw:new Q({values:_l}),title:U,uri:U,clickUri:U,rankingModifier:new V({required:!1,emptyAllowed:!0})};function WS(e){return Object.assign({},...Object.keys(_l).map(t=>({[t]:e[t]})))}function YS(e){return Object.assign({},...Object.keys(Vl).map(t=>({[t]:e[t]})),{raw:WS(e.raw)})}function KS(e){let t=e.raw.author;return H(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function JS(e){let t=e.raw.source;return H(t)?"unknown":t}var ds=e=>new ke(Vl).validate(YS(e));function XS(_x25,_x26,_x27){return _XS.apply(this,arguments)}function _XS(){_XS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _XS.apply(this,arguments)}p();u();d();l();var Ll=()=>Fe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Pn(e)),Ul=()=>({actionCause:"recommendationInterfaceLoad"}),ti=e=>Fe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(ds(e),t.makeRecommendationOpen(ls(e,r),Zo(e))),__legacy__provider:t=>new Pn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=ls(e,t),n=Zo(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var qr=T("recommendation/set",e=>N(e,{id:U})),xt=re("recommendation/get",/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield ZS(o),m=yield n.recommendations(a),f=Date.now()-i;return Oe(m)?r(m.error):{recommendations:m.success.results,analyticsAction:Ll(),duration:f,searchUid:m.success.searchUid,splitTestRun:m.success.splitTestRun,pipeline:m.success.pipeline}});return function(_x28,_x29){return _ref15.apply(this,arguments)}}()),ZS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Be.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield ev(e,Ul()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function ZS(_x30){return _ref16.apply(this,arguments)}}(),ev=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Xo(e.configuration.analytics,r)});return function ev(_x31,_x32){return _ref17.apply(this,arguments)}}();var Mr=le(Dr(),e=>{e.addCase(qr,(t,r)=>{t.id=r.payload.id}).addCase(xt.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(xt.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(xt.pending,t=>{t.isLoading=!0}).addCase(Po,(t,r)=>{t.error=r.payload,t.isLoading=!1})});p();u();d();l();var Nr=T("searchHub/set",e=>N(e,new V({required:!0,emptyAllowed:!0})));p();u();d();l();var jr=le(Tr(),e=>{e.addCase(Nr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(et,(t,r)=>r.payload.searchHub||t)});p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();function Ql(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Bl=Xe;function td(e,t){if(e===t||!(Bl(e)&&Bl(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=td(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function _r(e){let t=0;for(let r in e)t++;return t}var $l=e=>[].concat(...e);function tv(e){return new RegExp("(^|:)//").test(e)}function rv(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function oi(e){return e!=null}function nv(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var ov=e=>e.replace(/\/$/,""),iv=e=>e.replace(/^\//,"");function av(e,t){if(!e)return t;if(!t)return e;if(tv(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=ov(e),t=iv(t),`${e}${r}${t}`}function sv(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Hl=(...e)=>v(...e),cv=e=>e.status>=200&&e.status<=299,uv=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function zl(e){if(!Xe(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function rd({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=Hl,paramsSerializer:n,isJsonContentType:o=uv,jsonContentType:i="application/json",jsonReplacer:a,timeout:m,responseHandler:f,validateStatus:s,...g}={}){return typeof v>"u"&&r===Hl&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(S,y,b){let{getState:R,extra:F,endpoint:x,forced:I,type:w}=y,E,{url:M,headers:k=new C(g.headers),params:P=void 0,responseHandler:O=f??"json",validateStatus:j=s??cv,timeout:_=m,...L}=typeof S=="string"?{url:S}:S,B,z=y.signal;_&&(B=new c.AbortController,y.signal.addEventListener("abort",B.abort),z=B.signal);let W={...g,signal:z,...L};k=new C(zl(k)),W.headers=(yield t(k,{getState:R,arg:S,extra:F,endpoint:x,forced:I,type:w,extraOptions:b}))||k;let G=ee=>typeof ee=="object"&&(Xe(ee)||Array.isArray(ee)||typeof ee.toJSON=="function");if(!W.headers.has("content-type")&&G(W.body)&&W.headers.set("content-type",i),G(W.body)&&o(W.headers)&&(W.body=JSON.stringify(W.body,a)),P){let ee=~M.indexOf("?")?"&":"?",ie=n?n(P):new URLSearchParams(zl(P));M+=ee+ie}M=av(e,M);let Y=new Request(M,W);E={request:new Request(M,W)};let Z,fe=!1,we=B&&setTimeout(()=>{fe=!0,B.abort()},_);try{Z=yield r(Y)}catch(ee){return{error:{status:fe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ee)},meta:E}}finally{we&&clearTimeout(we),B?.signal.removeEventListener("abort",B.abort)}let Me=Z.clone();E.response=Me;let ue,se="";try{let ee;if(yield Promise.all([h(Z,O).then(ie=>ue=ie,ie=>ee=ie),Me.text().then(ie=>se=ie,()=>{})]),ee)throw ee}catch(ee){return{error:{status:"PARSING_ERROR",originalStatus:Z.status,data:se,error:String(ee)},meta:E}}return j(Z,ue)?{data:ue,meta:E}:{error:{status:Z.status,data:ue},meta:E}});return function(_x33,_x34,_x35){return _ref18.apply(this,arguments)}}());function h(_x36,_x37){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,y){if(typeof y=="function")return y(S);if(y==="content-type"&&(y=o(S.headers)?"json":"text"),y==="json"){let b=yield S.text();return b.length?JSON.parse(b):null}return S.text()});return _h2.apply(this,arguments)}}var Vr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function lv(){return _lv.apply(this,arguments)}function _lv(){_lv=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _lv.apply(this,arguments)}function dv(e,t){throw Object.assign(new Vr({error:e,meta:t}),{throwImmediately:!0})}var Gl={},pv=(e,t)=>(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Gl).maxRetries,(o||Gl).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:lv,retryCondition:(g,h,{attempt:S})=>S<=a,...t,...o},s=0;for(;;)try{let g=yield e(r,n,o);if(g.error)throw new Vr(g);return g}catch(g){if(s++,g.throwImmediately){if(g instanceof Vr)return g.value;throw g}if(g instanceof Vr&&!f.retryCondition(g.value.error,r,{attempt:s,baseQueryApi:n,extraOptions:o}))return g.value;yield f.backoff(s,f.maxRetries)}});return function(_x38,_x39,_x40){return _ref19.apply(this,arguments)}}()),nd=Object.assign(pv,{fail:dv}),gs=T("__rtkq/focused"),od=T("__rtkq/unfocused"),ys=T("__rtkq/online"),id=T("__rtkq/offline");function hs(e){return e.type==="query"}function fv(e){return e.type==="mutation"}function Ss(e){return e.type==="infinitequery"}function vs(e,t,r,n,o,i){return mv(e)?e(t,r,n,o).filter(oi).map(ps).map(i):Array.isArray(e)?e.map(ps).map(i):[]}function mv(e){return typeof e=="function"}function ps(e){return typeof e=="string"?{type:e}:e}function gv(e,t){return e.catch(t)}var qn=Symbol("forceQueryFn"),fs=e=>typeof e[qn]=="function";function yv({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,m=new Map,{unsubscribeQueryResult:f,removeMutationResult:s,updateSubscriptionOptions:g}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:I,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:y,getRunningMutationsThunk:b};function h(E,M){return k=>{let P=i.endpointDefinitions[E],O=e({queryArgs:M,endpointDefinition:P,endpointName:E});return a.get(k)?.[O]}}function S(E,M){return k=>m.get(k)?.[M]}function y(){return E=>Object.values(a.get(E)||{}).filter(oi)}function b(){return E=>Object.values(m.get(E)||{}).filter(oi)}function R(E){}function F(E,M){let k=(P,{subscribe:O=!0,forceRefetch:j,subscriptionOptions:_,[qn]:L,...B}={})=>(z,W)=>{let G=e({queryArgs:P,endpointDefinition:M,endpointName:E}),Y,te={...B,type:"query",subscribe:O,forceRefetch:j,subscriptionOptions:_,endpointName:E,originalArgs:P,queryCacheKey:G,[qn]:L};if(hs(M))Y=t(te);else{let{direction:pe,initialPageParam:en}=B;Y=r({...te,direction:pe,initialPageParam:en})}let Z=o.endpoints[E].select(P),fe=z(Y),we=Z(W());let{requestId:Me,abort:ue}=fe,se=we.requestId!==Me,ee=a.get(z)?.[G],ie=()=>Z(W()),Pe=Object.assign(L?fe.then(ie):se&&!ee?Promise.resolve(we):Promise.all([ee,fe]).then(ie),{arg:P,requestId:Me,subscriptionOptions:_,queryCacheKey:G,abort:ue,unwrap(){return _asyncToGenerator(function*(){let pe=yield Pe;if(pe.isError)throw pe.error;return pe.data})()},refetch:()=>z(k(P,{subscribe:!1,forceRefetch:!0})),unsubscribe(){O&&z(f({queryCacheKey:G,requestId:Me}))},updateSubscriptionOptions(pe){Pe.subscriptionOptions=pe,z(g({endpointName:E,requestId:Me,queryCacheKey:G,options:pe}))}});if(!ee&&!se&&!L){let pe=sv(a,z,{});pe[G]=Pe,Pe.then(()=>{delete pe[G],_r(pe)||a.delete(z)})}return Pe};return k}function x(E,M){return F(E,M)}function I(E,M){return F(E,M)}function w(E){return(M,{track:k=!0,fixedCacheKey:P}={})=>(O,j)=>{let _=n({type:"mutation",endpointName:E,originalArgs:M,track:k,fixedCacheKey:P}),L=O(_);let{requestId:B,abort:z,unwrap:W}=L,G=gv(L.unwrap().then(fe=>({data:fe})),fe=>({error:fe})),Y=()=>{O(s({requestId:B,fixedCacheKey:P}))},te=Object.assign(G,{arg:L.arg,requestId:B,abort:z,unwrap:W,reset:Y}),Z=m.get(O)||{};return m.set(O,Z),Z[B]=te,te.then(()=>{delete Z[B],_r(Z)||m.delete(O)}),P&&(Z[P]=te,te.then(()=>{Z[P]===te&&(delete Z[P],_r(Z)||m.delete(O))})),te}}}function hv(e){return e}var ri=(e={})=>({...e,[An]:!0});function Sv({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let m=(O,j,_,L)=>(B,z)=>{let W=r[O],G=n({queryArgs:j,endpointDefinition:W,endpointName:O});if(B(o.internalActions.queryResultPatched({queryCacheKey:G,patches:_})),!L)return;let Y=o.endpoints[O].select(j)(z()),te=vs(W.providesTags,Y.data,void 0,j,{},i);B(o.internalActions.updateProvidedBy({queryCacheKey:G,providedTags:te}))};function f(O,j,_=0){let L=[j,...O];return _&&L.length>_?L.slice(0,-1):L}function s(O,j,_=0){let L=[...O,j];return _&&L.length>_?L.slice(1):L}let g=(O,j,_,L=!0)=>(B,z)=>{let G=o.endpoints[O].select(j)(z()),Y={patches:[],inversePatches:[],undo:()=>B(o.util.patchQueryData(O,j,Y.inversePatches,L))};if(G.status==="uninitialized")return Y;let te;if("data"in G)if(De(G.data)){let[Z,fe,we]=go(G.data,_);Y.patches.push(...fe),Y.inversePatches.push(...we),te=Z}else te=_(G.data),Y.patches.push({op:"replace",path:[],value:te}),Y.inversePatches.push({op:"replace",path:[],value:G.data});return Y.patches.length===0||B(o.util.patchQueryData(O,j,Y.patches,L)),Y},h=(O,j,_)=>L=>L(o.endpoints[O].initiate(j,{subscribe:!1,forceRefetch:!0,[qn]:()=>({data:_})})),S=(O,j)=>O.query&&O[j]?O[j]:hv,y=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(O,{signal:j,abort:_,rejectWithValue:L,fulfillWithValue:B,dispatch:z,getState:W,extra:G}){let Y=r[O.endpointName];try{let te=S(Y,"transformResponse"),Z={signal:j,abort:_,dispatch:z,getState:W,extra:G,endpoint:O.endpointName,type:O.type,forced:O.type==="query"?b(O,W()):void 0,queryCacheKey:O.type==="query"?O.queryCacheKey:void 0},fe=O.type==="query"?O[qn]:void 0,we,Me=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(se,ee,ie,Pe){if(ee==null&&se.pages.length)return Promise.resolve({data:se});let pe={queryArg:O.originalArgs,pageParam:ee},en=yield ue(pe),gt=Pe?f:s;return{data:{pages:gt(se.pages,en.data,ie),pageParams:gt(se.pageParams,ee,ie)}}});return function Me(_x43,_x44,_x45,_x46){return _ref21.apply(this,arguments)}}();function ue(_x47){return _ue.apply(this,arguments)}function _ue(){_ue=_asyncToGenerator(function*(se){let ee,{extraOptions:ie}=Y;if(fe?ee=fe():Y.query?ee=yield t(Y.query(se),Z,ie):ee=yield Y.queryFn(se,Z,ie,pe=>t(pe,Z,ie)),typeof process<"u",ee.error)throw new Vr(ee.error,ee.meta);let Pe=yield te(ee.data,ee.meta,se);return{...ee,data:Pe}});return _ue.apply(this,arguments)}if(O.type==="query"&&"infiniteQueryOptions"in Y){let{infiniteQueryOptions:se}=Y,{maxPages:ee=1/0}=se,ie,Pe={pages:[],pageParams:[]},pe=a.selectQueryEntry(W(),O.queryCacheKey)?.data,gt=b(O,W())&&!O.direction||!pe?Pe:pe;if("direction"in O&&O.direction&>.pages.length){let Gn=O.direction==="backward",Hi=(Gn?ad:ms)(se,gt);ie=yield Me(gt,Hi,ee,Gn)}else{let{initialPageParam:Gn=se.initialPageParam}=O,$i=pe?.pageParams??[],Hi=$i[0]??Gn,tm=$i.length;ie=yield Me(gt,Hi,ee),fe&&(ie={data:ie.data.pages[0]});for(let ac=1;ac<tm;ac++){let rm=ms(se,ie.data);ie=yield Me(ie.data,rm,ee)}}we=ie}else we=yield ue(O.originalArgs);return B(we.data,ri({fulfilledTimeStamp:Date.now(),baseQueryMeta:we.meta}))}catch(te){let Z=te;if(Z instanceof Vr){let fe=S(Y,"transformErrorResponse");try{return L(yield fe(Z.value,Z.meta,O.originalArgs),ri({baseQueryMeta:Z.meta}))}catch(we){Z=we}}throw typeof process<"u",console.error(Z),Z}});return function y(_x41,_x42){return _ref20.apply(this,arguments)}}();function b(O,j){let _=a.selectQueryEntry(j,O.queryCacheKey),L=a.selectConfig(j).refetchOnMountOrArgChange,B=_?.fulfilledTimeStamp,z=O.forceRefetch??(O.subscribe&&L);return z?z===!0||(Number(new Date)-Number(B))/1e3>=z:!1}let R=()=>re(`${e}/executeQuery`,y,{getPendingMeta({arg:j}){let _=r[j.endpointName];return ri({startedTimeStamp:Date.now(),...(Ss(_)?{direction:j.direction}:{})})},condition(j,{getState:_}){let L=_(),B=a.selectQueryEntry(L,j.queryCacheKey),z=B?.fulfilledTimeStamp,W=j.originalArgs,G=B?.originalArgs,Y=r[j.endpointName],te=j.direction;return fs(j)?!0:B?.status==="pending"?!1:b(j,L)||hs(Y)&&Y?.forceRefetch?.({currentArg:W,previousArg:G,endpointState:B,state:L})?!0:!(z&&!te)},dispatchConditionRejection:!0}),F=R(),x=R(),I=re(`${e}/executeMutation`,y,{getPendingMeta(){return ri({startedTimeStamp:Date.now()})}}),w=O=>"force"in O,E=O=>"ifOlderThan"in O,M=(O,j,_)=>(L,B)=>{let z=w(_)&&_.force,W=E(_)&&_.ifOlderThan,G=(te=!0)=>{let Z={forceRefetch:te,isPrefetch:!0};return o.endpoints[O].initiate(j,Z)},Y=o.endpoints[O].select(j)(B());if(z)L(G());else if(W){let te=Y?.fulfilledTimeStamp;if(!te){L(G());return}(Number(new Date)-Number(new Date(te)))/1e3>=W&&L(G())}else L(G(!1))};function k(O){return j=>j?.meta?.arg?.endpointName===O}function P(O,j){return{matchPending:yr(vo(O),k(j)),matchFulfilled:yr(ct(O),k(j)),matchRejected:yr(Gt(O),k(j))}}return{queryThunk:F,mutationThunk:I,infiniteQueryThunk:x,prefetch:M,updateQueryData:g,upsertQueryData:h,patchQueryData:m,buildMatchThunkActions:P}}function ms(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function ad(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function sd(e,t,r,n){return vs(r[e.meta.arg.endpointName][t],ct(e)?e.payload:void 0,bn(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function ni(e,t,r){let n=e[t];n&&r(n)}function Mn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Wl(e,t,r){let n=e[Mn(t)];n&&r(n)}var Tn={};function vv({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:m},assertTagType:f,config:s}){let g=T(`${e}/resetApiState`);function h(k,P,O,j){var _;k[_=P.queryCacheKey]??(k[_]={status:"uninitialized",endpointName:P.endpointName}),ni(k,P.queryCacheKey,L=>{L.status="pending",L.requestId=O&&L.requestId?L.requestId:j.requestId,P.originalArgs!==void 0&&(L.originalArgs=P.originalArgs),L.startedTimeStamp=j.startedTimeStamp;let B=o[j.arg.endpointName];Ss(B)&&"direction"in P&&(L.direction=P.direction)})}function S(k,P,O,j){ni(k,P.arg.queryCacheKey,_=>{if(_.requestId!==P.requestId&&!j)return;let{merge:L}=o[P.arg.endpointName];if(_.status="fulfilled",L){if(_.data!==void 0){let{fulfilledTimeStamp:B,arg:z,baseQueryMeta:W,requestId:G}=P,Y=st(_.data,te=>L(te,O,{arg:z.originalArgs,baseQueryMeta:W,fulfilledTimeStamp:B,requestId:G}));_.data=Y}else _.data=O;}else _.data=o[P.arg.endpointName].structuralSharing??!0?td(Ne(_.data)?wa(_.data):_.data,O):O;delete _.error,_.fulfilledTimeStamp=P.fulfilledTimeStamp})}let y=Wt({name:`${e}/queries`,initialState:Tn,reducers:{removeQueryResult:{reducer(k,{payload:{queryCacheKey:P}}){delete k[P]},prepare:hr()},cacheEntriesUpserted:{reducer(k,P){for(let O of P.payload){let{queryDescription:j,value:_}=O;h(k,j,!0,{arg:j,requestId:P.meta.requestId,startedTimeStamp:P.meta.timestamp}),S(k,{arg:j,requestId:P.meta.requestId,fulfilledTimeStamp:P.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:k=>({payload:k.map(j=>{let{endpointName:_,arg:L,value:B}=j,z=o[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:j.arg,queryCacheKey:n({queryArgs:L,endpointDefinition:z,endpointName:_})},value:B}}),meta:{[An]:!0,requestId:Co(),timestamp:Date.now()}})},queryResultPatched:{reducer(k,{payload:{queryCacheKey:P,patches:O}}){ni(k,P,j=>{j.data=Ra(j.data,O.concat())})},prepare:hr()}},extraReducers(k){k.addCase(t.pending,(P,{meta:O,meta:{arg:j}})=>{let _=fs(j);h(P,j,_,O)}).addCase(t.fulfilled,(P,{meta:O,payload:j})=>{let _=fs(O.arg);S(P,O,j,_)}).addCase(t.rejected,(P,{meta:{condition:O,arg:j,requestId:_},error:L,payload:B})=>{ni(P,j.queryCacheKey,z=>{if(!O){if(z.requestId!==_)return;z.status="rejected",z.error=B??L}})}).addMatcher(m,(P,O)=>{let{queries:j}=a(O);for(let[_,L]of Object.entries(j))(L?.status==="fulfilled"||L?.status==="rejected")&&(P[_]=L)})}}),b=Wt({name:`${e}/mutations`,initialState:Tn,reducers:{removeMutationResult:{reducer(k,{payload:P}){let O=Mn(P);O in k&&delete k[O]},prepare:hr()}},extraReducers(k){k.addCase(r.pending,(P,{meta:O,meta:{requestId:j,arg:_,startedTimeStamp:L}})=>{_.track&&(P[Mn(O)]={requestId:j,status:"pending",endpointName:_.endpointName,startedTimeStamp:L})}).addCase(r.fulfilled,(P,{payload:O,meta:j})=>{j.arg.track&&Wl(P,j,_=>{_.requestId===j.requestId&&(_.status="fulfilled",_.data=O,_.fulfilledTimeStamp=j.fulfilledTimeStamp)})}).addCase(r.rejected,(P,{payload:O,error:j,meta:_})=>{_.arg.track&&Wl(P,_,L=>{L.requestId===_.requestId&&(L.status="rejected",L.error=O??j)})}).addMatcher(m,(P,O)=>{let{mutations:j}=a(O);for(let[_,L]of Object.entries(j))(L?.status==="fulfilled"||L?.status==="rejected")&&_!==L?.requestId&&(P[_]=L)})}}),R=Wt({name:`${e}/invalidation`,initialState:Tn,reducers:{updateProvidedBy:{reducer(k,P){var _,L;let{queryCacheKey:O,providedTags:j}=P.payload;for(let B of Object.values(k))for(let z of Object.values(B)){let W=z.indexOf(O);W!==-1&&z.splice(W,1)}for(let{type:B,id:z}of j){let W=(_=k[B]??(k[B]={}))[L=z||"__internal_without_id"]??(_[L]=[]);W.includes(O)||W.push(O)}},prepare:hr()}},extraReducers(k){k.addCase(y.actions.removeQueryResult,(P,{payload:{queryCacheKey:O}})=>{for(let j of Object.values(P))for(let _ of Object.values(j)){let L=_.indexOf(O);L!==-1&&_.splice(L,1)}}).addMatcher(m,(P,O)=>{var _,L;let{provided:j}=a(O);for(let[B,z]of Object.entries(j))for(let[W,G]of Object.entries(z)){let Y=(_=P[B]??(P[B]={}))[L=W||"__internal_without_id"]??(_[L]=[]);for(let te of G)Y.includes(te)||Y.push(te)}}).addMatcher(Ze(ct(t),bn(t)),(P,O)=>{let j=sd(O,"providesTags",o,f),{queryCacheKey:_}=O.meta.arg;R.caseReducers.updateProvidedBy(P,R.actions.updateProvidedBy({queryCacheKey:_,providedTags:j}))})}}),F=Wt({name:`${e}/subscriptions`,initialState:Tn,reducers:{updateSubscriptionOptions(k,P){},unsubscribeQueryResult(k,P){},internal_getRTKQSubscriptions(){}}}),x=Wt({name:`${e}/internalSubscriptions`,initialState:Tn,reducers:{subscriptionsUpdated:{reducer(k,P){return Ra(k,P.payload)},prepare:hr()}}}),I=Wt({name:`${e}/config`,initialState:{online:nv(),focused:rv(),middlewareRegistered:!1,...s},reducers:{middlewareRegistered(k,{payload:P}){k.middlewareRegistered=k.middlewareRegistered==="conflict"||i!==P?"conflict":!0}},extraReducers:k=>{k.addCase(ys,P=>{P.online=!0}).addCase(id,P=>{P.online=!1}).addCase(gs,P=>{P.focused=!0}).addCase(od,P=>{P.focused=!1}).addMatcher(m,P=>({...P}))}}),w=dr({queries:y.reducer,mutations:b.reducer,provided:R.reducer,subscriptions:x.reducer,config:I.reducer}),E=(k,P)=>w(g.match(P)?void 0:k,P),M={...I.actions,...y.actions,...F.actions,...x.actions,...b.actions,...R.actions,resetApiState:g};return{reducer:E,actions:M}}var Dn=Symbol.for("RTKQ/skipToken"),cd={status:"uninitialized"},Yl=st(cd,()=>{}),Kl=st(cd,()=>{});function Av({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>Yl,o=w=>Kl;return{buildQuerySelector:S,buildInfiniteQuerySelector:y,buildMutationSelector:b,selectInvalidatedBy:R,selectCachedArgsForQuery:F,selectApiState:a,selectQueries:m,selectMutations:s,selectQueryEntry:f,selectConfig:g};function i(w){return{...w,...Ql(w.status)}}function a(w){return w[t]}function m(w){return a(w)?.queries}function f(w,E){return m(w)?.[E]}function s(w){return a(w)?.mutations}function g(w){return a(w)?.config}function h(w,E,M){return k=>{if(k===Dn)return r(n,M);let P=e({queryArgs:k,endpointDefinition:E,endpointName:w});return r(j=>f(j,P)??Yl,M)}}function S(w,E){return h(w,E,i)}function y(w,E){let{infiniteQueryOptions:M}=E;function k(P){let O={...P,...Ql(P.status)},{isLoading:j,isError:_,direction:L}=O,B=L==="forward",z=L==="backward";return{...O,hasNextPage:x(M,O.data),hasPreviousPage:I(M,O.data),isFetchingNextPage:j&&B,isFetchingPreviousPage:j&&z,isFetchNextPageError:_&&B,isFetchPreviousPageError:_&&z}}return h(w,E,k)}function b(){return w=>{let E;return typeof w=="object"?E=Mn(w)??Dn:E=w,r(E===Dn?o:P=>a(P)?.mutations?.[E]??Kl,i)}}function R(w,E){let M=w[t],k=new Set;for(let P of E.filter(oi).map(ps)){let O=M.provided[P.type];if(!O)continue;let j=(P.id!==void 0?O[P.id]:$l(Object.values(O)))??[];for(let _ of j)k.add(_)}return $l(Array.from(k.values()).map(P=>{let O=M.queries[P];return O?[{queryCacheKey:P,endpointName:O.endpointName,originalArgs:O.originalArgs}]:[]}))}function F(w,E){return Object.values(m(w)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function x(w,E){return E?ms(w,E)!=null:!1}function I(w,E){return!E||!w.getPreviousPageParam?!1:ad(w,E)!=null}}var Jl=WeakMap?new WeakMap:void 0,Xl=({endpointName:e,queryArgs:t})=>{let r="",n=Jl?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Xe(a)?Object.keys(a).sort().reduce((m,f)=>(m[f]=a[f],m),{}):a,a));Xe(t)&&Jl?.set(t,o),r=o}return`${e}(${r})`};function Cv(...e){return function(r){let n=gr(s=>r.extractRehydrationInfo?.(s,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(s){let g=Xl;if("serializeQueryArgs"in s.endpointDefinition){let h=s.endpointDefinition.serializeQueryArgs;g=S=>{let y=h(S);return typeof y=="string"?y:Xl({...S,queryArgs:y})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(s)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(s){s()},apiUid:Co(),extractRehydrationInfo:n,hasRehydrationInfo:gr(s=>n(s)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:s,endpoints:g}){if(s)for(let h of s)o.tagTypes.includes(h)||o.tagTypes.push(h);if(g)for(let[h,S]of Object.entries(g))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},m=e.map(s=>s.init(a,o,i));function f(s){let g=s.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(g)){if(s.overrideExisting!==!0&&h in i.endpointDefinitions){if(s.overrideExisting==="throw")throw new Error(Ge(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let y of m)y.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ft(e,...t){return Object.assign(e,...t)}var bv=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:m}=e.internalActions,f=(y,b)=>{var F,x;if(a.match(b)){let{queryCacheKey:I,requestId:w,options:E}=b.payload;return y?.[I]?.[w]&&(y[I][w]=E),!0}if(m.match(b)){let{queryCacheKey:I,requestId:w}=b.payload;return y[I]&&delete y[I][w],!0}if(e.internalActions.removeQueryResult.match(b))return delete y[b.payload.queryCacheKey],!0;if(t.pending.match(b)){let{meta:{arg:I,requestId:w}}=b,E=y[F=I.queryCacheKey]??(y[F]={});return E[`${w}_running`]={},I.subscribe&&(E[w]=I.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(b)||t.rejected.match(b)){let I=y[b.meta.arg.queryCacheKey]||{},w=`${b.meta.requestId}_running`;R||(R=!!I[w]),delete I[w]}if(t.rejected.match(b)){let{meta:{condition:I,arg:w,requestId:E}}=b;if(I&&w.subscribe){let M=y[x=w.queryCacheKey]??(y[x]={});M[E]=w.subscriptionOptions??M[E]??{},R=!0}}return R},s=()=>r.currentSubscriptions,S={getSubscriptions:s,getSubscriptionCount:y=>{let R=s()[y]??{};return _r(R)},isRequestSubscribed:(y,b)=>!!s()?.[y]?.[b]};return(y,b)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(y))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(y))return[!1,S];let R=f(r.currentSubscriptions,y),F=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=go(o,()=>w);b.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof y.type=="string"&&!!y.type.startsWith(n),I=t.rejected.match(y)&&y.meta.condition&&!!y.meta.arg.subscribe;F=!x&&!I}return[F,!1]}};function wv(e){for(let t in e)return!1;return!0}var xv=2147483647/1e3-1,Rv=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:m,unsubscribeQueryResult:f,cacheEntriesUpserted:s}=t.internalActions,g=Ze(f.match,r.fulfilled,r.rejected,s.match);function h(F){let x=o.currentSubscriptions[F];return!!x&&!wv(x)}let S={},y=(F,x,I)=>{let w=x.getState(),E=a(w);if(g(F)){let M;if(s.match(F))M=F.payload.map(k=>k.queryDescription.queryCacheKey);else{let{queryCacheKey:k}=f.match(F)?F.payload:F.meta.arg;M=[k]}b(M,x,E)}if(t.util.resetApiState.match(F))for(let[M,k]of Object.entries(S))k&&clearTimeout(k),delete S[M];if(n.hasRehydrationInfo(F)){let{queries:M}=n.extractRehydrationInfo(F);b(Object.keys(M),x,E)}};function b(F,x,I){let w=x.getState();for(let E of F){let M=i(w,E);R(E,M?.endpointName,x,I)}}function R(F,x,I,w){let M=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(M===1/0)return;let k=Math.max(0,Math.min(M,xv));if(!h(F)){let P=S[F];P&&clearTimeout(P),S[F]=setTimeout(()=>{h(F)||I.dispatch(m({queryCacheKey:F})),delete S[F]},k*1e3)}}return y},Zl=new Error("Promise never resolved before cacheEntryRemoved."),Ev=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:m}})=>{let f=Ao(n),s=Ao(o),g=ct(n,o),h={};function S(x,I,w){let E=h[x];E?.valueResolved&&(E.valueResolved({data:I,meta:w}),delete E.valueResolved)}function y(x){let I=h[x];I&&(delete h[x],I.cacheEntryRemoved())}let b=(x,I,w)=>{let E=R(x);function M(k,P,O,j){let _=a(w,P),L=a(I.getState(),P);!_&&L&&F(k,j,P,I,O)}if(n.pending.match(x))M(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:k,value:P}of x.payload){let{endpointName:O,originalArgs:j,queryCacheKey:_}=k;M(O,_,x.meta.requestId,j),S(_,P,{})}else if(o.pending.match(x))I.getState()[t].mutations[E]&&F(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,I,x.meta.requestId);else if(g(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))y(E);else if(e.util.resetApiState.match(x))for(let k of Object.keys(h))y(k)};function R(x){return f(x)?x.meta.arg.queryCacheKey:s(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?Mn(x.payload):""}function F(x,I,w,E,M){let k=r.endpointDefinitions[x],P=k?.onCacheEntryAdded;if(!P)return;let O={},j=new Promise(G=>{O.cacheEntryRemoved=G}),_=Promise.race([new Promise(G=>{O.valueResolved=G}),j.then(()=>{throw Zl})]);_.catch(()=>{}),h[w]=O;let L=e.endpoints[x].select(k.type==="query"?I:w),B=E.dispatch((G,Y,te)=>te),z={...E,getCacheEntry:()=>L(E.getState()),requestId:M,extra:B,updateCachedData:k.type==="query"?G=>E.dispatch(e.util.updateQueryData(x,I,G)):void 0,cacheDataLoaded:_,cacheEntryRemoved:j},W=P(I,z);Promise.resolve(W).catch(G=>{if(G!==Zl)throw G})}return b},Iv=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Fv=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:m,internalState:f})=>{let{removeQueryResult:s}=i.internalActions,g=Ze(ct(n),bn(n)),h=Ze(ct(n,o),Gt(n,o)),S=[],y=(F,x)=>{g(F)?R(sd(F,"invalidatesTags",r,a),x):h(F)?R([],x):i.util.invalidateTags.match(F)&&R(vs(F.payload,void 0,void 0,void 0,void 0,a),x)};function b(F){let{queries:x,mutations:I}=F;for(let w of[x,I])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(F,x){let I=x.getState(),w=I[e];if(S.push(...F),w.config.invalidationBehavior==="delayed"&&b(w))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(I,E);t.batch(()=>{let k=Array.from(M.values());for(let{queryCacheKey:P}of k){let O=w.queries[P],j=f.currentSubscriptions[P]??{};O&&(_r(j)===0?x.dispatch(s({queryCacheKey:P})):O.status!=="uninitialized"&&x.dispatch(m(O)))}})}return y},Pv=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(y,b)=>{(r.internalActions.updateSubscriptionOptions.match(y)||r.internalActions.unsubscribeQueryResult.match(y))&&s(y.payload,b),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&s(y.meta.arg,b),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&f(y.meta.arg,b),r.util.resetApiState.match(y)&&h()};function m(y,b){let F=b.getState()[e].queries[y],x=o.currentSubscriptions[y];if(!(!F||F.status==="uninitialized"))return x}function f({queryCacheKey:y},b){let R=b.getState()[e],F=R.queries[y],x=o.currentSubscriptions[y];if(!F||F.status==="uninitialized")return;let{lowestPollingInterval:I,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(I))return;let E=i[y];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+I;i[y]={nextPollTimestamp:M,pollingInterval:I,timeout:setTimeout(()=>{(R.config.focused||!w)&&b.dispatch(n(F)),f({queryCacheKey:y},b)},I)}}function s({queryCacheKey:y},b){let F=b.getState()[e].queries[y],x=o.currentSubscriptions[y];if(!F||F.status==="uninitialized")return;let{lowestPollingInterval:I}=S(x);if(!Number.isFinite(I)){g(y);return}let w=i[y],E=Date.now()+I;(!w||E<w.nextPollTimestamp)&&f({queryCacheKey:y},b)}function g(y){let b=i[y];b?.timeout&&clearTimeout(b.timeout),delete i[y]}function h(){for(let y of Object.keys(i))g(y)}function S(y={}){let b=!1,R=Number.POSITIVE_INFINITY;for(let F in y)y[F].pollingInterval&&(R=Math.min(y[F].pollingInterval,R),b=y[F].skipPollingIfUnfocused||b);return{lowestPollingInterval:R,skipPollingIfUnfocused:b}}return a},kv=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=vo(r,n),i=Gt(r,n),a=ct(r,n),m={};return(s,g)=>{if(o(s)){let{requestId:h,arg:{endpointName:S,originalArgs:y}}=s.meta,b=t.endpointDefinitions[S],R=b?.onQueryStarted;if(R){let F={},x=new Promise((M,k)=>{F.resolve=M,F.reject=k});x.catch(()=>{}),m[h]=F;let I=e.endpoints[S].select(b.type==="query"?y:h),w=g.dispatch((M,k,P)=>P),E={...g,getCacheEntry:()=>I(g.getState()),requestId:h,extra:w,updateCachedData:b.type==="query"?M=>g.dispatch(e.util.updateQueryData(S,y,M)):void 0,queryFulfilled:x};R(y,E)}}else if(a(s)){let{requestId:h,baseQueryMeta:S}=s.meta;m[h]?.resolve({data:s.payload,meta:S}),delete m[h]}else if(i(s)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:y}=s.meta;m[h]?.reject({error:s.payload??s.error,isUnhandledError:!S,meta:y}),delete m[h]}}},Ov=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,s)=>{gs.match(f)&&m(s,"refetchOnFocus"),ys.match(f)&&m(s,"refetchOnReconnect")};function m(f,s){let g=f.getState()[e],h=g.queries,S=o.currentSubscriptions;t.batch(()=>{for(let y of Object.keys(S)){let b=h[y],R=S[y];if(!R||!b)continue;(Object.values(R).some(x=>x[s]===!0)||Object.values(R).every(x=>x[s]===void 0)&&g.config[s])&&(_r(R)===0?f.dispatch(i({queryCacheKey:y})):b.status!=="uninitialized"&&f.dispatch(n(b)))}})}return a};function Tv(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},m=h=>h.type.startsWith(`${t}/`),f=[Iv,Rv,Fv,Pv,Ev,kv];return{middleware:h=>{let S=!1,b={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:m},R=f.map(I=>I(b)),F=bv(b),x=Ov(b);return I=>w=>{if(!co(w))return I(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:I},M=h.getState(),[k,P]=F(w,E,M),O;if(k?O=I(w):O=P,h.getState()[t]&&(x(w,E,M),m(w)||o.hasRehydrationInfo(w)))for(let j of R)j(w,E,M);return O}},actions:a};function g(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var ed=Symbol(),Dv=({createSelector:e=de}={})=>({name:ed,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:m,refetchOnFocus:f,refetchOnReconnect:s,invalidationBehavior:g},h){lu();let S=ue=>(typeof process<"u",ue);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:ys,onOffline:id,onFocus:gs,onFocusLost:od},util:{}});let y=Av({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:b,selectCachedArgsForQuery:R,buildQuerySelector:F,buildInfiniteQuerySelector:x,buildMutationSelector:I}=y;ft(t.util,{selectInvalidatedBy:b,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:k,updateQueryData:P,upsertQueryData:O,prefetch:j,buildMatchThunkActions:_}=Sv({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:y}),{reducer:L,actions:B}=vv({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:f,refetchOnReconnect:s,refetchOnMountOrArgChange:m,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});ft(t.util,{patchQueryData:k,updateQueryData:P,upsertQueryData:O,prefetch:j,resetApiState:B.resetApiState,upsertQueryEntries:B.cacheEntriesUpserted}),ft(t.internalActions,B);let{middleware:z,actions:W}=Tv({reducerPath:o,context:h,queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:y});ft(t.util,W),ft(t,{reducer:L,middleware:z});let{buildInitiateQuery:G,buildInitiateInfiniteQuery:Y,buildInitiateMutation:te,getRunningMutationThunk:Z,getRunningMutationsThunk:fe,getRunningQueriesThunk:we,getRunningQueryThunk:Me}=yv({queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return ft(t.util,{getRunningMutationThunk:Z,getRunningMutationsThunk:fe,getRunningQueryThunk:Me,getRunningQueriesThunk:we}),{name:ed,injectEndpoint(ue,se){var Pe;let ie=(Pe=t.endpoints)[ue]??(Pe[ue]={});hs(se)&&ft(ie,{name:ue,select:F(ue,se),initiate:G(ue,se)},_(w,ue)),fv(se)&&ft(ie,{name:ue,select:I(),initiate:te(ue)},_(M,ue)),Ss(se)&&ft(ie,{name:ue,select:x(ue,se),initiate:Y(ue,se)},_(w,ue))}}}}),ud=Cv(Dv());p();u();d();l();var ii=e=>e.query,ld=e=>e.query?.enableQuerySyntax;var Rq=de(e=>ii(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),qv=de(e=>e.generatedAnswer?.answerApiQueryParams,e=>e??Dn);p();u();d();l();p();u();d();l();var ai=e=>Fe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Jt(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Jt(t)??"",answerGenerated:e??!1})}),si=()=>Fe({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Jt(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});p();u();d();l();p();u();d();l();var dd=de(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});p();u();d();l();var ci=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:Ir(e)}});p();u();d();l();var pd=e=>e.context;p();u();d();l();var fd=e=>e.pipeline;p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var md=60,gd=md*60,yd=gd*24,Mv=yd*7,Xt=1e3,Lr=md*Xt,As=gd*Xt,hd=yd*Xt,Sd=Mv*Xt,Zt="millisecond",Rt="second",_e="minute",Et="hour",Ve="day",Ur="week",be="month",er="quarter",nt="year",It="date",vd="YYYY-MM-DDTHH:mm:ssZ",Cs="Invalid Date",Ad=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Cd=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;p();u();d();l();var wd={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var r=["th","st","nd","rd"],n=t%100;return"["+t+(r[(n-20)%10]||r[n]||r[0])+"]"}};p();u();d();l();var bs=function(t,r,n){var o=String(t);return!o||o.length>=r?t:""+Array(r+1-o.length).join(n)+t},Nv=function(t){var r=-t.utcOffset(),n=Math.abs(r),o=Math.floor(n/60),i=n%60;return(r<=0?"+":"-")+bs(o,2,"0")+":"+bs(i,2,"0")},jv=function e(t,r){if(t.date()<r.date())return-e(r,t);var n=(r.year()-t.year())*12+(r.month()-t.month()),o=t.clone().add(n,be),i=r-o<0,a=t.clone().add(n+(i?-1:1),be);return+(-(n+(r-o)/(i?o-a:a-o))||0)},_v=function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},Vv=function(t){var r={M:be,y:nt,w:Ur,d:Ve,D:It,h:Et,m:_e,s:Rt,ms:Zt,Q:er};return r[t]||String(t||"").toLowerCase().replace(/s$/,"")},Lv=function(t){return t===void 0},xd={s:bs,z:Nv,m:jv,a:_v,p:Vv,u:Lv};var Nn="en",tr={};tr[Nn]=wd;var Rd="$isDayjsObject",ws=function(t){return t instanceof li||!!(t&&t[Rd])},ui=function e(t,r,n){var o;if(!t)return Nn;if(typeof t=="string"){var i=t.toLowerCase();tr[i]&&(o=i),r&&(tr[i]=r,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var m=t.name;tr[m]=t,o=m}return!n&&o&&(Nn=o),o||!n&&Nn},me=function(t,r){if(ws(t))return t.clone();var n=typeof r=="object"?r:{};return n.date=t,n.args=arguments,new li(n)},Uv=function(t,r){return me(t,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})},ae=xd;ae.l=ui;ae.i=ws;ae.w=Uv;var Qv=function(t){var r=t.date,n=t.utc;if(r===null)return new Date(NaN);if(ae.u(r))return new Date;if(r instanceof Date)return new Date(r);if(typeof r=="string"&&!/Z$/i.test(r)){var o=r.match(Ad);if(o){var i=o[2]-1||0,a=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)}}return new Date(r)},li=function(){function e(r){this.$L=ui(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[Rd]=!0}var t=e.prototype;return t.parse=function(n){this.$d=Qv(n),this.init()},t.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},t.$utils=function(){return ae},t.isValid=function(){return this.$d.toString()!==Cs},t.isSame=function(n,o){var i=me(n);return this.startOf(o)<=i&&i<=this.endOf(o)},t.isAfter=function(n,o){return me(n)<this.startOf(o)},t.isBefore=function(n,o){return this.endOf(o)<me(n)},t.$g=function(n,o,i){return ae.u(n)?this[o]:this.set(i,n)},t.unix=function(){return Math.floor(this.valueOf()/1e3)},t.valueOf=function(){return this.$d.getTime()},t.startOf=function(n,o){var i=this,a=ae.u(o)?!0:o,m=ae.p(n),f=function(x,I){var w=ae.w(i.$u?Date.UTC(i.$y,I,x):new Date(i.$y,I,x),i);return a?w:w.endOf(Ve)},s=function(x,I){var w=[0,0,0,0],E=[23,59,59,999];return ae.w(i.toDate()[x].apply(i.toDate("s"),(a?w:E).slice(I)),i)},g=this.$W,h=this.$M,S=this.$D,y="set"+(this.$u?"UTC":"");switch(m){case nt:return a?f(1,0):f(31,11);case be:return a?f(1,h):f(0,h+1);case Ur:{var b=this.$locale().weekStart||0,R=(g<b?g+7:g)-b;return f(a?S-R:S+(6-R),h)}case Ve:case It:return s(y+"Hours",0);case Et:return s(y+"Minutes",1);case _e:return s(y+"Seconds",2);case Rt:return s(y+"Milliseconds",3);default:return this.clone()}},t.endOf=function(n){return this.startOf(n,!1)},t.$set=function(n,o){var i,a=ae.p(n),m="set"+(this.$u?"UTC":""),f=(i={},i[Ve]=m+"Date",i[It]=m+"Date",i[be]=m+"Month",i[nt]=m+"FullYear",i[Et]=m+"Hours",i[_e]=m+"Minutes",i[Rt]=m+"Seconds",i[Zt]=m+"Milliseconds",i)[a],s=a===Ve?this.$D+(o-this.$W):o;if(a===be||a===nt){var g=this.clone().set(It,1);g.$d[f](s),g.init(),this.$d=g.set(It,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](s);return this.init(),this},t.set=function(n,o){return this.clone().$set(n,o)},t.get=function(n){return this[ae.p(n)]()},t.add=function(n,o){var i=this,a;n=Number(n);var m=ae.p(o),f=function(S){var y=me(i);return ae.w(y.date(y.date()+Math.round(S*n)),i)};if(m===be)return this.set(be,this.$M+n);if(m===nt)return this.set(nt,this.$y+n);if(m===Ve)return f(1);if(m===Ur)return f(7);var s=(a={},a[_e]=Lr,a[Et]=As,a[Rt]=Xt,a)[m]||1,g=this.$d.getTime()+n*s;return ae.w(g,this)},t.subtract=function(n,o){return this.add(n*-1,o)},t.format=function(n){var o=this,i=this.$locale();if(!this.isValid())return i.invalidDate||Cs;var a=n||vd,m=ae.z(this),f=this.$H,s=this.$m,g=this.$M,h=i.weekdays,S=i.months,y=i.meridiem,b=function(w,E,M,k){return w&&(w[E]||w(o,a))||M[E].slice(0,k)},R=function(w){return ae.s(f%12||12,w,"0")},F=y||function(I,w,E){var M=I<12?"AM":"PM";return E?M.toLowerCase():M},x=function(w){switch(w){case"YY":return String(o.$y).slice(-2);case"YYYY":return ae.s(o.$y,4,"0");case"M":return g+1;case"MM":return ae.s(g+1,2,"0");case"MMM":return b(i.monthsShort,g,S,3);case"MMMM":return b(S,g);case"D":return o.$D;case"DD":return ae.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return b(i.weekdaysMin,o.$W,h,2);case"ddd":return b(i.weekdaysShort,o.$W,h,3);case"dddd":return h[o.$W];case"H":return String(f);case"HH":return ae.s(f,2,"0");case"h":return R(1);case"hh":return R(2);case"a":return F(f,s,!0);case"A":return F(f,s,!1);case"m":return String(s);case"mm":return ae.s(s,2,"0");case"s":return String(o.$s);case"ss":return ae.s(o.$s,2,"0");case"SSS":return ae.s(o.$ms,3,"0");case"Z":return m;default:break}return null};return a.replace(Cd,function(I,w){return w||x(I)||m.replace(":","")})},t.utcOffset=function(){return-Math.round(this.$d.getTimezoneOffset()/15)*15},t.diff=function(n,o,i){var a=this,m=ae.p(o),f=me(n),s=(f.utcOffset()-this.utcOffset())*Lr,g=this-f,h=function(){return ae.m(a,f)},S;switch(m){case nt:S=h()/12;break;case be:S=h();break;case er:S=h()/3;break;case Ur:S=(g-s)/Sd;break;case Ve:S=(g-s)/hd;break;case Et:S=g/As;break;case _e:S=g/Lr;break;case Rt:S=g/Xt;break;default:S=g;break}return i?S:ae.a(S)},t.daysInMonth=function(){return this.endOf(be).$D},t.$locale=function(){return tr[this.$L]},t.locale=function(n,o){if(!n)return this.$L;var i=this.clone(),a=ui(n,o,!0);return a&&(i.$L=a),i},t.clone=function(){return ae.w(this.$d,this)},t.toDate=function(){return new Date(this.valueOf())},t.toJSON=function(){return this.isValid()?this.toISOString():null},t.toISOString=function(){return this.$d.toISOString()},t.toString=function(){return this.$d.toUTCString()},e}(),Ed=li.prototype;me.prototype=Ed;[["$ms",Zt],["$s",Rt],["$m",_e],["$H",Et],["$W",Ve],["$M",be],["$y",nt],["$D",It]].forEach(function(e){Ed[e[1]]=function(t){return this.$g(t,e[0],e[1])}});me.extend=function(e,t){return e.$i||(e(t,li,me),e.$i=!0),me};me.locale=ui;me.isDayjs=ws;me.unix=function(e){return me(e*1e3)};me.en=tr[Nn];me.Ls=tr;me.p={};var Le=me;p();u();d();l();var Id=function(e,t){var r=t.prototype;r.quarter=function(i){return this.$utils().u(i)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+(i-1)*3)};var n=r.add;r.add=function(i,a){i=Number(i);var m=this.$utils().p(a);return m===er?this.add(i*3,be):n.bind(this)(i,a)};var o=r.startOf;r.startOf=function(i,a){var m=this.$utils(),f=m.u(a)?!0:a,s=m.p(i);if(s===er){var g=this.quarter()-1;return f?this.month(g*3).startOf(be).startOf(Ve):this.month(g*3+2).endOf(be).endOf(Ve)}return o.bind(this)(i,a)}};p();u();d();l();p();u();d();l();p();u();d();l();var Bv=function(t){return t.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(r,n,o){return n||o.slice(1)})},$v={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Fd=function(t,r){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(n,o,i){var a=i&&i.toUpperCase();return o||r[i]||$v[i]||Bv(r[a])})};var Hv=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,Pd=/\d/,jn=/\d\d/,zv=/\d{3}/,Gv=/\d{4}/,We=/\d\d?/,Wv=/[+-]?\d+/,Yv=/[+-]\d\d:?(\d\d)?|Z/,_n=/\d*[^-_:/,()\s\d]+/,Ft={},Td=function(t){return t=+t,t+(t>68?1900:2e3)};function Kv(e){if(!e||e==="Z")return 0;var t=e.match(/([+-]|\d\d)/g),r=+(t[1]*60)+(+t[2]||0);return r===0?0:t[0]==="+"?-r:r}var Re=function(t){return function(r){this[t]=+r}},kd=[Yv,function(e){var t=this.zone||(this.zone={});t.offset=Kv(e)}],xs=function(t){var r=Ft[t];return r&&(r.indexOf?r:r.s.concat(r.f))},Od=function(t,r){var n,o=Ft,i=o.meridiem;if(!i)n=t===(r?"pm":"PM");else for(var a=1;a<=24;a+=1)if(t.indexOf(i(a,0,r))>-1){n=a>12;break}return n},Jv={A:[_n,function(e){this.afternoon=Od(e,!1)}],a:[_n,function(e){this.afternoon=Od(e,!0)}],Q:[Pd,function(e){this.month=(e-1)*3+1}],S:[Pd,function(e){this.milliseconds=+e*100}],SS:[jn,function(e){this.milliseconds=+e*10}],SSS:[zv,function(e){this.milliseconds=+e}],s:[We,Re("seconds")],ss:[We,Re("seconds")],m:[We,Re("minutes")],mm:[We,Re("minutes")],H:[We,Re("hours")],h:[We,Re("hours")],HH:[We,Re("hours")],hh:[We,Re("hours")],D:[We,Re("day")],DD:[jn,Re("day")],Do:[_n,function(e){var t=Ft,r=t.ordinal,n=e.match(/\d+/);if(this.day=n[0],!!r)for(var o=1;o<=31;o+=1)r(o).replace(/\[|\]/g,"")===e&&(this.day=o)}],w:[We,Re("week")],ww:[jn,Re("week")],M:[We,Re("month")],MM:[jn,Re("month")],MMM:[_n,function(e){var t=xs("months"),r=xs("monthsShort"),n=(r||t.map(function(o){return o.slice(0,3)})).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[_n,function(e){var t=xs("months"),r=t.indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],Y:[Wv,Re("year")],YY:[jn,function(e){this.year=Td(e)}],YYYY:[Gv,Re("year")],Z:kd,ZZ:kd};function Xv(e){var t=e.afternoon;if(t!==void 0){var r=e.hours;t?r<12&&(e.hours+=12):r===12&&(e.hours=0),delete e.afternoon}}function Zv(e){e=Fd(e,Ft&&Ft.formats);for(var t=e.match(Hv),r=t.length,n=0;n<r;n+=1){var o=t[n],i=Jv[o],a=i&&i[0],m=i&&i[1];m?t[n]={regex:a,parser:m}:t[n]=o.replace(/^\[|\]$/g,"")}return function(f){for(var s={},g=0,h=0;g<r;g+=1){var S=t[g];if(typeof S=="string")h+=S.length;else{var y=S.regex,b=S.parser,R=f.slice(h),F=y.exec(R),x=F[0];b.call(s,x),f=f.replace(x,"")}}return Xv(s),s}}var eA=function(t,r,n,o){try{if(["x","X"].indexOf(r)>-1)return new Date((r==="X"?1e3:1)*t);var i=Zv(r),a=i(t),m=a.year,f=a.month,s=a.day,g=a.hours,h=a.minutes,S=a.seconds,y=a.milliseconds,b=a.zone,R=a.week,F=new Date,x=s||(!m&&!f?F.getDate():1),I=m||F.getFullYear(),w=0;m&&!f||(w=f>0?f-1:F.getMonth());var E=g||0,M=h||0,k=S||0,P=y||0;if(b)return new Date(Date.UTC(I,w,x,E,M,k,P+b.offset*60*1e3));if(n)return new Date(Date.UTC(I,w,x,E,M,k,P));var O;return O=new Date(I,w,x,E,M,k,P),R&&(O=o(O).week(R).toDate()),O}catch{return new Date("")}},Dd=function(e,t,r){r.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(Td=e.parseTwoDigitYear);var n=t.prototype,o=n.parse;n.parse=function(i){var a=i.date,m=i.utc,f=i.args;this.$u=m;var s=f[1];if(typeof s=="string"){var g=f[2]===!0,h=f[3]===!0,S=g||h,y=f[2];h&&(y=f[2]),Ft=this.$locale(),!g&&y&&(Ft=r.Ls[y]),this.$d=eA(a,s,m,r),this.init(),y&&y!==!0&&(this.$L=this.locale(y).$L),S&&a!=this.format(s)&&(this.$d=new Date("")),Ft={}}else if(s instanceof Array)for(var b=s.length,R=1;R<=b;R+=1){f[1]=s[R-1];var F=r.apply(this,f);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}R===b&&(this.$d=new Date(""))}else o.call(this,i)}};Le.extend(Dd);var qd="YYYY/MM/DD@HH:mm:ss",tA="1401-01-01";function Qr(e,t){let r=Le(e,t);return!r.isValid()&&!t?Le(e,qd):r}function di(e){return e.format(qd)}function Md(e,t){let r=Qr(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}Rs(r)}function Rs(e){if(e.isBefore(tA))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Le.extend(Id);var Nd=["past","now","next"],jd=["minute","hour","day","week","month","quarter","year"],rA=e=>{let t=e==="now";return{amount:new $({required:!t,min:1}),unit:new V({required:!t,constrainTo:jd}),period:new V({required:!0,constrainTo:Nd})}};function Es(e){if(typeof e=="string"&&!Pt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Qd(e):e;new ke(rA(t.period)).validate(t);let r=Vd(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Rs(r)}function _d(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Vd(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return Le().subtract(r,n);case"next":return Le().add(r,n);case"now":return Le()}}function Vn(e){return di(Vd(Qd(e)))}function Ld(e){return e.toLocaleLowerCase().split("-")}function Pt(e){let[t,r,n]=Ld(e);if(t==="now")return!0;if(!Nd.includes(t)||!jd.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Ud(e){return!!e&&typeof e=="object"&&"period"in e}function Qd(e){let[t,r,n]=Ld(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}p();u();d();l();function Bd(e){return e.type==="dateRange"}function $d(e){return`start${e}`}function Hd(e){return`end${e}`}var Is=()=>({dateFacetValueMap:{}});function nA(e,t,r){let n=e.start,o=e.end;return Pt(n)&&(n=Vn(n),r.dateFacetValueMap[t][$d(n)]=e.start),Pt(o)&&(o=Vn(o),r.dateFacetValueMap[t][Hd(o)]=e.end),{...e,start:n,end:o}}function Fs(e,t){if(Bd(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>nA(o,r,t))}}return e}function kt(e){let t=Is();return{request:{...e,facets:e.facets?.map(n=>Fs(n,t))},mappings:t}}function oA(e,t,r){return{...e,start:r.dateFacetValueMap[t][$d(e.start)]||e.start,end:r.dateFacetValueMap[t][Hd(e.end)]||e.end}}function iA(e,t){return e.facetId in t.dateFacetValueMap}function aA(e,t){return iA(e,t)?{...e,values:e.values.map(r=>oA(r,e.facetId,t))}:e}function pi(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>aA(n,t))}}:e}p();u();d();l();p();u();d();l();p();u();d();l();function Ot(e){return Object.values(e).map(t=>t.request)}function Ps(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function zd(e){return Ot(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ks={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function sA(e){return Ot(e).map(t=>{let r=ks[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function cA(e){return[...sA(e.facetSet??{}),...zd(e.numericFacetSet??{}),...zd(e.dateFacetSet??{}),...Ot(e.categoryFacetSet??{})]}function uA(e){return cA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function fi(e){return Ps(uA(e),e.facetOrder??[])}p();u();d();l();p();u();d();l();var Tt=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Be.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Xo(e.configuration.analytics,t))),...(e.excerptLength&&!H(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Tt(_x48,_x49){return _ref22.apply(this,arguments)}}();p();u();d();l();var Br=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??yt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&ci(e.configuration.analytics,t,r)),...(e.excerptLength&&!H(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});p();u();d();l();var Gd=de(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Dt=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t,r){let n=Ts(e),o=lA(e),i=dA(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Tt(e,r):Br(e,t,r);return kt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Os(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Dt(_x50,_x51,_x52){return _ref23.apply(this,arguments)}}();function Os(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function lA(e){return Ps(fA(e),e.facetOrder??[])}function dA(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(pA).filter(r=>r.currentValues.length>0):void 0}function pA(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function fA(e){return mA(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function mA(e){return[...gA(e.facetSet??{}),...Wd(e.numericFacetSet??{}),...Wd(e.dateFacetSet??{}),...Ot(e.categoryFacetSet??{})]}function gA(e){return Ot(e).map(t=>{let r=ks[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Wd(e){return Ot(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Ts(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Gd(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}p();u();d();l();p();u();d();l();var Ln=(e,t)=>{let r=e;return H(r[t])?H(e.raw[t])?null:e.raw[t]:r[t]},yA=e=>t=>e.every(r=>!H(Ln(t,r))),hA=e=>t=>e.every(r=>H(Ln(t,r))),SA=(e,t)=>r=>{let n=Yd(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},vA=(e,t)=>r=>{let n=Yd(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Yd=(e,t)=>{let r=Ln(t,e);return Pc(r)?r:[r]},Kd={getResultProperty:Ln,fieldsMustBeDefined:yA,fieldsMustNotBeDefined:hA,fieldMustMatch:SA,fieldMustNotMatch:vA};var Jd=de(e=>e.search,e=>e?.searchAction?.actionCause||"");p();u();d();l();var Xd=e=>e.searchHub;p();u();d();l();var Ds=de(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),_j=de(e=>e,e=>{let t=Ds(e);return t&&e?e[t].expression:""});p();u();d();l();var Zd=e=>e.configuration.search.locale,ep=e=>e.configuration.search.timezone;p();u();d();l();var tp=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};p();u();d();l();var rp=e=>e.excerptLength?.length;p();u();d();l();var np=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};p();u();d();l();var op=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};p();u();d();l();var ip=e=>e.sortCriteria;var ap=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Ie(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function ap(_x53){return _ref24.apply(this,arguments)}}(),sp=(e,t)=>{let r=ii(e)?.q,{aq:n,cq:o,dq:i,lq:a}=bA(e),m=pd(e),f=ci(e.configuration.analytics,t,{actionCause:Jd(e)}),s=Xd(e),g=fd(e),h=hl(e)??[],S=AA(e),y=Ds(e.tabSet)||"default",b=Zd(e),R=ep(e),F=t.referrer||"",x=np(e),I=ip(e),w=CA(e),E=rp(e),M=op(e),k=tp(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:ld(e)}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:h}},...(s?.length&&{searchHub:s}),...(g?.length&&{pipeline:g}),...(S.length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Os(e),firstResult:e.pagination.firstResult}),tab:y,locale:b,timezone:R,...(e.debug!==void 0&&{debug:e.debug}),referrer:F,...w,...(M??{}),...(E&&{excerptLength:E}),...(k&&{dictionaryFieldContext:k}),sortCriteria:I,...(x&&{facetOptions:x}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},AA=e=>fi(e)?.map(t=>Fs(t,Is())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),CA=e=>({actionsHistory:e.configuration.analytics.enabled?Be.getInstance().getHistory():[]}),bA=e=>{let t=dd(e),r=Ts(e);return{...t,...(r&&{cq:r})}};p();u();d();l();var cp=["text/plain","text/markdown"];var $r=new V({required:!0}),lp=new V,Hr=new K({required:!0}),wA={id:$r,title:$r,uri:$r,permanentid:$r,clickUri:lp},dp=new V({required:!0,constrainTo:cp}),nV=T("generatedAnswer/setIsVisible",e=>N(e,Hr)),pp=T("generatedAnswer/setAnswerId",e=>N(e,U)),oV=T("generatedAnswer/setAnswerGenerationMode",e=>N(e,new V({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),iV=T("generatedAnswer/setIsEnabled",e=>N(e,Hr)),Ms=T("generatedAnswer/updateMessage",e=>N(e,{textDelta:$r})),Ns=T("generatedAnswer/updateCitations",e=>N(e,{citations:new J({required:!0,each:new Q({values:wA})})})),xA=T("generatedAnswer/updateError",e=>N(e,{message:lp,code:new $({min:0})})),fp=T("generatedAnswer/resetAnswer"),aV=T("generatedAnswer/like"),sV=T("generatedAnswer/dislike"),cV=T("generatedAnswer/feedbackModal/open"),uV=T("generatedAnswer/expand"),lV=T("generatedAnswer/collapse"),dV=T("generatedAnswer/setId",e=>N(e,{id:new V({required:!0})})),pV=T("generatedAnswer/feedbackModal/close"),fV=T("generatedAnswer/sendFeedback"),qs=T("generatedAnswer/setIsLoading",e=>N(e,Hr)),up=T("generatedAnswer/setIsStreaming",e=>N(e,Hr)),js=T("generatedAnswer/setAnswerContentFormat",e=>N(e,dp)),mV=T("generatedAnswer/updateResponseFormat",e=>N(e,{contentFormat:new J({each:dp,default:["text/plain"]})})),gV=T("knowledge/updateAnswerConfigurationId",e=>N(e,$r)),yV=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>N(e,bo)),RA=T("generatedAnswer/setIsAnswerGenerated",e=>N(e,Hr)),_s=T("generatedAnswer/setCannotAnswer",e=>N(e,Hr)),EA=T("generatedAnswer/setAnswerApiQueryParams",e=>N(e,new Q({}))),hV=re("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:m}=a,{setAbortControllerRef:f}=e,s=yield ap(r),g=(y,b)=>{switch(y){case"genqa.headerMessageType":{let R=JSON.parse(b);n(js(R.contentFormat));break}case"genqa.messageType":n(Ms(JSON.parse(b)));break;case"genqa.citationsType":n(Ns(JSON.parse(b)));break;case"genqa.endOfStreamType":{let R=JSON.parse(b).answerGenerated,F=m.length!==0&&!R;n(_s(F)),n(up(!1)),n(RA(R)),n(ai(R)),n(si());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(qs(!0));let h=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(s,{write:y=>{h(s)&&(n(qs(!1)),y.payload&&y.payloadType&&g(y.payloadType,y.payload))},abort:y=>{h(s)&&n(xA(y))},close:()=>{h(s)&&n(up(!1))},resetAnswer:()=>{h(s)&&n(fp())}});S?f(S):n(qs(!1))});return function(_x54,_x55){return _ref25.apply(this,arguments)}}()),SV=re("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(fp());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=sp(i,n);r(EA(a)),yield r(mp(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x56,_x57){return _ref26.apply(this,arguments)}}());p();u();d();l();p();u();d();l();function yp(_x58,_x59){return _yp.apply(this,arguments)}function _yp(){_yp=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _yp.apply(this,arguments)}function hp(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=FA(t,a);let m=t.length,f=0;for(;r<m;){o&&(t[r]===10&&(f=++r),o=!1);let s=-1;for(;r<m&&s===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,s=r;break;case 10:s=r;break}if(s===-1)break;e(t.subarray(f,s),n),f=r,n=-1}f===m?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function Sp(e,t,r){let n=gp(),o=new TextDecoder;return function(a,m){if(a.length===0)r?.(n),n=gp();else if(m>0){let f=o.decode(a.subarray(0,m)),s=m+(a[m+1]===32?2:1),g=o.decode(a.subarray(s));switch(f){case"data":n.data=n.data?`${n.data}
|
|
31
|
+
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":IA(g,n,t);break}}}}function IA(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function FA(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function gp(){return{data:"",event:"",id:"",retry:void 0}}var Vs="text/event-stream",PA=1e3,vp="last-event-id";function Ap(){return typeof window<"u"}function Cp(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:m,fetch:f,...s}){return new Promise((g,h)=>{let S={...r};S.accept||(S.accept=Vs);let y;function b(){y?.abort(),document.hidden||E()}!m&&Ap()&&document.addEventListener("visibilitychange",b);let R=PA,F;function x(){Ap()&&document.removeEventListener("visibilitychange",b),clearTimeout(F),y?.abort()}t?.addEventListener("abort",()=>{x(),g()});let I=f??v,w=n??kA;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){y=c.AbortController?new c.AbortController:null;try{let M=yield I(e,{...s,headers:S,signal:y?.signal});yield w(M),yield yp(M.body,hp(Sp(k=>{k?S[vp]=k:delete S[vp]},k=>{R=k},o))),i?.(),x(),g()}catch(M){if(!y?.signal?.aborted)try{let k=a?.(M)??R;clearTimeout(F),F=setTimeout(E,k)}catch(k){x(),h(k)}}});return _E.apply(this,arguments)}E()})}function kA(e){let t=e.headers.get("content-type");if(!t?.startsWith(Vs))throw new Error(`Expected content-type to be ${Vs}, Actual: ${t}`)}p();u();d();l();var OA=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,m=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let s=Ie(a,i);return{data:rd({baseUrl:`${s}/rest/organizations/${a}/answer/v1/configs/${m}`,fetchFn:function(){var _ref28=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,y={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(b=>{y[b]=h[b]}),y.duplex="half",y.body=yield h.text(),v(S,y)});return function fetchFn(_x63){return _ref28.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(s){return{error:s}}});return function OA(_x60,_x61,_x62){return _ref27.apply(this,arguments)}}(),bp=ud({reducerPath:"answer",baseQuery:nd(OA,{maxRetries:3}),endpoints:()=>({})});var TA=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},DA=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},qA=(e,t)=>{e.citations=t.citations},MA=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},NA=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},jA=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&NA(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(TA(t,o),r(js(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(DA(t,o),r(Ms({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(qA(t,o),r(Ns({citations:o.citations})));break;case"genqa.endOfStreamType":MA(t,o),r(ai(o.answerGenerated??!1)),r(si());break}},_A=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},Ls=bp.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x64,_x65){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:m,insightConfiguration:f}=r(),{organizationId:s,environment:g,accessToken:h}=a,S=Ie(s,g),y=_A(S,s,m.answerConfigurationId,f?.insightId);yield Cp(y,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref29=_asyncToGenerator(function*(b){let R=b.headers.get("x-answer-id");R&&o(F=>{F.answerId=R,i(pp(R))})});return function onopen(_x66){return _ref29.apply(this,arguments)}}(),onmessage:b=>{o(R=>{jA(b,R,i)})},onerror:b=>{throw b},onclose:()=>{o(b=>{i(_s(!b.generated))})}})}).apply(this,arguments)}})})}),mp=e=>Ls.endpoints.getAnswer.initiate(e);p();u();d();l();var wp=le(Sr,e=>e);p();u();d();l();function VA(e){let t=e.payload?.analyticsAction;return xp(e)&&!H(t)}function xp(e){return"type"in e}var Rp=e=>t=>r=>{let n;VA(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return xp(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};p();u();d();l();p();u();d();l();p();u();d();l();var gL=T("tab/register",e=>{let t=new Q({values:{id:U,expression:ve}});return N(e,t)}),mi=T("tab/updateActiveTab",e=>N(e,U));p();u();d();l();p();u();d();l();var LA={year:0,month:1,day:2,hour:3,minute:4,second:5},Ep={},UA=function(t,r){r===void 0&&(r={});var n=r.timeZoneName||"short",o=t+"|"+n,i=Ep[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),Ep[o]=i),i},Ip=function(e,t,r){var n,o=function(g,h,S){S===void 0&&(S={});var y=new Date(g),b=UA(h,S);return b.formatToParts(y)},i=function(g,h){for(var S=o(g,h),y=[],b=0;b<S.length;b+=1){var R=S[b],F=R.type,x=R.value,I=LA[F];I>=0&&(y[I]=parseInt(x,10))}var w=y[3],E=w===24?0:w,M=y[0]+"-"+y[1]+"-"+y[2]+" "+E+":"+y[4]+":"+y[5]+":000",k=r.utc(M).valueOf(),P=+g,O=P%1e3;return P-=O,(k-P)/6e4},a=function(g,h,S){var y=g-h*60*1e3,b=i(y,S);if(h===b)return[y,h];y-=(b-h)*60*1e3;var R=i(y,S);return b===R?[y,b]:[g-Math.min(b,R)*60*1e3,Math.max(b,R)]},m=t.prototype;m.tz=function(s,g){s===void 0&&(s=n);var h=this.utcOffset(),S=this.toDate(),y=S.toLocaleString("en-US",{timeZone:s}),b=Math.round((S-new Date(y))/1e3/60),R=-Math.round(S.getTimezoneOffset()/15)*15-b,F=!Number(R),x;if(F)x=this.utcOffset(0,g);else if(x=r(y,{locale:this.$L}).$set(Zt,this.$ms).utcOffset(R,!0),g){var I=x.utcOffset();x=x.add(h-I,_e)}return x.$x.$timezone=s,x},m.offsetName=function(s){var g=this.$x.$timezone||r.tz.guess(),h=o(this.valueOf(),g,{timeZoneName:s}).find(function(S){return S.type.toLowerCase()==="timezonename"});return h&&h.value};var f=m.startOf;m.startOf=function(s,g){if(!this.$x||!this.$x.$timezone)return f.call(this,s,g);var h=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L}),S=f.call(h,s,g);return S.tz(this.$x.$timezone,!0)},r.tz=function(s,g,h){var S=h&&g,y=h||g||n,b=i(+r(),y);if(typeof s!="string")return r(s).tz(y);var R=r.utc(s,S).valueOf(),F=a(R,b,y),x=F[0],I=F[1],w=r(x).utcOffset(I);return w.$x.$timezone=y,w},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(s){n=s}};p();u();d();l();var QA=/[+-]\d\d(?::?\d\d)?/g,BA=/([+-]|\d\d)/g;function $A(e){e===void 0&&(e="");var t=e.match(QA);if(!t)return null;var r=(""+t[0]).match(BA)||["-",0,0],n=r[0],o=r[1],i=r[2],a=+o*60+ +i;return a===0?0:n==="+"?a:-a}var Fp=function(e,t,r){var n=t.prototype;r.utc=function(h){var S={date:h,utc:!0,args:arguments};return new t(S)},n.utc=function(h){var S=r(this.toDate(),{locale:this.$L,utc:!0});return h?S.add(this.utcOffset(),_e):S},n.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var o=n.parse;n.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),o.call(this,h)};var i=n.init;n.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else i.call(this)};var a=n.utcOffset;n.utcOffset=function(h,S){var y=this.$utils(),b=y.u;if(b(h))return this.$u?0:b(this.$offset)?a.call(this):this.$offset;if(typeof h=="string"&&(h=$A(h),h===null))return this;var R=Math.abs(h)<=16?h*60:h,F=this;if(S)return F.$offset=R,F.$u=h===0,F;if(h!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();F=this.local().add(R+x,_e),F.$offset=R,F.$x.$localOffset=x}else F=this.utc();return F};var m=n.format,f="YYYY-MM-DDTHH:mm:ss[Z]";n.format=function(h){var S=h||(this.$u?f:"");return m.call(this,S)},n.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-h*Lr},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var s=n.toDate;n.toDate=function(h){return h==="s"&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():s.call(this)};var g=n.diff;n.diff=function(h,S,y){if(h&&this.$u===h.$u)return g.call(this,h,S,y);var b=this.local(),R=r(h).local();return g.call(b,R,S,y)}};Le.extend(Fp);Le.extend(Ip);var Pp=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Le.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});p();u();d();l();var HA=/(^|; )Coveo-Pendragon=([^;]*)/;function Us(){return typeof window>"u"?!1:HA.exec(document.cookie)?.pop()||null}var kp=le(Pp(),e=>e.addCase(At,(t,r)=>{zA(t,r.payload)}).addCase(et,(t,r)=>{GA(t,r.payload)}).addCase(vr,(t,r)=>{WA(t,r.payload)}).addCase(Ar,t=>{t.analytics.enabled=!1}).addCase(Cr,t=>{t.analytics.enabled=!0}).addCase(wo,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(xo,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(mi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(_u,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Ct,(t,r)=>{H(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function zA(e,t){H(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",H(t.organizationId)||(e.organizationId=t.organizationId)}function GA(e,t){H(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),H(t.locale)||(e.search.locale=t.locale),H(t.timezone)||(e.search.timezone=t.timezone),H(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function WA(e,t){H(t.enabled)||(e.analytics.enabled=t.enabled),H(t.originContext)||(e.analytics.originContext=t.originContext),H(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),H(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),H(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),H(t.trackingId)||(e.analytics.trackingId=t.trackingId),H(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),H(t.source)||(e.analytics.source=t.source);try{let r=Us();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}H(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),H(t.anonymous)||(e.analytics.anonymous=t.anonymous),H(t.deviceId)||(e.analytics.deviceId=t.deviceId),H(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),H(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Ye=kp;p();u();d();l();function YA(e){return e.instantlyCallable}var Op=()=>e=>t=>e(YA(t)?t():t);p();u();d();l();var Tp=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},Dp=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));p();u();d();l();var Qs=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};p();u();d();l();function qp(e,t){let r={...e},n,o=i=>(a,m)=>{let f=i(a,m);return n?n(f,m):f};return{get combinedReducer(){let i=Oc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,m])=>[a,()=>m]));return o(dr({...i,...r}))},containsAll(i){return Object.keys(i).every(m=>m in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}p();u();d();l();p();u();d();l();function KA(e){if(!e||!JA(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Mp(e,t=60){if(!e)return!1;let r=KA(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function JA(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function jp(e,t){let r=0,n=null,o=Zn(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(f,s=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){return s&&ZA(t),yield t()})().finally(()=>{n=null}));let h=yield n;return g&&h&&f.dispatch(At({accessToken:h})),h});return function i(_x67){return _ref30.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(f){let s=f.getState(),g=eC(s);if(!(!g||!Mp(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(h){e.warn(h,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x68){return _ref32.apply(this,arguments)}}(),m=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(f,s,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Np(f,s.error),s;r++,o(),yield i(f,!0),f.dispatch(g)});return function m(_x69,_x70,_x71){return _ref33.apply(this,arguments)}}();return f=>s=>(/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(g){let h=typeof g=="function",S=typeof t=="function";if(!h)return s(g);S&&(yield a(f));let y=yield s(g);return XA(y)?S?yield m(f,y,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Np(f,y.error),y):y});return function(_x72){return _ref34.apply(this,arguments)}}())}function XA(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new lr().name}function Np(e,t){e.dispatch(Po({status:401,statusCode:401,message:t.message,type:t.name}))}function ZA(_x73){return _ZA.apply(this,arguments)}function _ZA(){_ZA=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _ZA.apply(this,arguments)}function eC(e){return e.configuration.accessToken}p();u();d();l();function _p({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return bu({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Dp(n.logger))})}function tC(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&kc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function Vp(e,t){let r={...e.reducers,configuration:Ye,version:wp},n=rC({...e,reducers:r},t,Ye),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(At({accessToken:o,environment:i,organizationId:a}));let m=tC(e.configuration,n.logger);return m&&n.dispatch(vr(m)),n}function rC(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=qp({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,m={...t,get relay(){return kn(s.state,o)},get navigatorContext(){return Qs(this.relay,o)}},f=nC(e,m,i),s={addReducers(g){i.containsAll(g)||(i.add(g),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(Cr())},disableAnalytics(){f.dispatch(Ar())},get state(){return f.getState()},get relay(){return kn(this.state,o)},get navigatorContext(){return Qs(this.relay,o)},logger:a,store:f};return s}function nC(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=oC(e,t.logger);return _p({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function oC(e,t){let{renewAccessToken:r}=e.configuration,n=jp(t,r);return[Op,n,Tp(t),Rp].concat(Ls.middleware,e.middlewares||[])}p();u();d();l();var Wp=Wn(Gp(),1);function Yp(e){return(0,Wp.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}p();u();d();l();function Kp(e,t){let r=bC(e),n=Qe,o=wC(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function bC(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function wC(e){return e.preprocessRequest||ro}p();u();d();l();p();u();d();l();var Jp={organizationId:U,accessToken:U,name:new V({required:!1,emptyAllowed:!1}),analytics:new Q({options:{required:!1},values:{enabled:new K({required:!1}),originContext:new V({required:!1}),originLevel2:new V({required:!1}),originLevel3:new V({required:!1}),analyticsMode:new V({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new V({required:!1,url:!0}),trackingId:new V({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new V({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Xp(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Zp=new ke({...Jp,pipeline:new V({required:!1,emptyAllowed:!0}),searchHub:Se,locale:Se,timezone:Se});function Ws(){return{...Xp(),searchHub:"default"}}var xC={debug:Fo,pipeline:xr,searchHub:jr,recommendation:Mr};function ef(e){let t=Yp(e.loggerOptions);RC(e.configuration,t);let r=EC(e.configuration,t),n={...Kp(e.configuration,t),apiClient:r},o={...e,reducers:xC},i=Vp(o,n),{pipeline:a,searchHub:m,timezone:f,locale:s,proxyBaseUrl:g}=e.configuration;return i.dispatch(et({timezone:f,locale:s,proxyBaseUrl:g})),H(a)||i.dispatch(br(a)),H(m)||i.dispatch(Nr(m)),{...i,get state(){return i.state}}}function RC(e,t){try{Zp.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function EC(e,t){return new io({logger:t,preprocessRequest:e.preprocessRequest||ro,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Wc,postprocessFacetSearchResponseMiddleware:Yc,postprocessQuerySuggestResponseMiddleware:Kc})}p();u();d();l();p();u();d();l();p();u();d();l();var IC=new J({each:U,required:!0}),tf=(e,t)=>(N(e,U),Jn(t)?N(t,U):N(t,IC),{payload:{contextKey:e,contextValue:t}}),or=T("context/set",e=>{for(let[t,r]of Object.entries(e))tf(t,r);return{payload:e}}),ir=T("context/add",e=>tf(e.contextKey,e.contextValue)),ar=T("context/remove",e=>N(e,U));p();u();d();l();p();u();d();l();function hi(){return{contextValues:{}}}var Si=le(hi(),e=>{e.addCase(or,(t,r)=>{t.contextValues=r.payload}).addCase(ir,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(ar,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});p();u();d();l();function Mt(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),m=t!==a;return t=a,m}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),m;return n()&&(t=JSON.stringify(this.state),m=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&m?.()}},get state(){return{}}}}p();u();d();l();var FC=["caseId","caseNumber"],PC={caseId:"caseContext",caseNumber:"caseContext"},Qn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${PC[t]} to set this value.}`)}};function Ys(e){return FC.includes(e)}var kC=new ke({values:new Q({options:{required:!1}})});function rf(e,t={}){if(!DC(e))throw Ke;let r=Mt(e),{dispatch:n}=e,o=()=>e.state,i=Tu(e,kC,t.initialState,"buildContext");return i.values&&n(or(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(or(a))},...(o().configuration.analytics.analyticsMode==="legacy"?OC(n):TC(n))}}var OC=e=>({add(t,r){e(ir({contextKey:t,contextValue:r}))},remove(t){e(ar(t))}}),TC=e=>({add(t,r){if(Ys(t))throw new Qn(t);e(ir({contextKey:t,contextValue:r}))},remove(t){if(Ys(t))throw new Qn(t);e(ar(t))}});function DC(e){return e.addReducers({context:Si}),!0}function nf(e,t){return rf(e,t)}p();u();d();l();p();u();d();l();var Gr=T("dictionaryFieldContext/set",e=>{let t=new Q({options:{required:!0}}),r=N(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new J({each:ve}),i=N(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Wr=T("dictionaryFieldContext/add",e=>{let t=new Q({options:{required:!0},values:{field:ve,key:ve}});return N(e,t)}),Yr=T("dictionaryFieldContext/remove",e=>N(e,ve));p();u();d();l();p();u();d();l();function vi(){return{contextValues:{}}}var Ai=le(vi(),e=>{e.addCase(Gr,(t,r)=>{t.contextValues=r.payload}).addCase(Wr,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Yr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function of(e){if(!qC(e))throw Ke;let t=Mt(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Gr(o))},add(o,i){r(Wr({field:o,key:i}))},remove(o){r(Yr(o))}}}function qC(e){return e.addReducers({dictionaryFieldContext:Ai}),!0}p();u();d();l();p();u();d();l();p();u();d();l();p();u();d();l();var Ci=T("breadcrumb/deselectAll"),af=T("breadcrumb/deselectAllNonBreadcrumbs");p();u();d();l();p();u();d();l();var Bn={value:U,numberOfResults:new $({min:0}),state:U};p();u();d();l();var ne=U;var _C=new $({min:1,default:8,required:!1}),VC=new $({min:1,max:20,default:5,required:!1}),LC={desiredCount:VC,numberOfValues:_C},v$=T("automaticFacet/setOptions",e=>N(e,LC)),A$=T("automaticFacet/deselectAll",e=>N(e,ne)),UC=U,sf=T("automaticFacet/toggleSelectValue",e=>N(e,{field:UC,selection:new Q({values:Bn})}));p();u();d();l();p();u();d();l();var QC={state:new ce({required:!0}),numberOfResults:new $({required:!0,min:0}),value:new V({required:!0,emptyAllowed:!0}),path:new J({required:!0,each:U}),moreValuesAvailable:new K({required:!1})};function Ks(e){e.children.forEach(t=>{Ks(t)}),Qe({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},QC)}var Kr={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),delimitingCharacter:new V({required:!1,emptyAllowed:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),basePath:new J({required:!1,each:U}),filterByBasePath:new K({required:!1})};var _$=T("categoryFacet/register",e=>N(e,Kr)),cf=T("categoryFacet/toggleSelectValue",e=>{try{return Qe(e.facetId,U),Ks(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),uf=T("categoryFacet/deselectAll",e=>N(e,Kr.facetId)),V$=T("categoryFacet/updateNumberOfValues",e=>N(e,{facetId:Kr.facetId,numberOfValues:Kr.numberOfValues})),L$=T("categoryFacet/updateSortCriterion",e=>N(e,{facetId:Kr.facetId,criterion:new ce})),U$=T("categoryFacet/updateBasePath",e=>N(e,{facetId:Kr.facetId,basePath:new J({each:U})}));p();u();d();l();p();u();d();l();var $n={facetId:ne,captions:new Q({options:{required:!1}}),numberOfValues:new $({required:!1,min:1}),query:new V({required:!1,emptyAllowed:!0})};var BC={path:new J({required:!0,each:U}),displayValue:ve,rawValue:ve,count:new $({required:!0,min:0})},lf=T("categoryFacet/selectSearchResult",e=>N(e,{facetId:ne,value:new Q({values:BC})})),iH=T("categoryFacetSearch/register",e=>N(e,$n));p();u();d();l();var df={facetId:ne,value:new Q({values:{displayValue:ve,rawValue:ve,count:new $({required:!0,min:0})}})},yH=T("facetSearch/register",e=>N(e,$n)),hH=T("facetSearch/update",e=>N(e,$n)),pf=T("facetSearch/toggleSelectValue",e=>N(e,df)),ff=T("facetSearch/toggleExcludeValue",e=>N(e,df));p();u();d();l();p();u();d();l();var xH=new V({regex:/^[a-zA-Z0-9-_]+$/}),RH=new V({required:!0}),EH=new J({each:new V}),IH=new V,FH=new K,PH=new K,kH=new $({min:0}),$C=new $({min:1}),OH=new K({required:!0}),HC=new Q,zC=new V,GC={captions:HC,numberOfValues:$C,query:zC},TH=new Q({values:GC}),mf=new Q({options:{required:!1},values:{type:new V({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new J({required:!0,max:25,each:new V({emptyAllowed:!1,required:!0})})}}),DH=new K,gf=new J({min:1,max:25,required:!1,each:new V({emptyAllowed:!1,required:!0})});var WC={facetId:ne,field:new V({required:!0,emptyAllowed:!0}),tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),resultsMustMatch:new ce({required:!1}),allowedValues:mf,customSort:gf},HH=T("facet/register",e=>N(e,WC)),yf=T("facet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:Bn})})),hf=T("facet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:Bn})})),bi=T("facet/deselectAll",e=>N(e,ne)),zH=T("facet/updateSortCriterion",e=>N(e,{facetId:ne,criterion:new ce({required:!0})})),GH=T("facet/updateNumberOfValues",e=>N(e,{facetId:ne,numberOfValues:new $({required:!0,min:1})})),WH=T("facet/updateIsFieldExpanded",e=>N(e,{facetId:ne,isFieldExpanded:new K({required:!0})})),YH=T("facet/updateFreezeCurrentValues",e=>N(e,{facetId:ne,freezeCurrentValues:new K({required:!0})}));p();u();d();l();p();u();d();l();function vf(e){let t=Sf(e.start,e),r=Sf(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function Sf(e,t){let{dateFormat:r}=t;return Ud(e)?(Es(e),_d(e)):typeof e=="string"&&Pt(e)?(Es(e),e):(Md(e,r),di(Qr(e,r)))}p();u();d();l();var Af=T("rangeFacet/updateSortCriterion",e=>N(e,{facetId:ne,criterion:new ce({required:!0})}));p();u();d();l();var wi={state:U,start:new $({required:!0}),end:new $({required:!0}),endInclusive:new K({required:!0}),numberOfResults:new $({required:!0,min:0})},xi={start:U,end:U,endInclusive:new K({required:!0}),state:U,numberOfResults:new $({required:!0,min:0})};var YC={start:U,end:U,endInclusive:new K({required:!0}),state:U},KC={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),currentValues:new J({required:!1,each:new Q({values:YC})}),generateAutomaticRanges:new K({required:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),rangeAlgorithm:new ce({required:!1})};function Cf(e){return Pt(e)?Vn(e):e}function bf(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=vf(t);if(Qr(Cf(r)).isAfter(Qr(Cf(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Mz=T("dateFacet/register",e=>{try{return Qe(e,KC),bf(e),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),wf=T("dateFacet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:xi})})),xf=T("dateFacet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:xi})})),Rf=T("dateFacet/updateFacetValues",e=>{try{return Qe(e,{facetId:ne,values:new J({each:new Q({values:xi})})}),bf({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}});p();u();d();l();var JC={state:U,start:new $({required:!0}),end:new $({required:!0}),endInclusive:new K({required:!0})},XC={facetId:ne,field:U,tabs:new Q({options:{required:!1},values:{included:new J({each:new V}),excluded:new J({each:new V})}}),activeTab:new V({required:!1}),currentValues:new J({required:!1,each:new Q({values:JC})}),generateAutomaticRanges:new K({required:!0}),filterFacetCount:new K({required:!1}),injectionDepth:new $({required:!1,min:0}),numberOfValues:new $({required:!1,min:1}),sortCriteria:new ce({required:!1}),rangeAlgorithm:new ce({required:!1})};function Ef(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var Wz=T("numericFacet/register",e=>{try{return N(e,XC),Ef(e),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}}),If=T("numericFacet/toggleSelectValue",e=>N(e,{facetId:ne,selection:new Q({values:wi})})),Ff=T("numericFacet/toggleExcludeValue",e=>N(e,{facetId:ne,selection:new Q({values:wi})})),Pf=T("numericFacet/updateFacetValues",e=>{try{return Qe(e,{facetId:ne,values:new J({each:new Q({values:wi})})}),Ef({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ut(t)}}});p();u();d();l();p();u();d();l();var kf=T("facet/updateFacetAutoSelection",e=>N(e,{allow:new K({required:!0})}));p();u();d();l();p();u();d();l();var Ri=class extends wt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??je().q}get responseTime(){return this.activeInstantResultCache?.duration??Je().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Je().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Of=()=>Fe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Ri(e)),Tf=()=>({actionCause:"searchboxAsYouType"});p();u();d();l();var Js={id:U},ZC={...Js,q:ve},I2=T("instantResults/register",e=>N(e,Js)),Ei=T("instantResults/updateQuery",e=>N(e,ZC)),F2=T("instantResults/clearExpired",e=>N(e,Js));p();u();d();l();var Ii=new $({required:!0,min:0}),Fi=T("pagination/registerNumberOfResults",e=>N(e,Ii)),Pi=T("pagination/updateNumberOfResults",e=>N(e,Ii)),ki=T("pagination/registerPage",e=>N(e,Ii)),Jr=T("pagination/updatePage",e=>N(e,Ii)),Oi=T("pagination/nextPage"),Ti=T("pagination/previousPage");p();u();d();l();var Xr=T("query/updateQuery",e=>N(e,{q:new V,enableQuerySyntax:new K}));p();u();d();l();p();u();d();l();p();u();d();l();var Nt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Xs=()=>Fe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),jt=e=>Fe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||je().q,aq:r.advancedSearchQueries?.aq||Nt().aq,cq:r.advancedSearchQueries?.cq||Nt().cq,dq:r.advancedSearchQueries?.dq||Nt().dq,errorType:e.type,errorMessage:e.message}));p();u();d();l();p();u();d();l();var pG=T("didYouMean/enable"),fG=T("didYouMean/disable"),mG=T("didYouMean/automaticCorrections/disable"),gG=T("didYouMean/automaticCorrections/enable"),Di=T("didYouMean/correction",e=>N(e,U)),yG=T("didYouMean/automaticCorrections/mode",e=>N(e,new V({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));p();u();d();l();var Zs=()=>Fe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Df=()=>({actionCause:"didYouMeanAutomatic"});p();u();d();l();p();u();d();l();function qf(){return{freezeFacetOrder:!1,facets:{}}}p();u();d();l();function Mf(){return[]}p();u();d();l();function Hn(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}p();u();d();l();function Nf(){return{}}p();u();d();l();function jf(){return{}}p();u();d();l();function _f(){return{}}function ot(e){return{context:e.context||hi(),dictionaryFieldContext:e.dictionaryFieldContext||vi(),facetSet:e.facetSet||Ko(),numericFacetSet:e.numericFacetSet||Yo(),dateFacetSet:e.dateFacetSet||Wo(),categoryFacetSet:e.categoryFacetSet||Go(),automaticFacetSet:e.automaticFacetSet??zo(),pagination:e.pagination||Hn(),query:e.query||je(),tabSet:e.tabSet||_f(),advancedSearchQueries:e.advancedSearchQueries||Nt(),staticFilterSet:e.staticFilterSet||jf(),querySet:e.querySet||Nf(),sortCriteria:e.sortCriteria||Jo(),pipeline:e.pipeline||wr(),searchHub:e.searchHub||Tr(),facetOptions:e.facetOptions||qf(),facetOrder:e.facetOrder??Mf(),debug:e.debug??Io()}}p();u();d();l();var TW=new Q({values:{undoneQuery:ve},options:{required:!0}}),Vf=()=>Fe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);p();u();d();l();var qi=T("trigger/query/ignore",e=>N(e,new V({emptyAllowed:!0,required:!0}))),Mi=T("trigger/query/modification",e=>N(e,new Q({values:{originalQuery:Se,modification:Se}})));p();u();d();l();var _t=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=rb(e),n=fi(e),o=eb(e),i=yield Tt(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return kt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function _t(_x74,_x75){return _ref35.apply(this,arguments)}}();function eb(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(tb).filter(r=>r.currentValues.length>0):void 0}function tb(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function rb(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=nb(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function nb(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Vt=class{constructor(t,r=n=>{this.dispatch(Xr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x76,_x77){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=pi(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(jt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let s=a.length===0&&m&&m.length!==0,g=!H(f)&&!H(f.correctedQuery);if(!s&&!g)return null;let S=s?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(tt(ot(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this13.dispatch(jt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(tt(ot(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Zs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Zs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(qi("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this14.dispatch(jt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(tt(ot(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Vf()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??je().enableQuerySyntax},search:{...Je(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(tt(ot(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return ao(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield _t(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Di(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Mi({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield _t(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var OY=re("search/executeSearch",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ni(r,t,e)});return function(_x78,_x79){return _ref36.apply(this,arguments)}}()),TY=re("search/fetchPage",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();return yield tc(r,t,e)});return function(_x80,_x81){return _ref37.apply(this,arguments)}}()),DY=re("search/fetchMoreResults",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=t.getState();return yield rc(t,r)});return function(_x82,_x83){return _ref38.apply(this,arguments)}}()),qY=re("search/fetchFacetValues",/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=t.getState();return yield sb(t,e,r)});return function(_x84,_x85){return _ref39.apply(this,arguments)}}()),MY=re("search/fetchInstantResults",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){return ec(e,t)});return function(_x86,_x87){return _ref40.apply(this,arguments)}}()),ob=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=yield _t(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function ob(_x88,_x89){return _ref41.apply(this,arguments)}}(),ib=/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t,r){let n=yield Tt(e);return kt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function ib(_x90,_x91,_x92){return _ref42.apply(this,arguments)}}(),ab=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=yield _t(e,t);return r.request.numberOfResults=0,r});return function ab(_x93,_x94){return _ref43.apply(this,arguments)}}(),Lf=e=>{e.configuration.analytics.enabled&&Be.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function ec(_x95,_x96){return _ec.apply(this,arguments)}function _ec(){_ec=_asyncToGenerator(function*(e,t){N(e,{id:U,q:U,maxResultsPerQuery:new $({required:!0,min:1}),cacheTimeout:new $});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Vt({...t,analyticsAction:Of()},s=>{t.dispatch(Ei({q:s,id:e.id}))}),a=yield ib(o,r,n),m=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(m);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _ec.apply(this,arguments)}function tc(_x97,_x98,_x99){return _tc.apply(this,arguments)}function _tc(){_tc=_asyncToGenerator(function*(e,t,r){Lf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Vt({...t,analyticsAction:r}),f=yield _t(e,a),s=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(s)});return _tc.apply(this,arguments)}function rc(_x100,_x101){return _rc.apply(this,arguments)}function _rc(){_rc=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Xs().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Vt({...e,analyticsAction:Xs()}),m=yield ob(t,i),f=yield a.fetchFromAPI(m,{origin:"mainSearch"});return yield a.process(f)});return _rc.apply(this,arguments)}function sb(_x102,_x103,_x104){return _sb.apply(this,arguments)}function _sb(){_sb=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new Vt({...e,analyticsAction:t}),f=yield ab(r,a),s=yield m.fetchFromAPI(f,{origin:"facetValues"});return yield m.process(s)});return _sb.apply(this,arguments)}function Ni(_x105,_x106,_x107){return _Ni.apply(this,arguments)}function _Ni(){_Ni=_asyncToGenerator(function*(e,t,r){Lf(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=yield _t(e,a),f=new Vt({...t,analyticsAction:r}),s=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(s)});return _Ni.apply(this,arguments)}p();u();d();l();var Lt=class{constructor(t,r=n=>{this.dispatch(Xr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x108,_x109){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=pi(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(jt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let s=a.length===0&&m&&m.length!==0,g=!H(f)&&!H(f.correctedQuery);if(!s&&!g)return null;let S=s?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(tt(ot(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this20.dispatch(jt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(tt(ot(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(qi("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this21.dispatch(jt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(tt(ot(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(tt(ot(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return ao(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Df(),o=yield _this22.fetchFromAPI(yield Dt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Di(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Mi({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Dt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var AK=re("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;N(e,{q:new V,enableQuerySyntax:new K,clearFilters:new K}),e.clearFilters&&(r(Ci()),r(af())),r(kf({allow:!0})),r(Xr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Jr(1))}),CK=T("search/updateSearchAction"),Uf=re("search/executeSearch",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ni(r,t,e.legacy);Qf(r);let n=e.next?Bf(e.next):void 0,o=yield Dt(r,t.extra.navigatorContext,n),i=new Lt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x110,_x111){return _ref44.apply(this,arguments)}}()),bK=re("search/fetchPage",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=t.getState();if(Qf(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return tc(r,t,e.legacy);let n=new Lt({...t,analyticsAction:e.next}),o=yield Dt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x112,_x113){return _ref45.apply(this,arguments)}}()),wK=re("search/fetchMoreResults",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return rc(t,r);let n=Nl("browseResults",t.getState),o=new Lt({...t,analyticsAction:n}),i=yield cb(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x114,_x115){return _ref46.apply(this,arguments)}}()),xK=re("search/fetchFacetValues",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ni(r,t,e.legacy);let n=new Lt({...t,analyticsAction:{}}),o=yield lb(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x116,_x117){return _ref47.apply(this,arguments)}}()),RK=re("search/fetchInstantResults",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return ec(e,t);N(e,{id:U,q:U,maxResultsPerQuery:new $({required:!0,min:1}),cacheTimeout:new $});let{q:n,maxResultsPerQuery:o}=e,i=Bf(Tf()),a=yield ub(r,t.extra.navigatorContext,n,o,i),m=new Lt({...t,analyticsAction:i},g=>{t.dispatch(Ei({q:g,id:e.id}))}),f=yield m.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),s=yield m.process(f);return"response"in s?{results:s.response.results,searchUid:s.response.searchUid,totalCountFiltered:s.response.totalCountFiltered,duration:s.duration}:s});return function(_x118,_x119){return _ref48.apply(this,arguments)}}()),cb=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t,r){let n=yield Dt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function cb(_x120,_x121,_x122){return _ref49.apply(this,arguments)}}(),ub=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t,r,n,o){let i=Br(e,t,o);return kt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function ub(_x123,_x124,_x125,_x126,_x127){return _ref50.apply(this,arguments)}}(),lb=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t,r){let n=yield Dt(e,t,r);return n.request.numberOfResults=0,n});return function lb(_x128,_x129,_x130){return _ref51.apply(this,arguments)}}(),Qf=e=>{e.configuration.analytics.enabled&&Be.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Bf=e=>({actionCause:e.actionCause,type:e.actionCause});var $f=le(Hn(),e=>{e.addCase(Fi,(t,r)=>{let n=nc(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=zn(n,o)}).addCase(Pi,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(mi,t=>{t.firstResult=0}).addCase(ki,(t,r)=>{let n=r.payload;t.firstResult=zn(n,t.numberOfResults)}).addCase(Jr,(t,r)=>{let n=r.payload;t.firstResult=zn(n,t.numberOfResults)}).addCase(Ti,t=>{let r=nc(t),n=Math.max(r-1,1);t.firstResult=zn(n,t.numberOfResults)}).addCase(Oi,t=>{let r=nc(t),n=pb(t),o=Math.min(r+1,n);t.firstResult=zn(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Ct,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Uf.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(bi,t=>{Ee(t)}).addCase(xf,t=>{Ee(t)}).addCase(hf,t=>{Ee(t)}).addCase(Ff,t=>{Ee(t)}).addCase(ff,t=>{Ee(t)}).addCase(yf,t=>{Ee(t)}).addCase(uf,t=>{Ee(t)}).addCase(cf,t=>{Ee(t)}).addCase(lf,t=>{Ee(t)}).addCase(wf,t=>{Ee(t)}).addCase(If,t=>{Ee(t)}).addCase(Ci,t=>{Ee(t)}).addCase(Rf,t=>{Ee(t)}).addCase(Pf,t=>{Ee(t)}).addCase(pf,t=>{Ee(t)}).addCase(sf,t=>{Ee(t)})});function Ee(e){e.firstResult=Hn().firstResult}function nc(e){let{firstResult:t,numberOfResults:r}=e;return fb(t,r)}function pb(e){let{totalCountFiltered:t,numberOfResults:r}=e;return mb(t,r)}function zn(e,t){return(e-1)*t}function fb(e,t){return Math.round(e/t)+1}function mb(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function oc(e){return e.addReducers({pagination:$f}),{nextPage:Oi,previousPage:Ti,registerNumberOfResults:Fi,registerPage:ki,updateNumberOfResults:Pi,updatePage:Jr}}var gb=new ke({id:new V({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new $({min:0})});function Hf(e,t={}){if(!yb(e))throw Ke;let r=Mt(e),{dispatch:n}=e,o=()=>e.state,i=Du(e,gb,t.options,"buildRecommendationList");return i.id!==""&&n(qr({id:i.id})),i.numberOfRecommendations&&n(oc(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(xt())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function yb(e){return e.addReducers({recommendation:Mr,configuration:Ye}),!0}p();u();d();l();p();u();d();l();function zf(e,t,r){if(!hb(e))throw Ke;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Zn(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function hb(e){return e.addReducers({configuration:Ye}),!0}function Gf(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(ti(t.options.result)))};return zf(e,t,()=>{n()})}p();u();d();l();p();u();d();l();p();u();d();l();var Ut=()=>new V({required:!1,emptyAllowed:!0}),ji=T("advancedSearchQueries/update",e=>N(e,{aq:Ut(),cq:Ut(),lq:Ut(),dq:Ut()})),_i=T("advancedSearchQueries/register",e=>N(e,{aq:Ut(),cq:Ut(),lq:Ut(),dq:Ut()}));var Wf=le(Nt(),e=>{e.addCase(ji,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ge(n)||(t.aq=n,t.aqWasSet=!0),ge(o)||(t.cq=o,t.cqWasSet=!0),ge(i)||(t.lq=i,t.lqWasSet=!0),ge(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(_i,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ge(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ge(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ge(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ge(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Ct,(t,r)=>{let{aq:n,cq:o}=r.payload;ge(n)||(t.aq=n,t.aqWasSet=!0),ge(o)||(t.cq=o,t.cqWasSet=!0)})});function Sb(e){return e.addReducers({advancedSearchQueries:Wf}),{updateAdvancedSearchQueries:ji,registerAdvancedSearchQueries:_i}}p();u();d();l();function vb(e){return e.addReducers({configuration:Ye}),{disableAnalytics:Ar,enableAnalytics:Cr,setOriginLevel2:wo,setOriginLevel3:xo,updateAnalyticsConfiguration:vr,updateBasicConfiguration:At}}p();u();d();l();function Ab(e){return e.addReducers({configuration:Ye,pipeline:xr,searchHub:jr}),{updateSearchConfiguration:et}}p();u();d();l();function Cb(e){return e.addReducers({context:Si}),{addContext:ir,removeContext:ar,setContext:or}}p();u();d();l();function bb(e){return e.addReducers({debug:Fo}),{disableDebug:Eo,enableDebug:Ro}}p();u();d();l();function wb(e){return e.addReducers({dictionaryFieldContext:Ai}),{addContext:Wr,removeContext:Yr,setContext:Gr}}p();u();d();l();p();u();d();l();p();u();d();l();var xb={collectionField:new V({emptyAllowed:!1,required:!1}),parentField:new V({emptyAllowed:!1,required:!1}),childField:new V({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new $({min:0,required:!1})},Yf=T("folding/register",e=>N(e,xb)),W4=re("folding/loadCollection",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Tt(i):Br(i,o),m=yield n.search({...a,q:Rb(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Oe(m)?r(m.error):{collectionId:e,results:m.success.results,searchUid:m.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x131,_x132){return _ref52.apply(this,arguments)}}());function Rb(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}p();u();d();l();var Kf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});p();u();d();l();var Zr=T("fields/registerFieldsToInclude",e=>N(e,bo)),Vi=T("fields/fetchall/enable"),Li=T("fields/fetchall/disable"),Ui=re("fields/fetchDescription",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:m}=o.configuration,{apiBaseUrl:f}=o.configuration.search,s=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:m,url:f??yt(m,a)});return Oe(s)?n(s.error):s.success.fields});return function(_x133,_x134){return _ref53.apply(this,arguments)}}());p();u();d();l();var Qi=["author","language","urihash","objecttype","collection","source","permanentid"],ic=[...Qi,"date","filetype","parents"],Jf=[...ic,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],Xf=()=>({fieldsToInclude:Qi,fetchAllFields:!1,fieldsDescription:[]});var Bi=le(Xf(),e=>e.addCase(Zr,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Vi,t=>{t.fetchAllFields=!0}).addCase(Li,t=>{t.fetchAllFields=!1}).addCase(Ui.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Yf,(t,{payload:r})=>{let n=Kf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function Eb(e){return e.addReducers({fields:Bi}),{registerFieldsToInclude:Zr,enableFetchAllFields:Vi,disableFetchAllFields:Li,fetchFieldsDescription:Ui}}p();u();d();l();function Ib(e){return e.addReducers({pipeline:xr}),{setPipeline:br}}p();u();d();l();function Fb(e){return e.addReducers({recommendation:Mr}),{getRecommendations:xt,setRecommendationId:qr}}p();u();d();l();function Pb(e){return e.addReducers({}),{logRecommendationOpen:ti}}p();u();d();l();p();u();d();l();var kb=new ke({content:new ce({required:!0}),conditions:new ce({required:!0}),priority:new $({required:!1,default:0,min:0}),fields:new J({required:!1,each:U})});function Zf(){let e=[],t=r=>{let n=kb.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new sn("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function em(e){if(!Ob(e))throw Ke;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Zf();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Zr(i))},selectTemplate:r,selectLinkTemplate:n}}function Ob(e){return e.addReducers({fields:Bi}),!0}p();u();d();l();function Tb(e){return e.addReducers({searchHub:jr}),{setSearchHub:Nr}}/**
|
|
32
32
|
* @license
|
|
33
33
|
*
|
|
34
34
|
* Copyright 2025 Coveo Solutions Inc.
|
|
@@ -46,4 +46,4 @@ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":R
|
|
|
46
46
|
* limitations under the License.
|
|
47
47
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
48
48
|
|
|
49
|
-
window.coveoQuanticVersion = '3.33.
|
|
49
|
+
window.coveoQuanticVersion = '3.33.6';
|