@coveo/quantic 3.38.0 → 3.38.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 oi(r)}var oi=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},mt=class{constructor(e){ie(this,"definition");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 uA(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}},Fe=class{constructor(e={}){ie(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&ce(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 Xe(e){return e===void 0}function lA(e){return e===null}function ce(e){return Xe(e)||lA(e)}var me=class{constructor(e={}){ie(this,"value");this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(dA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function dA(e){return Xe(e)||Bf(e)}function Bf(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(pA(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 pA(e){return Xe(e)||$f(e)}function $f(e){return typeof e=="number"&&!Number.isNaN(e)}var fA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ie(this,"value");ie(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Fe(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(Xe(e))return null;if(!Ra(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&&!(fA.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 Ra(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ie(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Xe(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Gf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ce(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 Gf(e){return e!==void 0&&typeof e=="object"}var ve=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(this.config)}validate(e){if(!ce(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ce(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&&ce(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 Bf(e)||Ra(e)||$f(e)||Gf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Qf(e){return Array.isArray(e)}var vl=class{constructor(e){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Xe(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}};m();d();f();p();function Hf(e){return Array.isArray(e)}function Ia(e){return e.trim()===""}var mA=new Set(["1",1,"yes",!0]);function zf(){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=>mA.has(r))}function Wf(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ii(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ta(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 gA(e){if(Ia(e.openingDelimiter)||Ia(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ce(e.content)||Ia(e.content))return e.content;if(e.highlights.length===0)return Gn(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,s=a+i.length;if(s>t)break;r+=Gn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Gn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Gn(e.content.slice(n))),r}function hA(e,t){return e=Gn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Sl(n,t.notMatchDelimiters):o?Sl(o,t.exactMatchDelimiters):i?Sl(i,t.correctionDelimiters):r)}function Sl(e,t){return t?t.open+e+t.close:e}function Gn(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}m();d();f();p();var am=Mt(rm(),1);m();d();f();p();var $t=new Error("Failed to load reducers."),Qn=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."}},Yr=class extends Error{constructor(r,n){super();ie(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function nm(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function om(e){return typeof e!="object"||!e?!1:Object.values(e).every(BA)}function BA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function im(e){return e===429}var jt=class e{static call(t){return _asyncToGenerator(function*(){let r=$A(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let l=yield w(i,a);if(im(l.status))throw l;return l});return function s(){return _ref.apply(this,arguments)}}();try{let l=yield(0,am.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(c){let g=c&&im(c.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(l.status){case 419:case 401:throw n.info("Platform renewing token"),new Qn;case 404:throw new Yr(i,l.status);default:return n.info({response:l,requestInfo:o},"Platform response"),l}}catch(l){return l.message==="Failed to fetch"?new Yr(i):l}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...l}=t,c=ii(l);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return c})()}};function Et(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Hn(e,t,r="prod"){return e??Et(t,r)}function br(e,t="prod"){return`${Et(e,t)}/rest/search/v2`}function ka(e,t="prod"){return`${Et(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function $A(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",l=GA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:l}),signal:a}}function GA(e,t){return t==="application/x-www-form-urlencoded"?om(e)?nm(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var Oa=e=>e;m();d();f();p();m();d();f();p();function Pa(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Gt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Pa(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Pa(),extendedResults:{},searchAction:void 0}}m();d();f();p();function wr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Ar=e=>{let{response:t}=e;return t.body?QA(e):HA(t)},QA=e=>WA(e)?KA(e):zA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},HA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function zA(e){return e.body.statusCode!==void 0}function WA(e){return e.body.exception!==void 0}var KA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var xr=class{constructor(){ie(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new u.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();f();p();m();d();f();p();var ci=class{constructor(t){ie(this,"_basePath");ie(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}};m();d();f();p();function sm(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var or=(e,t,r,n)=>{let o=new ci(`${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 cm=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jt.call({...or(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:wr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=sm(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return YA(a)?{success:a}:{error:Ar({response:r,body:a})}});return function cm(_x3,_x4){return _ref3.apply(this,arguments)}}();function YA(e){return typeof e=="string"}m();d();f();p();function XA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function ZA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Na(e,t){if(t&&e.name==="AbortError")return{error:ZA(e)};if(e instanceof Yr)return{error:XA(e)};throw e}var Fa=class{constructor(t){ie(this,"options",t);ie(this,"apiCallsQueues",{unknown:new xr,mainSearch:new xr,facetValues:new xr,foldingCollection:new xr,instantResults:new xr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json","/plan"),requestParams:wr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Na(r);let n=yield r.json();return ex(n)?{success:n}:{error:Ar({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:wr(t),..._this3.options});if(r instanceof Error)return Na(r);let n=yield r.json(),o={response:r,body:n};return JA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:Ar(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>jt.call({...or(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Na(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return um(i)?(a.body=lm(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:Ar(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json","/facet"),requestParams:wr(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(um(n)){let o={response:r,body:n};return o.body=lm(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:Ar({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return cm(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return tx(n)?{success:n}:{error:Ar({response:r,body:n})}})()}},Da=e=>e.success!==void 0,gt=e=>e.error!==void 0;function um(e){return e.results!==void 0}function lm(e){let t=Pa();return ce(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function JA(e){return e.completions!==void 0}function ex(e){return e.preprocessingOutput!==void 0}function tx(e){return e.fields!==void 0}m();d();f();p();var dm=e=>e,pm=e=>e,fm=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function Ze(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 rx=typeof Symbol=="function"&&Symbol.observable||"@@observable",mm=rx,_l=()=>Math.random().toString(36).substring(7).split("").join("."),nx={INIT:`@@redux/INIT${_l()}`,REPLACE:`@@redux/REPLACE${_l()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${_l()}`},Ma=nx;function Qt(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 kl(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(kl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach((C,R)=>{a.set(R,C)}))}function g(){if(l)throw new Error(Ze(3));return o}function v(C){if(typeof C!="function")throw new Error(Ze(4));if(l)throw new Error(Ze(5));let R=!0;c();let T=s++;return a.set(T,C),function(){if(R){if(l)throw new Error(Ze(6));R=!1,c(),a.delete(T),i=null}}}function E(C){if(!Qt(C))throw new Error(Ze(7));if(typeof C.type>"u")throw new Error(Ze(8));if(typeof C.type!="string")throw new Error(Ze(17));if(l)throw new Error(Ze(9));try{l=!0,o=n(o,C)}finally{l=!1}return(i=a).forEach(T=>{T()}),C}function h(C){if(typeof C!="function")throw new Error(Ze(10));n=C,E({type:Ma.REPLACE})}function y(){let C=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ze(11));function T(){let k=R;k.next&&k.next(g())}return T(),{unsubscribe:C(T)}},[mm](){return this}}}return E({type:Ma.INIT}),{dispatch:E,subscribe:v,getState:g,replaceReducer:h,[mm]:y}}function ox(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ma.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Ma.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function zn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{ox(r)}catch(a){i=a}return function(s={},l){if(i)throw i;let c=!1,g={};for(let v=0;v<n.length;v++){let E=n[v],h=r[E],y=s[E],S=h(y,l);if(typeof S>"u"){let C=l&&l.type;throw new Error(Ze(14))}g[E]=S,c=c||S!==y}return c=c||n.length!==Object.keys(s).length,c?g:s}}function ui(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function gm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ze(15))},a={getState:o.getState,dispatch:(l,...c)=>i(l,...c)},s=e.map(l=>l(a));return i=ui(...s)(o.dispatch),{...o,dispatch:i}}}function li(e){return Qt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var Ll=Symbol.for("immer-nothing"),di=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function Je(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wt=Object,Zr=wt.getPrototypeOf,fi="constructor",vi="prototype",Nl="configurable",Va="enumerable",qa="writable",mi="value",lt=e=>!!e&&!!e[ze];function dt(e){return e?xm(e)||bi(e)||!!e[di]||!!e[fi]?.[di]||wi(e)||Ai(e):!1}var ix=wt[vi][fi].toString(),hm=new WeakMap;function xm(e){if(!e||!Wn(e))return!1;let t=Zr(e);if(t===null||t===wt[vi])return!0;let r=wt.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!Xr(r))return!1;let n=hm.get(r);return n===void 0&&(n=Function.toString.call(r),hm.set(r,n)),n===ix}function Cm(e){return lt(e)||Je(15,e),e[ze].base_}function Si(e,t,r=!0){Jr(e)===0?(r?Reflect.ownKeys(e):wt.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Jr(e){let t=e[ze];return t?t.type_:bi(e)?1:wi(e)?2:Ai(e)?3:0}var pi=(e,t,r=Jr(e))=>r===2?e.has(t):wt[vi].hasOwnProperty.call(e,t),ir=(e,t,r=Jr(e))=>r===2?e.get(t):e[t],Ua=(e,t,r,n=Jr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function ax(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var bi=Array.isArray,wi=e=>e instanceof Map,Ai=e=>e instanceof Set,Wn=e=>typeof e=="object",Xr=e=>typeof e=="function",Ol=e=>typeof e=="boolean";function sx(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var cx=e=>Wn(e)?e?.[ze]:null,ar=e=>e.copy_||e.base_;var Vl=e=>e.modified_?e.copy_:e.base_;function Fl(e,t){if(wi(e))return new Map(e);if(Ai(e))return new Set(e);if(bi(e))return Array[vi].slice.call(e);let r=xm(e);if(t===!0||t==="class_only"&&!r){let n=wt.getOwnPropertyDescriptors(e);delete n[ze];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[qa]===!1&&(s[qa]=!0,s[Nl]=!0),(s.get||s.set)&&(n[a]={[Nl]:!0,[qa]:!0,[Va]:s[Va],[mi]:e[a]})}return wt.create(Zr(e),n)}else{let n=Zr(e);if(n!==null&&r)return{...e};let o=wt.create(n);return wt.assign(o,e)}}function Ul(e,t=!1){return za(e)||lt(e)||!dt(e)||(Jr(e)>1&&wt.defineProperties(e,{set:ja,add:ja,clear:ja,delete:ja}),wt.freeze(e),t&&Si(e,(r,n)=>{Ul(n,!0)},!1)),e}function ux(){Je(2)}var ja={[mi]:ux};function za(e){return e===null||!Wn(e)?!0:wt.isFrozen(e)}var Ba="MapSet",$a="Patches",ym="ArrayMethods",Ga={};function en(e){let t=Ga[e];return t||Je(0,e),t}var vm=e=>!!Ga[e];function lx(e,t){Ga[e]||(Ga[e]=t)}var gi,Em=()=>gi,dx=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:vm(Ba)?en(Ba):void 0,arrayMethodsPlugin_:vm(ym)?en(ym):void 0});function Sm(e,t){t&&(e.patchPlugin_=en($a),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dl(e){Ml(e),e.drafts_.forEach(px),e.drafts_=null}function Ml(e){e===gi&&(gi=e.parent_)}var bm=e=>gi=dx(gi,e);function px(e){let t=e[ze];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function wm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ze].modified_&&(Dl(t),Je(4)),dt(e)&&(e=Am(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ze].base_,e,t)}else e=Am(t,r);return fx(t,e,!0),Dl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ll?e:void 0}function Am(e,t){if(za(t))return t;let r=t[ze];if(!r)return Qa(t,e.handledSet_,e);if(!Wa(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Tm(r,e)}return r.copy_}function fx(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ul(t,r)}function Rm(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wa=(e,t)=>e.scope_===t,mx=[];function Im(e,t,r,n){let o=ar(e),i=e.type_;if(n!==void 0&&ir(o,n,i)===t){Ua(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(l,c)=>{if(lt(c)){let g=s.get(c)||[];g.push(l),s.set(c,g)}})}let a=e.draftLocations_.get(t)??mx;for(let s of a)Ua(o,s,r,i)}function gx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Wa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Vl(i);Im(e,i.draft_??i,a,r),Tm(i,o)})}function Tm(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}Rm(e)}}function hx(e,t,r){let{scope_:n}=e;if(lt(r)){let o=r[ze];Wa(o,n)&&o.callbacks_.push(function(){La(e);let a=Vl(o);Im(e,r,a,t)})}else dt(r)&&e.callbacks_.push(function(){let i=ar(e);e.type_===3?i.has(r)&&Qa(r,n.handledSet_,n):ir(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Qa(ir(e.copy_,t,e.type_),n.handledSet_,n)})}function Qa(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||lt(e)||t.has(e)||!dt(e)||za(e)||(t.add(e),Si(e,(n,o)=>{if(lt(o)){let i=o[ze];if(Wa(i,r)){let a=Vl(i);Ua(e,n,a,e.type_),Rm(i)}}else dt(o)&&Qa(o,t,r)})),e}function yx(e,t){let r=bi(e),n={type_:r?1:0,scope_:t?t.scope_:Em(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=Ha;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var Ha={get(e,t){if(t===ze)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=ar(e);if(!pi(o,t,e.type_))return vx(e,o,t);let i=o[t];if(e.finalized_||!dt(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&sx(t))return i;if(i===Pl(e.base_,t)){La(e);let a=e.type_===1?+t:t,s=ql(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in ar(e)},ownKeys(e){return Reflect.ownKeys(ar(e))},set(e,t,r){let n=_m(ar(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Pl(ar(e),t),i=o?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(ax(r,o)&&(r!==void 0||pi(e.base_,t,e.type_)))return!0;La(e),jl(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_.set(t,!0),hx(e,t,r)),!0},deleteProperty(e,t){return La(e),Pl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),jl(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ar(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[qa]:!0,[Nl]:e.type_!==1||t!=="length",[Va]:n[Va],[mi]:r[t]}},defineProperty(){Je(11)},getPrototypeOf(e){return Zr(e.base_)},setPrototypeOf(){Je(12)}},hi={};for(let e in Ha){let t=Ha[e];hi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return Ha.set.call(this,e[0],t,r,e[0])};function Pl(e,t){let r=e[ze];return(r?ar(r):e)[t]}function vx(e,t,r){let n=_m(t,r);return n?mi in n?n[mi]:n.get?.call(e.draft_):void 0}function _m(e,t){if(!(t in e))return;let r=Zr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Zr(r)}}function jl(e){e.modified_||(e.modified_=!0,e.parent_&&jl(e.parent_))}function La(e){e.copy_||(e.assigned_=new Map,e.copy_=Fl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Sx=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Xr(t)&&!Xr(r)){let i=r;r=t;let a=this;return function(l=i,...c){return a.produce(l,g=>r.call(this,g,...c))}}Xr(r)||Je(6),n!==void 0&&!Xr(n)&&Je(7);let o;if(dt(t)){let i=bm(this),a=ql(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Dl(i):Ml(i)}return Sm(i,n),wm(o,i)}else if(!t||!Wn(t)){if(o=r(t),o===void 0&&(o=t),o===Ll&&(o=void 0),this.autoFreeze_&&Ul(o,!0),n){let i=[],a=[];en($a).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else Je(1,t)},this.produceWithPatches=(t,r)=>{if(Xr(t))return(a,...s)=>this.produceWithPatches(a,l=>t(l,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Ol(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Ol(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Ol(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){dt(e)||Je(8),lt(e)&&(e=Ka(e));let t=bm(this),r=ql(t,e,void 0);return r[ze].isManual_=!0,Ml(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&Je(9);let{scope_:n}=r;return Sm(n,t),wm(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=en($a).applyPatches_;return lt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function ql(e,t,r,n){let[o,i]=wi(t)?en(Ba).proxyMap_(t,r):Ai(t)?en(Ba).proxySet_(t,r):yx(t,r);return(r?.scope_??Em()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?gx(r,i,n):i.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:c}=l;i.modified_&&c&&c.generatePatches_(i,[],l)}),o}function Ka(e){return lt(e)||Je(10,e),km(e)}function km(e){if(!dt(e)||za(e))return e;let t=e[ze],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Fl(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Fl(e,!0);return Si(r,(o,i)=>{Ua(r,o,km(i))},n),t&&(t.finalized_=!1),r}function Om(){function t(y,S=[]){if(y.key_!==void 0){let C=y.parent_.copy_??y.parent_.base_,R=cx(ir(C,y.key_)),T=ir(C,y.key_);if(T===void 0||T!==y.draft_&&T!==y.base_&&T!==y.copy_||R!=null&&R.base_!==y.base_)return null;let I=y.parent_.type_===3,k;if(I){let _=y.parent_;k=Array.from(_.drafts_.keys()).indexOf(y.key_)}else k=y.key_;if(!(I&&C.size>k||pi(C,k)))return null;S.push(k)}if(y.parent_)return t(y.parent_,S);S.reverse();try{r(y.copy_,S)}catch{return null}return S}function r(y,S){let C=y;for(let R=0;R<S.length-1;R++){let T=S[R];if(C=ir(C,T),!Wn(C)||C===null)throw new Error(`Cannot resolve path at '${S.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(y,S,C){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:R,inversePatches_:T}=C;switch(y.type_){case 0:case 2:return l(y,S,R,T);case 1:return s(y,S,R,T);case 3:return c(y,S,R,T)}}function s(y,S,C,R){let{base_:T,assigned_:I}=y,k=y.copy_;k.length<T.length&&([T,k]=[k,T],[C,R]=[R,C]);let _=y.allIndicesReassigned_===!0;for(let D=0;D<T.length;D++){let B=k[D],L=T[D];if((_||I?.get(D.toString()))&&B!==L){let U=B?.[ze];if(U&&U.modified_)continue;let j=S.concat([D]);C.push({op:n,path:j,value:h(B)}),R.push({op:n,path:j,value:h(L)})}}for(let D=T.length;D<k.length;D++){let B=S.concat([D]);C.push({op:o,path:B,value:h(k[D])})}for(let D=k.length-1;T.length<=D;--D){let B=S.concat([D]);R.push({op:i,path:B})}}function l(y,S,C,R){let{base_:T,copy_:I,type_:k}=y;Si(y.assigned_,(_,D)=>{let B=ir(T,_,k),L=ir(I,_,k),q=D?pi(T,_)?n:o:i;if(B===L&&q===n)return;let U=S.concat(_);C.push(q===i?{op:q,path:U}:{op:q,path:U,value:h(L)}),R.push(q===o?{op:i,path:U}:q===i?{op:o,path:U,value:h(B)}:{op:n,path:U,value:h(B)})})}function c(y,S,C,R){let{base_:T,copy_:I}=y,k=0;T.forEach(_=>{if(!I.has(_)){let D=S.concat([k]);C.push({op:i,path:D,value:_}),R.unshift({op:o,path:D,value:_})}k++}),k=0,I.forEach(_=>{if(!T.has(_)){let D=S.concat([k]);C.push({op:o,path:D,value:_}),R.unshift({op:i,path:D,value:_})}k++})}function g(y,S,C){let{patches_:R,inversePatches_:T}=C;R.push({op:n,path:[],value:S===Ll?void 0:S}),T.push({op:n,path:[],value:y})}function v(y,S){return S.forEach(C=>{let{path:R,op:T}=C,I=y;for(let B=0;B<R.length-1;B++){let L=Jr(I),q=R[B];typeof q!="string"&&typeof q!="number"&&(q=""+q),(L===0||L===1)&&(q==="__proto__"||q===fi)&&Je(19),Xr(I)&&q===vi&&Je(19),I=ir(I,q),Wn(I)||Je(18,R.join("/"))}let k=Jr(I),_=E(C.value),D=R[R.length-1];switch(T){case n:switch(k){case 2:return I.set(D,_);case 3:Je(16);default:return I[D]=_}case o:switch(k){case 1:return D==="-"?I.push(_):I.splice(D,0,_);case 2:return I.set(D,_);case 3:return I.add(_);default:return I[D]=_}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:Je(17,T)}}),y}function E(y){if(!dt(y))return y;if(bi(y))return y.map(E);if(wi(y))return new Map(Array.from(y.entries()).map(([C,R])=>[C,E(R)]));if(Ai(y))return new Set(Array.from(y).map(E));let S=Object.create(Zr(y));for(let C in y)S[C]=E(y[C]);return pi(y,di)&&(S[di]=y[di]),S}function h(y){return lt(y)?E(y):y}lx($a,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:g,getPath:t})}var yi=new Sx,tn=yi.produce,Bl=yi.produceWithPatches.bind(yi);var $l=yi.applyPatches.bind(yi);m();d();f();p();function bx(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function wx(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 Pm=e=>Array.isArray(e)?e:[e];function Ax(e){let t=Array.isArray(e[0])?e[0]:e;return wx(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function xx(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Cx=class{constructor(e){this.value=e}deref(){return this.value}},Ex=()=>typeof WeakRef>"u"?Cx:WeakRef,Fm=Ex(),Rx=0,Nm=1;function Ya(){return{s:Rx,v:void 0,o:null,p:null}}function Ix(e){return e instanceof Fm?e.deref():e}function xi(e,t={}){let r=Ya(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:l}=arguments;for(let v=0,E=l;v<E;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}else{let y=s.p;y===null&&(s.p=y=new Map);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}}let c=s,g;if(s.s===Nm)g=s.v;else if(g=e.apply(null,arguments),i++,n){let v=Ix(o);v!=null&&n(v,g)&&(g=v,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Fm(g):g}return c.s=Nm,c.v=g,g}return a.clearCache=()=>{r=Ya(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Tx(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),bx(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let g={...r,...l},{memoize:v,memoizeOptions:E=[],argsMemoize:h=xi,argsMemoizeOptions:y=[]}=g,S=Pm(E),C=Pm(y),R=Ax(o),T=v(function(){return i++,c.apply(null,arguments)},...S),I=!0,k=h(function(){a++;let D=xx(R,arguments);return s=T.apply(null,D),s},...C);return Object.assign(k,{resultFunc:c,memoizedResultFunc:T,dependencies:R,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Be=Tx(xi);m();d();f();p();function Dm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Mm=Dm(),jm=Dm;var _x=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ui:ui.apply(null,arguments)},VM=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},kx=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(pt(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=>li(n)&&n.type===e,r}var Qm=class Ci extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ci.prototype)}static get[Symbol.species](){return Ci}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ci(...t[0].concat(this)):new Ci(...t.concat(this))}};function qm(e){return dt(e)?tn(e,()=>{}):e}function Xa(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Ox(e){return typeof e=="boolean"}var Px=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Qm;return r&&(Ox(r)?a.push(Mm):a.push(jm(r.extraArgument))),a},Ei="RTK_autoBatch",Xn=()=>e=>({payload:e,meta:{[Ei]:!0}}),Lm=e=>t=>{setTimeout(t,e)},Nx=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},Fx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Nx(window.requestAnimationFrame,100):Lm(10):e.type==="callback"?e.queueNotification:Lm(e.timeout),c=()=>{a=!1,i&&(i=!1,s.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),E=n.subscribe(v);return s.add(g),()=>{E(),s.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ei],i=!o,i&&(a||(a=!0,l(c))),n.dispatch(g)}finally{o=!0}}})},Dx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Qm(e);return n&&o.push(Fx(typeof n=="object"?n:void 0)),o};function Hm(e){let t=Px(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},l;if(typeof r=="function")l=r;else if(Qt(r))l=zn(r);else throw new Error(pt(1));let c;typeof n=="function"?c=n(t):c=t();let g=ui;o&&(g=_x({trace:!1,...(typeof o=="object"&&o)}));let v=gm(...c),E=Dx(v),h=typeof s=="function"?s(E):E(),y=g(...h);return kl(l,a,y)}function zm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(pt(28));if(s in t)throw new Error(pt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),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 Mx(e){return typeof e=="function"}function Le(e,t){let[r,n,o]=zm(t),i;if(Mx(e))i=()=>qm(e());else{let s=qm(e);i=()=>s}function a(s=i(),l){let c=[r[l.type],...n.filter(({matcher:g})=>g(l)).map(({reducer:g})=>g)];return c.filter(g=>!!g).length===0&&(c=[o]),c.reduce((g,v)=>{if(v)if(lt(g)){let h=v(g,l);return h===void 0?g:h}else{if(dt(g))return tn(g,E=>v(E,l));{let E=v(g,l);if(E===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}}return g},s)}return a.getInitialState=i,a}var Wm=(e,t)=>kx(e)?e.match(t):e(t);function Ht(...e){return t=>e.some(r=>Wm(r,t))}function Yn(...e){return t=>e.every(r=>Wm(r,t))}function ts(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 Ri(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function rs(...e){return e.length===0?t=>ts(t,["pending"]):Ri(e)?Ht(...e.map(t=>t.pending)):rs()(e[0])}function nn(...e){return e.length===0?t=>ts(t,["rejected"]):Ri(e)?Ht(...e.map(t=>t.rejected)):nn()(e[0])}function Ii(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Yn(nn(...e),t):Ri(e)?Yn(nn(...e),t):Ii()(e[0])}function sr(...e){return e.length===0?t=>ts(t,["fulfilled"]):Ri(e)?Ht(...e.map(t=>t.fulfilled)):sr()(e[0])}function ns(...e){return e.length===0?t=>ts(t,["pending","fulfilled","rejected"]):Ri(e)?Ht(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ns()(e[0])}var jx="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ti=(e=21)=>{let t="",r=e;for(;r--;)t+=jx[Math.random()*64|0];return t},qx=["name","message","stack","code"],Gl=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},Vm=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},Lx=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of qx)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Um="External signal was aborted",Re=(()=>{function e(t,r,n){let o=N(t+"/fulfilled",(l,c,g,v)=>({payload:l,meta:{...(v||{}),arg:g,requestId:c,requestStatus:"fulfilled"}})),i=N(t+"/pending",(l,c,g)=>({payload:void 0,meta:{...(g||{}),arg:c,requestId:l,requestStatus:"pending"}})),a=N(t+"/rejected",(l,c,g,v,E)=>({payload:v,error:(n&&n.serializeError||Lx)(l||"Rejected"),meta:{...(E||{}),arg:g,requestId:c,rejectedWithValue:!!v,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function s(l,{signal:c}={}){return(g,v,E)=>{let h=n?.idGenerator?n.idGenerator(l):Ti(),y=new u.AbortController,S,C;function R(I){C=I,y.abort()}c&&(c.aborted?R(Um):c.addEventListener("abort",()=>R(Um),{once:!0}));let T=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(l,{getState:v,extra:E});if(Ux(_)&&(_=yield _),_===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((B,L)=>{S=()=>{L({name:"AbortError",message:C||"Aborted"})},y.signal.addEventListener("abort",S,{once:!0})});g(i(h,l,n?.getPendingMeta?.({requestId:h,arg:l},{getState:v,extra:E}))),I=yield Promise.race([D,Promise.resolve(r(l,{dispatch:g,getState:v,extra:E,requestId:h,signal:y.signal,abort:R,rejectWithValue:(B,L)=>new Gl(B,L),fulfillWithValue:(B,L)=>new Vm(B,L)})).then(B=>{if(B instanceof Gl)throw B;return B instanceof Vm?o(B.payload,h,l,B.meta):o(B,h,l)})])}catch(_){I=_ instanceof Gl?a(null,h,l,_.payload,_.meta):a(_,h,l)}finally{S&&y.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||g(I),I})();return Object.assign(T,{abort:R,requestId:h,arg:l,unwrap(){return T.then(Vx)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Ht(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Vx(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Ux(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Km=Symbol.for("rtk-slice-createasyncthunk"),BM={[Km]:Re};function Bx(e,t){return`${e}/${t}`}function $x({creators:e}={}){let t=e?.asyncThunk?.[Km];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(pt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Qx()):n.reducers)||{},s=Object.keys(a),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(I,k){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(pt(12));if(_ in l.sliceCaseReducersByType)throw new Error(pt(13));return l.sliceCaseReducersByType[_]=k,c},addMatcher(I,k){return l.sliceMatchers.push({matcher:I,reducer:k}),c},exposeAction(I,k){return l.actionCreators[I]=k,c},exposeCaseReducer(I,k){return l.sliceCaseReducersByName[I]=k,c}};s.forEach(I=>{let k=a[I],_={reducerName:I,type:Bx(o,I),createNotation:typeof n.reducers=="function"};zx(k)?Kx(_,k,c,t):Hx(_,k,c)});function g(){let[I={},k=[],_=void 0]=typeof n.extraReducers=="function"?zm(n.extraReducers):[n.extraReducers],D={...I,...l.sliceCaseReducersByType};return Le(n.initialState,B=>{for(let L in D)B.addCase(L,D[L]);for(let L of l.sliceMatchers)B.addMatcher(L.matcher,L.reducer);for(let L of k)B.addMatcher(L.matcher,L.reducer);_&&B.addDefaultCase(_)})}let v=I=>I,E=new Map,h=new WeakMap,y;function S(I,k){return y||(y=g()),y(I,k)}function C(){return y||(y=g()),y.getInitialState()}function R(I,k=!1){function _(B){let L=B[I];return typeof L>"u"&&k&&(L=Xa(h,_,C)),L}function D(B=v){let L=Xa(E,k,()=>new WeakMap);return Xa(L,B,()=>{let q={};for(let[U,j]of Object.entries(n.selectors??{}))q[U]=Gx(j,B,()=>Xa(h,B,C),k);return q})}return{reducerPath:I,getSelectors:D,get selectors(){return D(_)},selectSlice:_}}let T={name:o,reducer:S,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(I,{reducerPath:k,..._}={}){let D=k??i;return I.inject({reducerPath:D,reducer:S},_),{...T,...R(D,!0)}}};return T}}function Gx(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var on=$x();function Qx(){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 Hx({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Wx(n))throw new Error(pt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?N(e,a):N(e))}function zx(e){return e._reducerDefinitionType==="asyncThunk"}function Wx(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Kx({type:e,reducerName:t},r,n,o){if(!o)throw new Error(pt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:l,settled:c,options:g}=r,v=o(e,i,g);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),l&&n.addCase(v.rejected,l),c&&n.addMatcher(v.settled,c),n.exposeCaseReducer(t,{fulfilled:a||Za,pending:s||Za,rejected:l||Za,settled:c||Za})}function Za(){}var Yx="task",Ym="listener",Xm="completed",zl="cancelled",Xx=`task-${zl}`,Zx=`task-${Xm}`,Ql=`${Ym}-${zl}`,Jx=`${Ym}-${Xm}`,os=class{constructor(e){ie(this,"code");ie(this,"name","TaskAbortError");ie(this,"message");this.code=e,this.message=`${Yx} ${zl} (reason: ${e})`}},Wl=(e,t)=>{if(typeof e!="function")throw new TypeError(pt(32))},Ja=()=>{},Zm=(e,t=Ja)=>(e.catch(t),e),Jm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),rn=e=>{if(e.aborted)throw new os(e.reason)};function eg(e,t){let r=Ja;return new Promise((n,o)=>{let i=()=>o(new os(e.reason));if(e.aborted){i();return}r=Jm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ja})}var eC=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof os?"cancelled":"rejected",error:r}}finally{t?.()}});return function eC(_x5,_x6){return _ref5.apply(this,arguments)}}(),es=e=>t=>Zm(eg(e,t).then(r=>(rn(e),r))),tg=e=>{let t=es(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Kn}=Object,Bm={},is="listenerMiddleware",tC=(e,t)=>{let r=n=>Jm(e,()=>n.abort(e.reason));return(n,o)=>{Wl(n,"taskExecutor");let i=new u.AbortController;r(i);let a=eC(/*#__PURE__*/_asyncToGenerator(function*(){rn(e),rn(i.signal);let s=yield n({pause:es(i.signal),delay:tg(i.signal),signal:i.signal});return rn(i.signal),s}),()=>i.abort(Zx));return o?.autoJoin&&t.push(a.catch(Ja)),{result:es(e)(a),cancel(){i.abort(Xx)}}}},rC=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){rn(t);let i=()=>{},s=[new Promise((l,c)=>{let g=e({predicate:n,effect:(v,E)=>{E.unsubscribe(),l([v,E.getState(),E.getOriginalState()])}});i=()=>{g(),c()}})];o!=null&&s.push(new Promise(l=>setTimeout(l,o,null)));try{let l=yield eg(t,Promise.race(s));return rn(t),l}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>Zm(r(n,o))},rg=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=N(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(pt(21));return Wl(i,"options.listener"),{predicate:o,type:t,effect:i}},ng=Kn(e=>{let{type:t,predicate:r,effect:n}=rg(e);return{id:Ti(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(pt(22))}}},{withTypes:()=>ng}),$m=(e,t)=>{let{type:r,effect:n,predicate:o}=rg(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Hl=e=>{e.pending.forEach(t=>{t.abort(Ql)})},nC=(e,t)=>()=>{for(let r of t.keys())Hl(r);e.clear()},Gm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},og=Kn(N(`${is}/add`),{withTypes:()=>og}),oC=N(`${is}/removeAll`),ig=Kn(N(`${is}/remove`),{withTypes:()=>ig}),iC=(...e)=>{console.error(`${is}/error`,...e)},ag=(e={})=>{let t=new Map,r=new Map,n=h=>{let y=r.get(h)??0;r.set(h,y+1)},o=h=>{let y=r.get(h)??1;y===1?r.delete(h):r.set(h,y-1)},{extra:i,onError:a=iC}=e;Wl(a,"onError");let s=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&Hl(h)}),l=h=>{let y=$m(t,h)??ng(h);return s(y)};Kn(l,{withTypes:()=>l});let c=h=>{let y=$m(t,h);return y&&(y.unsubscribe(),h.cancelActive&&Hl(y)),!!y};Kn(c,{withTypes:()=>c});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,y,S,C){let R=new u.AbortController,T=rC(l,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(y,Kn({},S,{getOriginalState:C,condition:(k,_)=>T(k,_).then(Boolean),take:T,delay:tg(R.signal),pause:es(R.signal),extra:i,signal:R.signal,fork:tC(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,_,D)=>{k!==R&&(k.abort(Ql),D.delete(k))})},cancel:()=>{R.abort(Ql),h.pending.delete(R)},throwIfCancelled:()=>{rn(R.signal)}})))}catch(k){k instanceof os||Gm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(Jx),o(h),h.pending.delete(R)}});return function g(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),v=nC(t,r);return{middleware:h=>y=>S=>{if(!li(S))return y(S);if(og.match(S))return l(S.payload);if(oC.match(S)){v();return}if(ig.match(S))return c(S.payload);let C=h.getState(),R=()=>{if(C===Bm)throw new Error(pt(23));return C},T;try{if(T=y(S),t.size>0){let I=h.getState(),k=Array.from(t.values());for(let _ of k){let D=!1;try{D=_.predicate(S,I,C)}catch(B){D=!1,Gm(a,B,{raisedBy:"predicate"})}D&&g(_,S,h,R)}}}finally{C=Bm}return T},startListening:l,stopListening:c,clearListeners:v}};function pt(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. `}m();d();f();p();var Z=new z({required:!0,emptyAllowed:!1}),et=new z({required:!1,emptyAllowed:!1}),tt=new z({required:!0,emptyAllowed:!0}),ej=new z({required:!1,emptyAllowed:!0}),as=new ve({each:Z,required:!0}),sg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),cg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),tj=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),cr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Rt=(e,t)=>{if("required"in t)return{payload:new mt({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new oi(o);return{payload:e}},$=(e,t)=>{try{return Rt(e,t)}catch(r){return{payload:e,error:cr(r)}}},ug=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return dg(e,t,r,o,"Controller initialization error")},lg=(e,t,r,n)=>{let o=`Check the options of ${n}`;return dg(e,t,r,o,"Controller initialization error")},dg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var Zn="3.51.1",pg=["@coveo/atomic","@coveo/quantic"];var Kl=()=>et,fg=()=>Z,Cr=N("configuration/updateBasicConfiguration",e=>$(e,{accessToken:et,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:et})),zt=N("configuration/updateSearchConfiguration",e=>$(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:et,timezone:et,locale:et,authenticationProviders:new ve({required:!1,each:Z})})),aC={enabled:new me({default:!0}),originContext:Kl(),originLevel2:Kl(),originLevel3:Kl(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new Fe,anonymous:new me({default:!1}),deviceId:et,userDisplayName:et,documentLocation:et,trackingId:cg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:pg.reduce((e,t)=>(e[t]=sg,e),{})})},Jn=N("configuration/updateAnalyticsConfiguration",e=>$(e,aC)),eo=N("configuration/analytics/disable"),to=N("configuration/analytics/enable"),ss=N("configuration/analytics/originlevel2",e=>$(e,{originLevel2:fg()})),cs=N("configuration/analytics/originlevel3",e=>$(e,{originLevel3:fg()})),mg=N("knowledge/setAgentId",e=>$(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var gg={q:new z,enableQuerySyntax:new me,aq:new z,cq:new z,firstResult:new oe({min:0}),numberOfResults:new oe({min:0}),sortCriteria:new z,f:new ne,fExcluded:new ne,cf:new ne,nf:new ne,mnf:new ne,df:new ne,debug:new me,sf:new ne,tab:new z,af:new ne};var Er=N("searchParameters/restore",e=>$(e,gg)),hg=N("searchParameters/restoreTab",e=>$(e,Z));m();d();f();p();var us=N("debug/enable"),ls=N("debug/disable");m();d();f();p();var ds=()=>!1;var ps=Le(ds(),e=>{e.addCase(us,()=>!0).addCase(ls,()=>!1).addCase(Er,(t,r)=>r.payload.debug??t)});m();d();f();p();var ro=N("pipeline/set",e=>$(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var sC=N("history/undo"),cC=N("history/redo"),Wt=N("history/snapshot"),lq=Re("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(sC()),yield t(ht())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),dq=Re("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(cC()),yield t(ht())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),ht=Re("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var no=()=>"";var oo=Le(no(),e=>{e.addCase(ro,(t,r)=>r.payload).addCase(ht.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(zt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var fs=N("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var io=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,l=/^(\d{1,3}\.){3}\d{1,3}$/,c=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;l.test(s)||c.test(s)||s.indexOf(".")===-1?Yl(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Yl(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 Yl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}m();d();f();p();function uC(){return typeof navigator<"u"}function yg(){try{return typeof localStorage<"u"}catch{return!1}}function vg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Sg(){return!!(uC()&&navigator.cookieEnabled)}var bg=null;function wg(){return bg||(yg()?localStorage:Sg()?new Xl:vg()?sessionStorage:new Zl)}var ao=class ao{getItem(t){return io.get(`${ao.prefix}${t}`)}removeItem(t){io.erase(`${ao.prefix}${t}`)}setItem(t,r,n){io.set(`${ao.prefix}${t}`,r,n)}};ie(ao,"prefix","coveo_");var Xl=ao;var Zl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ms="__coveo.analytics.history",lC=20,dC=1e3*60,pC=75,an=class an{constructor(t){ie(this,"store");this.store=t||wg()}static getInstance(t){return an.instance||(an.instance=new an(t)),an.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(ms);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ms);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ms,JSON.stringify(t.slice(0,lC)))}catch{}}clear(){try{this.store.removeItem(ms)}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,pC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>dC:!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))}};ie(an,"instance",null);var Jl=an,It=Jl;m();d();f();p();m();d();f();p();var so=Be(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Zn}`));m();d();f();p();m();d();f();p();function ur(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 V(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 s(g){try{c(n.next(g))}catch(v){a(v)}}function l(g){try{c(n.throw(g))}catch(v){a(v)}}function c(g){g.done?i(g.value):o(g.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}var Ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ae||(Ae={}));function rd(){return typeof window<"u"}function gd(){return typeof navigator<"u"}function co(){return typeof document<"u"}function nd(){try{return typeof localStorage<"u"}catch{return!1}}function fC(){try{return typeof sessionStorage<"u"}catch{return!1}}function Dg(){return gd()&&navigator.cookieEnabled}var mC=[Ae.click,Ae.custom,Ae.search,Ae.view],gC=(e,t)=>mC.indexOf(e)!==-1?Object.assign({language:co()?document.documentElement.lang:"unknown",userAgent:gd()?navigator.userAgent:"unknown"},t):t,ki=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Ag(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Ag(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 Ag(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function hC(){return nd()?localStorage:Dg()?new Oi:fC()?sessionStorage:new lo}var Oi=class e{getItem(t){return ki.get(`${e.prefix}${t}`)}removeItem(t){ki.erase(`${e.prefix}${t}`)}setItem(t,r,n){ki.set(`${e.prefix}${t}`,r,n)}};Oi.prefix="coveo_";var od=class{constructor(){this.cookieStorage=new Oi}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)}},lo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},gs="__coveo.analytics.history",yC=20,vC=1e3*60,SC=75,vs=class{constructor(t){this.store=t||hC()}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 V(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 V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(gs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(gs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(gs,JSON.stringify(t.slice(0,yC)))}catch{}}clear(){try{this.store.removeItem(gs)}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,SC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>vC:!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 bC=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Ae.view?(yield wC(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),wC=e=>V(void 0,void 0,void 0,function*(){let t=new vs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),hs,AC=new Uint8Array(16);function xC(){if(!hs&&(hs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hs(AC)}var CC=/^(?:[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 Ss(e){return typeof e=="string"&&CC.test(e)}var rt=[];for(let e=0;e<256;++e)rt.push((e+256).toString(16).slice(1));function Mg(e,t=0){return rt[e[t+0]]+rt[e[t+1]]+rt[e[t+2]]+rt[e[t+3]]+"-"+rt[e[t+4]]+rt[e[t+5]]+"-"+rt[e[t+6]]+rt[e[t+7]]+"-"+rt[e[t+8]]+rt[e[t+9]]+"-"+rt[e[t+10]]+rt[e[t+11]]+rt[e[t+12]]+rt[e[t+13]]+rt[e[t+14]]+rt[e[t+15]]}function EC(e){if(!Ss(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 RC(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var IC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",TC="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function _C(e,t,r){function n(o,i,a,s){var l;if(typeof o=="string"&&(o=RC(o)),typeof i=="string"&&(i=EC(i)),((l=i)===null||l===void 0?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+o.length);if(c.set(i),c.set(o,i.length),c=r(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,a){s=s||0;for(let g=0;g<16;++g)a[s+g]=c[g];return a}return Mg(c)}try{n.name=e}catch{}return n.DNS=IC,n.URL=TC,n}var kC=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xg={randomUUID:kC};function sn(e,t,r){if(xg.randomUUID&&!t&&!e)return xg.randomUUID();e=e||{};let n=e.random||(e.rng||xC)();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 Mg(n)}function OC(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 ed(e,t){return e<<t|e>>>32-t}function PC(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 s=0;s<a.length;++s)e.push(a.charCodeAt(s))}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 s=new Uint32Array(16);for(let l=0;l<16;++l)s[l]=e[a*64+l*4]<<24|e[a*64+l*4+1]<<16|e[a*64+l*4+2]<<8|e[a*64+l*4+3];i[a]=s}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 s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=i[a][h];for(let h=16;h<80;++h)s[h]=ed(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let l=r[0],c=r[1],g=r[2],v=r[3],E=r[4];for(let h=0;h<80;++h){let y=Math.floor(h/20),S=ed(l,5)+OC(y,c,g,v)+E+t[y]+s[h]>>>0;E=v,v=g,g=ed(c,30)>>>0,c=l,l=S}r[0]=r[0]+l>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+E>>>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 NC=_C("v5",80,PC),Cg=NC,jg="2.30.55",Eg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,_i={pageview:"pageview",event:"event"},bs=class{constructor({client:t,uuidGenerator:r=sn}){this.client=t,this.uuidGenerator=r}},id=class extends bs{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Eg(window.location),this.lastReferrer=co()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:co()?document.title:"",encoding:co()?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===_i.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===_i.pageview?this.nextPageViewId:this.pageViewId,referrer:t===_i.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===_i.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 Eg(window.location)}},Rr=class e{constructor(t,r){if(!Ss(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 Ss(i)?new e(i,Number.parseInt(o)*1e3):null}};Rr.cvo_cid="cvo_cid";Rr.expirationTime=120;var ad=class extends bs{constructor({client:t,uuidGenerator:r=sn}){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 V(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(Rr.cvo_cid,new Rr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ad.Id="link";var _t=Object.keys;function ys(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var td=128,qg=192,Rg=224,Ig=240;function FC(e){return(e&248)===Ig?4:(e&Ig)===Rg?3:(e&Rg)===qg?2:1}function DC(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&td)!=td)break;if(r-=3,(n&qg)!=td){t-r>=FC(n)*3&&(r=t);break}}return e.substring(0,r)}var sd={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"},MC=_t(sd).map(e=>sd[e]),jC=[...MC].join("|"),qC=new RegExp(`^(${jC}$)`),LC={svcAction:"svc_action",svcActionData:"svc_action_data"},VC=e=>_t(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=sd[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),UC=e=>qC.test(e),BC=[UC],Tg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},_g={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},st={action:"pa",list:"pal",listSource:"pls"},ws={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},$C=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],cd={id:"quoteId",affiliation:"quoteAffiliation"},ud={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},GC={add:st,bookmark_add:st,bookmark_remove:st,click:st,checkout:st,checkout_option:st,detail:st,impression:st,remove:st,refund:Object.assign(Object.assign({},st),ws),purchase:Object.assign(Object.assign({},st),ws),quickview:st,quote:Object.assign(Object.assign({},st),cd),review:Object.assign(Object.assign({},st),ud)},QC=_t(Tg).map(e=>Tg[e]),HC=_t(_g).map(e=>_g[e]),zC=_t(st).map(e=>st[e]),WC=_t(ws).map(e=>ws[e]),KC=_t(ud).map(e=>ud[e]),YC=_t(cd).map(e=>cd[e]),XC=[...QC,"custom"].join("|"),ZC=[...HC,"custom"].join("|"),Lg="(pr[0-9]+)",Vg="(il[0-9]+pi[0-9]+)",JC=new RegExp(`^${Lg}(${XC})$`),eE=new RegExp(`^(${Vg}(${ZC}))|(il[0-9]+nm)$`),tE=new RegExp(`^(${zC.join("|")})$`),rE=new RegExp(`^(${WC.join("|")})$`),nE=new RegExp(`^${Lg}custom$`),oE=new RegExp(`^${Vg}custom$`),iE=new RegExp(`^(${[...$C,...KC,...YC].join("|")})$`),aE=e=>JC.test(e),sE=e=>eE.test(e),cE=e=>tE.test(e),uE=e=>rE.test(e),lE=e=>iE.test(e),dE=[sE,aE,cE,uE,lE],pE=[nE,oE],fE={anonymizeIp:"aip"},mE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},gE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},hE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],yE=Object.assign(Object.assign(Object.assign(Object.assign({},fE),mE),gE),hE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ld=Object.assign(Object.assign({},yE),LC),vE=e=>{let t=!!e.action&&GC[e.action]||{};return _t(e).reduce((r,n)=>{let o=t[n]||ld[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},SE=_t(ld).map(e=>ld[e]),bE=e=>SE.indexOf(e)!==-1,wE=e=>e==="custom",AE=e=>[...dE,...BC,bE,wE].some(t=>t(e)),xE=e=>_t(e).reduce((t,r)=>{let n=CE(r);return n?Object.assign(Object.assign({},t),EE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),CE=e=>{let t;return[...pE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},EE=(e,t)=>_t(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),dd=class{constructor(t){this.opts=t}sendEvent(t,r){return V(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:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),l=this.encodeForEventType(t,s),c=new Blob([l],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,c)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(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:s,body:l}=a;o=s||t;try{i=JSON.parse(l)}catch(c){console.error("Unable to process the request body as a JSON string",c)}}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 V(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[Ae.click,Ae.custom,Ae.search,Ae.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}},pd=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},kg=b.fetch,As=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},l=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:c}=l,g=ur(l,["url"]),v;try{v=yield kg(c,g)}catch(E){console.error("An error has occured when sending the event.",E);return}if(v.ok){let E=yield v.json();return E.visitorId&&o.setCurrentVisitorId(E.visitorId),E}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield kg(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}getVisitorIdParam(){return V(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"})}},fd=class{constructor(t,r){nd()&&Dg()?this.storage=new od:nd()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new lo),this.client=new As(t),this.beaconClient=new dd(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}},md=class{constructor(t,r){this.storage=r||new lo,this.client=new As(t)}getClientDependingOnEventType(t){return this.client}},xs=class{constructor(){this.storage=new lo,this.client=new pd}getClientDependingOnEventType(t){return this.client}},RE="xx",IE=e=>e?.startsWith(RE)||!1,TE=`
27
+ `;return new oi(r)}var oi=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},mt=class{constructor(e){ie(this,"definition");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 uA(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}},Fe=class{constructor(e={}){ie(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&ce(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 Xe(e){return e===void 0}function lA(e){return e===null}function ce(e){return Xe(e)||lA(e)}var me=class{constructor(e={}){ie(this,"value");this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(dA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function dA(e){return Xe(e)||Bf(e)}function Bf(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(pA(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 pA(e){return Xe(e)||$f(e)}function $f(e){return typeof e=="number"&&!Number.isNaN(e)}var fA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ie(this,"value");ie(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Fe(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(Xe(e))return null;if(!Ra(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&&!(fA.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 Ra(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ie(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Xe(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Gf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ce(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 Gf(e){return e!==void 0&&typeof e=="object"}var ve=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(this.config)}validate(e){if(!ce(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ce(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&&ce(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 Bf(e)||Ra(e)||$f(e)||Gf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Qf(e){return Array.isArray(e)}var vl=class{constructor(e){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Xe(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}};m();d();f();p();function Hf(e){return Array.isArray(e)}function Ia(e){return e.trim()===""}var mA=new Set(["1",1,"yes",!0]);function zf(){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=>mA.has(r))}function Wf(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ii(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ta(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 gA(e){if(Ia(e.openingDelimiter)||Ia(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ce(e.content)||Ia(e.content))return e.content;if(e.highlights.length===0)return Gn(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,s=a+i.length;if(s>t)break;r+=Gn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Gn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Gn(e.content.slice(n))),r}function hA(e,t){return e=Gn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Sl(n,t.notMatchDelimiters):o?Sl(o,t.exactMatchDelimiters):i?Sl(i,t.correctionDelimiters):r)}function Sl(e,t){return t?t.open+e+t.close:e}function Gn(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}m();d();f();p();var am=Mt(rm(),1);m();d();f();p();var $t=new Error("Failed to load reducers."),Qn=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."}},Yr=class extends Error{constructor(r,n){super();ie(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function nm(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function om(e){return typeof e!="object"||!e?!1:Object.values(e).every(BA)}function BA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function im(e){return e===429}var jt=class e{static call(t){return _asyncToGenerator(function*(){let r=$A(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let l=yield w(i,a);if(im(l.status))throw l;return l});return function s(){return _ref.apply(this,arguments)}}();try{let l=yield(0,am.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(c){let g=c&&im(c.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(l.status){case 419:case 401:throw n.info("Platform renewing token"),new Qn;case 404:throw new Yr(i,l.status);default:return n.info({response:l,requestInfo:o},"Platform response"),l}}catch(l){return l.message==="Failed to fetch"?new Yr(i):l}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...l}=t,c=ii(l);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return c})()}};function Et(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Hn(e,t,r="prod"){return e??Et(t,r)}function br(e,t="prod"){return`${Et(e,t)}/rest/search/v2`}function ka(e,t="prod"){return`${Et(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function $A(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",l=GA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:l}),signal:a}}function GA(e,t){return t==="application/x-www-form-urlencoded"?om(e)?nm(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var Oa=e=>e;m();d();f();p();m();d();f();p();function Pa(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Gt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Pa(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Pa(),extendedResults:{},searchAction:void 0}}m();d();f();p();function wr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Ar=e=>{let{response:t}=e;return t.body?QA(e):HA(t)},QA=e=>WA(e)?KA(e):zA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},HA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function zA(e){return e.body.statusCode!==void 0}function WA(e){return e.body.exception!==void 0}var KA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var xr=class{constructor(){ie(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new u.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();f();p();m();d();f();p();var ci=class{constructor(t){ie(this,"_basePath");ie(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}};m();d();f();p();function sm(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var or=(e,t,r,n)=>{let o=new ci(`${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 cm=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jt.call({...or(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:wr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=sm(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return YA(a)?{success:a}:{error:Ar({response:r,body:a})}});return function cm(_x3,_x4){return _ref3.apply(this,arguments)}}();function YA(e){return typeof e=="string"}m();d();f();p();function XA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function ZA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Na(e,t){if(t&&e.name==="AbortError")return{error:ZA(e)};if(e instanceof Yr)return{error:XA(e)};throw e}var Fa=class{constructor(t){ie(this,"options",t);ie(this,"apiCallsQueues",{unknown:new xr,mainSearch:new xr,facetValues:new xr,foldingCollection:new xr,instantResults:new xr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json","/plan"),requestParams:wr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Na(r);let n=yield r.json();return ex(n)?{success:n}:{error:Ar({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:wr(t),..._this3.options});if(r instanceof Error)return Na(r);let n=yield r.json(),o={response:r,body:n};return JA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:Ar(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>jt.call({...or(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Na(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return um(i)?(a.body=lm(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:Ar(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json","/facet"),requestParams:wr(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(um(n)){let o={response:r,body:n};return o.body=lm(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:Ar({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return cm(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jt.call({...or(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return tx(n)?{success:n}:{error:Ar({response:r,body:n})}})()}},Da=e=>e.success!==void 0,gt=e=>e.error!==void 0;function um(e){return e.results!==void 0}function lm(e){let t=Pa();return ce(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function JA(e){return e.completions!==void 0}function ex(e){return e.preprocessingOutput!==void 0}function tx(e){return e.fields!==void 0}m();d();f();p();var dm=e=>e,pm=e=>e,fm=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function Ze(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 rx=typeof Symbol=="function"&&Symbol.observable||"@@observable",mm=rx,_l=()=>Math.random().toString(36).substring(7).split("").join("."),nx={INIT:`@@redux/INIT${_l()}`,REPLACE:`@@redux/REPLACE${_l()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${_l()}`},Ma=nx;function Qt(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 kl(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(kl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach((C,R)=>{a.set(R,C)}))}function g(){if(l)throw new Error(Ze(3));return o}function v(C){if(typeof C!="function")throw new Error(Ze(4));if(l)throw new Error(Ze(5));let R=!0;c();let T=s++;return a.set(T,C),function(){if(R){if(l)throw new Error(Ze(6));R=!1,c(),a.delete(T),i=null}}}function E(C){if(!Qt(C))throw new Error(Ze(7));if(typeof C.type>"u")throw new Error(Ze(8));if(typeof C.type!="string")throw new Error(Ze(17));if(l)throw new Error(Ze(9));try{l=!0,o=n(o,C)}finally{l=!1}return(i=a).forEach(T=>{T()}),C}function h(C){if(typeof C!="function")throw new Error(Ze(10));n=C,E({type:Ma.REPLACE})}function y(){let C=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ze(11));function T(){let k=R;k.next&&k.next(g())}return T(),{unsubscribe:C(T)}},[mm](){return this}}}return E({type:Ma.INIT}),{dispatch:E,subscribe:v,getState:g,replaceReducer:h,[mm]:y}}function ox(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ma.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Ma.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function zn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{ox(r)}catch(a){i=a}return function(s={},l){if(i)throw i;let c=!1,g={};for(let v=0;v<n.length;v++){let E=n[v],h=r[E],y=s[E],S=h(y,l);if(typeof S>"u"){let C=l&&l.type;throw new Error(Ze(14))}g[E]=S,c=c||S!==y}return c=c||n.length!==Object.keys(s).length,c?g:s}}function ui(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function gm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ze(15))},a={getState:o.getState,dispatch:(l,...c)=>i(l,...c)},s=e.map(l=>l(a));return i=ui(...s)(o.dispatch),{...o,dispatch:i}}}function li(e){return Qt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var Ll=Symbol.for("immer-nothing"),di=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function Je(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wt=Object,Zr=wt.getPrototypeOf,fi="constructor",vi="prototype",Nl="configurable",Va="enumerable",qa="writable",mi="value",lt=e=>!!e&&!!e[ze];function dt(e){return e?xm(e)||bi(e)||!!e[di]||!!e[fi]?.[di]||wi(e)||Ai(e):!1}var ix=wt[vi][fi].toString(),hm=new WeakMap;function xm(e){if(!e||!Wn(e))return!1;let t=Zr(e);if(t===null||t===wt[vi])return!0;let r=wt.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!Xr(r))return!1;let n=hm.get(r);return n===void 0&&(n=Function.toString.call(r),hm.set(r,n)),n===ix}function Cm(e){return lt(e)||Je(15,e),e[ze].base_}function Si(e,t,r=!0){Jr(e)===0?(r?Reflect.ownKeys(e):wt.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Jr(e){let t=e[ze];return t?t.type_:bi(e)?1:wi(e)?2:Ai(e)?3:0}var pi=(e,t,r=Jr(e))=>r===2?e.has(t):wt[vi].hasOwnProperty.call(e,t),ir=(e,t,r=Jr(e))=>r===2?e.get(t):e[t],Ua=(e,t,r,n=Jr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function ax(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var bi=Array.isArray,wi=e=>e instanceof Map,Ai=e=>e instanceof Set,Wn=e=>typeof e=="object",Xr=e=>typeof e=="function",Ol=e=>typeof e=="boolean";function sx(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var cx=e=>Wn(e)?e?.[ze]:null,ar=e=>e.copy_||e.base_;var Vl=e=>e.modified_?e.copy_:e.base_;function Fl(e,t){if(wi(e))return new Map(e);if(Ai(e))return new Set(e);if(bi(e))return Array[vi].slice.call(e);let r=xm(e);if(t===!0||t==="class_only"&&!r){let n=wt.getOwnPropertyDescriptors(e);delete n[ze];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[qa]===!1&&(s[qa]=!0,s[Nl]=!0),(s.get||s.set)&&(n[a]={[Nl]:!0,[qa]:!0,[Va]:s[Va],[mi]:e[a]})}return wt.create(Zr(e),n)}else{let n=Zr(e);if(n!==null&&r)return{...e};let o=wt.create(n);return wt.assign(o,e)}}function Ul(e,t=!1){return za(e)||lt(e)||!dt(e)||(Jr(e)>1&&wt.defineProperties(e,{set:ja,add:ja,clear:ja,delete:ja}),wt.freeze(e),t&&Si(e,(r,n)=>{Ul(n,!0)},!1)),e}function ux(){Je(2)}var ja={[mi]:ux};function za(e){return e===null||!Wn(e)?!0:wt.isFrozen(e)}var Ba="MapSet",$a="Patches",ym="ArrayMethods",Ga={};function en(e){let t=Ga[e];return t||Je(0,e),t}var vm=e=>!!Ga[e];function lx(e,t){Ga[e]||(Ga[e]=t)}var gi,Em=()=>gi,dx=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:vm(Ba)?en(Ba):void 0,arrayMethodsPlugin_:vm(ym)?en(ym):void 0});function Sm(e,t){t&&(e.patchPlugin_=en($a),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dl(e){Ml(e),e.drafts_.forEach(px),e.drafts_=null}function Ml(e){e===gi&&(gi=e.parent_)}var bm=e=>gi=dx(gi,e);function px(e){let t=e[ze];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function wm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ze].modified_&&(Dl(t),Je(4)),dt(e)&&(e=Am(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ze].base_,e,t)}else e=Am(t,r);return fx(t,e,!0),Dl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ll?e:void 0}function Am(e,t){if(za(t))return t;let r=t[ze];if(!r)return Qa(t,e.handledSet_,e);if(!Wa(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Tm(r,e)}return r.copy_}function fx(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ul(t,r)}function Rm(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wa=(e,t)=>e.scope_===t,mx=[];function Im(e,t,r,n){let o=ar(e),i=e.type_;if(n!==void 0&&ir(o,n,i)===t){Ua(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(l,c)=>{if(lt(c)){let g=s.get(c)||[];g.push(l),s.set(c,g)}})}let a=e.draftLocations_.get(t)??mx;for(let s of a)Ua(o,s,r,i)}function gx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Wa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Vl(i);Im(e,i.draft_??i,a,r),Tm(i,o)})}function Tm(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}Rm(e)}}function hx(e,t,r){let{scope_:n}=e;if(lt(r)){let o=r[ze];Wa(o,n)&&o.callbacks_.push(function(){La(e);let a=Vl(o);Im(e,r,a,t)})}else dt(r)&&e.callbacks_.push(function(){let i=ar(e);e.type_===3?i.has(r)&&Qa(r,n.handledSet_,n):ir(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Qa(ir(e.copy_,t,e.type_),n.handledSet_,n)})}function Qa(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||lt(e)||t.has(e)||!dt(e)||za(e)||(t.add(e),Si(e,(n,o)=>{if(lt(o)){let i=o[ze];if(Wa(i,r)){let a=Vl(i);Ua(e,n,a,e.type_),Rm(i)}}else dt(o)&&Qa(o,t,r)})),e}function yx(e,t){let r=bi(e),n={type_:r?1:0,scope_:t?t.scope_:Em(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=Ha;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var Ha={get(e,t){if(t===ze)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=ar(e);if(!pi(o,t,e.type_))return vx(e,o,t);let i=o[t];if(e.finalized_||!dt(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&sx(t))return i;if(i===Pl(e.base_,t)){La(e);let a=e.type_===1?+t:t,s=ql(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in ar(e)},ownKeys(e){return Reflect.ownKeys(ar(e))},set(e,t,r){let n=_m(ar(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Pl(ar(e),t),i=o?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(ax(r,o)&&(r!==void 0||pi(e.base_,t,e.type_)))return!0;La(e),jl(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_.set(t,!0),hx(e,t,r)),!0},deleteProperty(e,t){return La(e),Pl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),jl(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ar(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[qa]:!0,[Nl]:e.type_!==1||t!=="length",[Va]:n[Va],[mi]:r[t]}},defineProperty(){Je(11)},getPrototypeOf(e){return Zr(e.base_)},setPrototypeOf(){Je(12)}},hi={};for(let e in Ha){let t=Ha[e];hi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return Ha.set.call(this,e[0],t,r,e[0])};function Pl(e,t){let r=e[ze];return(r?ar(r):e)[t]}function vx(e,t,r){let n=_m(t,r);return n?mi in n?n[mi]:n.get?.call(e.draft_):void 0}function _m(e,t){if(!(t in e))return;let r=Zr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Zr(r)}}function jl(e){e.modified_||(e.modified_=!0,e.parent_&&jl(e.parent_))}function La(e){e.copy_||(e.assigned_=new Map,e.copy_=Fl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Sx=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Xr(t)&&!Xr(r)){let i=r;r=t;let a=this;return function(l=i,...c){return a.produce(l,g=>r.call(this,g,...c))}}Xr(r)||Je(6),n!==void 0&&!Xr(n)&&Je(7);let o;if(dt(t)){let i=bm(this),a=ql(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Dl(i):Ml(i)}return Sm(i,n),wm(o,i)}else if(!t||!Wn(t)){if(o=r(t),o===void 0&&(o=t),o===Ll&&(o=void 0),this.autoFreeze_&&Ul(o,!0),n){let i=[],a=[];en($a).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else Je(1,t)},this.produceWithPatches=(t,r)=>{if(Xr(t))return(a,...s)=>this.produceWithPatches(a,l=>t(l,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Ol(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Ol(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Ol(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){dt(e)||Je(8),lt(e)&&(e=Ka(e));let t=bm(this),r=ql(t,e,void 0);return r[ze].isManual_=!0,Ml(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&Je(9);let{scope_:n}=r;return Sm(n,t),wm(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=en($a).applyPatches_;return lt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function ql(e,t,r,n){let[o,i]=wi(t)?en(Ba).proxyMap_(t,r):Ai(t)?en(Ba).proxySet_(t,r):yx(t,r);return(r?.scope_??Em()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?gx(r,i,n):i.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:c}=l;i.modified_&&c&&c.generatePatches_(i,[],l)}),o}function Ka(e){return lt(e)||Je(10,e),km(e)}function km(e){if(!dt(e)||za(e))return e;let t=e[ze],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Fl(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Fl(e,!0);return Si(r,(o,i)=>{Ua(r,o,km(i))},n),t&&(t.finalized_=!1),r}function Om(){function t(y,S=[]){if(y.key_!==void 0){let C=y.parent_.copy_??y.parent_.base_,R=cx(ir(C,y.key_)),T=ir(C,y.key_);if(T===void 0||T!==y.draft_&&T!==y.base_&&T!==y.copy_||R!=null&&R.base_!==y.base_)return null;let I=y.parent_.type_===3,k;if(I){let _=y.parent_;k=Array.from(_.drafts_.keys()).indexOf(y.key_)}else k=y.key_;if(!(I&&C.size>k||pi(C,k)))return null;S.push(k)}if(y.parent_)return t(y.parent_,S);S.reverse();try{r(y.copy_,S)}catch{return null}return S}function r(y,S){let C=y;for(let R=0;R<S.length-1;R++){let T=S[R];if(C=ir(C,T),!Wn(C)||C===null)throw new Error(`Cannot resolve path at '${S.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(y,S,C){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:R,inversePatches_:T}=C;switch(y.type_){case 0:case 2:return l(y,S,R,T);case 1:return s(y,S,R,T);case 3:return c(y,S,R,T)}}function s(y,S,C,R){let{base_:T,assigned_:I}=y,k=y.copy_;k.length<T.length&&([T,k]=[k,T],[C,R]=[R,C]);let _=y.allIndicesReassigned_===!0;for(let D=0;D<T.length;D++){let B=k[D],L=T[D];if((_||I?.get(D.toString()))&&B!==L){let U=B?.[ze];if(U&&U.modified_)continue;let j=S.concat([D]);C.push({op:n,path:j,value:h(B)}),R.push({op:n,path:j,value:h(L)})}}for(let D=T.length;D<k.length;D++){let B=S.concat([D]);C.push({op:o,path:B,value:h(k[D])})}for(let D=k.length-1;T.length<=D;--D){let B=S.concat([D]);R.push({op:i,path:B})}}function l(y,S,C,R){let{base_:T,copy_:I,type_:k}=y;Si(y.assigned_,(_,D)=>{let B=ir(T,_,k),L=ir(I,_,k),q=D?pi(T,_)?n:o:i;if(B===L&&q===n)return;let U=S.concat(_);C.push(q===i?{op:q,path:U}:{op:q,path:U,value:h(L)}),R.push(q===o?{op:i,path:U}:q===i?{op:o,path:U,value:h(B)}:{op:n,path:U,value:h(B)})})}function c(y,S,C,R){let{base_:T,copy_:I}=y,k=0;T.forEach(_=>{if(!I.has(_)){let D=S.concat([k]);C.push({op:i,path:D,value:_}),R.unshift({op:o,path:D,value:_})}k++}),k=0,I.forEach(_=>{if(!T.has(_)){let D=S.concat([k]);C.push({op:o,path:D,value:_}),R.unshift({op:i,path:D,value:_})}k++})}function g(y,S,C){let{patches_:R,inversePatches_:T}=C;R.push({op:n,path:[],value:S===Ll?void 0:S}),T.push({op:n,path:[],value:y})}function v(y,S){return S.forEach(C=>{let{path:R,op:T}=C,I=y;for(let B=0;B<R.length-1;B++){let L=Jr(I),q=R[B];typeof q!="string"&&typeof q!="number"&&(q=""+q),(L===0||L===1)&&(q==="__proto__"||q===fi)&&Je(19),Xr(I)&&q===vi&&Je(19),I=ir(I,q),Wn(I)||Je(18,R.join("/"))}let k=Jr(I),_=E(C.value),D=R[R.length-1];switch(T){case n:switch(k){case 2:return I.set(D,_);case 3:Je(16);default:return I[D]=_}case o:switch(k){case 1:return D==="-"?I.push(_):I.splice(D,0,_);case 2:return I.set(D,_);case 3:return I.add(_);default:return I[D]=_}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:Je(17,T)}}),y}function E(y){if(!dt(y))return y;if(bi(y))return y.map(E);if(wi(y))return new Map(Array.from(y.entries()).map(([C,R])=>[C,E(R)]));if(Ai(y))return new Set(Array.from(y).map(E));let S=Object.create(Zr(y));for(let C in y)S[C]=E(y[C]);return pi(y,di)&&(S[di]=y[di]),S}function h(y){return lt(y)?E(y):y}lx($a,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:g,getPath:t})}var yi=new Sx,tn=yi.produce,Bl=yi.produceWithPatches.bind(yi);var $l=yi.applyPatches.bind(yi);m();d();f();p();function bx(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function wx(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 Pm=e=>Array.isArray(e)?e:[e];function Ax(e){let t=Array.isArray(e[0])?e[0]:e;return wx(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function xx(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Cx=class{constructor(e){this.value=e}deref(){return this.value}},Ex=()=>typeof WeakRef>"u"?Cx:WeakRef,Fm=Ex(),Rx=0,Nm=1;function Ya(){return{s:Rx,v:void 0,o:null,p:null}}function Ix(e){return e instanceof Fm?e.deref():e}function xi(e,t={}){let r=Ya(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:l}=arguments;for(let v=0,E=l;v<E;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}else{let y=s.p;y===null&&(s.p=y=new Map);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}}let c=s,g;if(s.s===Nm)g=s.v;else if(g=e.apply(null,arguments),i++,n){let v=Ix(o);v!=null&&n(v,g)&&(g=v,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Fm(g):g}return c.s=Nm,c.v=g,g}return a.clearCache=()=>{r=Ya(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Tx(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),bx(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let g={...r,...l},{memoize:v,memoizeOptions:E=[],argsMemoize:h=xi,argsMemoizeOptions:y=[]}=g,S=Pm(E),C=Pm(y),R=Ax(o),T=v(function(){return i++,c.apply(null,arguments)},...S),I=!0,k=h(function(){a++;let D=xx(R,arguments);return s=T.apply(null,D),s},...C);return Object.assign(k,{resultFunc:c,memoizedResultFunc:T,dependencies:R,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Be=Tx(xi);m();d();f();p();function Dm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Mm=Dm(),jm=Dm;var _x=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ui:ui.apply(null,arguments)},VM=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},kx=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(pt(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=>li(n)&&n.type===e,r}var Qm=class Ci extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ci.prototype)}static get[Symbol.species](){return Ci}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ci(...t[0].concat(this)):new Ci(...t.concat(this))}};function qm(e){return dt(e)?tn(e,()=>{}):e}function Xa(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Ox(e){return typeof e=="boolean"}var Px=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Qm;return r&&(Ox(r)?a.push(Mm):a.push(jm(r.extraArgument))),a},Ei="RTK_autoBatch",Xn=()=>e=>({payload:e,meta:{[Ei]:!0}}),Lm=e=>t=>{setTimeout(t,e)},Nx=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},Fx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Nx(window.requestAnimationFrame,100):Lm(10):e.type==="callback"?e.queueNotification:Lm(e.timeout),c=()=>{a=!1,i&&(i=!1,s.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),E=n.subscribe(v);return s.add(g),()=>{E(),s.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ei],i=!o,i&&(a||(a=!0,l(c))),n.dispatch(g)}finally{o=!0}}})},Dx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Qm(e);return n&&o.push(Fx(typeof n=="object"?n:void 0)),o};function Hm(e){let t=Px(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},l;if(typeof r=="function")l=r;else if(Qt(r))l=zn(r);else throw new Error(pt(1));let c;typeof n=="function"?c=n(t):c=t();let g=ui;o&&(g=_x({trace:!1,...(typeof o=="object"&&o)}));let v=gm(...c),E=Dx(v),h=typeof s=="function"?s(E):E(),y=g(...h);return kl(l,a,y)}function zm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(pt(28));if(s in t)throw new Error(pt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),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 Mx(e){return typeof e=="function"}function Le(e,t){let[r,n,o]=zm(t),i;if(Mx(e))i=()=>qm(e());else{let s=qm(e);i=()=>s}function a(s=i(),l){let c=[r[l.type],...n.filter(({matcher:g})=>g(l)).map(({reducer:g})=>g)];return c.filter(g=>!!g).length===0&&(c=[o]),c.reduce((g,v)=>{if(v)if(lt(g)){let h=v(g,l);return h===void 0?g:h}else{if(dt(g))return tn(g,E=>v(E,l));{let E=v(g,l);if(E===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}}return g},s)}return a.getInitialState=i,a}var Wm=(e,t)=>kx(e)?e.match(t):e(t);function Ht(...e){return t=>e.some(r=>Wm(r,t))}function Yn(...e){return t=>e.every(r=>Wm(r,t))}function ts(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 Ri(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function rs(...e){return e.length===0?t=>ts(t,["pending"]):Ri(e)?Ht(...e.map(t=>t.pending)):rs()(e[0])}function nn(...e){return e.length===0?t=>ts(t,["rejected"]):Ri(e)?Ht(...e.map(t=>t.rejected)):nn()(e[0])}function Ii(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Yn(nn(...e),t):Ri(e)?Yn(nn(...e),t):Ii()(e[0])}function sr(...e){return e.length===0?t=>ts(t,["fulfilled"]):Ri(e)?Ht(...e.map(t=>t.fulfilled)):sr()(e[0])}function ns(...e){return e.length===0?t=>ts(t,["pending","fulfilled","rejected"]):Ri(e)?Ht(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ns()(e[0])}var jx="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ti=(e=21)=>{let t="",r=e;for(;r--;)t+=jx[Math.random()*64|0];return t},qx=["name","message","stack","code"],Gl=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},Vm=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},Lx=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of qx)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Um="External signal was aborted",Re=(()=>{function e(t,r,n){let o=N(t+"/fulfilled",(l,c,g,v)=>({payload:l,meta:{...(v||{}),arg:g,requestId:c,requestStatus:"fulfilled"}})),i=N(t+"/pending",(l,c,g)=>({payload:void 0,meta:{...(g||{}),arg:c,requestId:l,requestStatus:"pending"}})),a=N(t+"/rejected",(l,c,g,v,E)=>({payload:v,error:(n&&n.serializeError||Lx)(l||"Rejected"),meta:{...(E||{}),arg:g,requestId:c,rejectedWithValue:!!v,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function s(l,{signal:c}={}){return(g,v,E)=>{let h=n?.idGenerator?n.idGenerator(l):Ti(),y=new u.AbortController,S,C;function R(I){C=I,y.abort()}c&&(c.aborted?R(Um):c.addEventListener("abort",()=>R(Um),{once:!0}));let T=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(l,{getState:v,extra:E});if(Ux(_)&&(_=yield _),_===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((B,L)=>{S=()=>{L({name:"AbortError",message:C||"Aborted"})},y.signal.addEventListener("abort",S,{once:!0})});g(i(h,l,n?.getPendingMeta?.({requestId:h,arg:l},{getState:v,extra:E}))),I=yield Promise.race([D,Promise.resolve(r(l,{dispatch:g,getState:v,extra:E,requestId:h,signal:y.signal,abort:R,rejectWithValue:(B,L)=>new Gl(B,L),fulfillWithValue:(B,L)=>new Vm(B,L)})).then(B=>{if(B instanceof Gl)throw B;return B instanceof Vm?o(B.payload,h,l,B.meta):o(B,h,l)})])}catch(_){I=_ instanceof Gl?a(null,h,l,_.payload,_.meta):a(_,h,l)}finally{S&&y.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||g(I),I})();return Object.assign(T,{abort:R,requestId:h,arg:l,unwrap(){return T.then(Vx)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Ht(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Vx(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Ux(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Km=Symbol.for("rtk-slice-createasyncthunk"),BM={[Km]:Re};function Bx(e,t){return`${e}/${t}`}function $x({creators:e}={}){let t=e?.asyncThunk?.[Km];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(pt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Qx()):n.reducers)||{},s=Object.keys(a),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(I,k){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(pt(12));if(_ in l.sliceCaseReducersByType)throw new Error(pt(13));return l.sliceCaseReducersByType[_]=k,c},addMatcher(I,k){return l.sliceMatchers.push({matcher:I,reducer:k}),c},exposeAction(I,k){return l.actionCreators[I]=k,c},exposeCaseReducer(I,k){return l.sliceCaseReducersByName[I]=k,c}};s.forEach(I=>{let k=a[I],_={reducerName:I,type:Bx(o,I),createNotation:typeof n.reducers=="function"};zx(k)?Kx(_,k,c,t):Hx(_,k,c)});function g(){let[I={},k=[],_=void 0]=typeof n.extraReducers=="function"?zm(n.extraReducers):[n.extraReducers],D={...I,...l.sliceCaseReducersByType};return Le(n.initialState,B=>{for(let L in D)B.addCase(L,D[L]);for(let L of l.sliceMatchers)B.addMatcher(L.matcher,L.reducer);for(let L of k)B.addMatcher(L.matcher,L.reducer);_&&B.addDefaultCase(_)})}let v=I=>I,E=new Map,h=new WeakMap,y;function S(I,k){return y||(y=g()),y(I,k)}function C(){return y||(y=g()),y.getInitialState()}function R(I,k=!1){function _(B){let L=B[I];return typeof L>"u"&&k&&(L=Xa(h,_,C)),L}function D(B=v){let L=Xa(E,k,()=>new WeakMap);return Xa(L,B,()=>{let q={};for(let[U,j]of Object.entries(n.selectors??{}))q[U]=Gx(j,B,()=>Xa(h,B,C),k);return q})}return{reducerPath:I,getSelectors:D,get selectors(){return D(_)},selectSlice:_}}let T={name:o,reducer:S,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(I,{reducerPath:k,..._}={}){let D=k??i;return I.inject({reducerPath:D,reducer:S},_),{...T,...R(D,!0)}}};return T}}function Gx(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var on=$x();function Qx(){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 Hx({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Wx(n))throw new Error(pt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?N(e,a):N(e))}function zx(e){return e._reducerDefinitionType==="asyncThunk"}function Wx(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Kx({type:e,reducerName:t},r,n,o){if(!o)throw new Error(pt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:l,settled:c,options:g}=r,v=o(e,i,g);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),l&&n.addCase(v.rejected,l),c&&n.addMatcher(v.settled,c),n.exposeCaseReducer(t,{fulfilled:a||Za,pending:s||Za,rejected:l||Za,settled:c||Za})}function Za(){}var Yx="task",Ym="listener",Xm="completed",zl="cancelled",Xx=`task-${zl}`,Zx=`task-${Xm}`,Ql=`${Ym}-${zl}`,Jx=`${Ym}-${Xm}`,os=class{constructor(e){ie(this,"code");ie(this,"name","TaskAbortError");ie(this,"message");this.code=e,this.message=`${Yx} ${zl} (reason: ${e})`}},Wl=(e,t)=>{if(typeof e!="function")throw new TypeError(pt(32))},Ja=()=>{},Zm=(e,t=Ja)=>(e.catch(t),e),Jm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),rn=e=>{if(e.aborted)throw new os(e.reason)};function eg(e,t){let r=Ja;return new Promise((n,o)=>{let i=()=>o(new os(e.reason));if(e.aborted){i();return}r=Jm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ja})}var eC=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof os?"cancelled":"rejected",error:r}}finally{t?.()}});return function eC(_x5,_x6){return _ref5.apply(this,arguments)}}(),es=e=>t=>Zm(eg(e,t).then(r=>(rn(e),r))),tg=e=>{let t=es(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Kn}=Object,Bm={},is="listenerMiddleware",tC=(e,t)=>{let r=n=>Jm(e,()=>n.abort(e.reason));return(n,o)=>{Wl(n,"taskExecutor");let i=new u.AbortController;r(i);let a=eC(/*#__PURE__*/_asyncToGenerator(function*(){rn(e),rn(i.signal);let s=yield n({pause:es(i.signal),delay:tg(i.signal),signal:i.signal});return rn(i.signal),s}),()=>i.abort(Zx));return o?.autoJoin&&t.push(a.catch(Ja)),{result:es(e)(a),cancel(){i.abort(Xx)}}}},rC=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){rn(t);let i=()=>{},s=[new Promise((l,c)=>{let g=e({predicate:n,effect:(v,E)=>{E.unsubscribe(),l([v,E.getState(),E.getOriginalState()])}});i=()=>{g(),c()}})];o!=null&&s.push(new Promise(l=>setTimeout(l,o,null)));try{let l=yield eg(t,Promise.race(s));return rn(t),l}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>Zm(r(n,o))},rg=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=N(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(pt(21));return Wl(i,"options.listener"),{predicate:o,type:t,effect:i}},ng=Kn(e=>{let{type:t,predicate:r,effect:n}=rg(e);return{id:Ti(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(pt(22))}}},{withTypes:()=>ng}),$m=(e,t)=>{let{type:r,effect:n,predicate:o}=rg(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Hl=e=>{e.pending.forEach(t=>{t.abort(Ql)})},nC=(e,t)=>()=>{for(let r of t.keys())Hl(r);e.clear()},Gm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},og=Kn(N(`${is}/add`),{withTypes:()=>og}),oC=N(`${is}/removeAll`),ig=Kn(N(`${is}/remove`),{withTypes:()=>ig}),iC=(...e)=>{console.error(`${is}/error`,...e)},ag=(e={})=>{let t=new Map,r=new Map,n=h=>{let y=r.get(h)??0;r.set(h,y+1)},o=h=>{let y=r.get(h)??1;y===1?r.delete(h):r.set(h,y-1)},{extra:i,onError:a=iC}=e;Wl(a,"onError");let s=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&Hl(h)}),l=h=>{let y=$m(t,h)??ng(h);return s(y)};Kn(l,{withTypes:()=>l});let c=h=>{let y=$m(t,h);return y&&(y.unsubscribe(),h.cancelActive&&Hl(y)),!!y};Kn(c,{withTypes:()=>c});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,y,S,C){let R=new u.AbortController,T=rC(l,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(y,Kn({},S,{getOriginalState:C,condition:(k,_)=>T(k,_).then(Boolean),take:T,delay:tg(R.signal),pause:es(R.signal),extra:i,signal:R.signal,fork:tC(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,_,D)=>{k!==R&&(k.abort(Ql),D.delete(k))})},cancel:()=>{R.abort(Ql),h.pending.delete(R)},throwIfCancelled:()=>{rn(R.signal)}})))}catch(k){k instanceof os||Gm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(Jx),o(h),h.pending.delete(R)}});return function g(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),v=nC(t,r);return{middleware:h=>y=>S=>{if(!li(S))return y(S);if(og.match(S))return l(S.payload);if(oC.match(S)){v();return}if(ig.match(S))return c(S.payload);let C=h.getState(),R=()=>{if(C===Bm)throw new Error(pt(23));return C},T;try{if(T=y(S),t.size>0){let I=h.getState(),k=Array.from(t.values());for(let _ of k){let D=!1;try{D=_.predicate(S,I,C)}catch(B){D=!1,Gm(a,B,{raisedBy:"predicate"})}D&&g(_,S,h,R)}}}finally{C=Bm}return T},startListening:l,stopListening:c,clearListeners:v}};function pt(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. `}m();d();f();p();var Z=new z({required:!0,emptyAllowed:!1}),et=new z({required:!1,emptyAllowed:!1}),tt=new z({required:!0,emptyAllowed:!0}),ej=new z({required:!1,emptyAllowed:!0}),as=new ve({each:Z,required:!0}),sg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),cg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),tj=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),cr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Rt=(e,t)=>{if("required"in t)return{payload:new mt({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new oi(o);return{payload:e}},$=(e,t)=>{try{return Rt(e,t)}catch(r){return{payload:e,error:cr(r)}}},ug=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return dg(e,t,r,o,"Controller initialization error")},lg=(e,t,r,n)=>{let o=`Check the options of ${n}`;return dg(e,t,r,o,"Controller initialization error")},dg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var Zn="3.51.3",pg=["@coveo/atomic","@coveo/quantic"];var Kl=()=>et,fg=()=>Z,Cr=N("configuration/updateBasicConfiguration",e=>$(e,{accessToken:et,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:et})),zt=N("configuration/updateSearchConfiguration",e=>$(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:et,timezone:et,locale:et,authenticationProviders:new ve({required:!1,each:Z})})),aC={enabled:new me({default:!0}),originContext:Kl(),originLevel2:Kl(),originLevel3:Kl(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new Fe,anonymous:new me({default:!1}),deviceId:et,userDisplayName:et,documentLocation:et,trackingId:cg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:pg.reduce((e,t)=>(e[t]=sg,e),{})})},Jn=N("configuration/updateAnalyticsConfiguration",e=>$(e,aC)),eo=N("configuration/analytics/disable"),to=N("configuration/analytics/enable"),ss=N("configuration/analytics/originlevel2",e=>$(e,{originLevel2:fg()})),cs=N("configuration/analytics/originlevel3",e=>$(e,{originLevel3:fg()})),mg=N("knowledge/setAgentId",e=>$(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var gg={q:new z,enableQuerySyntax:new me,aq:new z,cq:new z,firstResult:new oe({min:0}),numberOfResults:new oe({min:0}),sortCriteria:new z,f:new ne,fExcluded:new ne,cf:new ne,nf:new ne,mnf:new ne,df:new ne,debug:new me,sf:new ne,tab:new z,af:new ne};var Er=N("searchParameters/restore",e=>$(e,gg)),hg=N("searchParameters/restoreTab",e=>$(e,Z));m();d();f();p();var us=N("debug/enable"),ls=N("debug/disable");m();d();f();p();var ds=()=>!1;var ps=Le(ds(),e=>{e.addCase(us,()=>!0).addCase(ls,()=>!1).addCase(Er,(t,r)=>r.payload.debug??t)});m();d();f();p();var ro=N("pipeline/set",e=>$(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var sC=N("history/undo"),cC=N("history/redo"),Wt=N("history/snapshot"),lq=Re("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(sC()),yield t(ht())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),dq=Re("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(cC()),yield t(ht())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),ht=Re("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var no=()=>"";var oo=Le(no(),e=>{e.addCase(ro,(t,r)=>r.payload).addCase(ht.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(zt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var fs=N("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var io=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,l=/^(\d{1,3}\.){3}\d{1,3}$/,c=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;l.test(s)||c.test(s)||s.indexOf(".")===-1?Yl(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Yl(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 Yl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}m();d();f();p();function uC(){return typeof navigator<"u"}function yg(){try{return typeof localStorage<"u"}catch{return!1}}function vg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Sg(){return!!(uC()&&navigator.cookieEnabled)}var bg=null;function wg(){return bg||(yg()?localStorage:Sg()?new Xl:vg()?sessionStorage:new Zl)}var ao=class ao{getItem(t){return io.get(`${ao.prefix}${t}`)}removeItem(t){io.erase(`${ao.prefix}${t}`)}setItem(t,r,n){io.set(`${ao.prefix}${t}`,r,n)}};ie(ao,"prefix","coveo_");var Xl=ao;var Zl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ms="__coveo.analytics.history",lC=20,dC=1e3*60,pC=75,an=class an{constructor(t){ie(this,"store");this.store=t||wg()}static getInstance(t){return an.instance||(an.instance=new an(t)),an.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(ms);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ms);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ms,JSON.stringify(t.slice(0,lC)))}catch{}}clear(){try{this.store.removeItem(ms)}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,pC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>dC:!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))}};ie(an,"instance",null);var Jl=an,It=Jl;m();d();f();p();m();d();f();p();var so=Be(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Zn}`));m();d();f();p();m();d();f();p();function ur(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 V(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 s(g){try{c(n.next(g))}catch(v){a(v)}}function l(g){try{c(n.throw(g))}catch(v){a(v)}}function c(g){g.done?i(g.value):o(g.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}var Ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ae||(Ae={}));function rd(){return typeof window<"u"}function gd(){return typeof navigator<"u"}function co(){return typeof document<"u"}function nd(){try{return typeof localStorage<"u"}catch{return!1}}function fC(){try{return typeof sessionStorage<"u"}catch{return!1}}function Dg(){return gd()&&navigator.cookieEnabled}var mC=[Ae.click,Ae.custom,Ae.search,Ae.view],gC=(e,t)=>mC.indexOf(e)!==-1?Object.assign({language:co()?document.documentElement.lang:"unknown",userAgent:gd()?navigator.userAgent:"unknown"},t):t,ki=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Ag(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Ag(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 Ag(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function hC(){return nd()?localStorage:Dg()?new Oi:fC()?sessionStorage:new lo}var Oi=class e{getItem(t){return ki.get(`${e.prefix}${t}`)}removeItem(t){ki.erase(`${e.prefix}${t}`)}setItem(t,r,n){ki.set(`${e.prefix}${t}`,r,n)}};Oi.prefix="coveo_";var od=class{constructor(){this.cookieStorage=new Oi}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)}},lo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},gs="__coveo.analytics.history",yC=20,vC=1e3*60,SC=75,vs=class{constructor(t){this.store=t||hC()}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 V(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 V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(gs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(gs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(gs,JSON.stringify(t.slice(0,yC)))}catch{}}clear(){try{this.store.removeItem(gs)}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,SC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>vC:!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 bC=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Ae.view?(yield wC(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),wC=e=>V(void 0,void 0,void 0,function*(){let t=new vs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),hs,AC=new Uint8Array(16);function xC(){if(!hs&&(hs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hs(AC)}var CC=/^(?:[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 Ss(e){return typeof e=="string"&&CC.test(e)}var rt=[];for(let e=0;e<256;++e)rt.push((e+256).toString(16).slice(1));function Mg(e,t=0){return rt[e[t+0]]+rt[e[t+1]]+rt[e[t+2]]+rt[e[t+3]]+"-"+rt[e[t+4]]+rt[e[t+5]]+"-"+rt[e[t+6]]+rt[e[t+7]]+"-"+rt[e[t+8]]+rt[e[t+9]]+"-"+rt[e[t+10]]+rt[e[t+11]]+rt[e[t+12]]+rt[e[t+13]]+rt[e[t+14]]+rt[e[t+15]]}function EC(e){if(!Ss(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 RC(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var IC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",TC="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function _C(e,t,r){function n(o,i,a,s){var l;if(typeof o=="string"&&(o=RC(o)),typeof i=="string"&&(i=EC(i)),((l=i)===null||l===void 0?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+o.length);if(c.set(i),c.set(o,i.length),c=r(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,a){s=s||0;for(let g=0;g<16;++g)a[s+g]=c[g];return a}return Mg(c)}try{n.name=e}catch{}return n.DNS=IC,n.URL=TC,n}var kC=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xg={randomUUID:kC};function sn(e,t,r){if(xg.randomUUID&&!t&&!e)return xg.randomUUID();e=e||{};let n=e.random||(e.rng||xC)();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 Mg(n)}function OC(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 ed(e,t){return e<<t|e>>>32-t}function PC(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 s=0;s<a.length;++s)e.push(a.charCodeAt(s))}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 s=new Uint32Array(16);for(let l=0;l<16;++l)s[l]=e[a*64+l*4]<<24|e[a*64+l*4+1]<<16|e[a*64+l*4+2]<<8|e[a*64+l*4+3];i[a]=s}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 s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=i[a][h];for(let h=16;h<80;++h)s[h]=ed(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let l=r[0],c=r[1],g=r[2],v=r[3],E=r[4];for(let h=0;h<80;++h){let y=Math.floor(h/20),S=ed(l,5)+OC(y,c,g,v)+E+t[y]+s[h]>>>0;E=v,v=g,g=ed(c,30)>>>0,c=l,l=S}r[0]=r[0]+l>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+E>>>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 NC=_C("v5",80,PC),Cg=NC,jg="2.30.55",Eg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,_i={pageview:"pageview",event:"event"},bs=class{constructor({client:t,uuidGenerator:r=sn}){this.client=t,this.uuidGenerator=r}},id=class extends bs{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Eg(window.location),this.lastReferrer=co()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:co()?document.title:"",encoding:co()?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===_i.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===_i.pageview?this.nextPageViewId:this.pageViewId,referrer:t===_i.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===_i.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 Eg(window.location)}},Rr=class e{constructor(t,r){if(!Ss(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 Ss(i)?new e(i,Number.parseInt(o)*1e3):null}};Rr.cvo_cid="cvo_cid";Rr.expirationTime=120;var ad=class extends bs{constructor({client:t,uuidGenerator:r=sn}){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 V(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(Rr.cvo_cid,new Rr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ad.Id="link";var _t=Object.keys;function ys(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var td=128,qg=192,Rg=224,Ig=240;function FC(e){return(e&248)===Ig?4:(e&Ig)===Rg?3:(e&Rg)===qg?2:1}function DC(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&td)!=td)break;if(r-=3,(n&qg)!=td){t-r>=FC(n)*3&&(r=t);break}}return e.substring(0,r)}var sd={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"},MC=_t(sd).map(e=>sd[e]),jC=[...MC].join("|"),qC=new RegExp(`^(${jC}$)`),LC={svcAction:"svc_action",svcActionData:"svc_action_data"},VC=e=>_t(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=sd[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),UC=e=>qC.test(e),BC=[UC],Tg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},_g={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},st={action:"pa",list:"pal",listSource:"pls"},ws={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},$C=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],cd={id:"quoteId",affiliation:"quoteAffiliation"},ud={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},GC={add:st,bookmark_add:st,bookmark_remove:st,click:st,checkout:st,checkout_option:st,detail:st,impression:st,remove:st,refund:Object.assign(Object.assign({},st),ws),purchase:Object.assign(Object.assign({},st),ws),quickview:st,quote:Object.assign(Object.assign({},st),cd),review:Object.assign(Object.assign({},st),ud)},QC=_t(Tg).map(e=>Tg[e]),HC=_t(_g).map(e=>_g[e]),zC=_t(st).map(e=>st[e]),WC=_t(ws).map(e=>ws[e]),KC=_t(ud).map(e=>ud[e]),YC=_t(cd).map(e=>cd[e]),XC=[...QC,"custom"].join("|"),ZC=[...HC,"custom"].join("|"),Lg="(pr[0-9]+)",Vg="(il[0-9]+pi[0-9]+)",JC=new RegExp(`^${Lg}(${XC})$`),eE=new RegExp(`^(${Vg}(${ZC}))|(il[0-9]+nm)$`),tE=new RegExp(`^(${zC.join("|")})$`),rE=new RegExp(`^(${WC.join("|")})$`),nE=new RegExp(`^${Lg}custom$`),oE=new RegExp(`^${Vg}custom$`),iE=new RegExp(`^(${[...$C,...KC,...YC].join("|")})$`),aE=e=>JC.test(e),sE=e=>eE.test(e),cE=e=>tE.test(e),uE=e=>rE.test(e),lE=e=>iE.test(e),dE=[sE,aE,cE,uE,lE],pE=[nE,oE],fE={anonymizeIp:"aip"},mE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},gE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},hE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],yE=Object.assign(Object.assign(Object.assign(Object.assign({},fE),mE),gE),hE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ld=Object.assign(Object.assign({},yE),LC),vE=e=>{let t=!!e.action&&GC[e.action]||{};return _t(e).reduce((r,n)=>{let o=t[n]||ld[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},SE=_t(ld).map(e=>ld[e]),bE=e=>SE.indexOf(e)!==-1,wE=e=>e==="custom",AE=e=>[...dE,...BC,bE,wE].some(t=>t(e)),xE=e=>_t(e).reduce((t,r)=>{let n=CE(r);return n?Object.assign(Object.assign({},t),EE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),CE=e=>{let t;return[...pE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},EE=(e,t)=>_t(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),dd=class{constructor(t){this.opts=t}sendEvent(t,r){return V(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:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),l=this.encodeForEventType(t,s),c=new Blob([l],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,c)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(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:s,body:l}=a;o=s||t;try{i=JSON.parse(l)}catch(c){console.error("Unable to process the request body as a JSON string",c)}}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 V(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[Ae.click,Ae.custom,Ae.search,Ae.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}},pd=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},kg=b.fetch,As=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},l=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:c}=l,g=ur(l,["url"]),v;try{v=yield kg(c,g)}catch(E){console.error("An error has occured when sending the event.",E);return}if(v.ok){let E=yield v.json();return E.visitorId&&o.setCurrentVisitorId(E.visitorId),E}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield kg(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}getVisitorIdParam(){return V(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"})}},fd=class{constructor(t,r){nd()&&Dg()?this.storage=new od:nd()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new lo),this.client=new As(t),this.beaconClient=new dd(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}},md=class{constructor(t,r){this.storage=r||new lo,this.client=new As(t)}getClientDependingOnEventType(t){return this.client}},xs=class{constructor(){this.storage=new lo,this.client=new pd}getClientDependingOnEventType(t){return this.client}},RE="xx",IE=e=>e?.startsWith(RE)||!1,TE=`
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
@@ -72,4 +72,4 @@ fast-json-patch/module/duplex.mjs:
72
72
  *)
73
73
  */if(__exports!=exports)module.exports=exports;return module.exports});
74
74
 
75
- window.coveoQuanticVersion = '3.38.0';
75
+ window.coveoQuanticVersion = '3.38.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/quantic",
3
- "version": "3.38.0",
3
+ "version": "3.38.2",
4
4
  "description": "A Salesforce Lightning Web Component (LWC) library for building modern UIs interfacing with the Coveo platform",
5
5
  "author": "coveo.com",
6
6
  "homepage": "https://coveo.com",
@@ -15,7 +15,7 @@
15
15
  "dompurify": "3.4.5",
16
16
  "marked": "12.0.2",
17
17
  "@coveo/bueno": "1.1.9",
18
- "@coveo/headless": "3.51.1"
18
+ "@coveo/headless": "3.51.3"
19
19
  },
20
20
  "engines": {
21
21
  "node": "^20.9.0 || ^22.11.0 || ^24.11.0"