@coveo/headless 3.57.0 → 3.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/case-assist/headless.cjs +1 -1
- package/dist/cjs/commerce/headless.cjs +5 -1
- package/dist/cjs/commerce/node.cjs.stats.json +1 -1
- package/dist/cjs/headless.cjs +1 -1
- package/dist/cjs/insight/headless.cjs +1 -1
- package/dist/cjs/recommendation/headless.cjs +1 -1
- package/dist/cjs/ssr/headless.cjs +1 -1
- package/dist/cjs/ssr-commerce/headless.cjs +5 -1
- package/dist/cjs/ssr-commerce/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-commerce-next/headless.cjs +5 -1
- package/dist/cjs/ssr-commerce-next/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-next/headless.cjs +1 -1
- package/dist/definitions/ssr/commerce/types/engine.d.ts +4 -1
- package/dist/definitions/ssr/common/types/engine.d.ts +4 -1
- package/dist/esm/features/commerce/facets/numeric-facet/manual-numeric-facet-slice.js +6 -1
- package/dist/esm/utils/version.js +1 -1
- package/dist/quantic/case-assist/headless.js +1 -1
- package/dist/quantic/commerce/browser.cjs.stats.json +1 -1
- package/dist/quantic/commerce/headless.js +15 -15
- package/dist/quantic/commerce/headless.js.map +3 -3
- package/dist/quantic/headless.js +1 -1
- package/dist/quantic/insight/headless.js +1 -1
- package/dist/quantic/recommendation/headless.js +1 -1
- package/package.json +3 -3
|
@@ -25,7 +25,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
25
25
|
`)}
|
|
26
26
|
|
|
27
27
|
${t}
|
|
28
|
-
`;return new fi(r)}var fi=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},yt=class{constructor(e){ue(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 Hw(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}},qe=class{constructor(e={}){ue(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 Je(e){return e===void 0}function zw(e){return e===null}function ce(e){return Je(e)||zw(e)}var me=class{constructor(e={}){ue(this,"value");this.value=new qe(e)}validate(e){let t=this.value.validate(e);return t||(Ww(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Ww(e){return Je(e)||sm(e)}function sm(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ue(this,"config");ue(this,"value");this.config=e,this.value=new qe(e)}validate(e){let t=this.value.validate(e);return t||(Kw(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 Kw(e){return Je(e)||cm(e)}function cm(e){return typeof e=="number"&&!Number.isNaN(e)}var Yw=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ue(this,"value");ue(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new qe(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(Je(e))return null;if(!Fa(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&&!(Yw.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 Fa(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ue(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Je(e))return this.config.options.required?"value is required and is currently undefined":null;if(!um(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 um(e){return e!==void 0&&typeof e=="object"}var Ae=class{constructor(e={}){ue(this,"config");ue(this,"value");this.config=e,this.value=new qe(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 sm(e)||Fa(e)||cm(e)||um(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function lm(e){return Array.isArray(e)}var Ll=class{constructor(e){ue(this,"config");ue(this,"value");this.config=e,this.value=new qe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Je(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 dm(e){return Array.isArray(e)}function Da(e){return e.trim()===""}var Xw=new Set(["1",1,"yes",!0]);function ql(){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=>Xw.has(r))}function pm(e){let t={};for(let[r,n]of e)t[r]=n;return t}function mi(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ma(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 Zw(e){if(Da(e.openingDelimiter)||Da(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ce(e.content)||Da(e.content))return e.content;if(e.highlights.length===0)return Yn(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+=Yn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Yn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Yn(e.content.slice(n))),r}function Jw(e,t){return e=Yn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?jl(n,t.notMatchDelimiters):o?jl(o,t.exactMatchDelimiters):i?jl(i,t.correctionDelimiters):r)}function jl(e,t){return t?t.open+e+t.close:e}function Yn(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var Cm=jt(bm(),1);m();d();f();p();var Ht=new Error("Failed to load reducers."),Xn=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."}},rn=class extends Error{constructor(r,n){super();ue(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 Am(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function wm(e){return typeof e!="object"||!e?!1:Object.values(e).every(Ex)}function Ex(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function xm(e){return e===429}var Ut=class e{static async call(t){let r=Rx(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=async()=>{let u=await C(i,a);if(xm(u.status))throw u;return u};try{let u=await(0,Cm.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:async c=>{let g=c&&xm(c.status);return g&&(n.info("Platform retrying request"),await new Promise(v=>setTimeout(v,1e3))),g}});switch(u.status){case 419:case 401:throw n.info("Platform renewing token"),new Xn;case 404:throw new rn(i,u.status);default:return n.info({response:u,requestInfo:o},"Platform response"),u}}catch(u){return u.message==="Failed to fetch"?new rn(i):u}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...u}=t,c=mi(u);try{let g=await o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return c}};function _t(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Zn(e,t,r="prod"){return e??_t(t,r)}function xr(e,t="prod"){return`${_t(e,t)}/rest/search/v2`}function qa(e,t="prod"){return`${_t(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Rx(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",u=Ix(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...s&&{body:u},signal:a}}function Ix(e,t){return t==="application/x-www-form-urlencoded"?wm(e)?Am(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var ja=e=>e;m();d();f();p();m();d();f();p();function Ua(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function zt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ua(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ua(),extendedResults:{},searchAction:void 0}}m();d();f();p();function Cr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Er=e=>{let{response:t}=e;return t.body?Tx(e):_x(t)},Tx=e=>Ox(e)?Px(e):kx(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},_x=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function kx(e){return e.body.statusCode!==void 0}function Ox(e){return e.body.exception!==void 0}var Px=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var Rr=class{constructor(){ue(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController;this.currentAbortController=new l.AbortController;let o=this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};m();d();f();p();m();d();f();p();var yi=class{constructor(t){ue(this,"_basePath");ue(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 Em(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var sr=(e,t,r,n)=>{let o=new yi(`${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 Rm=async(e,t)=>{let r=await Ut.call({...sr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Cr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Em(r),o=await r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Nx(a)?{success:a}:{error:Er({response:r,body:a})}};function Nx(e){return typeof e=="string"}m();d();f();p();function Fx(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Dx(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Va(e,t){if(t&&e.name==="AbortError")return{error:Dx(e)};if(e instanceof rn)return{error:Fx(e)};throw e}var Ga=class{constructor(t){ue(this,"options",t);ue(this,"apiCallsQueues",{unknown:new Rr,mainSearch:new Rr,facetValues:new Rr,foldingCollection:new Rr,instantResults:new Rr})}async plan(t){let r=await Ut.call({...sr(t,"POST","application/json","/plan"),requestParams:Cr(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Va(r);let n=await r.json();return Lx(n)?{success:n}:{error:Er({response:r,body:n})}}async querySuggest(t){let r=await Ut.call({...sr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:Cr(t),...this.options});if(r instanceof Error)return Va(r);let n=await r.json(),o={response:r,body:n};return Mx(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:Er(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(s=>Ut.call({...sr(t,"POST","application/json",""),requestParams:Cr(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:s??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Va(o,r?.disableAbortWarning);let i=await o.json(),a={response:o,body:i};return Im(i)?(a.body=Tm(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:Er(a)}}async facetSearch(t){let r=await Ut.call({...sr(t,"POST","application/json","/facet"),requestParams:Cr(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await Ut.call({...sr(t,"POST","application/json",""),requestParams:Cr(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(Im(n)){let o={response:r,body:n};return o.body=Tm(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:Er({response:r,body:n})}}async html(t){return Rm(t,{...this.options})}async fieldDescriptions(t){let r=await Ut.call({...sr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return qx(n)?{success:n}:{error:Er({response:r,body:n})}}},Ba=e=>e.success!==void 0,vt=e=>e.error!==void 0;function Im(e){return e.results!==void 0}function Tm(e){let t=Ua();return ce(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Mx(e){return e.completions!==void 0}function Lx(e){return e.preprocessingOutput!==void 0}function qx(e){return e.fields!==void 0}m();d();f();p();var _m=e=>e,km=e=>e,Om=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function et(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 jx=typeof Symbol=="function"&&Symbol.observable||"@@observable",Pm=jx,Kl=()=>Math.random().toString(36).substring(7).split("").join("."),Ux={INIT:`@@redux/INIT${Kl()}`,REPLACE:`@@redux/REPLACE${Kl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Kl()}`},$a=Ux;function Wt(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 Yl(e,t,r){if(typeof e!="function")throw new Error(et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(et(1));return r(Yl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,u=!1;function c(){a===i&&(a=new Map,i.forEach((x,I)=>{a.set(I,x)}))}function g(){if(u)throw new Error(et(3));return o}function v(x){if(typeof x!="function")throw new Error(et(4));if(u)throw new Error(et(5));let I=!0;c();let _=s++;return a.set(_,x),function(){if(I){if(u)throw new Error(et(6));I=!1,c(),a.delete(_),i=null}}}function R(x){if(!Wt(x))throw new Error(et(7));if(typeof x.type>"u")throw new Error(et(8));if(typeof x.type!="string")throw new Error(et(17));if(u)throw new Error(et(9));try{u=!0,o=n(o,x)}finally{u=!1}return(i=a).forEach(_=>{_()}),x}function h(x){if(typeof x!="function")throw new Error(et(10));n=x,R({type:$a.REPLACE})}function y(){let x=v;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(et(11));function _(){let P=I;P.next&&P.next(g())}return _(),{unsubscribe:x(_)}},[Pm](){return this}}}return R({type:$a.INIT}),{dispatch:R,subscribe:v,getState:g,replaceReducer:h,[Pm]:y}}function Vx(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:$a.INIT})>"u")throw new Error(et(12));if(typeof r(void 0,{type:$a.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(et(13))})}function Jn(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{Vx(r)}catch(a){i=a}return function(s={},u){if(i)throw i;let c=!1,g={};for(let v=0;v<n.length;v++){let R=n[v],h=r[R],y=s[R],b=h(y,u);if(typeof b>"u"){let x=u&&u.type;throw new Error(et(14))}g[R]=b,c=c||b!==y}return c=c||n.length!==Object.keys(s).length,c?g:s}}function vi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Nm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(et(15))},a={getState:o.getState,dispatch:(u,...c)=>i(u,...c)},s=e.map(u=>u(a));return i=vi(...s)(o.dispatch),{...o,dispatch:i}}}function Si(e){return Wt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var id=Symbol.for("immer-nothing"),bi=Symbol.for("immer-draftable"),Ke=Symbol.for("immer-state");function tt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ct=Object,on=Ct.getPrototypeOf,Ai="constructor",Ri="prototype",Jl="configurable",Wa="enumerable",Ha="writable",wi="value",mt=e=>!!e&&!!e[Ke];function lt(e){return e?Vm(e)||Ti(e)||!!e[bi]||!!e[Ai]?.[bi]||_i(e)||ki(e):!1}var Gx=Ct[Ri][Ai].toString(),Fm=new WeakMap;function Vm(e){if(!e||!to(e))return!1;let t=on(e);if(t===null||t===Ct[Ri])return!0;let r=Ct.hasOwnProperty.call(t,Ai)&&t[Ai];if(r===Object)return!0;if(!nn(r))return!1;let n=Fm.get(r);return n===void 0&&(n=Function.toString.call(r),Fm.set(r,n)),n===Gx}function Gm(e){return mt(e)||tt(15,e),e[Ke].base_}function Ii(e,t,r=!0){an(e)===0?(r?Reflect.ownKeys(e):Ct.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function an(e){let t=e[Ke];return t?t.type_:Ti(e)?1:_i(e)?2:ki(e)?3:0}var eo=(e,t,r=an(e))=>r===2?e.has(t):Ct[Ri].hasOwnProperty.call(e,t),cr=(e,t,r=an(e))=>r===2?e.get(t):e[t],Ka=(e,t,r,n=an(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Bx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ti=Array.isArray,_i=e=>e instanceof Map,ki=e=>e instanceof Set,to=e=>typeof e=="object",nn=e=>typeof e=="function",Xl=e=>typeof e=="boolean";function $x(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Qx=e=>to(e)?e?.[Ke]:null,ur=e=>e.copy_||e.base_;var ad=e=>e.modified_?e.copy_:e.base_;function ed(e,t){if(_i(e))return new Map(e);if(ki(e))return new Set(e);if(Ti(e))return Array[Ri].slice.call(e);let r=Vm(e);if(t===!0||t==="class_only"&&!r){let n=Ct.getOwnPropertyDescriptors(e);delete n[Ke];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[Ha]===!1&&(s[Ha]=!0,s[Jl]=!0),(s.get||s.set)&&(n[a]={[Jl]:!0,[Ha]:!0,[Wa]:s[Wa],[wi]:e[a]})}return Ct.create(on(e),n)}else{let n=on(e);if(n!==null&&r)return{...e};let o=Ct.create(n);return Ct.assign(o,e)}}function sd(e,t=!1){return ts(e)||mt(e)||!lt(e)||(an(e)>1&&Ct.defineProperties(e,{set:Qa,add:Qa,clear:Qa,delete:Qa}),Ct.freeze(e),t&&Ii(e,(r,n)=>{sd(n,!0)},!1)),e}function Hx(){tt(2)}var Qa={[wi]:Hx};function ts(e){return e===null||!to(e)?!0:Ct.isFrozen(e)}var Ya="MapSet",Xa="Patches",Dm="ArrayMethods",Za={};function sn(e){let t=Za[e];return t||tt(0,e),t}var Mm=e=>!!Za[e];function zx(e,t){Za[e]||(Za[e]=t)}var xi,Bm=()=>xi,Wx=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Mm(Ya)?sn(Ya):void 0,arrayMethodsPlugin_:Mm(Dm)?sn(Dm):void 0});function Lm(e,t){t&&(e.patchPlugin_=sn(Xa),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function td(e){rd(e),e.drafts_.forEach(Kx),e.drafts_=null}function rd(e){e===xi&&(xi=e.parent_)}var qm=e=>xi=Wx(xi,e);function Kx(e){let t=e[Ke];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ke].modified_&&(td(t),tt(4)),lt(e)&&(e=Um(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[Ke].base_,e,t)}else e=Um(t,r);return Yx(t,e,!0),td(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==id?e:void 0}function Um(e,t){if(ts(t))return t;let r=t[Ke];if(!r)return Ja(t,e.handledSet_,e);if(!rs(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);Hm(r,e)}return r.copy_}function Yx(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&sd(t,r)}function $m(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var rs=(e,t)=>e.scope_===t,Xx=[];function Qm(e,t,r,n){let o=ur(e),i=e.type_;if(n!==void 0&&cr(o,n,i)===t){Ka(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Ii(o,(u,c)=>{if(mt(c)){let g=s.get(c)||[];g.push(u),s.set(c,g)}})}let a=e.draftLocations_.get(t)??Xx;for(let s of a)Ka(o,s,r,i)}function Zx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!rs(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=ad(i);Qm(e,i.draft_??i,a,r),Hm(i,o)})}function Hm(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)}$m(e)}}function Jx(e,t,r){let{scope_:n}=e;if(mt(r)){let o=r[Ke];rs(o,n)&&o.callbacks_.push(function(){za(e);let a=ad(o);Qm(e,r,a,t)})}else lt(r)&&e.callbacks_.push(function(){let i=ur(e);e.type_===3?i.has(r)&&Ja(r,n.handledSet_,n):cr(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ja(cr(e.copy_,t,e.type_),n.handledSet_,n)})}function Ja(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||mt(e)||t.has(e)||!lt(e)||ts(e)||(t.add(e),Ii(e,(n,o)=>{if(mt(o)){let i=o[Ke];if(rs(i,r)){let a=ad(i);Ka(e,n,a,e.type_),$m(i)}}else lt(o)&&Ja(o,t,r)})),e}function eC(e,t){let r=Ti(e),n={type_:r?1:0,scope_:t?t.scope_:Bm(),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=es;r&&(o=[n],i=Ci);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var es={get(e,t){if(t===Ke)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=ur(e);if(!eo(o,t,e.type_))return rC(e,o,t);let i=o[t];if(e.finalized_||!lt(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&$x(t))return i;if(i===Zl(e.base_,t)||tC(e,t,i)){za(e);let a=e.type_===1?+t:t,s=od(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in ur(e)},ownKeys(e){return Reflect.ownKeys(ur(e))},set(e,t,r){let n=zm(ur(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zl(ur(e),t),i=o?.[Ke];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Bx(r,o)&&(r!==void 0||eo(e.base_,t,e.type_)))return!0;za(e),nd(e)}return e.copy_[t]===r&&(r!==void 0||eo(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Jx(e,t,r)),!0},deleteProperty(e,t){return za(e),Zl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),nd(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ur(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ha]:!0,[Jl]:e.type_!==1||t!=="length",[Wa]:n[Wa],[wi]:r[t]}},defineProperty(){tt(11)},getPrototypeOf(e){return on(e.base_)},setPrototypeOf(){tt(12)}},Ci={};for(let e in es){let t=es[e];Ci[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Ci.deleteProperty=function(e,t){return Ci.set.call(this,e,t,void 0)};Ci.set=function(e,t,r){return es.set.call(this,e[0],t,r,e[0])};function Zl(e,t){let r=e[Ke];return(r?ur(r):e)[t]}function tC(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!lt(r)||r[Ke]?!1:e.baseRefs_.has(r)}function rC(e,t,r){let n=zm(t,r);return n?wi in n?n[wi]:n.get?.call(e.draft_):void 0}function zm(e,t){if(!(t in e))return;let r=on(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=on(r)}}function nd(e){e.modified_||(e.modified_=!0,e.parent_&&nd(e.parent_))}function za(e){e.copy_||(e.assigned_=new Map,e.copy_=ed(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var nC=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(nn(t)&&!nn(r)){let i=r;r=t;let a=this;return function(u=i,...c){return a.produce(u,g=>r.call(this,g,...c))}}nn(r)||tt(6),n!==void 0&&!nn(n)&&tt(7);let o;if(lt(t)){let i=qm(this),a=od(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?td(i):rd(i)}return Lm(i,n),jm(o,i)}else if(!t||!to(t)){if(o=r(t),o===void 0&&(o=t),o===id&&(o=void 0),this.autoFreeze_&&sd(o,!0),n){let i=[],a=[];sn(Xa).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else tt(1,t)},this.produceWithPatches=(t,r)=>{if(nn(t))return(a,...s)=>this.produceWithPatches(a,u=>t(u,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Xl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Xl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Xl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){lt(e)||tt(8),mt(e)&&(e=ns(e));let t=qm(this),r=od(t,e,void 0);return r[Ke].isManual_=!0,rd(t),r}finishDraft(e,t){let r=e&&e[Ke];(!r||!r.isManual_)&&tt(9);let{scope_:n}=r;return Lm(n,t),jm(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=sn(Xa).applyPatches_;return mt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function od(e,t,r,n){let[o,i]=_i(t)?sn(Ya).proxyMap_(t,r):ki(t)?sn(Ya).proxySet_(t,r):eC(t,r);return(r?.scope_??Bm()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Zx(r,i,n):i.callbacks_.push(function(u){u.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:c}=u;i.modified_&&c&&c.generatePatches_(i,[],u)}),o}function ns(e){return mt(e)||tt(10,e),Wm(e)}function Wm(e){if(!lt(e)||ts(e))return e;let t=e[Ke],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ed(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ed(e,!0);return Ii(r,(o,i)=>{Ka(r,o,Wm(i))},n),t&&(t.finalized_=!1),r}function Km(){function t(y,b=[]){if(y.key_!==void 0){let x=y.parent_.copy_??y.parent_.base_,I=Qx(cr(x,y.key_)),_=cr(x,y.key_);if(_===void 0||_!==y.draft_&&_!==y.base_&&_!==y.copy_||I!=null&&I.base_!==y.base_)return null;let T=y.parent_.type_===3,P;if(T){let A=y.parent_;P=Array.from(A.drafts_.keys()).indexOf(y.key_)}else P=y.key_;if(!(T&&x.size>P||eo(x,P)))return null;b.push(P)}if(y.parent_)return t(y.parent_,b);b.reverse();try{r(y.copy_,b)}catch{return null}return b}function r(y,b){let x=y;for(let I=0;I<b.length-1;I++){let _=b[I];if(x=cr(x,_),!to(x)||x===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return x}let n="replace",o="add",i="remove";function a(y,b,x){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:I,inversePatches_:_}=x;switch(y.type_){case 0:case 2:return u(y,b,I,_);case 1:return s(y,b,I,_);case 3:return c(y,b,I,_)}}function s(y,b,x,I){let{base_:_,assigned_:T}=y,P=y.copy_;P.length<_.length&&([_,P]=[P,_],[x,I]=[I,x]);let A=y.allIndicesReassigned_===!0;for(let O=0;O<_.length;O++){let k=P[O],N=_[O];if((A||T?.get(O.toString()))&&k!==N){let V=k?.[Ke];if(V&&V.modified_)continue;let j=b.concat([O]);x.push({op:n,path:j,value:h(k)}),I.push({op:n,path:j,value:h(N)})}}for(let O=_.length;O<P.length;O++){let k=b.concat([O]);x.push({op:o,path:k,value:h(P[O])})}for(let O=P.length-1;_.length<=O;--O){let k=b.concat([O]);I.push({op:i,path:k})}}function u(y,b,x,I){let{base_:_,copy_:T,type_:P}=y;Ii(y.assigned_,(A,O)=>{let k=cr(_,A,P),N=cr(T,A,P),M=O?eo(_,A)?n:o:i;if(k===N&&M===n)return;let V=b.concat(A);x.push(M===i?{op:M,path:V}:{op:M,path:V,value:h(N)}),I.push(M===o?{op:i,path:V}:M===i?{op:o,path:V,value:h(k)}:{op:n,path:V,value:h(k)})})}function c(y,b,x,I){let{base_:_,copy_:T}=y,P=0;_.forEach(A=>{if(!T.has(A)){let O=b.concat([P]);x.push({op:i,path:O,value:A}),I.unshift({op:o,path:O,value:A})}P++}),P=0,T.forEach(A=>{if(!_.has(A)){let O=b.concat([P]);x.push({op:o,path:O,value:A}),I.unshift({op:i,path:O,value:A})}P++})}function g(y,b,x){let{patches_:I,inversePatches_:_}=x;I.push({op:n,path:[],value:b===id?void 0:b}),_.push({op:n,path:[],value:y})}function v(y,b){return b.forEach(x=>{let{path:I,op:_}=x,T=y;for(let k=0;k<I.length-1;k++){let N=an(T),M=I[k];typeof M!="string"&&typeof M!="number"&&(M=""+M),(N===0||N===1)&&(M==="__proto__"||M===Ai)&&tt(19),nn(T)&&M===Ri&&tt(19),T=cr(T,M),(T===null||!to(T))&&tt(18,I.join("/"))}let P=an(T),A=R(x.value),O=I[I.length-1];switch(_){case n:switch(P){case 2:return T.set(O,A);case 3:tt(16);default:return T[O]=A}case o:switch(P){case 1:return O==="-"?T.push(A):T.splice(O,0,A);case 2:return T.set(O,A);case 3:return T.add(A);default:return T[O]=A}case i:switch(P){case 1:return T.splice(O,1);case 2:return T.delete(O);case 3:return T.delete(x.value);default:return delete T[O]}default:tt(17,_)}}),y}function R(y){if(!lt(y))return y;if(Ti(y))return y.map(R);if(_i(y))return new Map(Array.from(y.entries()).map(([x,I])=>[x,R(I)]));if(ki(y))return new Set(Array.from(y).map(R));let b=Object.create(on(y));for(let x in y)b[x]=R(y[x]);return eo(y,bi)&&(b[bi]=y[bi]),b}function h(y){return mt(y)?R(y):y}zx(Xa,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:g,getPath:t})}var oC=w.Iterator,ML=typeof oC?.from=="function";var Ei=new nC,cn=Ei.produce,cd=Ei.produceWithPatches.bind(Ei);var ud=Ei.applyPatches.bind(Ei);m();d();f();p();var iC=class{constructor(e){this.value=e}deref(){return this.value}},aC=()=>typeof WeakRef>"u"?iC:WeakRef,Xm=aC(),sC=0,os=1;function Oi(){return{s:sC,v:void 0,o:null,p:null}}function cC(e){return e instanceof Xm?e.deref():e}function ro(e,t={}){let r=Oi(),{resultEqualityCheck:n,maxSize:o}=t,i=o!==void 0;if(i&&(!Number.isInteger(o)||o<1))throw new TypeError(`maxSize must be a positive integer, received: ${o}`);let a=null,s=0,u,c=0,g=!1;function v(){s>=o&&(a=r,r=Oi(),s=0)}function R(){let h=r,{length:y}=arguments;for(let I=0,_=y;I<_;I++){let T=arguments[I];if(typeof T=="function"||typeof T=="object"&&T!==null){let P=h.o;P===null&&(h.o=P=new WeakMap);let A=P.get(T);A===void 0?(h=Oi(),P.set(T,h)):h=A}else{let P=h.p;P===null&&(h.p=P=new Map);let A=P.get(T);A===void 0?(h=Oi(),P.set(T,h),s++):h=A}}if(h.s===os)return h.v;if(a!==null){let I=a;for(let _=0,T=y;_<T;_++){let P=arguments[_],A;if(typeof P=="function"||typeof P=="object"&&P!==null){let O=I.o;A=O!==null?O.get(P):void 0}else{let O=I.p;A=O!==null?O.get(P):void 0}if(A===void 0){I=null;break}I=A}if(I!==null&&I.s===os){let _=h;return _.s=os,_.v=I.v,v(),I.v}}let b=h,x=e.apply(null,arguments);if(c++,n){let I=cC(u);I!=null&&n(I,x)&&(x=I,c!==0&&c--),u=typeof x=="object"&&x!==null||typeof x=="function"?new Xm(x):x}return b.s=os,b.v=x,i&&v(),x}return R.clearCache=()=>{r=Oi(),a=null,s=0,R.resetResultsCount()},R.resultsCount=()=>c,R.resetResultsCount=()=>{c=0},R}var ld=Symbol("NOT_FOUND");function uC(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function lC(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 Ym=e=>Array.isArray(e)?e:[e];function dC(e){let t=Array.isArray(e[0])?e[0]:e;return lC(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function is(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,u={},c=o.pop();typeof c=="object"&&(u=c,c=o.pop()),uC(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let g={...r,...u},{memoize:v,memoizeOptions:R=[],argsMemoize:h=ro,argsMemoizeOptions:y=[]}=g,b=Ym(R),x=Ym(y),I=dC(o),_=v(function(){return i++,c.apply(null,arguments)},...b),T=!0,P=h(function(){a++;let{length:O}=I,k=new Array(O);for(let N=0;N<O;N++)k[N]=I[N].apply(null,arguments);return s=_.apply(null,k),s},...x);return Object.assign(P,{resultFunc:c,memoizedResultFunc:_,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var ze=is(ro);function pC(e){let t;return{get(r){return t&&e(t.key,r)?t.value:ld},put(r,n){t={key:r,value:n}},findMatchingEntry(r,n){let o=t;return o!==void 0&&n(o.value,r)?o:void 0},clear(){t=void 0}}}function fC(e,t){let r=[];function n(s){let u=r.findIndex(c=>t(c.key,s));if(u>-1){let c=r[u];return u>0&&(r.splice(u,1),r.unshift(c)),c.value}return ld}function o(s,u){r.unshift({key:s,value:u}),r.length>e&&r.pop()}function i(s,u){let c=r,{length:g}=c;for(let v=0;v<g;v++){let R=c[v];if(u(R.value,s))return R}}function a(){r=[]}return{get:n,put:o,findMatchingEntry:i,clear:a}}var mC=(e,t)=>e===t;function gC(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;let{length:o}=r;for(let i=0;i<o;i++)if(!e(r[i],n[i]))return!1;return!0}}function dd(e,t){let r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=mC,maxSize:o=1,resultEqualityCheck:i}=r,a=gC(n),s=0,u=o<=1?pC(a):fC(o,a);function c(){let g=u.get(arguments);if(g===ld){if(g=e.apply(null,arguments),s++,i){let v=u.findMatchingEntry(g,i);v&&(g=v.value,s!==0&&s--)}u.put(arguments,g)}return g}return c.clearCache=()=>{u.clear(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}m();d();f();p();function Zm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Jm=Zm(),eg=Zm;var hC=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vi:vi.apply(null,arguments)},iq=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},yC=e=>e&&typeof e.match=="function";function L(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(gt(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=>Si(n)&&n.type===e,r}var cg=class Pi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Pi.prototype)}static get[Symbol.species](){return Pi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Pi(...t[0].concat(this)):new Pi(...t.concat(this))}};function tg(e){return lt(e)?cn(e,()=>{}):e}function as(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function vC(e){return typeof e=="boolean"}var SC=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new cg;return r&&(vC(r)?a.push(Jm):a.push(eg(r.extraArgument))),a},Ni="RTK_autoBatch",io=()=>e=>({payload:e,meta:{[Ni]:!0}}),rg=e=>t=>{setTimeout(t,e)},bC=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},AC=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?bC(window.requestAnimationFrame,100):rg(10):e.type==="callback"?e.queueNotification:rg(e.timeout),c=()=>{a=!1,i&&(i=!1,s.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),R=n.subscribe(v);return s.add(g),()=>{R(),s.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ni],i=!o,i&&(a||(a=!0,u(c))),n.dispatch(g)}finally{o=!0}}})},wC=e=>function(r){let{autoBatch:n=!0}=r??{},o=new cg(e);return n&&o.push(AC(typeof n=="object"?n:void 0)),o};function ug(e){let t=SC(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Wt(r))u=Jn(r);else throw new Error(gt(1));let c;typeof n=="function"?c=n(t):c=t();let g=vi;o&&(g=hC({trace:!1,...typeof o=="object"&&o}));let v=Nm(...c),R=wC(v),h=typeof s=="function"?s(R):R(),y=g(...h);return Yl(u,a,y)}function lg(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(gt(28));if(s in t)throw new Error(gt(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 xC(e){return typeof e=="function"}function Be(e,t){let[r,n,o]=lg(t),i;if(xC(e))i=()=>tg(e());else{let s=tg(e);i=()=>s}function a(s=i(),u){let c=[r[u.type],...n.filter(({matcher:g})=>g(u)).map(({reducer:g})=>g)];return c.filter(g=>!!g).length===0&&(c=[o]),c.reduce((g,v)=>{if(v)if(mt(g)){let h=v(g,u);return h===void 0?g:h}else{if(lt(g))return cn(g,R=>v(R,u));{let R=v(g,u);if(R===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}}return g},s)}return a.getInitialState=i,a}var dg=(e,t)=>yC(e)?e.match(t):e(t);function Kt(...e){return t=>e.some(r=>dg(r,t))}function oo(...e){return t=>e.every(r=>dg(r,t))}function ls(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 Fi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ds(...e){return e.length===0?t=>ls(t,["pending"]):Fi(e)?Kt(...e.map(t=>t.pending)):ds()(e[0])}function ln(...e){return e.length===0?t=>ls(t,["rejected"]):Fi(e)?Kt(...e.map(t=>t.rejected)):ln()(e[0])}function Di(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?oo(ln(...e),t):Fi(e)?oo(ln(...e),t):Di()(e[0])}function lr(...e){return e.length===0?t=>ls(t,["fulfilled"]):Fi(e)?Kt(...e.map(t=>t.fulfilled)):lr()(e[0])}function ps(...e){return e.length===0?t=>ls(t,["pending","fulfilled","rejected"]):Fi(e)?Kt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ps()(e[0])}var CC="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Mi=(e=21)=>{let t="",r=e;for(;r--;)t+=CC[Math.random()*64|0];return t},EC=["name","message","stack","code"],pd=class{constructor(e,t){ue(this,"payload");ue(this,"meta");ue(this,"_type");this.payload=e,this.meta=t}},ng=class{constructor(e,t){ue(this,"payload");ue(this,"meta");ue(this,"_type");this.payload=e,this.meta=t}},RC=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of EC)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},og="External signal was aborted",ke=(()=>{function e(t,r,n){let o=L(t+"/fulfilled",(u,c,g,v)=>({payload:u,meta:{...v||{},arg:g,requestId:c,requestStatus:"fulfilled"}})),i=L(t+"/pending",(u,c,g)=>({payload:void 0,meta:{...g||{},arg:c,requestId:u,requestStatus:"pending"}})),a=L(t+"/rejected",(u,c,g,v,R)=>({payload:v,error:(n&&n.serializeError||RC)(u||"Rejected"),meta:{...R||{},arg:g,requestId:c,rejectedWithValue:!!v,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"}}));function s(u,{signal:c}={}){return(g,v,R)=>{let h=n?.idGenerator?n.idGenerator(u):Mi(),y=new l.AbortController,b,x;function I(T){x=T,y.abort()}c&&(c.aborted?I(og):c.addEventListener("abort",()=>I(og),{once:!0}));let _=(async function(){let T;try{let A=n?.condition?.(u,{getState:v,extra:R});if(TC(A)&&(A=await A),A===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let O=new Promise((k,N)=>{b=()=>{N({name:"AbortError",message:x||"Aborted"})},y.signal.addEventListener("abort",b,{once:!0})});g(i(h,u,n?.getPendingMeta?.({requestId:h,arg:u},{getState:v,extra:R}))),T=await Promise.race([O,Promise.resolve(r(u,{dispatch:g,getState:v,extra:R,requestId:h,signal:y.signal,abort:I,rejectWithValue:((k,N)=>new pd(k,N)),fulfillWithValue:((k,N)=>new ng(k,N))})).then(k=>{if(k instanceof pd)throw k;return k instanceof ng?o(k.payload,h,u,k.meta):o(k,h,u)})])}catch(A){T=A instanceof pd?a(null,h,u,A.payload,A.meta):a(A,h,u)}finally{b&&y.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&a.match(T)&&T.meta.condition||g(T),T})();return Object.assign(_,{abort:I,requestId:h,arg:u,unwrap(){return _.then(IC)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Kt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function IC(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function TC(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pg=Symbol.for("rtk-slice-createasyncthunk"),sq={[pg]:ke};function _C(e,t){return`${e}/${t}`}function kC({creators:e}={}){let t=e?.asyncThunk?.[pg];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(gt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(PC()):n.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(T,P){let A=typeof T=="string"?T:T.type;if(!A)throw new Error(gt(12));if(A in u.sliceCaseReducersByType)throw new Error(gt(13));return u.sliceCaseReducersByType[A]=P,c},addMatcher(T,P){return u.sliceMatchers.push({matcher:T,reducer:P}),c},exposeAction(T,P){return u.actionCreators[T]=P,c},exposeCaseReducer(T,P){return u.sliceCaseReducersByName[T]=P,c}};s.forEach(T=>{let P=a[T],A={reducerName:T,type:_C(o,T),createNotation:typeof n.reducers=="function"};FC(P)?MC(A,P,c,t):NC(A,P,c)});function g(){let[T={},P=[],A=void 0]=typeof n.extraReducers=="function"?lg(n.extraReducers):[n.extraReducers],O={...T,...u.sliceCaseReducersByType};return Be(n.initialState,k=>{for(let N in O)k.addCase(N,O[N]);for(let N of u.sliceMatchers)k.addMatcher(N.matcher,N.reducer);for(let N of P)k.addMatcher(N.matcher,N.reducer);A&&k.addDefaultCase(A)})}let v=T=>T,R=new Map,h=new WeakMap,y;function b(T,P){return y||(y=g()),y(T,P)}function x(){return y||(y=g()),y.getInitialState()}function I(T,P=!1){function A(k){let N=k[T];return typeof N>"u"&&P&&(N=as(h,A,x)),N}function O(k=v){let N=as(R,P,()=>new WeakMap);return as(N,k,()=>{let M={};for(let[V,j]of Object.entries(n.selectors??{}))M[V]=OC(j,k,()=>as(h,k,x),P);return M})}return{reducerPath:T,getSelectors:O,get selectors(){return O(A)},selectSlice:A}}let _={name:o,reducer:b,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:x,...I(i),injectInto(T,{reducerPath:P,...A}={}){let O=P??i;return T.inject({reducerPath:O,reducer:b},A),{..._,...I(O,!0)}}};return _}}function OC(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 dn=kC();function PC(){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 NC({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!DC(n))throw new Error(gt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?L(e,a):L(e))}function FC(e){return e._reducerDefinitionType==="asyncThunk"}function DC(e){return e._reducerDefinitionType==="reducerWithPrepare"}function MC({type:e,reducerName:t},r,n,o){if(!o)throw new Error(gt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:u,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),u&&n.addCase(v.rejected,u),c&&n.addMatcher(v.settled,c),n.exposeCaseReducer(t,{fulfilled:a||ss,pending:s||ss,rejected:u||ss,settled:c||ss})}function ss(){}var LC="task",fg="listener",mg="completed",gd="cancelled",qC=`task-${gd}`,jC=`task-${mg}`,fd=`${fg}-${gd}`,UC=`${fg}-${mg}`,fs=class{constructor(e){ue(this,"code");ue(this,"name","TaskAbortError");ue(this,"message");this.code=e,this.message=`${LC} ${gd} (reason: ${e})`}},hd=(e,t)=>{if(typeof e!="function")throw new TypeError(gt(32))},cs=()=>{},gg=(e,t=cs)=>(e.catch(t),e),hg=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),un=e=>{if(e.aborted)throw new fs(e.reason)};function yg(e,t){let r=cs;return new Promise((n,o)=>{let i=()=>o(new fs(e.reason));if(e.aborted){i();return}r=hg(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=cs})}var VC=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof fs?"cancelled":"rejected",error:r}}finally{t?.()}},us=e=>t=>gg(yg(e,t).then(r=>(un(e),r))),vg=e=>{let t=us(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:no}=Object,ig={},ms="listenerMiddleware",GC=(e,t)=>{let r=n=>hg(e,()=>n.abort(e.reason));return(n,o)=>{hd(n,"taskExecutor");let i=new l.AbortController;r(i);let a=VC(async()=>{un(e),un(i.signal);let s=await n({pause:us(i.signal),delay:vg(i.signal),signal:i.signal});return un(i.signal),s},()=>i.abort(jC));return o?.autoJoin&&t.push(a.catch(cs)),{result:us(e)(a),cancel(){i.abort(qC)}}}},BC=(e,t)=>{let r=async(n,o)=>{un(t);let i=()=>{},s=[new Promise((u,c)=>{let g=e({predicate:n,effect:(v,R)=>{R.unsubscribe(),u([v,R.getState(),R.getOriginalState()])}});i=()=>{g(),c()}})];o!=null&&s.push(new Promise(u=>setTimeout(u,o,null)));try{let u=await yg(t,Promise.race(s));return un(t),u}finally{i()}};return((n,o)=>gg(r(n,o)))},Sg=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=L(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(gt(21));return hd(i,"options.listener"),{predicate:o,type:t,effect:i}},bg=no(e=>{let{type:t,predicate:r,effect:n}=Sg(e);return{id:Mi(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(gt(22))}}},{withTypes:()=>bg}),ag=(e,t)=>{let{type:r,effect:n,predicate:o}=Sg(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},md=e=>{e.pending.forEach(t=>{t.abort(fd)})},$C=(e,t)=>()=>{for(let r of t.keys())md(r);e.clear()},sg=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Ag=no(L(`${ms}/add`),{withTypes:()=>Ag}),QC=L(`${ms}/removeAll`),wg=no(L(`${ms}/remove`),{withTypes:()=>wg}),HC=(...e)=>{console.error(`${ms}/error`,...e)},xg=(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=HC}=e;hd(a,"onError");let s=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&md(h)}),u=(h=>{let y=ag(t,h)??bg(h);return s(y)});no(u,{withTypes:()=>u});let c=h=>{let y=ag(t,h);return y&&(y.unsubscribe(),h.cancelActive&&md(y)),!!y};no(c,{withTypes:()=>c});let g=async(h,y,b,x)=>{let I=new l.AbortController,_=BC(u,I.signal),T=[];try{h.pending.add(I),n(h),await Promise.resolve(h.effect(y,no({},b,{getOriginalState:x,condition:(P,A)=>_(P,A).then(Boolean),take:_,delay:vg(I.signal),pause:us(I.signal),extra:i,signal:I.signal,fork:GC(I.signal,T),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((P,A,O)=>{P!==I&&(P.abort(fd),O.delete(P))})},cancel:()=>{I.abort(fd),h.pending.delete(I)},throwIfCancelled:()=>{un(I.signal)}})))}catch(P){P instanceof fs||sg(a,P,{raisedBy:"effect"})}finally{await Promise.all(T),I.abort(UC),o(h),h.pending.delete(I)}},v=$C(t,r);return{middleware:h=>y=>b=>{if(!Si(b))return y(b);if(Ag.match(b))return u(b.payload);if(QC.match(b)){v();return}if(wg.match(b))return c(b.payload);let x=h.getState(),I=()=>{if(x===ig)throw new Error(gt(23));return x},_;try{if(_=y(b),t.size>0){let T=h.getState(),P=Array.from(t.values());for(let A of P){let O=!1;try{O=A.predicate(b,T,x)}catch(k){O=!1,sg(a,k,{raisedBy:"predicate"})}O&&g(A,b,h,I)}}}finally{x=ig}return _},startListening:u,stopListening:c,clearListeners:v}};function gt(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 Y=new z({required:!0,emptyAllowed:!1}),rt=new z({required:!1,emptyAllowed:!1}),nt=new z({required:!0,emptyAllowed:!0}),Sq=new z({required:!1,emptyAllowed:!0}),gs=new Ae({each:Y,required:!0}),Cg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Eg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),bq=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),dr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),kt=(e,t)=>{if("required"in t)return{payload:new yt({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new fi(o);return{payload:e}},B=(e,t)=>{try{return kt(e,t)}catch(r){return{payload:e,error:dr(r)}}},Rg=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Tg(e,t,r,o,"Controller initialization error")},Ig=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Tg(e,t,r,o,"Controller initialization error")},Tg=(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 ao="3.57.0",_g=["@coveo/atomic","@coveo/quantic"];var yd=()=>rt,kg=()=>Y,Ir=L("configuration/updateBasicConfiguration",e=>B(e,{accessToken:rt,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:rt})),Yt=L("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:rt,timezone:rt,locale:rt,authenticationProviders:new Ae({required:!1,each:Y})})),zC={enabled:new me({default:!0}),originContext:yd(),originLevel2:yd(),originLevel3:yd(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new qe,anonymous:new me({default:!1}),deviceId:rt,userDisplayName:rt,documentLocation:rt,trackingId:Eg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:_g.reduce((e,t)=>(e[t]=Cg,e),{})})},so=L("configuration/updateAnalyticsConfiguration",e=>B(e,zC)),co=L("configuration/analytics/disable"),uo=L("configuration/analytics/enable"),hs=L("configuration/analytics/originlevel2",e=>B(e,{originLevel2:kg()})),ys=L("configuration/analytics/originlevel3",e=>B(e,{originLevel3:kg()})),Og=L("knowledge/setAgentId",e=>B(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var Pg={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 Tr=L("searchParameters/restore",e=>B(e,Pg)),Ng=L("searchParameters/restoreTab",e=>B(e,Y));m();d();f();p();var vs=L("debug/enable"),Ss=L("debug/disable");m();d();f();p();var bs=()=>!1;var As=Be(bs(),e=>{e.addCase(vs,()=>!0).addCase(Ss,()=>!1).addCase(Tr,(t,r)=>r.payload.debug??t)});m();d();f();p();var lo=L("pipeline/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var WC=L("history/undo"),KC=L("history/redo"),Xt=L("history/snapshot"),_j=ke("history/back",async(e,{dispatch:t})=>{t(WC()),await t(St())}),kj=ke("history/forward",async(e,{dispatch:t})=>{t(KC()),await t(St())}),St=ke("history/change",async(e,{getState:t})=>t().history.present);m();d();f();p();var _r=()=>"";var po=Be(_r(),e=>{e.addCase(lo,(t,r)=>r.payload).addCase(St.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Yt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var ws=L("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function YC(){return typeof navigator<"u"}function Fg(){try{return typeof localStorage<"u"}catch{return!1}}function Dg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Mg(){return YC()&&navigator.cookieEnabled}m();d();f();p();var fo=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?Lg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Lg(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 Lg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function qg(){return Fg()?localStorage:Mg()?new xs:Dg()?sessionStorage:new vd}var xs=class e{getItem(t){return fo.get(`${e.prefix}${t}`)}removeItem(t){fo.erase(`${e.prefix}${t}`)}setItem(t,r,n){fo.set(`${e.prefix}${t}`,r,n)}};xs.prefix="coveo_";var vd=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Cs="__coveo.analytics.history",XC=20,ZC=1e3*60,JC=75,Es=class{constructor(t){this.store=t||qg()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}async addElementAsync(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=await this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}async getHistoryAsync(){let t=await this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryWithInternalTime(){try{let t=this.store.getItem(Cs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}async getHistoryWithInternalTimeAsync(){try{let t=await this.store.getItem(Cs);return t?JSON.parse(t):[]}catch{return[]}}setHistory(t){try{this.store.setItem(Cs,JSON.stringify(t.slice(0,XC)))}catch{}}clear(){try{this.store.removeItem(Cs)}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,JC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>ZC:!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 pn=class pn extends Es{static getInstance(t){return pn.instance||(pn.instance=new pn(t)),pn.instance}constructor(t){super(t)}};ue(pn,"instance",null);var ht=pn;m();d();f();p();m();d();f();p();var mo=ze(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ao}`));m();d();f();p();m();d();f();p();function pr(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 G(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 u(g){try{c(n.throw(g))}catch(v){a(v)}}function c(g){g.done?i(g.value):o(g.value).then(s,u)}c((n=n.apply(e,t||[])).next())})}var Ce;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ce||(Ce={}));function Ad(){return typeof window<"u"}function Fd(){return typeof navigator<"u"}function go(){return typeof document<"u"}function wd(){try{return typeof localStorage<"u"}catch{return!1}}function eE(){try{return typeof sessionStorage<"u"}catch{return!1}}function Xg(){return Fd()&&navigator.cookieEnabled}var tE=[Ce.click,Ce.custom,Ce.search,Ce.view],rE=(e,t)=>tE.indexOf(e)!==-1?Object.assign({language:go()?document.documentElement.lang:"unknown",userAgent:Fd()?navigator.userAgent:"unknown"},t):t,qi=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?jg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],jg(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 jg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function nE(){return wd()?localStorage:Xg()?new ji:eE()?sessionStorage:new yo}var ji=class e{getItem(t){return qi.get(`${e.prefix}${t}`)}removeItem(t){qi.erase(`${e.prefix}${t}`)}setItem(t,r,n){qi.set(`${e.prefix}${t}`,r,n)}};ji.prefix="coveo_";var xd=class{constructor(){this.cookieStorage=new ji}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)}},yo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Rs="__coveo.analytics.history",oE=20,iE=1e3*60,aE=75,Ts=class{constructor(t){this.store=t||nE()}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 G(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 G(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Rs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return G(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Rs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Rs,JSON.stringify(t.slice(0,oE)))}catch{}}clear(){try{this.store.removeItem(Rs)}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,aE)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>iE:!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 sE=(e,t)=>G(void 0,void 0,void 0,function*(){return e===Ce.view?(yield cE(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),cE=e=>G(void 0,void 0,void 0,function*(){let t=new Ts,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),uE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function _s(e){return typeof e=="string"&&uE.test(e)}function Ug(e){if(!_s(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function Zg(e,t=0){return(ot[e[t+0]]+ot[e[t+1]]+ot[e[t+2]]+ot[e[t+3]]+"-"+ot[e[t+4]]+ot[e[t+5]]+"-"+ot[e[t+6]]+ot[e[t+7]]+"-"+ot[e[t+8]]+ot[e[t+9]]+"-"+ot[e[t+10]]+ot[e[t+11]]+ot[e[t+12]]+ot[e[t+13]]+ot[e[t+14]]+ot[e[t+15]]).toLowerCase()}var lE=new Uint8Array(16);function dE(){return crypto.getRandomValues(lE)}function pE(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}var fE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",mE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function gE(e,t,r,n,o,i){let a=typeof r=="string"?pE(r):r,s=typeof n=="string"?Ug(n):n;if(typeof n=="string"&&(n=Ug(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+a.length);return u.set(s),u.set(a,s.length),u=t(u),u[6]=u[6]&15|e,u[8]=u[8]&63|128,Zg(u)}function fn(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():hE(e,t,r)}function hE(e,t,r){e=e||{};let n=e.random??e.rng?.()??dE();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Zg(n)}function yE(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 Sd(e,t){return e<<t|e>>>32-t}function vE(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(e.length+1);n.set(e),n[e.length]=128,e=n;let o=e.length/4+2,i=Math.ceil(o/16),a=new Array(i);for(let s=0;s<i;++s){let u=new Uint32Array(16);for(let c=0;c<16;++c)u[c]=e[s*64+c*4]<<24|e[s*64+c*4+1]<<16|e[s*64+c*4+2]<<8|e[s*64+c*4+3];a[s]=u}a[i-1][14]=(e.length-1)*8/2**32,a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let u=new Uint32Array(80);for(let y=0;y<16;++y)u[y]=a[s][y];for(let y=16;y<80;++y)u[y]=Sd(u[y-3]^u[y-8]^u[y-14]^u[y-16],1);let c=r[0],g=r[1],v=r[2],R=r[3],h=r[4];for(let y=0;y<80;++y){let b=Math.floor(y/20),x=Sd(c,5)+yE(b,g,v,R)+h+t[b]+u[y]>>>0;h=R,R=v,v=Sd(g,30)>>>0,g=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+R>>>0,r[4]=r[4]+h>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}function ks(e,t,r,n){return gE(80,vE,e,t)}ks.DNS=fE;ks.URL=mE;var Jg="2.33.0",Vg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Li={pageview:"pageview",event:"event"},Os=class{constructor({client:t,uuidGenerator:r=fn}){this.client=t,this.uuidGenerator=r}},Cd=class extends Os{constructor({client:t,uuidGenerator:r=fn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Vg(window.location),this.lastReferrer=go()?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:go()?document.title:"",encoding:go()?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===Li.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Li.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Li.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Li.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 Vg(window.location)}},kr=class e{constructor(t,r){if(!_s(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 _s(i)?new e(i,Number.parseInt(o)*1e3):null}};kr.cvo_cid="cvo_cid";kr.expirationTime=120;var Ed=class extends Os{constructor({client:t,uuidGenerator:r=fn}){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 G(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(kr.cvo_cid,new kr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ed.Id="link";var Pt=Object.keys;function Is(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var bd=128,eh=192,Gg=224,Bg=240;function SE(e){return(e&248)===Bg?4:(e&Bg)===Gg?3:(e&Gg)===eh?2:1}function bE(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&bd)!=bd)break;if(r-=3,(n&eh)!=bd){t-r>=SE(n)*3&&(r=t);break}}return e.substring(0,r)}var Rd={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"},AE=Pt(Rd).map(e=>Rd[e]),wE=[...AE].join("|"),xE=new RegExp(`^(${wE}$)`),CE={svcAction:"svc_action",svcActionData:"svc_action_data"},EE=e=>Pt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Rd[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),RE=e=>xE.test(e),IE=[RE],$g={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Qg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},dt={action:"pa",list:"pal",listSource:"pls"},Ps={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},TE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Id={id:"quoteId",affiliation:"quoteAffiliation"},Td={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},_E={add:dt,bookmark_add:dt,bookmark_remove:dt,click:dt,checkout:dt,checkout_option:dt,detail:dt,impression:dt,remove:dt,refund:Object.assign(Object.assign({},dt),Ps),purchase:Object.assign(Object.assign({},dt),Ps),quickview:dt,quote:Object.assign(Object.assign({},dt),Id),review:Object.assign(Object.assign({},dt),Td)},kE=Pt($g).map(e=>$g[e]),OE=Pt(Qg).map(e=>Qg[e]),PE=Pt(dt).map(e=>dt[e]),NE=Pt(Ps).map(e=>Ps[e]),FE=Pt(Td).map(e=>Td[e]),DE=Pt(Id).map(e=>Id[e]),ME=[...kE,"custom"].join("|"),LE=[...OE,"custom"].join("|"),th="(pr[0-9]+)",rh="(il[0-9]+pi[0-9]+)",qE=new RegExp(`^${th}(${ME})$`),jE=new RegExp(`^(${rh}(${LE}))|(il[0-9]+nm)$`),UE=new RegExp(`^(${PE.join("|")})$`),VE=new RegExp(`^(${NE.join("|")})$`),GE=new RegExp(`^${th}custom$`),BE=new RegExp(`^${rh}custom$`),$E=new RegExp(`^(${[...TE,...FE,...DE].join("|")})$`),QE=e=>qE.test(e),HE=e=>jE.test(e),zE=e=>UE.test(e),WE=e=>VE.test(e),KE=e=>$E.test(e),YE=[HE,QE,zE,WE,KE],XE=[GE,BE],ZE={anonymizeIp:"aip"},JE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},eR={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},tR=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],rR=Object.assign(Object.assign(Object.assign(Object.assign({},ZE),JE),eR),tR.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),_d=Object.assign(Object.assign({},rR),CE),nR=e=>{let t=!!e.action&&_E[e.action]||{};return Pt(e).reduce((r,n)=>{let o=t[n]||_d[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},oR=Pt(_d).map(e=>_d[e]),iR=e=>oR.indexOf(e)!==-1,aR=e=>e==="custom",sR=e=>[...YE,...IE,iR,aR].some(t=>t(e)),cR=e=>Pt(e).reduce((t,r)=>{let n=uR(r);return n?Object.assign(Object.assign({},t),lR(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),uR=e=>{let t;return[...XE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},lR=(e,t)=>Pt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),kd=class{constructor(t){this.opts=t}sendEvent(t,r){return G(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),u=this.encodeForEventType(t,s),c=new Blob([u],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,c)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return G(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:u}=a;o=s||t;try{i=JSON.parse(u)}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 G(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[Ce.click,Ce.custom,Ce.search,Ce.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}},Od=class{sendEvent(t,r){return G(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){return Promise.resolve()})}},Hg=w.fetch,Ns=class{constructor(t){this.opts=t}sendEvent(t,r){return G(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)},u=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:c}=u,g=pr(u,["url"]),v;try{v=yield Hg(c,g)}catch(R){console.error("An error has occurred when sending the event.",R);return}if(v.ok){let R=yield v.json();return R.visitorId&&o.setCurrentVisitorId(R.visitorId),R}else{try{v.json()}catch{}throw console.error(`An error has occurred 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 G(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Hg(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}getVisitorIdParam(){return G(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"})}},Pd=class{constructor(t,r){wd()&&Xg()?this.storage=new xd:wd()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new yo),this.client=new Ns(t),this.beaconClient=new kd(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}},Nd=class{constructor(t,r){this.storage=r||new yo,this.client=new Ns(t)}getClientDependingOnEventType(t){return this.client}},Fs=class{constructor(){this.storage=new yo,this.client=new Od}getClientDependingOnEventType(t){return this.client}},dR="xx",pR=e=>e?.startsWith(dR)||!1,fR=`
|
|
28
|
+
`;return new fi(r)}var fi=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},yt=class{constructor(e){ue(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 Hw(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}},qe=class{constructor(e={}){ue(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 Je(e){return e===void 0}function zw(e){return e===null}function ce(e){return Je(e)||zw(e)}var me=class{constructor(e={}){ue(this,"value");this.value=new qe(e)}validate(e){let t=this.value.validate(e);return t||(Ww(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Ww(e){return Je(e)||sm(e)}function sm(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ue(this,"config");ue(this,"value");this.config=e,this.value=new qe(e)}validate(e){let t=this.value.validate(e);return t||(Kw(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 Kw(e){return Je(e)||cm(e)}function cm(e){return typeof e=="number"&&!Number.isNaN(e)}var Yw=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ue(this,"value");ue(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new qe(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(Je(e))return null;if(!Fa(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&&!(Yw.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 Fa(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ue(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Je(e))return this.config.options.required?"value is required and is currently undefined":null;if(!um(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 um(e){return e!==void 0&&typeof e=="object"}var Ae=class{constructor(e={}){ue(this,"config");ue(this,"value");this.config=e,this.value=new qe(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 sm(e)||Fa(e)||cm(e)||um(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function lm(e){return Array.isArray(e)}var Ll=class{constructor(e){ue(this,"config");ue(this,"value");this.config=e,this.value=new qe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Je(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 dm(e){return Array.isArray(e)}function Da(e){return e.trim()===""}var Xw=new Set(["1",1,"yes",!0]);function ql(){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=>Xw.has(r))}function pm(e){let t={};for(let[r,n]of e)t[r]=n;return t}function mi(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ma(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 Zw(e){if(Da(e.openingDelimiter)||Da(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ce(e.content)||Da(e.content))return e.content;if(e.highlights.length===0)return Yn(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+=Yn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Yn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Yn(e.content.slice(n))),r}function Jw(e,t){return e=Yn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?jl(n,t.notMatchDelimiters):o?jl(o,t.exactMatchDelimiters):i?jl(i,t.correctionDelimiters):r)}function jl(e,t){return t?t.open+e+t.close:e}function Yn(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var Cm=jt(bm(),1);m();d();f();p();var Ht=new Error("Failed to load reducers."),Xn=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."}},rn=class extends Error{constructor(r,n){super();ue(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 Am(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function wm(e){return typeof e!="object"||!e?!1:Object.values(e).every(Ex)}function Ex(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function xm(e){return e===429}var Ut=class e{static async call(t){let r=Rx(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=async()=>{let u=await C(i,a);if(xm(u.status))throw u;return u};try{let u=await(0,Cm.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:async c=>{let g=c&&xm(c.status);return g&&(n.info("Platform retrying request"),await new Promise(v=>setTimeout(v,1e3))),g}});switch(u.status){case 419:case 401:throw n.info("Platform renewing token"),new Xn;case 404:throw new rn(i,u.status);default:return n.info({response:u,requestInfo:o},"Platform response"),u}}catch(u){return u.message==="Failed to fetch"?new rn(i):u}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...u}=t,c=mi(u);try{let g=await o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return c}};function _t(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Zn(e,t,r="prod"){return e??_t(t,r)}function xr(e,t="prod"){return`${_t(e,t)}/rest/search/v2`}function qa(e,t="prod"){return`${_t(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Rx(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",u=Ix(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...s&&{body:u},signal:a}}function Ix(e,t){return t==="application/x-www-form-urlencoded"?wm(e)?Am(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var ja=e=>e;m();d();f();p();m();d();f();p();function Ua(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function zt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ua(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ua(),extendedResults:{},searchAction:void 0}}m();d();f();p();function Cr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Er=e=>{let{response:t}=e;return t.body?Tx(e):_x(t)},Tx=e=>Ox(e)?Px(e):kx(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},_x=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function kx(e){return e.body.statusCode!==void 0}function Ox(e){return e.body.exception!==void 0}var Px=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var Rr=class{constructor(){ue(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController;this.currentAbortController=new l.AbortController;let o=this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};m();d();f();p();m();d();f();p();var yi=class{constructor(t){ue(this,"_basePath");ue(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 Em(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var sr=(e,t,r,n)=>{let o=new yi(`${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 Rm=async(e,t)=>{let r=await Ut.call({...sr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Cr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Em(r),o=await r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Nx(a)?{success:a}:{error:Er({response:r,body:a})}};function Nx(e){return typeof e=="string"}m();d();f();p();function Fx(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Dx(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Va(e,t){if(t&&e.name==="AbortError")return{error:Dx(e)};if(e instanceof rn)return{error:Fx(e)};throw e}var Ga=class{constructor(t){ue(this,"options",t);ue(this,"apiCallsQueues",{unknown:new Rr,mainSearch:new Rr,facetValues:new Rr,foldingCollection:new Rr,instantResults:new Rr})}async plan(t){let r=await Ut.call({...sr(t,"POST","application/json","/plan"),requestParams:Cr(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Va(r);let n=await r.json();return Lx(n)?{success:n}:{error:Er({response:r,body:n})}}async querySuggest(t){let r=await Ut.call({...sr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:Cr(t),...this.options});if(r instanceof Error)return Va(r);let n=await r.json(),o={response:r,body:n};return Mx(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:Er(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(s=>Ut.call({...sr(t,"POST","application/json",""),requestParams:Cr(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:s??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Va(o,r?.disableAbortWarning);let i=await o.json(),a={response:o,body:i};return Im(i)?(a.body=Tm(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:Er(a)}}async facetSearch(t){let r=await Ut.call({...sr(t,"POST","application/json","/facet"),requestParams:Cr(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await Ut.call({...sr(t,"POST","application/json",""),requestParams:Cr(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(Im(n)){let o={response:r,body:n};return o.body=Tm(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:Er({response:r,body:n})}}async html(t){return Rm(t,{...this.options})}async fieldDescriptions(t){let r=await Ut.call({...sr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return qx(n)?{success:n}:{error:Er({response:r,body:n})}}},Ba=e=>e.success!==void 0,vt=e=>e.error!==void 0;function Im(e){return e.results!==void 0}function Tm(e){let t=Ua();return ce(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Mx(e){return e.completions!==void 0}function Lx(e){return e.preprocessingOutput!==void 0}function qx(e){return e.fields!==void 0}m();d();f();p();var _m=e=>e,km=e=>e,Om=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function et(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 jx=typeof Symbol=="function"&&Symbol.observable||"@@observable",Pm=jx,Kl=()=>Math.random().toString(36).substring(7).split("").join("."),Ux={INIT:`@@redux/INIT${Kl()}`,REPLACE:`@@redux/REPLACE${Kl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Kl()}`},$a=Ux;function Wt(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 Yl(e,t,r){if(typeof e!="function")throw new Error(et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(et(1));return r(Yl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,u=!1;function c(){a===i&&(a=new Map,i.forEach((x,I)=>{a.set(I,x)}))}function g(){if(u)throw new Error(et(3));return o}function v(x){if(typeof x!="function")throw new Error(et(4));if(u)throw new Error(et(5));let I=!0;c();let _=s++;return a.set(_,x),function(){if(I){if(u)throw new Error(et(6));I=!1,c(),a.delete(_),i=null}}}function R(x){if(!Wt(x))throw new Error(et(7));if(typeof x.type>"u")throw new Error(et(8));if(typeof x.type!="string")throw new Error(et(17));if(u)throw new Error(et(9));try{u=!0,o=n(o,x)}finally{u=!1}return(i=a).forEach(_=>{_()}),x}function h(x){if(typeof x!="function")throw new Error(et(10));n=x,R({type:$a.REPLACE})}function y(){let x=v;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(et(11));function _(){let P=I;P.next&&P.next(g())}return _(),{unsubscribe:x(_)}},[Pm](){return this}}}return R({type:$a.INIT}),{dispatch:R,subscribe:v,getState:g,replaceReducer:h,[Pm]:y}}function Vx(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:$a.INIT})>"u")throw new Error(et(12));if(typeof r(void 0,{type:$a.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(et(13))})}function Jn(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{Vx(r)}catch(a){i=a}return function(s={},u){if(i)throw i;let c=!1,g={};for(let v=0;v<n.length;v++){let R=n[v],h=r[R],y=s[R],b=h(y,u);if(typeof b>"u"){let x=u&&u.type;throw new Error(et(14))}g[R]=b,c=c||b!==y}return c=c||n.length!==Object.keys(s).length,c?g:s}}function vi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Nm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(et(15))},a={getState:o.getState,dispatch:(u,...c)=>i(u,...c)},s=e.map(u=>u(a));return i=vi(...s)(o.dispatch),{...o,dispatch:i}}}function Si(e){return Wt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var id=Symbol.for("immer-nothing"),bi=Symbol.for("immer-draftable"),Ke=Symbol.for("immer-state");function tt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ct=Object,on=Ct.getPrototypeOf,Ai="constructor",Ri="prototype",Jl="configurable",Wa="enumerable",Ha="writable",wi="value",mt=e=>!!e&&!!e[Ke];function lt(e){return e?Vm(e)||Ti(e)||!!e[bi]||!!e[Ai]?.[bi]||_i(e)||ki(e):!1}var Gx=Ct[Ri][Ai].toString(),Fm=new WeakMap;function Vm(e){if(!e||!to(e))return!1;let t=on(e);if(t===null||t===Ct[Ri])return!0;let r=Ct.hasOwnProperty.call(t,Ai)&&t[Ai];if(r===Object)return!0;if(!nn(r))return!1;let n=Fm.get(r);return n===void 0&&(n=Function.toString.call(r),Fm.set(r,n)),n===Gx}function Gm(e){return mt(e)||tt(15,e),e[Ke].base_}function Ii(e,t,r=!0){an(e)===0?(r?Reflect.ownKeys(e):Ct.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function an(e){let t=e[Ke];return t?t.type_:Ti(e)?1:_i(e)?2:ki(e)?3:0}var eo=(e,t,r=an(e))=>r===2?e.has(t):Ct[Ri].hasOwnProperty.call(e,t),cr=(e,t,r=an(e))=>r===2?e.get(t):e[t],Ka=(e,t,r,n=an(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Bx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ti=Array.isArray,_i=e=>e instanceof Map,ki=e=>e instanceof Set,to=e=>typeof e=="object",nn=e=>typeof e=="function",Xl=e=>typeof e=="boolean";function $x(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Qx=e=>to(e)?e?.[Ke]:null,ur=e=>e.copy_||e.base_;var ad=e=>e.modified_?e.copy_:e.base_;function ed(e,t){if(_i(e))return new Map(e);if(ki(e))return new Set(e);if(Ti(e))return Array[Ri].slice.call(e);let r=Vm(e);if(t===!0||t==="class_only"&&!r){let n=Ct.getOwnPropertyDescriptors(e);delete n[Ke];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[Ha]===!1&&(s[Ha]=!0,s[Jl]=!0),(s.get||s.set)&&(n[a]={[Jl]:!0,[Ha]:!0,[Wa]:s[Wa],[wi]:e[a]})}return Ct.create(on(e),n)}else{let n=on(e);if(n!==null&&r)return{...e};let o=Ct.create(n);return Ct.assign(o,e)}}function sd(e,t=!1){return ts(e)||mt(e)||!lt(e)||(an(e)>1&&Ct.defineProperties(e,{set:Qa,add:Qa,clear:Qa,delete:Qa}),Ct.freeze(e),t&&Ii(e,(r,n)=>{sd(n,!0)},!1)),e}function Hx(){tt(2)}var Qa={[wi]:Hx};function ts(e){return e===null||!to(e)?!0:Ct.isFrozen(e)}var Ya="MapSet",Xa="Patches",Dm="ArrayMethods",Za={};function sn(e){let t=Za[e];return t||tt(0,e),t}var Mm=e=>!!Za[e];function zx(e,t){Za[e]||(Za[e]=t)}var xi,Bm=()=>xi,Wx=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Mm(Ya)?sn(Ya):void 0,arrayMethodsPlugin_:Mm(Dm)?sn(Dm):void 0});function Lm(e,t){t&&(e.patchPlugin_=sn(Xa),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function td(e){rd(e),e.drafts_.forEach(Kx),e.drafts_=null}function rd(e){e===xi&&(xi=e.parent_)}var qm=e=>xi=Wx(xi,e);function Kx(e){let t=e[Ke];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ke].modified_&&(td(t),tt(4)),lt(e)&&(e=Um(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[Ke].base_,e,t)}else e=Um(t,r);return Yx(t,e,!0),td(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==id?e:void 0}function Um(e,t){if(ts(t))return t;let r=t[Ke];if(!r)return Ja(t,e.handledSet_,e);if(!rs(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);Hm(r,e)}return r.copy_}function Yx(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&sd(t,r)}function $m(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var rs=(e,t)=>e.scope_===t,Xx=[];function Qm(e,t,r,n){let o=ur(e),i=e.type_;if(n!==void 0&&cr(o,n,i)===t){Ka(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Ii(o,(u,c)=>{if(mt(c)){let g=s.get(c)||[];g.push(u),s.set(c,g)}})}let a=e.draftLocations_.get(t)??Xx;for(let s of a)Ka(o,s,r,i)}function Zx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!rs(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=ad(i);Qm(e,i.draft_??i,a,r),Hm(i,o)})}function Hm(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)}$m(e)}}function Jx(e,t,r){let{scope_:n}=e;if(mt(r)){let o=r[Ke];rs(o,n)&&o.callbacks_.push(function(){za(e);let a=ad(o);Qm(e,r,a,t)})}else lt(r)&&e.callbacks_.push(function(){let i=ur(e);e.type_===3?i.has(r)&&Ja(r,n.handledSet_,n):cr(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ja(cr(e.copy_,t,e.type_),n.handledSet_,n)})}function Ja(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||mt(e)||t.has(e)||!lt(e)||ts(e)||(t.add(e),Ii(e,(n,o)=>{if(mt(o)){let i=o[Ke];if(rs(i,r)){let a=ad(i);Ka(e,n,a,e.type_),$m(i)}}else lt(o)&&Ja(o,t,r)})),e}function eC(e,t){let r=Ti(e),n={type_:r?1:0,scope_:t?t.scope_:Bm(),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=es;r&&(o=[n],i=Ci);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var es={get(e,t){if(t===Ke)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=ur(e);if(!eo(o,t,e.type_))return rC(e,o,t);let i=o[t];if(e.finalized_||!lt(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&$x(t))return i;if(i===Zl(e.base_,t)||tC(e,t,i)){za(e);let a=e.type_===1?+t:t,s=od(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in ur(e)},ownKeys(e){return Reflect.ownKeys(ur(e))},set(e,t,r){let n=zm(ur(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zl(ur(e),t),i=o?.[Ke];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Bx(r,o)&&(r!==void 0||eo(e.base_,t,e.type_)))return!0;za(e),nd(e)}return e.copy_[t]===r&&(r!==void 0||eo(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Jx(e,t,r)),!0},deleteProperty(e,t){return za(e),Zl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),nd(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ur(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ha]:!0,[Jl]:e.type_!==1||t!=="length",[Wa]:n[Wa],[wi]:r[t]}},defineProperty(){tt(11)},getPrototypeOf(e){return on(e.base_)},setPrototypeOf(){tt(12)}},Ci={};for(let e in es){let t=es[e];Ci[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Ci.deleteProperty=function(e,t){return Ci.set.call(this,e,t,void 0)};Ci.set=function(e,t,r){return es.set.call(this,e[0],t,r,e[0])};function Zl(e,t){let r=e[Ke];return(r?ur(r):e)[t]}function tC(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!lt(r)||r[Ke]?!1:e.baseRefs_.has(r)}function rC(e,t,r){let n=zm(t,r);return n?wi in n?n[wi]:n.get?.call(e.draft_):void 0}function zm(e,t){if(!(t in e))return;let r=on(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=on(r)}}function nd(e){e.modified_||(e.modified_=!0,e.parent_&&nd(e.parent_))}function za(e){e.copy_||(e.assigned_=new Map,e.copy_=ed(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var nC=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(nn(t)&&!nn(r)){let i=r;r=t;let a=this;return function(u=i,...c){return a.produce(u,g=>r.call(this,g,...c))}}nn(r)||tt(6),n!==void 0&&!nn(n)&&tt(7);let o;if(lt(t)){let i=qm(this),a=od(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?td(i):rd(i)}return Lm(i,n),jm(o,i)}else if(!t||!to(t)){if(o=r(t),o===void 0&&(o=t),o===id&&(o=void 0),this.autoFreeze_&&sd(o,!0),n){let i=[],a=[];sn(Xa).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else tt(1,t)},this.produceWithPatches=(t,r)=>{if(nn(t))return(a,...s)=>this.produceWithPatches(a,u=>t(u,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Xl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Xl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Xl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){lt(e)||tt(8),mt(e)&&(e=ns(e));let t=qm(this),r=od(t,e,void 0);return r[Ke].isManual_=!0,rd(t),r}finishDraft(e,t){let r=e&&e[Ke];(!r||!r.isManual_)&&tt(9);let{scope_:n}=r;return Lm(n,t),jm(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=sn(Xa).applyPatches_;return mt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function od(e,t,r,n){let[o,i]=_i(t)?sn(Ya).proxyMap_(t,r):ki(t)?sn(Ya).proxySet_(t,r):eC(t,r);return(r?.scope_??Bm()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Zx(r,i,n):i.callbacks_.push(function(u){u.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:c}=u;i.modified_&&c&&c.generatePatches_(i,[],u)}),o}function ns(e){return mt(e)||tt(10,e),Wm(e)}function Wm(e){if(!lt(e)||ts(e))return e;let t=e[Ke],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ed(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ed(e,!0);return Ii(r,(o,i)=>{Ka(r,o,Wm(i))},n),t&&(t.finalized_=!1),r}function Km(){function t(y,b=[]){if(y.key_!==void 0){let x=y.parent_.copy_??y.parent_.base_,I=Qx(cr(x,y.key_)),_=cr(x,y.key_);if(_===void 0||_!==y.draft_&&_!==y.base_&&_!==y.copy_||I!=null&&I.base_!==y.base_)return null;let T=y.parent_.type_===3,P;if(T){let A=y.parent_;P=Array.from(A.drafts_.keys()).indexOf(y.key_)}else P=y.key_;if(!(T&&x.size>P||eo(x,P)))return null;b.push(P)}if(y.parent_)return t(y.parent_,b);b.reverse();try{r(y.copy_,b)}catch{return null}return b}function r(y,b){let x=y;for(let I=0;I<b.length-1;I++){let _=b[I];if(x=cr(x,_),!to(x)||x===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return x}let n="replace",o="add",i="remove";function a(y,b,x){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:I,inversePatches_:_}=x;switch(y.type_){case 0:case 2:return u(y,b,I,_);case 1:return s(y,b,I,_);case 3:return c(y,b,I,_)}}function s(y,b,x,I){let{base_:_,assigned_:T}=y,P=y.copy_;P.length<_.length&&([_,P]=[P,_],[x,I]=[I,x]);let A=y.allIndicesReassigned_===!0;for(let O=0;O<_.length;O++){let k=P[O],N=_[O];if((A||T?.get(O.toString()))&&k!==N){let V=k?.[Ke];if(V&&V.modified_)continue;let j=b.concat([O]);x.push({op:n,path:j,value:h(k)}),I.push({op:n,path:j,value:h(N)})}}for(let O=_.length;O<P.length;O++){let k=b.concat([O]);x.push({op:o,path:k,value:h(P[O])})}for(let O=P.length-1;_.length<=O;--O){let k=b.concat([O]);I.push({op:i,path:k})}}function u(y,b,x,I){let{base_:_,copy_:T,type_:P}=y;Ii(y.assigned_,(A,O)=>{let k=cr(_,A,P),N=cr(T,A,P),M=O?eo(_,A)?n:o:i;if(k===N&&M===n)return;let V=b.concat(A);x.push(M===i?{op:M,path:V}:{op:M,path:V,value:h(N)}),I.push(M===o?{op:i,path:V}:M===i?{op:o,path:V,value:h(k)}:{op:n,path:V,value:h(k)})})}function c(y,b,x,I){let{base_:_,copy_:T}=y,P=0;_.forEach(A=>{if(!T.has(A)){let O=b.concat([P]);x.push({op:i,path:O,value:A}),I.unshift({op:o,path:O,value:A})}P++}),P=0,T.forEach(A=>{if(!_.has(A)){let O=b.concat([P]);x.push({op:o,path:O,value:A}),I.unshift({op:i,path:O,value:A})}P++})}function g(y,b,x){let{patches_:I,inversePatches_:_}=x;I.push({op:n,path:[],value:b===id?void 0:b}),_.push({op:n,path:[],value:y})}function v(y,b){return b.forEach(x=>{let{path:I,op:_}=x,T=y;for(let k=0;k<I.length-1;k++){let N=an(T),M=I[k];typeof M!="string"&&typeof M!="number"&&(M=""+M),(N===0||N===1)&&(M==="__proto__"||M===Ai)&&tt(19),nn(T)&&M===Ri&&tt(19),T=cr(T,M),(T===null||!to(T))&&tt(18,I.join("/"))}let P=an(T),A=R(x.value),O=I[I.length-1];switch(_){case n:switch(P){case 2:return T.set(O,A);case 3:tt(16);default:return T[O]=A}case o:switch(P){case 1:return O==="-"?T.push(A):T.splice(O,0,A);case 2:return T.set(O,A);case 3:return T.add(A);default:return T[O]=A}case i:switch(P){case 1:return T.splice(O,1);case 2:return T.delete(O);case 3:return T.delete(x.value);default:return delete T[O]}default:tt(17,_)}}),y}function R(y){if(!lt(y))return y;if(Ti(y))return y.map(R);if(_i(y))return new Map(Array.from(y.entries()).map(([x,I])=>[x,R(I)]));if(ki(y))return new Set(Array.from(y).map(R));let b=Object.create(on(y));for(let x in y)b[x]=R(y[x]);return eo(y,bi)&&(b[bi]=y[bi]),b}function h(y){return mt(y)?R(y):y}zx(Xa,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:g,getPath:t})}var oC=w.Iterator,ML=typeof oC?.from=="function";var Ei=new nC,cn=Ei.produce,cd=Ei.produceWithPatches.bind(Ei);var ud=Ei.applyPatches.bind(Ei);m();d();f();p();var iC=class{constructor(e){this.value=e}deref(){return this.value}},aC=()=>typeof WeakRef>"u"?iC:WeakRef,Xm=aC(),sC=0,os=1;function Oi(){return{s:sC,v:void 0,o:null,p:null}}function cC(e){return e instanceof Xm?e.deref():e}function ro(e,t={}){let r=Oi(),{resultEqualityCheck:n,maxSize:o}=t,i=o!==void 0;if(i&&(!Number.isInteger(o)||o<1))throw new TypeError(`maxSize must be a positive integer, received: ${o}`);let a=null,s=0,u,c=0,g=!1;function v(){s>=o&&(a=r,r=Oi(),s=0)}function R(){let h=r,{length:y}=arguments;for(let I=0,_=y;I<_;I++){let T=arguments[I];if(typeof T=="function"||typeof T=="object"&&T!==null){let P=h.o;P===null&&(h.o=P=new WeakMap);let A=P.get(T);A===void 0?(h=Oi(),P.set(T,h)):h=A}else{let P=h.p;P===null&&(h.p=P=new Map);let A=P.get(T);A===void 0?(h=Oi(),P.set(T,h),s++):h=A}}if(h.s===os)return h.v;if(a!==null){let I=a;for(let _=0,T=y;_<T;_++){let P=arguments[_],A;if(typeof P=="function"||typeof P=="object"&&P!==null){let O=I.o;A=O!==null?O.get(P):void 0}else{let O=I.p;A=O!==null?O.get(P):void 0}if(A===void 0){I=null;break}I=A}if(I!==null&&I.s===os){let _=h;return _.s=os,_.v=I.v,v(),I.v}}let b=h,x=e.apply(null,arguments);if(c++,n){let I=cC(u);I!=null&&n(I,x)&&(x=I,c!==0&&c--),u=typeof x=="object"&&x!==null||typeof x=="function"?new Xm(x):x}return b.s=os,b.v=x,i&&v(),x}return R.clearCache=()=>{r=Oi(),a=null,s=0,R.resetResultsCount()},R.resultsCount=()=>c,R.resetResultsCount=()=>{c=0},R}var ld=Symbol("NOT_FOUND");function uC(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function lC(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 Ym=e=>Array.isArray(e)?e:[e];function dC(e){let t=Array.isArray(e[0])?e[0]:e;return lC(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function is(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,u={},c=o.pop();typeof c=="object"&&(u=c,c=o.pop()),uC(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let g={...r,...u},{memoize:v,memoizeOptions:R=[],argsMemoize:h=ro,argsMemoizeOptions:y=[]}=g,b=Ym(R),x=Ym(y),I=dC(o),_=v(function(){return i++,c.apply(null,arguments)},...b),T=!0,P=h(function(){a++;let{length:O}=I,k=new Array(O);for(let N=0;N<O;N++)k[N]=I[N].apply(null,arguments);return s=_.apply(null,k),s},...x);return Object.assign(P,{resultFunc:c,memoizedResultFunc:_,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var ze=is(ro);function pC(e){let t;return{get(r){return t&&e(t.key,r)?t.value:ld},put(r,n){t={key:r,value:n}},findMatchingEntry(r,n){let o=t;return o!==void 0&&n(o.value,r)?o:void 0},clear(){t=void 0}}}function fC(e,t){let r=[];function n(s){let u=r.findIndex(c=>t(c.key,s));if(u>-1){let c=r[u];return u>0&&(r.splice(u,1),r.unshift(c)),c.value}return ld}function o(s,u){r.unshift({key:s,value:u}),r.length>e&&r.pop()}function i(s,u){let c=r,{length:g}=c;for(let v=0;v<g;v++){let R=c[v];if(u(R.value,s))return R}}function a(){r=[]}return{get:n,put:o,findMatchingEntry:i,clear:a}}var mC=(e,t)=>e===t;function gC(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;let{length:o}=r;for(let i=0;i<o;i++)if(!e(r[i],n[i]))return!1;return!0}}function dd(e,t){let r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=mC,maxSize:o=1,resultEqualityCheck:i}=r,a=gC(n),s=0,u=o<=1?pC(a):fC(o,a);function c(){let g=u.get(arguments);if(g===ld){if(g=e.apply(null,arguments),s++,i){let v=u.findMatchingEntry(g,i);v&&(g=v.value,s!==0&&s--)}u.put(arguments,g)}return g}return c.clearCache=()=>{u.clear(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}m();d();f();p();function Zm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Jm=Zm(),eg=Zm;var hC=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vi:vi.apply(null,arguments)},iq=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},yC=e=>e&&typeof e.match=="function";function L(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(gt(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=>Si(n)&&n.type===e,r}var cg=class Pi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Pi.prototype)}static get[Symbol.species](){return Pi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Pi(...t[0].concat(this)):new Pi(...t.concat(this))}};function tg(e){return lt(e)?cn(e,()=>{}):e}function as(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function vC(e){return typeof e=="boolean"}var SC=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new cg;return r&&(vC(r)?a.push(Jm):a.push(eg(r.extraArgument))),a},Ni="RTK_autoBatch",io=()=>e=>({payload:e,meta:{[Ni]:!0}}),rg=e=>t=>{setTimeout(t,e)},bC=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},AC=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?bC(window.requestAnimationFrame,100):rg(10):e.type==="callback"?e.queueNotification:rg(e.timeout),c=()=>{a=!1,i&&(i=!1,s.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),R=n.subscribe(v);return s.add(g),()=>{R(),s.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ni],i=!o,i&&(a||(a=!0,u(c))),n.dispatch(g)}finally{o=!0}}})},wC=e=>function(r){let{autoBatch:n=!0}=r??{},o=new cg(e);return n&&o.push(AC(typeof n=="object"?n:void 0)),o};function ug(e){let t=SC(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Wt(r))u=Jn(r);else throw new Error(gt(1));let c;typeof n=="function"?c=n(t):c=t();let g=vi;o&&(g=hC({trace:!1,...typeof o=="object"&&o}));let v=Nm(...c),R=wC(v),h=typeof s=="function"?s(R):R(),y=g(...h);return Yl(u,a,y)}function lg(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(gt(28));if(s in t)throw new Error(gt(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 xC(e){return typeof e=="function"}function Be(e,t){let[r,n,o]=lg(t),i;if(xC(e))i=()=>tg(e());else{let s=tg(e);i=()=>s}function a(s=i(),u){let c=[r[u.type],...n.filter(({matcher:g})=>g(u)).map(({reducer:g})=>g)];return c.filter(g=>!!g).length===0&&(c=[o]),c.reduce((g,v)=>{if(v)if(mt(g)){let h=v(g,u);return h===void 0?g:h}else{if(lt(g))return cn(g,R=>v(R,u));{let R=v(g,u);if(R===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}}return g},s)}return a.getInitialState=i,a}var dg=(e,t)=>yC(e)?e.match(t):e(t);function Kt(...e){return t=>e.some(r=>dg(r,t))}function oo(...e){return t=>e.every(r=>dg(r,t))}function ls(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 Fi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ds(...e){return e.length===0?t=>ls(t,["pending"]):Fi(e)?Kt(...e.map(t=>t.pending)):ds()(e[0])}function ln(...e){return e.length===0?t=>ls(t,["rejected"]):Fi(e)?Kt(...e.map(t=>t.rejected)):ln()(e[0])}function Di(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?oo(ln(...e),t):Fi(e)?oo(ln(...e),t):Di()(e[0])}function lr(...e){return e.length===0?t=>ls(t,["fulfilled"]):Fi(e)?Kt(...e.map(t=>t.fulfilled)):lr()(e[0])}function ps(...e){return e.length===0?t=>ls(t,["pending","fulfilled","rejected"]):Fi(e)?Kt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ps()(e[0])}var CC="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Mi=(e=21)=>{let t="",r=e;for(;r--;)t+=CC[Math.random()*64|0];return t},EC=["name","message","stack","code"],pd=class{constructor(e,t){ue(this,"payload");ue(this,"meta");ue(this,"_type");this.payload=e,this.meta=t}},ng=class{constructor(e,t){ue(this,"payload");ue(this,"meta");ue(this,"_type");this.payload=e,this.meta=t}},RC=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of EC)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},og="External signal was aborted",ke=(()=>{function e(t,r,n){let o=L(t+"/fulfilled",(u,c,g,v)=>({payload:u,meta:{...v||{},arg:g,requestId:c,requestStatus:"fulfilled"}})),i=L(t+"/pending",(u,c,g)=>({payload:void 0,meta:{...g||{},arg:c,requestId:u,requestStatus:"pending"}})),a=L(t+"/rejected",(u,c,g,v,R)=>({payload:v,error:(n&&n.serializeError||RC)(u||"Rejected"),meta:{...R||{},arg:g,requestId:c,rejectedWithValue:!!v,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"}}));function s(u,{signal:c}={}){return(g,v,R)=>{let h=n?.idGenerator?n.idGenerator(u):Mi(),y=new l.AbortController,b,x;function I(T){x=T,y.abort()}c&&(c.aborted?I(og):c.addEventListener("abort",()=>I(og),{once:!0}));let _=(async function(){let T;try{let A=n?.condition?.(u,{getState:v,extra:R});if(TC(A)&&(A=await A),A===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let O=new Promise((k,N)=>{b=()=>{N({name:"AbortError",message:x||"Aborted"})},y.signal.addEventListener("abort",b,{once:!0})});g(i(h,u,n?.getPendingMeta?.({requestId:h,arg:u},{getState:v,extra:R}))),T=await Promise.race([O,Promise.resolve(r(u,{dispatch:g,getState:v,extra:R,requestId:h,signal:y.signal,abort:I,rejectWithValue:((k,N)=>new pd(k,N)),fulfillWithValue:((k,N)=>new ng(k,N))})).then(k=>{if(k instanceof pd)throw k;return k instanceof ng?o(k.payload,h,u,k.meta):o(k,h,u)})])}catch(A){T=A instanceof pd?a(null,h,u,A.payload,A.meta):a(A,h,u)}finally{b&&y.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&a.match(T)&&T.meta.condition||g(T),T})();return Object.assign(_,{abort:I,requestId:h,arg:u,unwrap(){return _.then(IC)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Kt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function IC(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function TC(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pg=Symbol.for("rtk-slice-createasyncthunk"),sq={[pg]:ke};function _C(e,t){return`${e}/${t}`}function kC({creators:e}={}){let t=e?.asyncThunk?.[pg];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(gt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(PC()):n.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(T,P){let A=typeof T=="string"?T:T.type;if(!A)throw new Error(gt(12));if(A in u.sliceCaseReducersByType)throw new Error(gt(13));return u.sliceCaseReducersByType[A]=P,c},addMatcher(T,P){return u.sliceMatchers.push({matcher:T,reducer:P}),c},exposeAction(T,P){return u.actionCreators[T]=P,c},exposeCaseReducer(T,P){return u.sliceCaseReducersByName[T]=P,c}};s.forEach(T=>{let P=a[T],A={reducerName:T,type:_C(o,T),createNotation:typeof n.reducers=="function"};FC(P)?MC(A,P,c,t):NC(A,P,c)});function g(){let[T={},P=[],A=void 0]=typeof n.extraReducers=="function"?lg(n.extraReducers):[n.extraReducers],O={...T,...u.sliceCaseReducersByType};return Be(n.initialState,k=>{for(let N in O)k.addCase(N,O[N]);for(let N of u.sliceMatchers)k.addMatcher(N.matcher,N.reducer);for(let N of P)k.addMatcher(N.matcher,N.reducer);A&&k.addDefaultCase(A)})}let v=T=>T,R=new Map,h=new WeakMap,y;function b(T,P){return y||(y=g()),y(T,P)}function x(){return y||(y=g()),y.getInitialState()}function I(T,P=!1){function A(k){let N=k[T];return typeof N>"u"&&P&&(N=as(h,A,x)),N}function O(k=v){let N=as(R,P,()=>new WeakMap);return as(N,k,()=>{let M={};for(let[V,j]of Object.entries(n.selectors??{}))M[V]=OC(j,k,()=>as(h,k,x),P);return M})}return{reducerPath:T,getSelectors:O,get selectors(){return O(A)},selectSlice:A}}let _={name:o,reducer:b,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:x,...I(i),injectInto(T,{reducerPath:P,...A}={}){let O=P??i;return T.inject({reducerPath:O,reducer:b},A),{..._,...I(O,!0)}}};return _}}function OC(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 dn=kC();function PC(){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 NC({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!DC(n))throw new Error(gt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?L(e,a):L(e))}function FC(e){return e._reducerDefinitionType==="asyncThunk"}function DC(e){return e._reducerDefinitionType==="reducerWithPrepare"}function MC({type:e,reducerName:t},r,n,o){if(!o)throw new Error(gt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:u,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),u&&n.addCase(v.rejected,u),c&&n.addMatcher(v.settled,c),n.exposeCaseReducer(t,{fulfilled:a||ss,pending:s||ss,rejected:u||ss,settled:c||ss})}function ss(){}var LC="task",fg="listener",mg="completed",gd="cancelled",qC=`task-${gd}`,jC=`task-${mg}`,fd=`${fg}-${gd}`,UC=`${fg}-${mg}`,fs=class{constructor(e){ue(this,"code");ue(this,"name","TaskAbortError");ue(this,"message");this.code=e,this.message=`${LC} ${gd} (reason: ${e})`}},hd=(e,t)=>{if(typeof e!="function")throw new TypeError(gt(32))},cs=()=>{},gg=(e,t=cs)=>(e.catch(t),e),hg=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),un=e=>{if(e.aborted)throw new fs(e.reason)};function yg(e,t){let r=cs;return new Promise((n,o)=>{let i=()=>o(new fs(e.reason));if(e.aborted){i();return}r=hg(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=cs})}var VC=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof fs?"cancelled":"rejected",error:r}}finally{t?.()}},us=e=>t=>gg(yg(e,t).then(r=>(un(e),r))),vg=e=>{let t=us(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:no}=Object,ig={},ms="listenerMiddleware",GC=(e,t)=>{let r=n=>hg(e,()=>n.abort(e.reason));return(n,o)=>{hd(n,"taskExecutor");let i=new l.AbortController;r(i);let a=VC(async()=>{un(e),un(i.signal);let s=await n({pause:us(i.signal),delay:vg(i.signal),signal:i.signal});return un(i.signal),s},()=>i.abort(jC));return o?.autoJoin&&t.push(a.catch(cs)),{result:us(e)(a),cancel(){i.abort(qC)}}}},BC=(e,t)=>{let r=async(n,o)=>{un(t);let i=()=>{},s=[new Promise((u,c)=>{let g=e({predicate:n,effect:(v,R)=>{R.unsubscribe(),u([v,R.getState(),R.getOriginalState()])}});i=()=>{g(),c()}})];o!=null&&s.push(new Promise(u=>setTimeout(u,o,null)));try{let u=await yg(t,Promise.race(s));return un(t),u}finally{i()}};return((n,o)=>gg(r(n,o)))},Sg=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=L(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(gt(21));return hd(i,"options.listener"),{predicate:o,type:t,effect:i}},bg=no(e=>{let{type:t,predicate:r,effect:n}=Sg(e);return{id:Mi(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(gt(22))}}},{withTypes:()=>bg}),ag=(e,t)=>{let{type:r,effect:n,predicate:o}=Sg(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},md=e=>{e.pending.forEach(t=>{t.abort(fd)})},$C=(e,t)=>()=>{for(let r of t.keys())md(r);e.clear()},sg=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Ag=no(L(`${ms}/add`),{withTypes:()=>Ag}),QC=L(`${ms}/removeAll`),wg=no(L(`${ms}/remove`),{withTypes:()=>wg}),HC=(...e)=>{console.error(`${ms}/error`,...e)},xg=(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=HC}=e;hd(a,"onError");let s=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&md(h)}),u=(h=>{let y=ag(t,h)??bg(h);return s(y)});no(u,{withTypes:()=>u});let c=h=>{let y=ag(t,h);return y&&(y.unsubscribe(),h.cancelActive&&md(y)),!!y};no(c,{withTypes:()=>c});let g=async(h,y,b,x)=>{let I=new l.AbortController,_=BC(u,I.signal),T=[];try{h.pending.add(I),n(h),await Promise.resolve(h.effect(y,no({},b,{getOriginalState:x,condition:(P,A)=>_(P,A).then(Boolean),take:_,delay:vg(I.signal),pause:us(I.signal),extra:i,signal:I.signal,fork:GC(I.signal,T),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((P,A,O)=>{P!==I&&(P.abort(fd),O.delete(P))})},cancel:()=>{I.abort(fd),h.pending.delete(I)},throwIfCancelled:()=>{un(I.signal)}})))}catch(P){P instanceof fs||sg(a,P,{raisedBy:"effect"})}finally{await Promise.all(T),I.abort(UC),o(h),h.pending.delete(I)}},v=$C(t,r);return{middleware:h=>y=>b=>{if(!Si(b))return y(b);if(Ag.match(b))return u(b.payload);if(QC.match(b)){v();return}if(wg.match(b))return c(b.payload);let x=h.getState(),I=()=>{if(x===ig)throw new Error(gt(23));return x},_;try{if(_=y(b),t.size>0){let T=h.getState(),P=Array.from(t.values());for(let A of P){let O=!1;try{O=A.predicate(b,T,x)}catch(k){O=!1,sg(a,k,{raisedBy:"predicate"})}O&&g(A,b,h,I)}}}finally{x=ig}return _},startListening:u,stopListening:c,clearListeners:v}};function gt(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 Y=new z({required:!0,emptyAllowed:!1}),rt=new z({required:!1,emptyAllowed:!1}),nt=new z({required:!0,emptyAllowed:!0}),Sq=new z({required:!1,emptyAllowed:!0}),gs=new Ae({each:Y,required:!0}),Cg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Eg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),bq=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),dr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),kt=(e,t)=>{if("required"in t)return{payload:new yt({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new fi(o);return{payload:e}},B=(e,t)=>{try{return kt(e,t)}catch(r){return{payload:e,error:dr(r)}}},Rg=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Tg(e,t,r,o,"Controller initialization error")},Ig=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Tg(e,t,r,o,"Controller initialization error")},Tg=(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 ao="3.57.1",_g=["@coveo/atomic","@coveo/quantic"];var yd=()=>rt,kg=()=>Y,Ir=L("configuration/updateBasicConfiguration",e=>B(e,{accessToken:rt,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:rt})),Yt=L("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:rt,timezone:rt,locale:rt,authenticationProviders:new Ae({required:!1,each:Y})})),zC={enabled:new me({default:!0}),originContext:yd(),originLevel2:yd(),originLevel3:yd(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new qe,anonymous:new me({default:!1}),deviceId:rt,userDisplayName:rt,documentLocation:rt,trackingId:Eg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:_g.reduce((e,t)=>(e[t]=Cg,e),{})})},so=L("configuration/updateAnalyticsConfiguration",e=>B(e,zC)),co=L("configuration/analytics/disable"),uo=L("configuration/analytics/enable"),hs=L("configuration/analytics/originlevel2",e=>B(e,{originLevel2:kg()})),ys=L("configuration/analytics/originlevel3",e=>B(e,{originLevel3:kg()})),Og=L("knowledge/setAgentId",e=>B(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var Pg={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 Tr=L("searchParameters/restore",e=>B(e,Pg)),Ng=L("searchParameters/restoreTab",e=>B(e,Y));m();d();f();p();var vs=L("debug/enable"),Ss=L("debug/disable");m();d();f();p();var bs=()=>!1;var As=Be(bs(),e=>{e.addCase(vs,()=>!0).addCase(Ss,()=>!1).addCase(Tr,(t,r)=>r.payload.debug??t)});m();d();f();p();var lo=L("pipeline/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var WC=L("history/undo"),KC=L("history/redo"),Xt=L("history/snapshot"),_j=ke("history/back",async(e,{dispatch:t})=>{t(WC()),await t(St())}),kj=ke("history/forward",async(e,{dispatch:t})=>{t(KC()),await t(St())}),St=ke("history/change",async(e,{getState:t})=>t().history.present);m();d();f();p();var _r=()=>"";var po=Be(_r(),e=>{e.addCase(lo,(t,r)=>r.payload).addCase(St.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Yt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var ws=L("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function YC(){return typeof navigator<"u"}function Fg(){try{return typeof localStorage<"u"}catch{return!1}}function Dg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Mg(){return YC()&&navigator.cookieEnabled}m();d();f();p();var fo=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?Lg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Lg(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 Lg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function qg(){return Fg()?localStorage:Mg()?new xs:Dg()?sessionStorage:new vd}var xs=class e{getItem(t){return fo.get(`${e.prefix}${t}`)}removeItem(t){fo.erase(`${e.prefix}${t}`)}setItem(t,r,n){fo.set(`${e.prefix}${t}`,r,n)}};xs.prefix="coveo_";var vd=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Cs="__coveo.analytics.history",XC=20,ZC=1e3*60,JC=75,Es=class{constructor(t){this.store=t||qg()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}async addElementAsync(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=await this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}async getHistoryAsync(){let t=await this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryWithInternalTime(){try{let t=this.store.getItem(Cs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}async getHistoryWithInternalTimeAsync(){try{let t=await this.store.getItem(Cs);return t?JSON.parse(t):[]}catch{return[]}}setHistory(t){try{this.store.setItem(Cs,JSON.stringify(t.slice(0,XC)))}catch{}}clear(){try{this.store.removeItem(Cs)}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,JC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>ZC:!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 pn=class pn extends Es{static getInstance(t){return pn.instance||(pn.instance=new pn(t)),pn.instance}constructor(t){super(t)}};ue(pn,"instance",null);var ht=pn;m();d();f();p();m();d();f();p();var mo=ze(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ao}`));m();d();f();p();m();d();f();p();function pr(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 G(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 u(g){try{c(n.throw(g))}catch(v){a(v)}}function c(g){g.done?i(g.value):o(g.value).then(s,u)}c((n=n.apply(e,t||[])).next())})}var Ce;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ce||(Ce={}));function Ad(){return typeof window<"u"}function Fd(){return typeof navigator<"u"}function go(){return typeof document<"u"}function wd(){try{return typeof localStorage<"u"}catch{return!1}}function eE(){try{return typeof sessionStorage<"u"}catch{return!1}}function Xg(){return Fd()&&navigator.cookieEnabled}var tE=[Ce.click,Ce.custom,Ce.search,Ce.view],rE=(e,t)=>tE.indexOf(e)!==-1?Object.assign({language:go()?document.documentElement.lang:"unknown",userAgent:Fd()?navigator.userAgent:"unknown"},t):t,qi=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?jg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],jg(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 jg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function nE(){return wd()?localStorage:Xg()?new ji:eE()?sessionStorage:new yo}var ji=class e{getItem(t){return qi.get(`${e.prefix}${t}`)}removeItem(t){qi.erase(`${e.prefix}${t}`)}setItem(t,r,n){qi.set(`${e.prefix}${t}`,r,n)}};ji.prefix="coveo_";var xd=class{constructor(){this.cookieStorage=new ji}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)}},yo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Rs="__coveo.analytics.history",oE=20,iE=1e3*60,aE=75,Ts=class{constructor(t){this.store=t||nE()}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 G(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 G(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Rs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return G(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Rs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Rs,JSON.stringify(t.slice(0,oE)))}catch{}}clear(){try{this.store.removeItem(Rs)}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,aE)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>iE:!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 sE=(e,t)=>G(void 0,void 0,void 0,function*(){return e===Ce.view?(yield cE(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),cE=e=>G(void 0,void 0,void 0,function*(){let t=new Ts,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),uE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function _s(e){return typeof e=="string"&&uE.test(e)}function Ug(e){if(!_s(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function Zg(e,t=0){return(ot[e[t+0]]+ot[e[t+1]]+ot[e[t+2]]+ot[e[t+3]]+"-"+ot[e[t+4]]+ot[e[t+5]]+"-"+ot[e[t+6]]+ot[e[t+7]]+"-"+ot[e[t+8]]+ot[e[t+9]]+"-"+ot[e[t+10]]+ot[e[t+11]]+ot[e[t+12]]+ot[e[t+13]]+ot[e[t+14]]+ot[e[t+15]]).toLowerCase()}var lE=new Uint8Array(16);function dE(){return crypto.getRandomValues(lE)}function pE(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}var fE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",mE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function gE(e,t,r,n,o,i){let a=typeof r=="string"?pE(r):r,s=typeof n=="string"?Ug(n):n;if(typeof n=="string"&&(n=Ug(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+a.length);return u.set(s),u.set(a,s.length),u=t(u),u[6]=u[6]&15|e,u[8]=u[8]&63|128,Zg(u)}function fn(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():hE(e,t,r)}function hE(e,t,r){e=e||{};let n=e.random??e.rng?.()??dE();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Zg(n)}function yE(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 Sd(e,t){return e<<t|e>>>32-t}function vE(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(e.length+1);n.set(e),n[e.length]=128,e=n;let o=e.length/4+2,i=Math.ceil(o/16),a=new Array(i);for(let s=0;s<i;++s){let u=new Uint32Array(16);for(let c=0;c<16;++c)u[c]=e[s*64+c*4]<<24|e[s*64+c*4+1]<<16|e[s*64+c*4+2]<<8|e[s*64+c*4+3];a[s]=u}a[i-1][14]=(e.length-1)*8/2**32,a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let u=new Uint32Array(80);for(let y=0;y<16;++y)u[y]=a[s][y];for(let y=16;y<80;++y)u[y]=Sd(u[y-3]^u[y-8]^u[y-14]^u[y-16],1);let c=r[0],g=r[1],v=r[2],R=r[3],h=r[4];for(let y=0;y<80;++y){let b=Math.floor(y/20),x=Sd(c,5)+yE(b,g,v,R)+h+t[b]+u[y]>>>0;h=R,R=v,v=Sd(g,30)>>>0,g=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+R>>>0,r[4]=r[4]+h>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}function ks(e,t,r,n){return gE(80,vE,e,t)}ks.DNS=fE;ks.URL=mE;var Jg="2.33.0",Vg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Li={pageview:"pageview",event:"event"},Os=class{constructor({client:t,uuidGenerator:r=fn}){this.client=t,this.uuidGenerator=r}},Cd=class extends Os{constructor({client:t,uuidGenerator:r=fn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Vg(window.location),this.lastReferrer=go()?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:go()?document.title:"",encoding:go()?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===Li.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Li.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Li.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Li.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 Vg(window.location)}},kr=class e{constructor(t,r){if(!_s(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 _s(i)?new e(i,Number.parseInt(o)*1e3):null}};kr.cvo_cid="cvo_cid";kr.expirationTime=120;var Ed=class extends Os{constructor({client:t,uuidGenerator:r=fn}){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 G(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(kr.cvo_cid,new kr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ed.Id="link";var Pt=Object.keys;function Is(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var bd=128,eh=192,Gg=224,Bg=240;function SE(e){return(e&248)===Bg?4:(e&Bg)===Gg?3:(e&Gg)===eh?2:1}function bE(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&bd)!=bd)break;if(r-=3,(n&eh)!=bd){t-r>=SE(n)*3&&(r=t);break}}return e.substring(0,r)}var Rd={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"},AE=Pt(Rd).map(e=>Rd[e]),wE=[...AE].join("|"),xE=new RegExp(`^(${wE}$)`),CE={svcAction:"svc_action",svcActionData:"svc_action_data"},EE=e=>Pt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Rd[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),RE=e=>xE.test(e),IE=[RE],$g={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Qg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},dt={action:"pa",list:"pal",listSource:"pls"},Ps={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},TE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Id={id:"quoteId",affiliation:"quoteAffiliation"},Td={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},_E={add:dt,bookmark_add:dt,bookmark_remove:dt,click:dt,checkout:dt,checkout_option:dt,detail:dt,impression:dt,remove:dt,refund:Object.assign(Object.assign({},dt),Ps),purchase:Object.assign(Object.assign({},dt),Ps),quickview:dt,quote:Object.assign(Object.assign({},dt),Id),review:Object.assign(Object.assign({},dt),Td)},kE=Pt($g).map(e=>$g[e]),OE=Pt(Qg).map(e=>Qg[e]),PE=Pt(dt).map(e=>dt[e]),NE=Pt(Ps).map(e=>Ps[e]),FE=Pt(Td).map(e=>Td[e]),DE=Pt(Id).map(e=>Id[e]),ME=[...kE,"custom"].join("|"),LE=[...OE,"custom"].join("|"),th="(pr[0-9]+)",rh="(il[0-9]+pi[0-9]+)",qE=new RegExp(`^${th}(${ME})$`),jE=new RegExp(`^(${rh}(${LE}))|(il[0-9]+nm)$`),UE=new RegExp(`^(${PE.join("|")})$`),VE=new RegExp(`^(${NE.join("|")})$`),GE=new RegExp(`^${th}custom$`),BE=new RegExp(`^${rh}custom$`),$E=new RegExp(`^(${[...TE,...FE,...DE].join("|")})$`),QE=e=>qE.test(e),HE=e=>jE.test(e),zE=e=>UE.test(e),WE=e=>VE.test(e),KE=e=>$E.test(e),YE=[HE,QE,zE,WE,KE],XE=[GE,BE],ZE={anonymizeIp:"aip"},JE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},eR={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},tR=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],rR=Object.assign(Object.assign(Object.assign(Object.assign({},ZE),JE),eR),tR.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),_d=Object.assign(Object.assign({},rR),CE),nR=e=>{let t=!!e.action&&_E[e.action]||{};return Pt(e).reduce((r,n)=>{let o=t[n]||_d[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},oR=Pt(_d).map(e=>_d[e]),iR=e=>oR.indexOf(e)!==-1,aR=e=>e==="custom",sR=e=>[...YE,...IE,iR,aR].some(t=>t(e)),cR=e=>Pt(e).reduce((t,r)=>{let n=uR(r);return n?Object.assign(Object.assign({},t),lR(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),uR=e=>{let t;return[...XE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},lR=(e,t)=>Pt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),kd=class{constructor(t){this.opts=t}sendEvent(t,r){return G(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),u=this.encodeForEventType(t,s),c=new Blob([u],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,c)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return G(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:u}=a;o=s||t;try{i=JSON.parse(u)}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 G(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[Ce.click,Ce.custom,Ce.search,Ce.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}},Od=class{sendEvent(t,r){return G(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){return Promise.resolve()})}},Hg=w.fetch,Ns=class{constructor(t){this.opts=t}sendEvent(t,r){return G(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)},u=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:c}=u,g=pr(u,["url"]),v;try{v=yield Hg(c,g)}catch(R){console.error("An error has occurred when sending the event.",R);return}if(v.ok){let R=yield v.json();return R.visitorId&&o.setCurrentVisitorId(R.visitorId),R}else{try{v.json()}catch{}throw console.error(`An error has occurred 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 G(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Hg(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}getVisitorIdParam(){return G(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"})}},Pd=class{constructor(t,r){wd()&&Xg()?this.storage=new xd:wd()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new yo),this.client=new Ns(t),this.beaconClient=new kd(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}},Nd=class{constructor(t,r){this.storage=r||new yo,this.client=new Ns(t)}getClientDependingOnEventType(t){return this.client}},Fs=class{constructor(){this.storage=new yo,this.client=new Od}getClientDependingOnEventType(t){return this.client}},dR="xx",pR=e=>e?.startsWith(dR)||!1,fR=`
|
|
29
29
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
30
30
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
31
31
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/headless",
|
|
3
|
-
"version": "3.57.
|
|
3
|
+
"version": "3.57.1",
|
|
4
4
|
"description": "A headless library for building search experiences on the Coveo platform",
|
|
5
5
|
"homepage": "https://docs.coveo.com/en/headless/latest/",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@ag-ui/client": "0.0.59",
|
|
78
78
|
"@coveo/bueno": "1.1.9",
|
|
79
79
|
"@coveo/relay": "2.1.3",
|
|
80
|
-
"@coveo/relay-event-types": "20.
|
|
80
|
+
"@coveo/relay-event-types": "20.7.1",
|
|
81
81
|
"@reduxjs/toolkit": "2.12.0",
|
|
82
82
|
"abortcontroller-polyfill": "1.7.8",
|
|
83
83
|
"coveo.analytics": "2.33.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@coveo/documentation": "1.0.0",
|
|
95
95
|
"esbuild-plugin-alias": "0.2.1",
|
|
96
96
|
"esbuild-plugin-umd-wrapper": "3.0.0",
|
|
97
|
-
"jsdom": "30.
|
|
97
|
+
"jsdom": "30.1.1",
|
|
98
98
|
"live-server": "1.2.2",
|
|
99
99
|
"node-fetch": "3.3.2",
|
|
100
100
|
"publint": "0.3.24",
|