@coveo/headless 3.35.3 → 3.35.4

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.
@@ -24,7 +24,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24
24
  `)}
25
25
 
26
26
  ${t}
27
- `;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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},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 async call(t){let r=vg(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=async()=>{let f=await v(i,a);if(Qc(f.status))throw f;return f};try{let f=await(0,Bc.backOff)(m,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:async s=>{let g=s&&Qc(s.status);return g&&(n.info("Platform retrying request"),await new Promise(h=>setTimeout(h,1e3))),g}});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 async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,s=cn(f);try{let g=await 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)}async enqueue(t,r){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 await 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=async(e,t)=>{let r=await 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=await r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Eg(a)?{success:a}:{error:St({response:r,body:a})}};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})}async plan(t){let r=await ze.call({...at(t,"POST","application/json","/plan"),requestParams:ht(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return oo(r);let n=await r.json();return kg(n)?{success:n}:{error:St({response:r,body:n})}}async querySuggest(t){let r=await ze.call({...at(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ht(t),...this.options});if(r instanceof Error)return oo(r);let n=await r.json(),o={response:r,body:n};return Pg(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:St(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(m=>ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:m??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return oo(o,r?.disableAbortWarning);let i=await o.json(),a={response:o,body:i};return zc(i)?(a.body=Gc(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:St(a)}}async facetSearch(t){let r=await ze.call({...at(t,"POST","application/json","/facet"),requestParams:ht(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(zc(n)){let o={response:r,body:n};return o.body=Gc(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:St({response:r,body:n})}}async html(t){return Hc(t,{...this.options})}async fieldDescriptions(t){let r=await ze.call({...at(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await 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=async function(){let I;try{let E=n?.condition?.(f,{getState:g,extra:h});if(ly(E)&&(E=await 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=await 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.3",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",async(e,{dispatch:t})=>{t(by()),await t(qe())}),iF=re("history/forward",async(e,{dispatch:t})=>{t(wy()),await t(qe())}),qe=re("history/change",async(e,{getState:t})=>t().history.present);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])}async addElementAsync(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=await 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))}async getHistoryAsync(){let t=await this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryWithInternalTime(){try{let t=this.store.getItem(ko);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}async getHistoryWithInternalTimeAsync(){try{let t=await this.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
+ `;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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},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 async call(t){let r=vg(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=async()=>{let f=await v(i,a);if(Qc(f.status))throw f;return f};try{let f=await(0,Bc.backOff)(m,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:async s=>{let g=s&&Qc(s.status);return g&&(n.info("Platform retrying request"),await new Promise(h=>setTimeout(h,1e3))),g}});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 async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,s=cn(f);try{let g=await 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)}async enqueue(t,r){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 await 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=async(e,t)=>{let r=await 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=await r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Eg(a)?{success:a}:{error:St({response:r,body:a})}};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})}async plan(t){let r=await ze.call({...at(t,"POST","application/json","/plan"),requestParams:ht(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return oo(r);let n=await r.json();return kg(n)?{success:n}:{error:St({response:r,body:n})}}async querySuggest(t){let r=await ze.call({...at(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ht(t),...this.options});if(r instanceof Error)return oo(r);let n=await r.json(),o={response:r,body:n};return Pg(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:St(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(m=>ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:m??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return oo(o,r?.disableAbortWarning);let i=await o.json(),a={response:o,body:i};return zc(i)?(a.body=Gc(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:St(a)}}async facetSearch(t){let r=await ze.call({...at(t,"POST","application/json","/facet"),requestParams:ht(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await ze.call({...at(t,"POST","application/json",""),requestParams:ht(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(zc(n)){let o={response:r,body:n};return o.body=Gc(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:St({response:r,body:n})}}async html(t){return Hc(t,{...this.options})}async fieldDescriptions(t){let r=await ze.call({...at(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await 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=async function(){let I;try{let E=n?.condition?.(f,{getState:g,extra:h});if(ly(E)&&(E=await 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=await 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",async(e,{dispatch:t})=>{t(by()),await t(qe())}),iF=re("history/forward",async(e,{dispatch:t})=>{t(wy()),await t(qe())}),qe=re("history/change",async(e,{getState:t})=>t().history.present);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])}async addElementAsync(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=await 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))}async getHistoryAsync(){let t=await this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryWithInternalTime(){try{let t=this.store.getItem(ko);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}async getHistoryWithInternalTimeAsync(){try{let t=await this.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=`
28
28
  We've detected you're using React Native but have not provided the corresponding runtime,
29
29
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
30
30
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
package/package.json CHANGED
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "types": "./dist/definitions/index.d.ts",
70
70
  "license": "Apache-2.0",
71
- "version": "3.35.3",
71
+ "version": "3.35.4",
72
72
  "files": [
73
73
  "dist/"
74
74
  ],