@coveo/quantic 3.14.0 → 3.14.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.
Files changed (25) hide show
  1. package/docs/out/quantic-docs.json +9 -0
  2. package/force-app/main/default/lwc/quanticFeedbackModal/success.html +1 -1
  3. package/force-app/main/default/lwc/quanticFeedbackModalQna/templates/success.html +1 -1
  4. package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.js +1 -1
  5. package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -16
  6. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +8 -0
  7. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +51 -1
  8. package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +218 -37
  9. package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +61 -0
  10. package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +89 -0
  11. package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +91 -0
  12. package/force-app/main/default/lwc/quanticSort/quanticSort.js +7 -4
  13. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +1 -1
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/generator/headless-commerce-facet-generator.ssr.d.ts +2 -2
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/location/headless-commerce-location-facet.d.ts +11 -0
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/regular/headless-commerce-regular-facet.d.ts +8 -0
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/pagination/headless-core-commerce-pagination.d.ts +3 -0
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/pagination/headless-core-commerce-pagination.ssr.d.ts +2 -2
  19. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +2 -2
  20. package/force-app/main/default/staticresources/coveoheadless/definitions/tsdoc-metadata.json +1 -1
  21. package/force-app/main/default/staticresources/coveoheadless/headless.js +1 -1
  22. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +1 -1
  23. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +1 -1
  24. package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
  25. package/package.json +8 -8
@@ -24,7 +24,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24
24
 
25
25
  ${t}
26
26
  `;return new cs(r)}var cs=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ce=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw Iv(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}},Ae=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ne(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Ge(e){return e===void 0}function Tv(e){return e===null}function ne(e){return Ge(e)||Tv(e)}var z=class{constructor(e={}){ye(this,"value");this.config=e,this.value=new Ae(e)}validate(e){let t=this.value.validate(e);return t||(Ov(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 Ov(e){return Ge(e)||aS(e)}function aS(e){return typeof e=="number"&&!isNaN(e)}var re=class{constructor(e={}){ye(this,"value");this.value=new Ae(e)}validate(e){let t=this.value.validate(e);return t||(kv(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function kv(e){return Ge(e)||Nc(e)}function Nc(e){return typeof e=="boolean"}var qv=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,k=class{constructor(e={}){ye(this,"value");ye(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Ae(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,d=this.value.validate(e);if(d)return d;if(Ge(e))return null;if(!Qo(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(", ")}.`:a&&!(qv.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 Qo(e){return Object.prototype.toString.call(e)==="[object String]"}var Q=class{constructor(e={}){ye(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Ge(e))return this.config.options.required?"value is required and is currently undefined":null;if(!iS(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ne(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=" "+a)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function iS(e){return e!==void 0&&typeof e=="object"}var X=class{constructor(e={}){ye(this,"value");this.config=e,this.value=new Ae(this.config)}validate(e){if(!ne(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ne(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&&ne(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 Nc(e)||Qo(e)||aS(e)||iS(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Bo(e){return Array.isArray(e)}var Lt=class{constructor(e){ye(this,"value");this.config=e,this.value=new Ae(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Ge(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};l();s();u();c();var nn=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Mc(e){return Array.isArray(e)}function Lc(e){return e.trim()===""}function sS(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function Dv(e){return btoa(encodeURI(e))}function Qc(e,t){let{[e]:r,...n}=t;return n}function Uo(e){return Dv(JSON.stringify(e))}var Vv=new Set(["1",1,"yes",!0]);function cS(){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=>Vv.has(r))}function uS(e){let t={};for(let[r,n]of e)t[r]=n;return t}function lS(e,t,r){return clearTimeout(t),setTimeout(e,r)}function us(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Nv(e){if(Lc(e.openingDelimiter)||Lc(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ne(e.content)||Lc(e.content))return e.content;if(e.highlights.length===0)return _o(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],d=a.offset,p=d+a.length;if(p>t)break;r+=_o(e.content.slice(n,d)),r+=e.openingDelimiter,r+=_o(e.content.slice(d,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=_o(e.content.slice(n))),r}function Hp(e,t){return e=_o(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Gp(n,t.notMatchDelimiters):o?Gp(o,t.exactMatchDelimiters):a?Gp(a,t.correctionDelimiters):r)}function Gp(e,t){return t?t.open+e+t.close:e}function _o(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();function pS(_x2,_x3){return _pS.apply(this,arguments)}function _pS(){_pS=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _pS.apply(this,arguments)}function mS(e){let t,r,n,o=!1;return function(d){t===void 0?(t=d,r=0,n=-1):t=Mv(t,d);let p=t.length,m=0;for(;r<p;){o&&(t[r]===10&&(m=++r),o=!1);let f=-1;for(;r<p&&f===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0;case 10:f=r;break}if(f===-1)break;e(t.subarray(m,f),n),m=r,n=-1}m===p?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function fS(e,t,r){let n=dS(),o=new TextDecoder;return function(d,p){if(d.length===0)r?.(n),n=dS();else if(p>0){let m=o.decode(d.subarray(0,p)),f=p+(d[p+1]===32?2:1),g=o.decode(d.subarray(f));switch(m){case"data":n.data=n.data?n.data+`
27
- `+g:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":let x=parseInt(g,10);isNaN(x)||t(n.retry=x);break}}}}function Mv(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function dS(){return{data:"",event:"",id:"",retry:void 0}}var Lv=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var 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},Bc="text/event-stream",Qv=1e3,gS="last-event-id";function SS(){typeof window<"u"}function ls(e,t){var{signal:r,headers:n,onopen:o,onmessage:a,onclose:d,onerror:p,openWhenHidden:m,fetch:f}=t,g=Lv(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((x,C)=>{let A=Object.assign({},n);A.accept||(A.accept=Bc);let F;function v(){F?.abort(),document.hidden||L()}!m&&SS()&&document.addEventListener("visibilitychange",v);let b=Qv,P=0;function R(){SS()&&document.removeEventListener("visibilitychange",v),clearTimeout(P),F?.abort()}r?.addEventListener("abort",()=>{R(),x()});let E=f??E,O=o??Bv;function L(){return _L.apply(this,arguments)}function _L(){_L=_asyncToGenerator(function*(){var q;F=typeof i.AbortController>"u"?null:new i.AbortController;try{let T=yield E(e,Object.assign(Object.assign({},g),{headers:A,signal:F?.signal}));yield O(T),yield pS(T.body,mS(fS(N=>{N?A[gS]=N:delete A[gS]},N=>{b=N},a))),d?.(),R(),x()}catch(T){if(!F?.signal.aborted)try{let N=(q=p?.(T))!==null&&q!==void 0?q:b;clearTimeout(P),P=setTimeout(L,N)}catch(N){R(),C(N)}}});return _L.apply(this,arguments)}L()})}function Bv(e){let t=e.headers.get("content-type");if(!t?.startsWith(Bc))throw new Error(`Expected content-type to be ${Bc}, Actual: ${t}`)}l();s();u();c();var on=class{constructor(t){ye(this,"_basePath");ye(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}};var Uv=(e,t,r)=>new on(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,hS=3,_v=5e3,jv="text/event-stream",Yp=1,zp=class extends Error{},ds=class extends Error{constructor(r){super(r.message);this.payload=r}},Kp=class{constructor(){ye(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Uc=class{constructor(t){ye(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:g}=r,x=new Kp;if(!a){this.logger.error("No stream ID found");return}let C=0,A,F=()=>{A&&!x.isActive(A)&&(b?.abort(),g(),P())},v=()=>{x.remove(A),A=lS(F,A,_v),x.add(A)},b=new i.AbortController,P=()=>ls(Uv(n,o,a),{method:"GET",fetch:h,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:b?.signal,onopen(R){return _asyncToGenerator(function*(){if(R.ok&&R.headers.get("content-type")===jv)return;throw R.status>=400&&R.status<500&&R.status!==429?new ds({message:"Error opening stream",code:R.status}):new zp})()},onmessage:R=>{if(b?.signal.aborted)return;let E=JSON.parse(R.data);if(E.finishReason==="ERROR"){x.remove(A),b?.abort(),m({message:E.errorMessage,code:E.statusCode});return}p(E),C=0,E.finishReason==="COMPLETED"?(x.remove(A),f()):v()},onerror:R=>{if(!b?.signal.aborted){if(x.remove(A),R instanceof ds)throw b?.abort(),m(R),R;if(++C>hS){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:Yp};throw b?.abort(),m(E),new ds(E)}this.logger.info(`Retrying...(${C}/${hS})`),g()}}});return P(),b}};l();s();u();c();var IS=xt(vS(),1);l();s();u();c();l();s();u();c();var gP="recommendation-internal-options",n0=Symbol.for(gP);var H=new Error("Failed to load reducers."),jo=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var oo=class extends Error{constructor(r,n){super();ye(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};l();s();u();c();function PS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function wS(e){return typeof e!="object"||!e?!1:Object.values(e).every(SP)}function SP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ES(e){return e===429}var At=class e{static call(t){return _asyncToGenerator(function*(){let r=hP(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...d}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield h(a,d);if(ES(m.status))throw m;return m});return function p(){return _ref.apply(this,arguments)}}();try{let m=yield(0,IS.backOff)(p,{retry:f=>{let g=f&&ES(f.status);return g&&n.info("Platform retrying request"),g}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new jo;case 404:throw new oo(a,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new oo(a):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:d}=r,{signal:p,...m}=t,f=us(m);try{let g=yield o(t,n,d);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return f})()}};function He(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ke(e,t="prod"){return`${He(e,t)}/rest/search/v2`}function jc(e,t="prod"){return`${He(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function hP(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=yP(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:m}),signal:d}}function yP(e,t){return t==="application/x-www-form-urlencoded"?wS(e)?PS(e):"":JSON.stringify(e)}l();s();u();c();var $c=e=>e;l();s();u();c();var TS=e=>e,OS=e=>e,kS=e=>e;l();s();u();c();l();s();u();c();function $o(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function pt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:$o(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:$o(),extendedResults:{}}}l();s();u();c();function an(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var sn=e=>{let{response:t}=e;return t.body?CP(e):xP(t)},CP=e=>FP(e)?RP(e):AP(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},xP=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function AP(e){return e.body.statusCode!==void 0}function FP(e){return e.body.exception!==void 0}var RP=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();var cn=class{constructor(){ye(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new i.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};l();s();u();c();l();s();u();c();function qS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var Lr=(e,t,r,n)=>{let o=new on(`${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 DS=(e,t)=>{let r=new on(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},VS=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield At.call({...Lr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:an(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=qS(r),o=yield r.arrayBuffer(),d=new TextDecoder(n).decode(o);return bP(d)?{success:d}:{error:sn({response:r,body:d})}});return function VS(_x4,_x5){return _ref2.apply(this,arguments)}}();function bP(e){return typeof e=="string"}l();s();u();c();function vP(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function PP(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function fs(e,t){if(t&&e.name==="AbortError")return{error:PP(e)};if(e instanceof oo)return{error:vP(e)};throw e}var Gc=class{constructor(t){this.options=t;ye(this,"apiCallsQueues",{unknown:new cn,mainSearch:new cn,facetValues:new cn,foldingCollection:new cn,instantResults:new cn})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json","/plan"),requestParams:an(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return fs(r);let n=yield r.json();return EP(n)?{success:n}:{error:sn({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:an(t),..._this3.options});if(r instanceof Error)return fs(r);let n=yield r.json(),o={response:r,body:n};return wP(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:sn(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>At.call({...Lr(t,"POST","application/json",""),requestParams:an(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return fs(o,r?.disableAbortWarning);let a=yield o.json(),d={response:o,body:a};return NS(a)?(d.body=MS(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(d)).body}):{error:sn(d)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json","/facet"),requestParams:an(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json",""),requestParams:an(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(NS(n)){let o={response:r,body:n};return o.body=MS(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:sn({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return VS(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return IP(n)?{success:n}:{error:sn({response:r,body:n})}})()}},Hc=e=>e.success!==void 0,Le=e=>e.error!==void 0;function NS(e){return e.results!==void 0}function MS(e){let t=$o();return ne(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function wP(e){return e.completions!==void 0}function EP(e){return e.preprocessingOutput!==void 0}function IP(e){return e.fields!==void 0}l();s();u();c();l();s();u();c();var $=new k({required:!0,emptyAllowed:!1}),ve=new k({required:!1,emptyAllowed:!1}),Ce=new k({required:!0,emptyAllowed:!0}),LS=new k({required:!1,emptyAllowed:!0}),Wc=new X({each:$,required:!0}),QS=new k({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Qr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ft=(e,t)=>{if("required"in t)return{payload:new ce({value:t}).validate({value:e}).value};let o=new Q({options:{required:!0},values:t}).validate(e);if(o)throw new cs(o);return{payload:e}},I=(e,t)=>{try{return Ft(e,t)}catch(r){return{payload:e,error:Qr(r)}}},qe=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return BS(e,t,r,o,"Controller initialization error")},Re=(e,t,r,n)=>{let o=`Check the options of ${n}`;return BS(e,t,r,o,"Controller initialization error")},BS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};l();s();u();c();l();s();u();c();l();s();u();c();function We(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 TP=typeof Symbol=="function"&&Symbol.observable||"@@observable",US=TP,am=()=>Math.random().toString(36).substring(7).split("").join("."),OP={INIT:`@@redux/INIT${am()}`,REPLACE:`@@redux/REPLACE${am()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${am()}`},zc=OP;function Yt(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 im(e,t,r){if(typeof e!="function")throw new Error(We(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(We(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(We(1));return r(im)(e,t)}let n=e,o=t,a=new Map,d=a,p=0,m=!1;function f(){d===a&&(d=new Map,a.forEach((b,P)=>{d.set(P,b)}))}function g(){if(m)throw new Error(We(3));return o}function x(b){if(typeof b!="function")throw new Error(We(4));if(m)throw new Error(We(5));let P=!0;f();let R=p++;return d.set(R,b),function(){if(P){if(m)throw new Error(We(6));P=!1,f(),d.delete(R),a=null}}}function C(b){if(!Yt(b))throw new Error(We(7));if(typeof b.type>"u")throw new Error(We(8));if(typeof b.type!="string")throw new Error(We(17));if(m)throw new Error(We(9));try{m=!0,o=n(o,b)}finally{m=!1}return(a=d).forEach(R=>{R()}),b}function A(b){if(typeof b!="function")throw new Error(We(10));n=b,C({type:zc.REPLACE})}function F(){let b=x;return{subscribe(P){if(typeof P!="object"||P===null)throw new Error(We(11));function R(){let O=P;O.next&&O.next(g())}return R(),{unsubscribe:b(R)}},[US](){return this}}}return C({type:zc.INIT}),{dispatch:C,subscribe:x,getState:g,replaceReducer:A,[US]:F}}function kP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:zc.INIT})>"u")throw new Error(We(12));if(typeof r(void 0,{type:zc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(We(13))})}function Go(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{kP(r)}catch(d){a=d}return function(p={},m){if(a)throw a;let f=!1,g={};for(let x=0;x<n.length;x++){let C=n[x],A=r[C],F=p[C],v=A(F,m);if(typeof v>"u"){let b=m&&m.type;throw new Error(We(14))}g[C]=v,f=f||v!==F}return f=f||n.length!==Object.keys(p).length,f?g:p}}function Ho(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function _S(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(We(15))},d={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(d));return a=Ho(...p)(o.dispatch),{...o,dispatch:a}}}function Kc(e){return Yt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var Sm=Symbol.for("immer-nothing"),gs=Symbol.for("immer-draftable"),ot=Symbol.for("immer-state");function ze(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var io=Object.getPrototypeOf;function mt(e){return!!e&&!!e[ot]}function at(e){return e?WS(e)||Array.isArray(e)||!!e[gs]||!!e.constructor?.[gs]||xs(e)||As(e):!1}var qP=Object.prototype.constructor.toString();function WS(e){if(!e||typeof e!="object")return!1;let t=io(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===qP}function hm(e){return mt(e)||ze(15,e),e[ot].base_}function Ss(e,t){so(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function so(e){let t=e[ot];return t?t.type_:Array.isArray(e)?1:xs(e)?2:As(e)?3:0}function hs(e,t){return so(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sm(e,t){return so(e)===2?e.get(t):e[t]}function zS(e,t,r){let n=so(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function DP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xs(e){return e instanceof Map}function As(e){return e instanceof Set}function ao(e){return e.copy_||e.base_}function lm(e,t){if(xs(e))return new Map(e);if(As(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=WS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ot];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let d=o[a],p=n[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[d]})}return Object.create(io(e),n)}else{let n=io(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Xc(e,t=!1){return Zc(e)||mt(e)||!at(e)||(so(e)>1&&(e.set=e.add=e.clear=e.delete=VP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Xc(n,!0))),e}function VP(){ze(2)}function Zc(e){return Object.isFrozen(e)}var dm={};function co(e){let t=dm[e];return t||ze(0,e),t}function NP(e,t){dm[e]||(dm[e]=t)}var ys;function KS(){return ys}function MP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function jS(e,t){t&&(co("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function pm(e){mm(e),e.drafts_.forEach(LP),e.drafts_=null}function mm(e){e===ys&&(ys=e.parent_)}function $S(e){return ys=MP(ys,e)}function LP(e){let t=e[ot];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function GS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ot].modified_&&(pm(t),ze(4)),at(e)&&(e=Yc(t,e),t.parent_||Jc(t,e)),t.patches_&&co("Patches").generateReplacementPatches_(r[ot].base_,e,t.patches_,t.inversePatches_)):e=Yc(t,r,[]),pm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Sm?e:void 0}function Yc(e,t,r){if(Zc(t))return t;let n=t[ot];if(!n)return Ss(t,(o,a)=>HS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Jc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,d=!1;n.type_===3&&(a=new Set(o),o.clear(),d=!0),Ss(a,(p,m)=>HS(e,n,o,p,m,r,d)),Jc(e,o,!1),r&&e.patches_&&co("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function HS(e,t,r,n,o,a,d){if(mt(o)){let p=a&&t&&t.type_!==3&&!hs(t.assigned_,n)?a.concat(n):void 0,m=Yc(e,o,p);if(zS(r,n,m),mt(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(at(o)&&!Zc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Yc(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Jc(e,o)}}function Jc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xc(t,r)}function QP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:KS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=ym;r&&(o=[n],a=Cs);let{revoke:d,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=d,p}var ym={get(e,t){if(t===ot)return e;let r=ao(e);if(!hs(r,t))return BP(e,r,t);let n=r[t];return e.finalized_||!at(n)?n:n===cm(e.base_,t)?(um(e),e.copy_[t]=gm(n,e)):n},has(e,t){return t in ao(e)},ownKeys(e){return Reflect.ownKeys(ao(e))},set(e,t,r){let n=YS(ao(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=cm(ao(e),t),a=o?.[ot];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(DP(r,o)&&(r!==void 0||hs(e.base_,t)))return!0;um(e),fm(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,um(e),fm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ao(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ze(11)},getPrototypeOf(e){return io(e.base_)},setPrototypeOf(){ze(12)}},Cs={};Ss(ym,(e,t)=>{Cs[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Cs.deleteProperty=function(e,t){return Cs.set.call(this,e,t,void 0)};Cs.set=function(e,t,r){return ym.set.call(this,e[0],t,r,e[0])};function cm(e,t){let r=e[ot];return(r?ao(r):e)[t]}function BP(e,t,r){let n=YS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function YS(e,t){if(!(t in e))return;let r=io(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=io(r)}}function fm(e){e.modified_||(e.modified_=!0,e.parent_&&fm(e.parent_))}function um(e){e.copy_||(e.copy_=lm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var UP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let d=this;return function(m=a,...f){return d.produce(m,g=>r.call(this,g,...f))}}typeof r!="function"&&ze(6),n!==void 0&&typeof n!="function"&&ze(7);let o;if(at(t)){let a=$S(this),d=gm(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?pm(a):mm(a)}return jS(a,n),GS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Sm&&(o=void 0),this.autoFreeze_&&Xc(o,!0),n){let a=[],d=[];co("Patches").generateReplacementPatches_(t,o,a,d),n(a,d)}return o}else ze(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,o;return[this.produce(t,r,(d,p)=>{n=d,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){at(e)||ze(8),mt(e)&&(e=JS(e));let t=$S(this),r=gm(e,void 0);return r[ot].isManual_=!0,mm(t),r}finishDraft(e,t){let r=e&&e[ot];(!r||!r.isManual_)&&ze(9);let{scope_:n}=r;return jS(n,t),GS(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=co("Patches").applyPatches_;return mt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function gm(e,t){let r=xs(e)?co("MapSet").proxyMap_(e,t):As(e)?co("MapSet").proxySet_(e,t):QP(e,t);return(t?t.scope_:KS()).drafts_.push(r),r}function JS(e){return mt(e)||ze(10,e),XS(e)}function XS(e){if(!at(e)||Zc(e))return e;let t=e[ot],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=lm(e,t.scope_.immer_.useStrictShallowCopy_)}else r=lm(e,!0);return Ss(r,(n,o)=>{zS(r,n,XS(o))}),t&&(t.finalized_=!1),r}function ZS(){let t="replace",r="add",n="remove";function o(C,A,F,v){switch(C.type_){case 0:case 2:return d(C,A,F,v);case 1:return a(C,A,F,v);case 3:return p(C,A,F,v)}}function a(C,A,F,v){let{base_:b,assigned_:P}=C,R=C.copy_;R.length<b.length&&([b,R]=[R,b],[F,v]=[v,F]);for(let E=0;E<b.length;E++)if(P[E]&&R[E]!==b[E]){let O=A.concat([E]);F.push({op:t,path:O,value:x(R[E])}),v.push({op:t,path:O,value:x(b[E])})}for(let E=b.length;E<R.length;E++){let O=A.concat([E]);F.push({op:r,path:O,value:x(R[E])})}for(let E=R.length-1;b.length<=E;--E){let O=A.concat([E]);v.push({op:n,path:O})}}function d(C,A,F,v){let{base_:b,copy_:P}=C;Ss(C.assigned_,(R,E)=>{let O=sm(b,R),L=sm(P,R),q=E?hs(b,R)?t:r:n;if(O===L&&q===t)return;let T=A.concat(R);F.push(q===n?{op:q,path:T}:{op:q,path:T,value:L}),v.push(q===r?{op:n,path:T}:q===n?{op:r,path:T,value:x(O)}:{op:t,path:T,value:x(O)})})}function p(C,A,F,v){let{base_:b,copy_:P}=C,R=0;b.forEach(E=>{if(!P.has(E)){let O=A.concat([R]);F.push({op:n,path:O,value:E}),v.unshift({op:r,path:O,value:E})}R++}),R=0,P.forEach(E=>{if(!b.has(E)){let O=A.concat([R]);F.push({op:r,path:O,value:E}),v.unshift({op:n,path:O,value:E})}R++})}function m(C,A,F,v){F.push({op:t,path:[],value:A===Sm?void 0:A}),v.push({op:t,path:[],value:C})}function f(C,A){return A.forEach(F=>{let{path:v,op:b}=F,P=C;for(let L=0;L<v.length-1;L++){let q=so(P),T=v[L];typeof T!="string"&&typeof T!="number"&&(T=""+T),(q===0||q===1)&&(T==="__proto__"||T==="constructor")&&ze(19),typeof P=="function"&&T==="prototype"&&ze(19),P=sm(P,T),typeof P!="object"&&ze(18,v.join("/"))}let R=so(P),E=g(F.value),O=v[v.length-1];switch(b){case t:switch(R){case 2:return P.set(O,E);case 3:ze(16);default:return P[O]=E}case r:switch(R){case 1:return O==="-"?P.push(E):P.splice(O,0,E);case 2:return P.set(O,E);case 3:return P.add(E);default:return P[O]=E}case n:switch(R){case 1:return P.splice(O,1);case 2:return P.delete(O);case 3:return P.delete(F.value);default:return delete P[O]}default:ze(17,b)}}),C}function g(C){if(!at(C))return C;if(Array.isArray(C))return C.map(g);if(xs(C))return new Map(Array.from(C.entries()).map(([F,v])=>[F,g(v)]));if(As(C))return new Set(Array.from(C).map(g));let A=Object.create(io(C));for(let F in C)A[F]=g(C[F]);return hs(C,gs)&&(A[gs]=C[gs]),A}function x(C){return mt(C)?g(C):C}NP("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var ft=new UP,Br=ft.produce,eu=ft.produceWithPatches.bind(ft),oU=ft.setAutoFreeze.bind(ft),aU=ft.setUseStrictShallowCopy.bind(ft),Cm=ft.applyPatches.bind(ft),iU=ft.createDraft.bind(ft),sU=ft.finishDraft.bind(ft);l();s();u();c();function _P(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function jP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $P(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var eh=e=>Array.isArray(e)?e:[e];function GP(e){let t=Array.isArray(e[0])?e[0]:e;return $P(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function HP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var fU=Symbol();var gU=Object.getPrototypeOf({});var WP=class{constructor(e){this.value=e}deref(){return this.value}},zP=typeof WeakRef<"u"?WeakRef:WP,KP=0,th=1;function tu(){return{s:KP,v:void 0,o:null,p:null}}function Wo(e,t={}){let r=tu(),{resultEqualityCheck:n}=t,o,a=0;function d(){let p=r,{length:m}=arguments;for(let x=0,C=m;x<C;x++){let A=arguments[x];if(typeof A=="function"||typeof A=="object"&&A!==null){let F=p.o;F===null&&(p.o=F=new WeakMap);let v=F.get(A);v===void 0?(p=tu(),F.set(A,p)):p=v}else{let F=p.p;F===null&&(p.p=F=new Map);let v=F.get(A);v===void 0?(p=tu(),F.set(A,p)):p=v}}let f=p,g;if(p.s===th)g=p.v;else if(g=e.apply(null,arguments),a++,n){let x=o?.deref?.()??o;x!=null&&n(x,g)&&(g=x,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new zP(g):g}return f.s=th,f.v=g,g}return d.clearCache=()=>{r=tu(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}function rh(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),_P(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let g={...r,...m},{memoize:x,memoizeOptions:C=[],argsMemoize:A=Wo,argsMemoizeOptions:F=[],devModeChecks:v={}}=g,b=eh(C),P=eh(F),R=GP(o),E=x(function(){return a++,f.apply(null,arguments)},...b),O=!0,L=A(function(){d++;let T=HP(R,arguments);return p=E.apply(null,T),p},...P);return Object.assign(L,{resultFunc:f,memoizedResultFunc:E,dependencies:R,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:x,argsMemoize:A})};return Object.assign(n,{withTypes:()=>n}),n}var de=rh(Wo),YP=Object.assign((e,t=de)=>{jP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>YP});l();s();u();c();function nh(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var oh=nh(),ah=nh;var JP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ho:Ho.apply(null,arguments)},qU=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},XP=e=>e&&typeof e.match=="function";function w(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Qt(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=>Kc(n)&&n.type===e,r}var lh=class Fs extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Fs.prototype)}static get[Symbol.species](){return Fs}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Fs(...t[0].concat(this)):new Fs(...t.concat(this))}};function ih(e){return at(e)?Br(e,()=>{}):e}function sh(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ZP(e){return typeof e=="boolean"}var ew=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},d=new lh;return r&&(ZP(r)?d.push(oh):d.push(ah(r.extraArgument))),d},un="RTK_autoBatch",Ko=()=>e=>({payload:e,meta:{[un]:!0}}),ch=e=>t=>{setTimeout(t,e)},tw=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ch(10):e.type==="callback"?e.queueNotification:ch(e.timeout),f=()=>{d=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let x=()=>o&&g(),C=n.subscribe(x);return p.add(g),()=>{C(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[un],a=!o,a&&(d||(d=!0,m(f))),n.dispatch(g)}finally{o=!0}}})},rw=e=>function(r){let{autoBatch:n=!0}=r??{},o=new lh(e);return n&&o.push(tw(typeof n=="object"?n:void 0)),o};function dh(e){let t=ew(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Yt(r))p=Go(r);else throw new Error(Qt(1));let m;typeof n=="function"?m=n(t):m=t();let f=Ho;o&&(f=JP({trace:!1,...(typeof o=="object"&&o)}));let g=_S(...m),x=rw(g),C=typeof d=="function"?d(x):x(),A=f(...C);return im(p,a,A)}function ph(e){let t={},r=[],n,o={addCase(a,d){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Qt(28));if(p in t)throw new Error(Qt(29));return t[p]=d,o},addMatcher(a,d){return r.push({matcher:a,reducer:d}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function nw(e){return typeof e=="function"}function ee(e,t){let[r,n,o]=ph(t),a;if(nw(e))a=()=>ih(e());else{let p=ih(e);a=()=>p}function d(p=a(),m){let f=[r[m.type],...n.filter(({matcher:g})=>g(m)).map(({reducer:g})=>g)];return f.filter(g=>!!g).length===0&&(f=[o]),f.reduce((g,x)=>{if(x)if(mt(g)){let A=x(g,m);return A===void 0?g:A}else{if(at(g))return Br(g,C=>x(C,m));{let C=x(g,m);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return g},p)}return d.getInitialState=a,d}var mh=(e,t)=>XP(e)?e.match(t):e(t);function Jt(...e){return t=>e.some(r=>mh(r,t))}function zo(...e){return t=>e.every(r=>mh(r,t))}function nu(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 Rs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ou(...e){return e.length===0?t=>nu(t,["pending"]):Rs(e)?Jt(...e.map(t=>t.pending)):ou()(e[0])}function uo(...e){return e.length===0?t=>nu(t,["rejected"]):Rs(e)?Jt(...e.map(t=>t.rejected)):uo()(e[0])}function bs(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?zo(uo(...e),t):Rs(e)?zo(uo(...e),t):bs()(e[0])}function Ur(...e){return e.length===0?t=>nu(t,["fulfilled"]):Rs(e)?Jt(...e.map(t=>t.fulfilled)):Ur()(e[0])}function au(...e){return e.length===0?t=>nu(t,["pending","fulfilled","rejected"]):Rs(e)?Jt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):au()(e[0])}var ow="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",iu=(e=21)=>{let t="",r=e;for(;r--;)t+=ow[Math.random()*64|0];return t},aw=["name","message","stack","code"],xm=class{constructor(e,t){ye(this,"_type");this.payload=e,this.meta=t}},uh=class{constructor(e,t){ye(this,"_type");this.payload=e,this.meta=t}},iw=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of aw)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ae=(()=>{function e(t,r,n){let o=w(t+"/fulfilled",(m,f,g,x)=>({payload:m,meta:{...(x||{}),arg:g,requestId:f,requestStatus:"fulfilled"}})),a=w(t+"/pending",(m,f,g)=>({payload:void 0,meta:{...(g||{}),arg:f,requestId:m,requestStatus:"pending"}})),d=w(t+"/rejected",(m,f,g,x,C)=>({payload:x,error:(n&&n.serializeError||iw)(m||"Rejected"),meta:{...(C||{}),arg:g,requestId:f,rejectedWithValue:!!x,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,g,x)=>{let C=n?.idGenerator?n.idGenerator(m):iu(),A=new i.AbortController,F,v;function b(R){v=R,A.abort()}let P=_asyncToGenerator(function*(){let R;try{let O=n?.condition?.(m,{getState:g,extra:x});if(cw(O)&&(O=yield O),O===!1||A.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let L=new Promise((q,T)=>{F=()=>{T({name:"AbortError",message:v||"Aborted"})},A.signal.addEventListener("abort",F)});f(a(C,m,n?.getPendingMeta?.({requestId:C,arg:m},{getState:g,extra:x}))),R=yield Promise.race([L,Promise.resolve(r(m,{dispatch:f,getState:g,extra:x,requestId:C,signal:A.signal,abort:b,rejectWithValue:(q,T)=>new xm(q,T),fulfillWithValue:(q,T)=>new uh(q,T)})).then(q=>{if(q instanceof xm)throw q;return q instanceof uh?o(q.payload,C,m,q.meta):o(q,C,m)})])}catch(O){R=O instanceof xm?d(null,C,m,O.payload,O.meta):d(O,C,m)}finally{F&&A.signal.removeEventListener("abort",F)}return n&&!n.dispatchConditionRejection&&d.match(R)&&R.meta.condition||f(R),R})();return Object.assign(P,{abort:b,requestId:C,arg:m,unwrap(){return P.then(sw)}})}}return Object.assign(p,{pending:a,rejected:d,fulfilled:o,settled:Jt(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function sw(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function cw(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var fh=Symbol.for("rtk-slice-createasyncthunk"),LU={[fh]:ae};function uw(e,t){return`${e}/${t}`}function lw({creators:e}={}){let t=e?.asyncThunk?.[fh];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Qt(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(pw()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(R,E){let O=typeof R=="string"?R:R.type;if(!O)throw new Error(Qt(12));if(O in m.sliceCaseReducersByType)throw new Error(Qt(13));return m.sliceCaseReducersByType[O]=E,f},addMatcher(R,E){return m.sliceMatchers.push({matcher:R,reducer:E}),f},exposeAction(R,E){return m.actionCreators[R]=E,f},exposeCaseReducer(R,E){return m.sliceCaseReducersByName[R]=E,f}};p.forEach(R=>{let E=d[R],O={reducerName:R,type:uw(o,R),createNotation:typeof n.reducers=="function"};fw(E)?Sw(O,E,f,t):mw(O,E,f)});function g(){let[R={},E=[],O=void 0]=typeof n.extraReducers=="function"?ph(n.extraReducers):[n.extraReducers],L={...R,...m.sliceCaseReducersByType};return ee(n.initialState,q=>{for(let T in L)q.addCase(T,L[T]);for(let T of m.sliceMatchers)q.addMatcher(T.matcher,T.reducer);for(let T of E)q.addMatcher(T.matcher,T.reducer);O&&q.addDefaultCase(O)})}let x=R=>R,C=new Map,A;function F(R,E){return A||(A=g()),A(R,E)}function v(){return A||(A=g()),A.getInitialState()}function b(R,E=!1){function O(q){let T=q[R];return typeof T>"u"&&E&&(T=v()),T}function L(q=x){let T=sh(C,E,()=>new WeakMap);return sh(T,q,()=>{let N={};for(let[M,B]of Object.entries(n.selectors??{}))N[M]=dw(B,q,v,E);return N})}return{reducerPath:R,getSelectors:L,get selectors(){return L(O)},selectSlice:O}}let P={name:o,reducer:F,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:v,...b(a),injectInto(R,{reducerPath:E,...O}={}){let L=E??a;return R.inject({reducerPath:L,reducer:F},O),{...P,...b(L,!0)}}};return P}}function dw(e,t,r,n){function o(a,...d){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var lo=lw();function pw(){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 mw({type:e,reducerName:t,createNotation:r},n,o){let a,d;if("reducer"in n){if(r&&!gw(n))throw new Error(Qt(17));a=n.reducer,d=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,d?w(e,d):w(e))}function fw(e){return e._reducerDefinitionType==="asyncThunk"}function gw(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sw({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Qt(18));let{payloadCreator:a,fulfilled:d,pending:p,rejected:m,settled:f,options:g}=r,x=o(e,a,g);n.exposeAction(t,x),d&&n.addCase(x.fulfilled,d),p&&n.addCase(x.pending,p),m&&n.addCase(x.rejected,m),f&&n.addMatcher(x.settled,f),n.exposeCaseReducer(t,{fulfilled:d||ru,pending:p||ru,rejected:m||ru,settled:f||ru})}function ru(){}var gh="listener",Sh="completed",hh="cancelled",QU=`task-${hh}`,BU=`task-${Sh}`,UU=`${gh}-${hh}`,_U=`${gh}-${Sh}`;var{assign:yh}=Object;var Am="listenerMiddleware";var hw=yh(w(`${Am}/add`),{withTypes:()=>hw}),jU=w(`${Am}/removeAll`),yw=yh(w(`${Am}/remove`),{withTypes:()=>yw});var $U=Symbol.for("rtk-state-proxy-original");function Qt(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. `}l();s();u();c();l();s();u();c();function Cw({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,a,r))}var xw=/^(?:[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 Aw(e){return typeof e=="string"&&xw.test(e)}var Ke=[];for(let e=0;e<256;++e)Ke.push((e+256).toString(16).slice(1));function Fw(e,t=0){return(Ke[e[t+0]]+Ke[e[t+1]]+Ke[e[t+2]]+Ke[e[t+3]]+"-"+Ke[e[t+4]]+Ke[e[t+5]]+"-"+Ke[e[t+6]]+Ke[e[t+7]]+"-"+Ke[e[t+8]]+Ke[e[t+9]]+"-"+Ke[e[t+10]]+Ke[e[t+11]]+Ke[e[t+12]]+Ke[e[t+13]]+Ke[e[t+14]]+Ke[e[t+15]]).toLowerCase()}var Fm,Rw=new Uint8Array(16);function bw(){if(!Fm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Fm=crypto.getRandomValues.bind(crypto)}return Fm(Rw)}var vw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ch={randomUUID:vw};function Pw(e,t,r){if(Ch.randomUUID&&!e)return Ch.randomUUID();e=e||{};let n=e.random??e.rng?.()??bw();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Fw(n)}function ww(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&Aw(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var Ah="1.0.0";function Ew(e){let{trackingId:t}=e;return{trackingId:t}}function Iw(e){return(e.source||[]).concat([`relay@${Ah}`])}function Fh(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:d}=r,p=Ew(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:Iw(t),clientId:m,userAgent:d(),referrer:o(),location:a()})}function Tw(e,t,r,n,o){return{...t,meta:Fh(e,r,n,o)}}var Ow="*";function kw(){let e=[];function t({type:m,callback:f}){return e.findIndex(g=>g.type===m&&g.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(g){console.error(g)}})}function a(m){if(m===Ow)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function d(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?d({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function xh({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source})})}function qw(e){let t=xh(e);return{get:()=>t,update:r=>{t=xh({...t,...r})}}}function Dw(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var Rm=Vw();function Vw(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let d=a.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Nw(){return{getItem(e){return Rm.getItem(e)||localStorage.getItem(e)},removeItem(e){Rm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Rm.setItem(e,t,31556952e3)}}}function Mw(){let e=document.referrer;return e===""?null:e}function Lw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Dw().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>Mw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Pw(),storage:Nw()}}function Qw(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function Bw(){return{getItem(){return null},removeItem(){},setItem(){}}}function Uw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Bw()}}function _w(e){return e.get().mode!=="disabled"&&jw()&&Qw()?Lw():Uw()}function jw(){try{return typeof window=="object"}catch{return!1}}function $w(e){return{get:()=>Object.freeze(_w(e))}}function Rh(e){let t=qw(e),r=kw(),n=$w(t),o=ww(n);return{emit:(a,d)=>{let p=t.get(),m=n.get(),f=Tw(a,d,p,m,o);return Cw({config:p,environment:m,event:f,listenerManager:r})},getMeta:a=>Fh(a,t.get(),n.get(),o),on:(a,d)=>r.add({type:a,callback:d}),off:(a,d)=>r.remove(a,d),updateConfig:a=>t.update(a),version:Ah}}l();s();u();c();l();s();u();c();var ln="3.15.0",bh=["@coveo/atomic","@coveo/quantic"];var Xt=de(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ln}`));var Yo=de(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Xt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},d)=>Rh({mode:a?"emit":"disabled",url:o??jc(e,t),token:r,trackingId:n,source:d}));l();s();u();c();l();s();u();c();function _r(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function D(e,t,r,n){function o(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function p(g){try{f(n.next(g))}catch(x){d(x)}}function m(g){try{f(n.throw(g))}catch(x){d(x)}}function f(g){g.done?a(g.value):o(g.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var me;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(me||(me={}));function Pm(){return typeof window<"u"}function Qm(){return typeof navigator<"u"}function Jo(){return typeof document<"u"}function wm(){try{return typeof localStorage<"u"}catch{return!1}}function Gw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Lh(){return Qm()&&navigator.cookieEnabled}var Hw=[me.click,me.custom,me.search,me.view],Ww=(e,t)=>Hw.indexOf(e)!==-1?Object.assign({language:Jo()?document.documentElement.lang:"unknown",userAgent:Qm()?navigator.userAgent:"unknown"},t):t,ws=class e{static set(t,r,n){var o,a,d,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?vh(t,r,a):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],vh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function vh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function zw(){return wm()?localStorage:Lh()?new Es:Gw()?sessionStorage:new Zo}var Es=class e{getItem(t){return ws.get(`${e.prefix}${t}`)}removeItem(t){ws.erase(`${e.prefix}${t}`)}setItem(t,r,n){ws.set(`${e.prefix}${t}`,r,n)}};Es.prefix="coveo_";var Em=class{constructor(){this.cookieStorage=new Es}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)}},Zo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},vs="__coveo.analytics.history",Qh=20,Bh=1e3*60,Uh=75,ea=class{constructor(t){this.store=t||zw()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return D(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return D(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(vs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return D(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(vs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(vs,JSON.stringify(t.slice(0,Qh)))}catch{}}clear(){try{this.store.removeItem(vs)}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,Uh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Bh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}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))}},_h=Object.freeze({__proto__:null,HistoryStore:ea,MAX_NUMBER_OF_HISTORY_ELEMENTS:Qh,MAX_VALUE_SIZE:Uh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:Bh,STORE_KEY:vs,default:ea}),Kw=(e,t)=>D(void 0,void 0,void 0,function*(){return e===me.view?(yield Yw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Yw=e=>D(void 0,void 0,void 0,function*(){let t=new ea,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),su,Jw=new Uint8Array(16);function Xw(){if(!su&&(su=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!su))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return su(Jw)}var Zw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function uu(e){return typeof e=="string"&&Zw.test(e)}var Ye=[];for(let e=0;e<256;++e)Ye.push((e+256).toString(16).slice(1));function jh(e,t=0){return(Ye[e[t+0]]+Ye[e[t+1]]+Ye[e[t+2]]+Ye[e[t+3]]+"-"+Ye[e[t+4]]+Ye[e[t+5]]+"-"+Ye[e[t+6]]+Ye[e[t+7]]+"-"+Ye[e[t+8]]+Ye[e[t+9]]+"-"+Ye[e[t+10]]+Ye[e[t+11]]+Ye[e[t+12]]+Ye[e[t+13]]+Ye[e[t+14]]+Ye[e[t+15]]).toLowerCase()}function eE(e){if(!uu(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function tE(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var rE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",nE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function oE(e,t,r){function n(o,a,d,p){var m;if(typeof o=="string"&&(o=tE(o)),typeof a=="string"&&(a=eE(a)),((m=a)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(a),f.set(o,a.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let g=0;g<16;++g)d[p+g]=f[g];return d}return jh(f)}try{n.name=e}catch{}return n.DNS=rE,n.URL=nE,n}var aE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ph={randomUUID:aE};function po(e,t,r){if(Ph.randomUUID&&!t&&!e)return Ph.randomUUID();e=e||{};let n=e.random||(e.rng||Xw)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return jh(n)}function iE(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 bm(e,t){return e<<t|e>>>32-t}function sE(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];a[d]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let A=0;A<16;++A)p[A]=a[d][A];for(let A=16;A<80;++A)p[A]=bm(p[A-3]^p[A-8]^p[A-14]^p[A-16],1);let m=r[0],f=r[1],g=r[2],x=r[3],C=r[4];for(let A=0;A<80;++A){let F=Math.floor(A/20),v=bm(m,5)+iE(F,f,g,x)+C+t[F]+p[A]>>>0;C=x,x=g,g=bm(f,30)>>>0,f=m,m=v}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+x>>>0,r[4]=r[4]+C>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var cE=oE("v5",80,sE),wh=cE,$h="2.30.43",Eh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ps={pageview:"pageview",event:"event"},lu=class{constructor({client:t,uuidGenerator:r=po}){this.client=t,this.uuidGenerator=r}},Im=class extends lu{constructor({client:t,uuidGenerator:r=po}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Eh(window.location),this.lastReferrer=Jo()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:Jo()?document.title:"",encoding:Jo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Ps.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ps.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ps.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ps.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 Eh(window.location)}},dn=class e{constructor(t,r){if(!uu(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 a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return uu(a)?new e(a,Number.parseInt(o)*1e3):null}};dn.cvo_cid="cvo_cid";dn.expirationTime=120;var Tm=class extends lu{constructor({client:t,uuidGenerator:r=po}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return D(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(dn.cvo_cid,new dn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Tm.Id="link";var Rt=Object.keys;function cu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var vm=128,Gh=192,Ih=224,Th=240;function uE(e){return(e&248)===Th?4:(e&Th)===Ih?3:(e&Ih)===Gh?2:1}function lE(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&vm)!=vm)break;if(r-=3,(n&Gh)!=vm){t-r>=uE(n)*3&&(r=t);break}}return e.substring(0,r)}var Om={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"},dE=Rt(Om).map(e=>Om[e]),pE=[...dE].join("|"),mE=new RegExp(`^(${pE}$)`),fE={svcAction:"svc_action",svcActionData:"svc_action_data"},gE=e=>Rt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Om[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),SE=e=>mE.test(e),hE=[SE],Oh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},kh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Je={action:"pa",list:"pal",listSource:"pls"},du={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},yE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],km={id:"quoteId",affiliation:"quoteAffiliation"},qm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},CE={add:Je,bookmark_add:Je,bookmark_remove:Je,click:Je,checkout:Je,checkout_option:Je,detail:Je,impression:Je,remove:Je,refund:Object.assign(Object.assign({},Je),du),purchase:Object.assign(Object.assign({},Je),du),quickview:Je,quote:Object.assign(Object.assign({},Je),km),review:Object.assign(Object.assign({},Je),qm)},xE=Rt(Oh).map(e=>Oh[e]),AE=Rt(kh).map(e=>kh[e]),FE=Rt(Je).map(e=>Je[e]),RE=Rt(du).map(e=>du[e]),bE=Rt(qm).map(e=>qm[e]),vE=Rt(km).map(e=>km[e]),PE=[...xE,"custom"].join("|"),wE=[...AE,"custom"].join("|"),Hh="(pr[0-9]+)",Wh="(il[0-9]+pi[0-9]+)",EE=new RegExp(`^${Hh}(${PE})$`),IE=new RegExp(`^(${Wh}(${wE}))|(il[0-9]+nm)$`),TE=new RegExp(`^(${FE.join("|")})$`),OE=new RegExp(`^(${RE.join("|")})$`),kE=new RegExp(`^${Hh}custom$`),qE=new RegExp(`^${Wh}custom$`),DE=new RegExp(`^(${[...yE,...bE,...vE].join("|")})$`),VE=e=>EE.test(e),NE=e=>IE.test(e),ME=e=>TE.test(e),LE=e=>OE.test(e),QE=e=>DE.test(e),BE=[NE,VE,ME,LE,QE],UE=[kE,qE],_E={anonymizeIp:"aip"},jE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},$E={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},GE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],HE=Object.assign(Object.assign(Object.assign(Object.assign({},_E),jE),$E),GE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Dm=Object.assign(Object.assign({},HE),fE),WE=e=>{let t=!!e.action&&CE[e.action]||{};return Rt(e).reduce((r,n)=>{let o=t[n]||Dm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},zE=Rt(Dm).map(e=>Dm[e]),KE=e=>zE.indexOf(e)!==-1,YE=e=>e==="custom",JE=e=>[...BE,...hE,KE,YE].some(t=>t(e)),XE=e=>Rt(e).reduce((t,r)=>{let n=ZE(r);return n?Object.assign(Object.assign({},t),eI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),ZE=e=>{let t;return[...UE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},eI=(e,t)=>Rt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Vm=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let o=t,a=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return D(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[me.click,me.custom,me.search,me.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}},Nm=class{sendEvent(t,r){return D(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){return Promise.resolve()})}},qh=S.fetch,pu=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,d=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${d}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,g=_r(m,["url"]),x;try{x=yield qh(f,g)}catch(C){console.error("An error has occured when sending the event.",C);return}if(x.ok){let C=yield x.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{x.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,x,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield qh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[me.click,me.custom,me.search,me.view].indexOf(t)!==-1}getVisitorIdParam(){return D(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Mm=class{constructor(t,r){wm()&&Lh()?this.storage=new Em:wm()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Zo),this.client=new pu(t),this.beaconClient=new Vm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Lm=class{constructor(t,r){this.storage=r||new Zo,this.client=new pu(t)}getClientDependingOnEventType(t){return this.client}},mu=class{constructor(){this.storage=new Zo,this.client=new Nm}getClientDependingOnEventType(t){return this.client}},tI="xx",rI=e=>e?.startsWith(tI)||!1,nI=`
27
+ `+g:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":let x=parseInt(g,10);isNaN(x)||t(n.retry=x);break}}}}function Mv(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function dS(){return{data:"",event:"",id:"",retry:void 0}}var Lv=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var 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},Bc="text/event-stream",Qv=1e3,gS="last-event-id";function SS(){typeof window<"u"}function ls(e,t){var{signal:r,headers:n,onopen:o,onmessage:a,onclose:d,onerror:p,openWhenHidden:m,fetch:f}=t,g=Lv(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((x,C)=>{let A=Object.assign({},n);A.accept||(A.accept=Bc);let F;function v(){F?.abort(),document.hidden||L()}!m&&SS()&&document.addEventListener("visibilitychange",v);let b=Qv,P=0;function R(){SS()&&document.removeEventListener("visibilitychange",v),clearTimeout(P),F?.abort()}r?.addEventListener("abort",()=>{R(),x()});let E=f??E,O=o??Bv;function L(){return _L.apply(this,arguments)}function _L(){_L=_asyncToGenerator(function*(){var q;F=typeof i.AbortController>"u"?null:new i.AbortController;try{let T=yield E(e,Object.assign(Object.assign({},g),{headers:A,signal:F?.signal}));yield O(T),yield pS(T.body,mS(fS(N=>{N?A[gS]=N:delete A[gS]},N=>{b=N},a))),d?.(),R(),x()}catch(T){if(!F?.signal.aborted)try{let N=(q=p?.(T))!==null&&q!==void 0?q:b;clearTimeout(P),P=setTimeout(L,N)}catch(N){R(),C(N)}}});return _L.apply(this,arguments)}L()})}function Bv(e){let t=e.headers.get("content-type");if(!t?.startsWith(Bc))throw new Error(`Expected content-type to be ${Bc}, Actual: ${t}`)}l();s();u();c();var on=class{constructor(t){ye(this,"_basePath");ye(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}};var Uv=(e,t,r)=>new on(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,hS=3,_v=5e3,jv="text/event-stream",Yp=1,zp=class extends Error{},ds=class extends Error{constructor(r){super(r.message);this.payload=r}},Kp=class{constructor(){ye(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Uc=class{constructor(t){ye(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:g}=r,x=new Kp;if(!a){this.logger.error("No stream ID found");return}let C=0,A,F=()=>{A&&!x.isActive(A)&&(b?.abort(),g(),P())},v=()=>{x.remove(A),A=lS(F,A,_v),x.add(A)},b=new i.AbortController,P=()=>ls(Uv(n,o,a),{method:"GET",fetch:h,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:b?.signal,onopen(R){return _asyncToGenerator(function*(){if(R.ok&&R.headers.get("content-type")===jv)return;throw R.status>=400&&R.status<500&&R.status!==429?new ds({message:"Error opening stream",code:R.status}):new zp})()},onmessage:R=>{if(b?.signal.aborted)return;let E=JSON.parse(R.data);if(E.finishReason==="ERROR"){x.remove(A),b?.abort(),m({message:E.errorMessage,code:E.statusCode});return}p(E),C=0,E.finishReason==="COMPLETED"?(x.remove(A),f()):v()},onerror:R=>{if(!b?.signal.aborted){if(x.remove(A),R instanceof ds)throw b?.abort(),m(R),R;if(++C>hS){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:Yp};throw b?.abort(),m(E),new ds(E)}this.logger.info(`Retrying...(${C}/${hS})`),g()}}});return P(),b}};l();s();u();c();var IS=xt(vS(),1);l();s();u();c();l();s();u();c();var gP="recommendation-internal-options",n0=Symbol.for(gP);var H=new Error("Failed to load reducers."),jo=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var oo=class extends Error{constructor(r,n){super();ye(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};l();s();u();c();function PS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function wS(e){return typeof e!="object"||!e?!1:Object.values(e).every(SP)}function SP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ES(e){return e===429}var At=class e{static call(t){return _asyncToGenerator(function*(){let r=hP(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...d}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield h(a,d);if(ES(m.status))throw m;return m});return function p(){return _ref.apply(this,arguments)}}();try{let m=yield(0,IS.backOff)(p,{retry:f=>{let g=f&&ES(f.status);return g&&n.info("Platform retrying request"),g}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new jo;case 404:throw new oo(a,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new oo(a):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:d}=r,{signal:p,...m}=t,f=us(m);try{let g=yield o(t,n,d);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return f})()}};function He(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ke(e,t="prod"){return`${He(e,t)}/rest/search/v2`}function jc(e,t="prod"){return`${He(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function hP(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=yP(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:m}),signal:d}}function yP(e,t){return t==="application/x-www-form-urlencoded"?wS(e)?PS(e):"":JSON.stringify(e)}l();s();u();c();var $c=e=>e;l();s();u();c();var TS=e=>e,OS=e=>e,kS=e=>e;l();s();u();c();l();s();u();c();function $o(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function pt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:$o(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:$o(),extendedResults:{}}}l();s();u();c();function an(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var sn=e=>{let{response:t}=e;return t.body?CP(e):xP(t)},CP=e=>FP(e)?RP(e):AP(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},xP=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function AP(e){return e.body.statusCode!==void 0}function FP(e){return e.body.exception!==void 0}var RP=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();var cn=class{constructor(){ye(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new i.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};l();s();u();c();l();s();u();c();function qS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var Lr=(e,t,r,n)=>{let o=new on(`${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 DS=(e,t)=>{let r=new on(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},VS=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield At.call({...Lr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:an(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=qS(r),o=yield r.arrayBuffer(),d=new TextDecoder(n).decode(o);return bP(d)?{success:d}:{error:sn({response:r,body:d})}});return function VS(_x4,_x5){return _ref2.apply(this,arguments)}}();function bP(e){return typeof e=="string"}l();s();u();c();function vP(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function PP(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function fs(e,t){if(t&&e.name==="AbortError")return{error:PP(e)};if(e instanceof oo)return{error:vP(e)};throw e}var Gc=class{constructor(t){this.options=t;ye(this,"apiCallsQueues",{unknown:new cn,mainSearch:new cn,facetValues:new cn,foldingCollection:new cn,instantResults:new cn})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json","/plan"),requestParams:an(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return fs(r);let n=yield r.json();return EP(n)?{success:n}:{error:sn({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:an(t),..._this3.options});if(r instanceof Error)return fs(r);let n=yield r.json(),o={response:r,body:n};return wP(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:sn(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>At.call({...Lr(t,"POST","application/json",""),requestParams:an(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return fs(o,r?.disableAbortWarning);let a=yield o.json(),d={response:o,body:a};return NS(a)?(d.body=MS(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(d)).body}):{error:sn(d)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json","/facet"),requestParams:an(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"POST","application/json",""),requestParams:an(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(NS(n)){let o={response:r,body:n};return o.body=MS(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:sn({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return VS(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield At.call({...Lr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return IP(n)?{success:n}:{error:sn({response:r,body:n})}})()}},Hc=e=>e.success!==void 0,Le=e=>e.error!==void 0;function NS(e){return e.results!==void 0}function MS(e){let t=$o();return ne(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function wP(e){return e.completions!==void 0}function EP(e){return e.preprocessingOutput!==void 0}function IP(e){return e.fields!==void 0}l();s();u();c();l();s();u();c();var $=new k({required:!0,emptyAllowed:!1}),ve=new k({required:!1,emptyAllowed:!1}),Ce=new k({required:!0,emptyAllowed:!0}),LS=new k({required:!1,emptyAllowed:!0}),Wc=new X({each:$,required:!0}),QS=new k({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Qr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ft=(e,t)=>{if("required"in t)return{payload:new ce({value:t}).validate({value:e}).value};let o=new Q({options:{required:!0},values:t}).validate(e);if(o)throw new cs(o);return{payload:e}},I=(e,t)=>{try{return Ft(e,t)}catch(r){return{payload:e,error:Qr(r)}}},qe=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return BS(e,t,r,o,"Controller initialization error")},Re=(e,t,r,n)=>{let o=`Check the options of ${n}`;return BS(e,t,r,o,"Controller initialization error")},BS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};l();s();u();c();l();s();u();c();l();s();u();c();function We(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 TP=typeof Symbol=="function"&&Symbol.observable||"@@observable",US=TP,am=()=>Math.random().toString(36).substring(7).split("").join("."),OP={INIT:`@@redux/INIT${am()}`,REPLACE:`@@redux/REPLACE${am()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${am()}`},zc=OP;function Yt(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 im(e,t,r){if(typeof e!="function")throw new Error(We(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(We(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(We(1));return r(im)(e,t)}let n=e,o=t,a=new Map,d=a,p=0,m=!1;function f(){d===a&&(d=new Map,a.forEach((b,P)=>{d.set(P,b)}))}function g(){if(m)throw new Error(We(3));return o}function x(b){if(typeof b!="function")throw new Error(We(4));if(m)throw new Error(We(5));let P=!0;f();let R=p++;return d.set(R,b),function(){if(P){if(m)throw new Error(We(6));P=!1,f(),d.delete(R),a=null}}}function C(b){if(!Yt(b))throw new Error(We(7));if(typeof b.type>"u")throw new Error(We(8));if(typeof b.type!="string")throw new Error(We(17));if(m)throw new Error(We(9));try{m=!0,o=n(o,b)}finally{m=!1}return(a=d).forEach(R=>{R()}),b}function A(b){if(typeof b!="function")throw new Error(We(10));n=b,C({type:zc.REPLACE})}function F(){let b=x;return{subscribe(P){if(typeof P!="object"||P===null)throw new Error(We(11));function R(){let O=P;O.next&&O.next(g())}return R(),{unsubscribe:b(R)}},[US](){return this}}}return C({type:zc.INIT}),{dispatch:C,subscribe:x,getState:g,replaceReducer:A,[US]:F}}function kP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:zc.INIT})>"u")throw new Error(We(12));if(typeof r(void 0,{type:zc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(We(13))})}function Go(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{kP(r)}catch(d){a=d}return function(p={},m){if(a)throw a;let f=!1,g={};for(let x=0;x<n.length;x++){let C=n[x],A=r[C],F=p[C],v=A(F,m);if(typeof v>"u"){let b=m&&m.type;throw new Error(We(14))}g[C]=v,f=f||v!==F}return f=f||n.length!==Object.keys(p).length,f?g:p}}function Ho(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function _S(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(We(15))},d={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(d));return a=Ho(...p)(o.dispatch),{...o,dispatch:a}}}function Kc(e){return Yt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var Sm=Symbol.for("immer-nothing"),gs=Symbol.for("immer-draftable"),ot=Symbol.for("immer-state");function ze(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var io=Object.getPrototypeOf;function mt(e){return!!e&&!!e[ot]}function at(e){return e?WS(e)||Array.isArray(e)||!!e[gs]||!!e.constructor?.[gs]||xs(e)||As(e):!1}var qP=Object.prototype.constructor.toString();function WS(e){if(!e||typeof e!="object")return!1;let t=io(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===qP}function hm(e){return mt(e)||ze(15,e),e[ot].base_}function Ss(e,t){so(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function so(e){let t=e[ot];return t?t.type_:Array.isArray(e)?1:xs(e)?2:As(e)?3:0}function hs(e,t){return so(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sm(e,t){return so(e)===2?e.get(t):e[t]}function zS(e,t,r){let n=so(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function DP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xs(e){return e instanceof Map}function As(e){return e instanceof Set}function ao(e){return e.copy_||e.base_}function lm(e,t){if(xs(e))return new Map(e);if(As(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=WS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ot];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let d=o[a],p=n[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[d]})}return Object.create(io(e),n)}else{let n=io(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Xc(e,t=!1){return Zc(e)||mt(e)||!at(e)||(so(e)>1&&(e.set=e.add=e.clear=e.delete=VP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Xc(n,!0))),e}function VP(){ze(2)}function Zc(e){return Object.isFrozen(e)}var dm={};function co(e){let t=dm[e];return t||ze(0,e),t}function NP(e,t){dm[e]||(dm[e]=t)}var ys;function KS(){return ys}function MP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function jS(e,t){t&&(co("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function pm(e){mm(e),e.drafts_.forEach(LP),e.drafts_=null}function mm(e){e===ys&&(ys=e.parent_)}function $S(e){return ys=MP(ys,e)}function LP(e){let t=e[ot];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function GS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ot].modified_&&(pm(t),ze(4)),at(e)&&(e=Yc(t,e),t.parent_||Jc(t,e)),t.patches_&&co("Patches").generateReplacementPatches_(r[ot].base_,e,t.patches_,t.inversePatches_)):e=Yc(t,r,[]),pm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Sm?e:void 0}function Yc(e,t,r){if(Zc(t))return t;let n=t[ot];if(!n)return Ss(t,(o,a)=>HS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Jc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,d=!1;n.type_===3&&(a=new Set(o),o.clear(),d=!0),Ss(a,(p,m)=>HS(e,n,o,p,m,r,d)),Jc(e,o,!1),r&&e.patches_&&co("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function HS(e,t,r,n,o,a,d){if(mt(o)){let p=a&&t&&t.type_!==3&&!hs(t.assigned_,n)?a.concat(n):void 0,m=Yc(e,o,p);if(zS(r,n,m),mt(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(at(o)&&!Zc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Yc(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Jc(e,o)}}function Jc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xc(t,r)}function QP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:KS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=ym;r&&(o=[n],a=Cs);let{revoke:d,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=d,p}var ym={get(e,t){if(t===ot)return e;let r=ao(e);if(!hs(r,t))return BP(e,r,t);let n=r[t];return e.finalized_||!at(n)?n:n===cm(e.base_,t)?(um(e),e.copy_[t]=gm(n,e)):n},has(e,t){return t in ao(e)},ownKeys(e){return Reflect.ownKeys(ao(e))},set(e,t,r){let n=YS(ao(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=cm(ao(e),t),a=o?.[ot];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(DP(r,o)&&(r!==void 0||hs(e.base_,t)))return!0;um(e),fm(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,um(e),fm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ao(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ze(11)},getPrototypeOf(e){return io(e.base_)},setPrototypeOf(){ze(12)}},Cs={};Ss(ym,(e,t)=>{Cs[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Cs.deleteProperty=function(e,t){return Cs.set.call(this,e,t,void 0)};Cs.set=function(e,t,r){return ym.set.call(this,e[0],t,r,e[0])};function cm(e,t){let r=e[ot];return(r?ao(r):e)[t]}function BP(e,t,r){let n=YS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function YS(e,t){if(!(t in e))return;let r=io(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=io(r)}}function fm(e){e.modified_||(e.modified_=!0,e.parent_&&fm(e.parent_))}function um(e){e.copy_||(e.copy_=lm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var UP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let d=this;return function(m=a,...f){return d.produce(m,g=>r.call(this,g,...f))}}typeof r!="function"&&ze(6),n!==void 0&&typeof n!="function"&&ze(7);let o;if(at(t)){let a=$S(this),d=gm(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?pm(a):mm(a)}return jS(a,n),GS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Sm&&(o=void 0),this.autoFreeze_&&Xc(o,!0),n){let a=[],d=[];co("Patches").generateReplacementPatches_(t,o,a,d),n(a,d)}return o}else ze(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,o;return[this.produce(t,r,(d,p)=>{n=d,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){at(e)||ze(8),mt(e)&&(e=JS(e));let t=$S(this),r=gm(e,void 0);return r[ot].isManual_=!0,mm(t),r}finishDraft(e,t){let r=e&&e[ot];(!r||!r.isManual_)&&ze(9);let{scope_:n}=r;return jS(n,t),GS(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=co("Patches").applyPatches_;return mt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function gm(e,t){let r=xs(e)?co("MapSet").proxyMap_(e,t):As(e)?co("MapSet").proxySet_(e,t):QP(e,t);return(t?t.scope_:KS()).drafts_.push(r),r}function JS(e){return mt(e)||ze(10,e),XS(e)}function XS(e){if(!at(e)||Zc(e))return e;let t=e[ot],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=lm(e,t.scope_.immer_.useStrictShallowCopy_)}else r=lm(e,!0);return Ss(r,(n,o)=>{zS(r,n,XS(o))}),t&&(t.finalized_=!1),r}function ZS(){let t="replace",r="add",n="remove";function o(C,A,F,v){switch(C.type_){case 0:case 2:return d(C,A,F,v);case 1:return a(C,A,F,v);case 3:return p(C,A,F,v)}}function a(C,A,F,v){let{base_:b,assigned_:P}=C,R=C.copy_;R.length<b.length&&([b,R]=[R,b],[F,v]=[v,F]);for(let E=0;E<b.length;E++)if(P[E]&&R[E]!==b[E]){let O=A.concat([E]);F.push({op:t,path:O,value:x(R[E])}),v.push({op:t,path:O,value:x(b[E])})}for(let E=b.length;E<R.length;E++){let O=A.concat([E]);F.push({op:r,path:O,value:x(R[E])})}for(let E=R.length-1;b.length<=E;--E){let O=A.concat([E]);v.push({op:n,path:O})}}function d(C,A,F,v){let{base_:b,copy_:P}=C;Ss(C.assigned_,(R,E)=>{let O=sm(b,R),L=sm(P,R),q=E?hs(b,R)?t:r:n;if(O===L&&q===t)return;let T=A.concat(R);F.push(q===n?{op:q,path:T}:{op:q,path:T,value:L}),v.push(q===r?{op:n,path:T}:q===n?{op:r,path:T,value:x(O)}:{op:t,path:T,value:x(O)})})}function p(C,A,F,v){let{base_:b,copy_:P}=C,R=0;b.forEach(E=>{if(!P.has(E)){let O=A.concat([R]);F.push({op:n,path:O,value:E}),v.unshift({op:r,path:O,value:E})}R++}),R=0,P.forEach(E=>{if(!b.has(E)){let O=A.concat([R]);F.push({op:r,path:O,value:E}),v.unshift({op:n,path:O,value:E})}R++})}function m(C,A,F,v){F.push({op:t,path:[],value:A===Sm?void 0:A}),v.push({op:t,path:[],value:C})}function f(C,A){return A.forEach(F=>{let{path:v,op:b}=F,P=C;for(let L=0;L<v.length-1;L++){let q=so(P),T=v[L];typeof T!="string"&&typeof T!="number"&&(T=""+T),(q===0||q===1)&&(T==="__proto__"||T==="constructor")&&ze(19),typeof P=="function"&&T==="prototype"&&ze(19),P=sm(P,T),typeof P!="object"&&ze(18,v.join("/"))}let R=so(P),E=g(F.value),O=v[v.length-1];switch(b){case t:switch(R){case 2:return P.set(O,E);case 3:ze(16);default:return P[O]=E}case r:switch(R){case 1:return O==="-"?P.push(E):P.splice(O,0,E);case 2:return P.set(O,E);case 3:return P.add(E);default:return P[O]=E}case n:switch(R){case 1:return P.splice(O,1);case 2:return P.delete(O);case 3:return P.delete(F.value);default:return delete P[O]}default:ze(17,b)}}),C}function g(C){if(!at(C))return C;if(Array.isArray(C))return C.map(g);if(xs(C))return new Map(Array.from(C.entries()).map(([F,v])=>[F,g(v)]));if(As(C))return new Set(Array.from(C).map(g));let A=Object.create(io(C));for(let F in C)A[F]=g(C[F]);return hs(C,gs)&&(A[gs]=C[gs]),A}function x(C){return mt(C)?g(C):C}NP("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var ft=new UP,Br=ft.produce,eu=ft.produceWithPatches.bind(ft),oU=ft.setAutoFreeze.bind(ft),aU=ft.setUseStrictShallowCopy.bind(ft),Cm=ft.applyPatches.bind(ft),iU=ft.createDraft.bind(ft),sU=ft.finishDraft.bind(ft);l();s();u();c();function _P(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function jP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $P(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var eh=e=>Array.isArray(e)?e:[e];function GP(e){let t=Array.isArray(e[0])?e[0]:e;return $P(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function HP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var fU=Symbol();var gU=Object.getPrototypeOf({});var WP=class{constructor(e){this.value=e}deref(){return this.value}},zP=typeof WeakRef<"u"?WeakRef:WP,KP=0,th=1;function tu(){return{s:KP,v:void 0,o:null,p:null}}function Wo(e,t={}){let r=tu(),{resultEqualityCheck:n}=t,o,a=0;function d(){let p=r,{length:m}=arguments;for(let x=0,C=m;x<C;x++){let A=arguments[x];if(typeof A=="function"||typeof A=="object"&&A!==null){let F=p.o;F===null&&(p.o=F=new WeakMap);let v=F.get(A);v===void 0?(p=tu(),F.set(A,p)):p=v}else{let F=p.p;F===null&&(p.p=F=new Map);let v=F.get(A);v===void 0?(p=tu(),F.set(A,p)):p=v}}let f=p,g;if(p.s===th)g=p.v;else if(g=e.apply(null,arguments),a++,n){let x=o?.deref?.()??o;x!=null&&n(x,g)&&(g=x,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new zP(g):g}return f.s=th,f.v=g,g}return d.clearCache=()=>{r=tu(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}function rh(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),_P(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let g={...r,...m},{memoize:x,memoizeOptions:C=[],argsMemoize:A=Wo,argsMemoizeOptions:F=[],devModeChecks:v={}}=g,b=eh(C),P=eh(F),R=GP(o),E=x(function(){return a++,f.apply(null,arguments)},...b),O=!0,L=A(function(){d++;let T=HP(R,arguments);return p=E.apply(null,T),p},...P);return Object.assign(L,{resultFunc:f,memoizedResultFunc:E,dependencies:R,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:x,argsMemoize:A})};return Object.assign(n,{withTypes:()=>n}),n}var de=rh(Wo),YP=Object.assign((e,t=de)=>{jP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>YP});l();s();u();c();function nh(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var oh=nh(),ah=nh;var JP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ho:Ho.apply(null,arguments)},qU=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},XP=e=>e&&typeof e.match=="function";function w(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Qt(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=>Kc(n)&&n.type===e,r}var lh=class Fs extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Fs.prototype)}static get[Symbol.species](){return Fs}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Fs(...t[0].concat(this)):new Fs(...t.concat(this))}};function ih(e){return at(e)?Br(e,()=>{}):e}function sh(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ZP(e){return typeof e=="boolean"}var ew=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},d=new lh;return r&&(ZP(r)?d.push(oh):d.push(ah(r.extraArgument))),d},un="RTK_autoBatch",Ko=()=>e=>({payload:e,meta:{[un]:!0}}),ch=e=>t=>{setTimeout(t,e)},tw=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ch(10):e.type==="callback"?e.queueNotification:ch(e.timeout),f=()=>{d=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let x=()=>o&&g(),C=n.subscribe(x);return p.add(g),()=>{C(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[un],a=!o,a&&(d||(d=!0,m(f))),n.dispatch(g)}finally{o=!0}}})},rw=e=>function(r){let{autoBatch:n=!0}=r??{},o=new lh(e);return n&&o.push(tw(typeof n=="object"?n:void 0)),o};function dh(e){let t=ew(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Yt(r))p=Go(r);else throw new Error(Qt(1));let m;typeof n=="function"?m=n(t):m=t();let f=Ho;o&&(f=JP({trace:!1,...(typeof o=="object"&&o)}));let g=_S(...m),x=rw(g),C=typeof d=="function"?d(x):x(),A=f(...C);return im(p,a,A)}function ph(e){let t={},r=[],n,o={addCase(a,d){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Qt(28));if(p in t)throw new Error(Qt(29));return t[p]=d,o},addMatcher(a,d){return r.push({matcher:a,reducer:d}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function nw(e){return typeof e=="function"}function ee(e,t){let[r,n,o]=ph(t),a;if(nw(e))a=()=>ih(e());else{let p=ih(e);a=()=>p}function d(p=a(),m){let f=[r[m.type],...n.filter(({matcher:g})=>g(m)).map(({reducer:g})=>g)];return f.filter(g=>!!g).length===0&&(f=[o]),f.reduce((g,x)=>{if(x)if(mt(g)){let A=x(g,m);return A===void 0?g:A}else{if(at(g))return Br(g,C=>x(C,m));{let C=x(g,m);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return g},p)}return d.getInitialState=a,d}var mh=(e,t)=>XP(e)?e.match(t):e(t);function Jt(...e){return t=>e.some(r=>mh(r,t))}function zo(...e){return t=>e.every(r=>mh(r,t))}function nu(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 Rs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ou(...e){return e.length===0?t=>nu(t,["pending"]):Rs(e)?Jt(...e.map(t=>t.pending)):ou()(e[0])}function uo(...e){return e.length===0?t=>nu(t,["rejected"]):Rs(e)?Jt(...e.map(t=>t.rejected)):uo()(e[0])}function bs(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?zo(uo(...e),t):Rs(e)?zo(uo(...e),t):bs()(e[0])}function Ur(...e){return e.length===0?t=>nu(t,["fulfilled"]):Rs(e)?Jt(...e.map(t=>t.fulfilled)):Ur()(e[0])}function au(...e){return e.length===0?t=>nu(t,["pending","fulfilled","rejected"]):Rs(e)?Jt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):au()(e[0])}var ow="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",iu=(e=21)=>{let t="",r=e;for(;r--;)t+=ow[Math.random()*64|0];return t},aw=["name","message","stack","code"],xm=class{constructor(e,t){ye(this,"_type");this.payload=e,this.meta=t}},uh=class{constructor(e,t){ye(this,"_type");this.payload=e,this.meta=t}},iw=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of aw)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ae=(()=>{function e(t,r,n){let o=w(t+"/fulfilled",(m,f,g,x)=>({payload:m,meta:{...(x||{}),arg:g,requestId:f,requestStatus:"fulfilled"}})),a=w(t+"/pending",(m,f,g)=>({payload:void 0,meta:{...(g||{}),arg:f,requestId:m,requestStatus:"pending"}})),d=w(t+"/rejected",(m,f,g,x,C)=>({payload:x,error:(n&&n.serializeError||iw)(m||"Rejected"),meta:{...(C||{}),arg:g,requestId:f,rejectedWithValue:!!x,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,g,x)=>{let C=n?.idGenerator?n.idGenerator(m):iu(),A=new i.AbortController,F,v;function b(R){v=R,A.abort()}let P=_asyncToGenerator(function*(){let R;try{let O=n?.condition?.(m,{getState:g,extra:x});if(cw(O)&&(O=yield O),O===!1||A.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let L=new Promise((q,T)=>{F=()=>{T({name:"AbortError",message:v||"Aborted"})},A.signal.addEventListener("abort",F)});f(a(C,m,n?.getPendingMeta?.({requestId:C,arg:m},{getState:g,extra:x}))),R=yield Promise.race([L,Promise.resolve(r(m,{dispatch:f,getState:g,extra:x,requestId:C,signal:A.signal,abort:b,rejectWithValue:(q,T)=>new xm(q,T),fulfillWithValue:(q,T)=>new uh(q,T)})).then(q=>{if(q instanceof xm)throw q;return q instanceof uh?o(q.payload,C,m,q.meta):o(q,C,m)})])}catch(O){R=O instanceof xm?d(null,C,m,O.payload,O.meta):d(O,C,m)}finally{F&&A.signal.removeEventListener("abort",F)}return n&&!n.dispatchConditionRejection&&d.match(R)&&R.meta.condition||f(R),R})();return Object.assign(P,{abort:b,requestId:C,arg:m,unwrap(){return P.then(sw)}})}}return Object.assign(p,{pending:a,rejected:d,fulfilled:o,settled:Jt(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function sw(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function cw(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var fh=Symbol.for("rtk-slice-createasyncthunk"),LU={[fh]:ae};function uw(e,t){return`${e}/${t}`}function lw({creators:e}={}){let t=e?.asyncThunk?.[fh];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Qt(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(pw()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(R,E){let O=typeof R=="string"?R:R.type;if(!O)throw new Error(Qt(12));if(O in m.sliceCaseReducersByType)throw new Error(Qt(13));return m.sliceCaseReducersByType[O]=E,f},addMatcher(R,E){return m.sliceMatchers.push({matcher:R,reducer:E}),f},exposeAction(R,E){return m.actionCreators[R]=E,f},exposeCaseReducer(R,E){return m.sliceCaseReducersByName[R]=E,f}};p.forEach(R=>{let E=d[R],O={reducerName:R,type:uw(o,R),createNotation:typeof n.reducers=="function"};fw(E)?Sw(O,E,f,t):mw(O,E,f)});function g(){let[R={},E=[],O=void 0]=typeof n.extraReducers=="function"?ph(n.extraReducers):[n.extraReducers],L={...R,...m.sliceCaseReducersByType};return ee(n.initialState,q=>{for(let T in L)q.addCase(T,L[T]);for(let T of m.sliceMatchers)q.addMatcher(T.matcher,T.reducer);for(let T of E)q.addMatcher(T.matcher,T.reducer);O&&q.addDefaultCase(O)})}let x=R=>R,C=new Map,A;function F(R,E){return A||(A=g()),A(R,E)}function v(){return A||(A=g()),A.getInitialState()}function b(R,E=!1){function O(q){let T=q[R];return typeof T>"u"&&E&&(T=v()),T}function L(q=x){let T=sh(C,E,()=>new WeakMap);return sh(T,q,()=>{let N={};for(let[M,B]of Object.entries(n.selectors??{}))N[M]=dw(B,q,v,E);return N})}return{reducerPath:R,getSelectors:L,get selectors(){return L(O)},selectSlice:O}}let P={name:o,reducer:F,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:v,...b(a),injectInto(R,{reducerPath:E,...O}={}){let L=E??a;return R.inject({reducerPath:L,reducer:F},O),{...P,...b(L,!0)}}};return P}}function dw(e,t,r,n){function o(a,...d){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var lo=lw();function pw(){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 mw({type:e,reducerName:t,createNotation:r},n,o){let a,d;if("reducer"in n){if(r&&!gw(n))throw new Error(Qt(17));a=n.reducer,d=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,d?w(e,d):w(e))}function fw(e){return e._reducerDefinitionType==="asyncThunk"}function gw(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sw({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Qt(18));let{payloadCreator:a,fulfilled:d,pending:p,rejected:m,settled:f,options:g}=r,x=o(e,a,g);n.exposeAction(t,x),d&&n.addCase(x.fulfilled,d),p&&n.addCase(x.pending,p),m&&n.addCase(x.rejected,m),f&&n.addMatcher(x.settled,f),n.exposeCaseReducer(t,{fulfilled:d||ru,pending:p||ru,rejected:m||ru,settled:f||ru})}function ru(){}var gh="listener",Sh="completed",hh="cancelled",QU=`task-${hh}`,BU=`task-${Sh}`,UU=`${gh}-${hh}`,_U=`${gh}-${Sh}`;var{assign:yh}=Object;var Am="listenerMiddleware";var hw=yh(w(`${Am}/add`),{withTypes:()=>hw}),jU=w(`${Am}/removeAll`),yw=yh(w(`${Am}/remove`),{withTypes:()=>yw});var $U=Symbol.for("rtk-state-proxy-original");function Qt(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. `}l();s();u();c();l();s();u();c();function Cw({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,a,r))}var xw=/^(?:[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 Aw(e){return typeof e=="string"&&xw.test(e)}var Ke=[];for(let e=0;e<256;++e)Ke.push((e+256).toString(16).slice(1));function Fw(e,t=0){return(Ke[e[t+0]]+Ke[e[t+1]]+Ke[e[t+2]]+Ke[e[t+3]]+"-"+Ke[e[t+4]]+Ke[e[t+5]]+"-"+Ke[e[t+6]]+Ke[e[t+7]]+"-"+Ke[e[t+8]]+Ke[e[t+9]]+"-"+Ke[e[t+10]]+Ke[e[t+11]]+Ke[e[t+12]]+Ke[e[t+13]]+Ke[e[t+14]]+Ke[e[t+15]]).toLowerCase()}var Fm,Rw=new Uint8Array(16);function bw(){if(!Fm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Fm=crypto.getRandomValues.bind(crypto)}return Fm(Rw)}var vw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ch={randomUUID:vw};function Pw(e,t,r){if(Ch.randomUUID&&!e)return Ch.randomUUID();e=e||{};let n=e.random??e.rng?.()??bw();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Fw(n)}function ww(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&Aw(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var Ah="1.0.0";function Ew(e){let{trackingId:t}=e;return{trackingId:t}}function Iw(e){return(e.source||[]).concat([`relay@${Ah}`])}function Fh(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:d}=r,p=Ew(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:Iw(t),clientId:m,userAgent:d(),referrer:o(),location:a()})}function Tw(e,t,r,n,o){return{...t,meta:Fh(e,r,n,o)}}var Ow="*";function kw(){let e=[];function t({type:m,callback:f}){return e.findIndex(g=>g.type===m&&g.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(g){console.error(g)}})}function a(m){if(m===Ow)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function d(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?d({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function xh({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source})})}function qw(e){let t=xh(e);return{get:()=>t,update:r=>{t=xh({...t,...r})}}}function Dw(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var Rm=Vw();function Vw(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let d=a.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Nw(){return{getItem(e){return Rm.getItem(e)||localStorage.getItem(e)},removeItem(e){Rm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Rm.setItem(e,t,31556952e3)}}}function Mw(){let e=document.referrer;return e===""?null:e}function Lw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Dw().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>Mw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Pw(),storage:Nw()}}function Qw(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function Bw(){return{getItem(){return null},removeItem(){},setItem(){}}}function Uw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Bw()}}function _w(e){return e.get().mode!=="disabled"&&jw()&&Qw()?Lw():Uw()}function jw(){try{return typeof window=="object"}catch{return!1}}function $w(e){return{get:()=>Object.freeze(_w(e))}}function Rh(e){let t=qw(e),r=kw(),n=$w(t),o=ww(n);return{emit:(a,d)=>{let p=t.get(),m=n.get(),f=Tw(a,d,p,m,o);return Cw({config:p,environment:m,event:f,listenerManager:r})},getMeta:a=>Fh(a,t.get(),n.get(),o),on:(a,d)=>r.add({type:a,callback:d}),off:(a,d)=>r.remove(a,d),updateConfig:a=>t.update(a),version:Ah}}l();s();u();c();l();s();u();c();var ln="3.15.1",bh=["@coveo/atomic","@coveo/quantic"];var Xt=de(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ln}`));var Yo=de(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Xt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},d)=>Rh({mode:a?"emit":"disabled",url:o??jc(e,t),token:r,trackingId:n,source:d}));l();s();u();c();l();s();u();c();function _r(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function D(e,t,r,n){function o(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function p(g){try{f(n.next(g))}catch(x){d(x)}}function m(g){try{f(n.throw(g))}catch(x){d(x)}}function f(g){g.done?a(g.value):o(g.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var me;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(me||(me={}));function Pm(){return typeof window<"u"}function Qm(){return typeof navigator<"u"}function Jo(){return typeof document<"u"}function wm(){try{return typeof localStorage<"u"}catch{return!1}}function Gw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Lh(){return Qm()&&navigator.cookieEnabled}var Hw=[me.click,me.custom,me.search,me.view],Ww=(e,t)=>Hw.indexOf(e)!==-1?Object.assign({language:Jo()?document.documentElement.lang:"unknown",userAgent:Qm()?navigator.userAgent:"unknown"},t):t,ws=class e{static set(t,r,n){var o,a,d,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?vh(t,r,a):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],vh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function vh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function zw(){return wm()?localStorage:Lh()?new Es:Gw()?sessionStorage:new Zo}var Es=class e{getItem(t){return ws.get(`${e.prefix}${t}`)}removeItem(t){ws.erase(`${e.prefix}${t}`)}setItem(t,r,n){ws.set(`${e.prefix}${t}`,r,n)}};Es.prefix="coveo_";var Em=class{constructor(){this.cookieStorage=new Es}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)}},Zo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},vs="__coveo.analytics.history",Qh=20,Bh=1e3*60,Uh=75,ea=class{constructor(t){this.store=t||zw()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return D(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return D(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(vs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return D(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(vs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(vs,JSON.stringify(t.slice(0,Qh)))}catch{}}clear(){try{this.store.removeItem(vs)}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,Uh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Bh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}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))}},_h=Object.freeze({__proto__:null,HistoryStore:ea,MAX_NUMBER_OF_HISTORY_ELEMENTS:Qh,MAX_VALUE_SIZE:Uh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:Bh,STORE_KEY:vs,default:ea}),Kw=(e,t)=>D(void 0,void 0,void 0,function*(){return e===me.view?(yield Yw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Yw=e=>D(void 0,void 0,void 0,function*(){let t=new ea,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),su,Jw=new Uint8Array(16);function Xw(){if(!su&&(su=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!su))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return su(Jw)}var Zw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function uu(e){return typeof e=="string"&&Zw.test(e)}var Ye=[];for(let e=0;e<256;++e)Ye.push((e+256).toString(16).slice(1));function jh(e,t=0){return(Ye[e[t+0]]+Ye[e[t+1]]+Ye[e[t+2]]+Ye[e[t+3]]+"-"+Ye[e[t+4]]+Ye[e[t+5]]+"-"+Ye[e[t+6]]+Ye[e[t+7]]+"-"+Ye[e[t+8]]+Ye[e[t+9]]+"-"+Ye[e[t+10]]+Ye[e[t+11]]+Ye[e[t+12]]+Ye[e[t+13]]+Ye[e[t+14]]+Ye[e[t+15]]).toLowerCase()}function eE(e){if(!uu(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function tE(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var rE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",nE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function oE(e,t,r){function n(o,a,d,p){var m;if(typeof o=="string"&&(o=tE(o)),typeof a=="string"&&(a=eE(a)),((m=a)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(a),f.set(o,a.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let g=0;g<16;++g)d[p+g]=f[g];return d}return jh(f)}try{n.name=e}catch{}return n.DNS=rE,n.URL=nE,n}var aE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ph={randomUUID:aE};function po(e,t,r){if(Ph.randomUUID&&!t&&!e)return Ph.randomUUID();e=e||{};let n=e.random||(e.rng||Xw)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return jh(n)}function iE(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 bm(e,t){return e<<t|e>>>32-t}function sE(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];a[d]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let A=0;A<16;++A)p[A]=a[d][A];for(let A=16;A<80;++A)p[A]=bm(p[A-3]^p[A-8]^p[A-14]^p[A-16],1);let m=r[0],f=r[1],g=r[2],x=r[3],C=r[4];for(let A=0;A<80;++A){let F=Math.floor(A/20),v=bm(m,5)+iE(F,f,g,x)+C+t[F]+p[A]>>>0;C=x,x=g,g=bm(f,30)>>>0,f=m,m=v}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+x>>>0,r[4]=r[4]+C>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var cE=oE("v5",80,sE),wh=cE,$h="2.30.43",Eh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ps={pageview:"pageview",event:"event"},lu=class{constructor({client:t,uuidGenerator:r=po}){this.client=t,this.uuidGenerator=r}},Im=class extends lu{constructor({client:t,uuidGenerator:r=po}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Eh(window.location),this.lastReferrer=Jo()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:Jo()?document.title:"",encoding:Jo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Ps.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ps.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ps.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ps.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 Eh(window.location)}},dn=class e{constructor(t,r){if(!uu(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 a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return uu(a)?new e(a,Number.parseInt(o)*1e3):null}};dn.cvo_cid="cvo_cid";dn.expirationTime=120;var Tm=class extends lu{constructor({client:t,uuidGenerator:r=po}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return D(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(dn.cvo_cid,new dn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Tm.Id="link";var Rt=Object.keys;function cu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var vm=128,Gh=192,Ih=224,Th=240;function uE(e){return(e&248)===Th?4:(e&Th)===Ih?3:(e&Ih)===Gh?2:1}function lE(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&vm)!=vm)break;if(r-=3,(n&Gh)!=vm){t-r>=uE(n)*3&&(r=t);break}}return e.substring(0,r)}var Om={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"},dE=Rt(Om).map(e=>Om[e]),pE=[...dE].join("|"),mE=new RegExp(`^(${pE}$)`),fE={svcAction:"svc_action",svcActionData:"svc_action_data"},gE=e=>Rt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Om[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),SE=e=>mE.test(e),hE=[SE],Oh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},kh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Je={action:"pa",list:"pal",listSource:"pls"},du={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},yE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],km={id:"quoteId",affiliation:"quoteAffiliation"},qm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},CE={add:Je,bookmark_add:Je,bookmark_remove:Je,click:Je,checkout:Je,checkout_option:Je,detail:Je,impression:Je,remove:Je,refund:Object.assign(Object.assign({},Je),du),purchase:Object.assign(Object.assign({},Je),du),quickview:Je,quote:Object.assign(Object.assign({},Je),km),review:Object.assign(Object.assign({},Je),qm)},xE=Rt(Oh).map(e=>Oh[e]),AE=Rt(kh).map(e=>kh[e]),FE=Rt(Je).map(e=>Je[e]),RE=Rt(du).map(e=>du[e]),bE=Rt(qm).map(e=>qm[e]),vE=Rt(km).map(e=>km[e]),PE=[...xE,"custom"].join("|"),wE=[...AE,"custom"].join("|"),Hh="(pr[0-9]+)",Wh="(il[0-9]+pi[0-9]+)",EE=new RegExp(`^${Hh}(${PE})$`),IE=new RegExp(`^(${Wh}(${wE}))|(il[0-9]+nm)$`),TE=new RegExp(`^(${FE.join("|")})$`),OE=new RegExp(`^(${RE.join("|")})$`),kE=new RegExp(`^${Hh}custom$`),qE=new RegExp(`^${Wh}custom$`),DE=new RegExp(`^(${[...yE,...bE,...vE].join("|")})$`),VE=e=>EE.test(e),NE=e=>IE.test(e),ME=e=>TE.test(e),LE=e=>OE.test(e),QE=e=>DE.test(e),BE=[NE,VE,ME,LE,QE],UE=[kE,qE],_E={anonymizeIp:"aip"},jE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},$E={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},GE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],HE=Object.assign(Object.assign(Object.assign(Object.assign({},_E),jE),$E),GE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Dm=Object.assign(Object.assign({},HE),fE),WE=e=>{let t=!!e.action&&CE[e.action]||{};return Rt(e).reduce((r,n)=>{let o=t[n]||Dm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},zE=Rt(Dm).map(e=>Dm[e]),KE=e=>zE.indexOf(e)!==-1,YE=e=>e==="custom",JE=e=>[...BE,...hE,KE,YE].some(t=>t(e)),XE=e=>Rt(e).reduce((t,r)=>{let n=ZE(r);return n?Object.assign(Object.assign({},t),eI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),ZE=e=>{let t;return[...UE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},eI=(e,t)=>Rt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Vm=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let o=t,a=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return D(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[me.click,me.custom,me.search,me.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}},Nm=class{sendEvent(t,r){return D(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){return Promise.resolve()})}},qh=S.fetch,pu=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,d=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${d}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,g=_r(m,["url"]),x;try{x=yield qh(f,g)}catch(C){console.error("An error has occured when sending the event.",C);return}if(x.ok){let C=yield x.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{x.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,x,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield qh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[me.click,me.custom,me.search,me.view].indexOf(t)!==-1}getVisitorIdParam(){return D(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Mm=class{constructor(t,r){wm()&&Lh()?this.storage=new Em:wm()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Zo),this.client=new pu(t),this.beaconClient=new Vm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Lm=class{constructor(t,r){this.storage=r||new Zo,this.client=new pu(t)}getClientDependingOnEventType(t){return this.client}},mu=class{constructor(){this.storage=new Zo,this.client=new Nm}getClientDependingOnEventType(t){return this.client}},tI="xx",rI=e=>e?.startsWith(tI)||!1,nI=`
28
28
  We've detected you're using React Native but have not provided the corresponding runtime,
29
29
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
30
30
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native