@coveo/quantic 3.36.6 → 3.36.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +14 -14
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-core-generated-answer.d.ts +54 -11
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-generated-answer.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-generated-answer-with-follow-ups.d.ts +16 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-analytics-actions.d.ts +15 -10
- package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/headless.js +4 -4
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +13 -13
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +2 -2
- package/package.json +3 -3
|
@@ -23,7 +23,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new si(r)}var si=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},lt=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw cA(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}},Oe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ie(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 We(e){return e===void 0}function uA(e){return e===null}function ie(e){return We(e)||uA(e)}var ue=class{constructor(e={}){xe(this,"value");this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(lA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function lA(e){return We(e)||Zp(e)}function Zp(e){return typeof e=="boolean"}var te=class{constructor(e={}){xe(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(dA(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 dA(e){return We(e)||ef(e)}function ef(e){return typeof e=="number"&&!Number.isNaN(e)}var pA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){xe(this,"value");xe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Oe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(We(e))return null;if(!ua(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(pA.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 ua(e){return Object.prototype.toString.call(e)==="[object String]"}var ee=class{constructor(e={}){xe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(We(e))return this.config.options.required?"value is required and is currently undefined":null;if(!tf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ie(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function tf(e){return e!==void 0&&typeof e=="object"}var ge=class{constructor(e={}){xe(this,"value");this.config=e,this.value=new Oe(this.config)}validate(e){if(!ie(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ie(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&&ie(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 Zp(e)||ua(e)||ef(e)||tf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function rf(e){return Array.isArray(e)}var Pu=class{constructor(e){xe(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:We(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};m();d();f();p();function nf(e){return Array.isArray(e)}function la(e){return e.trim()===""}var fA=new Set(["1",1,"yes",!0]);function of(){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=>fA.has(r))}function af(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ci(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function da(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function mA(e){if(la(e.openingDelimiter)||la(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ie(e.content)||la(e.content))return e.content;if(e.highlights.length===0)return Un(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Un(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Un(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Un(e.content.slice(n))),r}function gA(e,t){return e=Un(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Nu(n,t.notMatchDelimiters):o?Nu(o,t.exactMatchDelimiters):i?Nu(i,t.correctionDelimiters):r)}function Nu(e,t){return t?t.open+e+t.close:e}function Un(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var vf=_t(mf(),1);m();d();f();p();var Mt=new Error("Failed to load reducers."),Vn=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},$r=class extends Error{constructor(r,n){super();xe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function gf(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function hf(e){return typeof e!="object"||!e?!1:Object.values(e).every(VA)}function VA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function yf(e){return e===429}var kt=class e{static call(t){return _asyncToGenerator(function*(){let r=GA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield A(i,a);if(yf(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,vf.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&yf(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Vn;case 404:throw new $r(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new $r(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=ci(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function Be(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pr(e,t="prod"){return`${Be(e,t)}/rest/search/v2`}function fa(e,t="prod"){return`${Be(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function GA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=BA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function BA(e,t){return t==="application/x-www-form-urlencoded"?hf(e)?gf(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var ma=e=>e;m();d();f();p();m();d();f();p();function ga(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function jt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:ga(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:ga(),extendedResults:{},searchAction:void 0}}m();d();f();p();function fr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mr=e=>{let{response:t}=e;return t.body?$A(e):QA(t)},$A=e=>zA(e)?WA(e):HA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},QA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function HA(e){return e.body.statusCode!==void 0}function zA(e){return e.body.exception!==void 0}var WA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var gr=class{constructor(){xe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();f();p();m();d();f();p();var di=class{constructor(t){xe(this,"_basePath");xe(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};m();d();f();p();function Sf(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var Xt=(e,t,r,n)=>{let o=new di(`${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 wf=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield kt.call({...Xt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:fr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Sf(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return KA(a)?{success:a}:{error:mr({response:r,body:a})}});return function wf(_x3,_x4){return _ref3.apply(this,arguments)}}();function KA(e){return typeof e=="string"}m();d();f();p();function YA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function XA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ha(e,t){if(t&&e.name==="AbortError")return{error:XA(e)};if(e instanceof $r)return{error:YA(e)};throw e}var ya=class{constructor(t){this.options=t;xe(this,"apiCallsQueues",{unknown:new gr,mainSearch:new gr,facetValues:new gr,foldingCollection:new gr,instantResults:new gr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/plan"),requestParams:fr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return ha(r);let n=yield r.json();return ZA(n)?{success:n}:{error:mr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:fr(t),..._this3.options});if(r instanceof Error)return ha(r);let n=yield r.json(),o={response:r,body:n};return JA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>kt.call({...Xt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return ha(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return Af(i)?(a.body=bf(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:mr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/facet"),requestParams:fr(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 kt.call({...Xt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Af(n)){let o={response:r,body:n};return o.body=bf(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return wf(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return eb(n)?{success:n}:{error:mr({response:r,body:n})}})()}},va=e=>e.success!==void 0,dt=e=>e.error!==void 0;function Af(e){return e.results!==void 0}function bf(e){let t=ga();return ie(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function JA(e){return e.completions!==void 0}function ZA(e){return e.preprocessingOutput!==void 0}function eb(e){return e.fields!==void 0}m();d();f();p();var xf=e=>e,Cf=e=>e,Ef=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function Ke(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 tb=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rf=tb,Bu=()=>Math.random().toString(36).substring(7).split("").join("."),rb={INIT:`@@redux/INIT${Bu()}`,REPLACE:`@@redux/REPLACE${Bu()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bu()}`},Sa=rb;function qt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function $u(e,t,r){if(typeof e!="function")throw new Error(Ke(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ke(1));return r($u)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((E,C)=>{a.set(C,E)}))}function h(){if(c)throw new Error(Ke(3));return o}function v(E){if(typeof E!="function")throw new Error(Ke(4));if(c)throw new Error(Ke(5));let C=!0;u();let I=s++;return a.set(I,E),function(){if(C){if(c)throw new Error(Ke(6));C=!1,u(),a.delete(I),i=null}}}function S(E){if(!qt(E))throw new Error(Ke(7));if(typeof E.type>"u")throw new Error(Ke(8));if(typeof E.type!="string")throw new Error(Ke(17));if(c)throw new Error(Ke(9));try{c=!0,o=n(o,E)}finally{c=!1}return(i=a).forEach(I=>{I()}),E}function g(E){if(typeof E!="function")throw new Error(Ke(10));n=E,S({type:Sa.REPLACE})}function y(){let E=v;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(Ke(11));function I(){let _=C;_.next&&_.next(h())}return I(),{unsubscribe:E(I)}},[Rf](){return this}}}return S({type:Sa.INIT}),{dispatch:S,subscribe:v,getState:h,replaceReducer:g,[Rf]:y}}function nb(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Sa.INIT})>"u")throw new Error(Ke(12));if(typeof r(void 0,{type:Sa.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function Gn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{nb(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let v=0;v<n.length;v++){let S=n[v],g=r[S],y=s[S],x=g(y,c);if(typeof x>"u"){let E=c&&c.type;throw new Error(Ke(14))}h[S]=x,u=u||x!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function Bn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function If(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ke(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=Bn(...s)(o.dispatch),{...o,dispatch:i}}}function $n(e){return qt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var el=Symbol.for("immer-nothing"),pi=Symbol.for("immer-draftable"),pt=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Qn=Object.getPrototypeOf;function vt(e){return!!e&&!!e[pt]}function ft(e){return e?Nf(e)||Array.isArray(e)||!!e[pi]||!!e.constructor?.[pi]||Hn(e)||vi(e):!1}var ob=Object.prototype.constructor.toString(),Tf=new WeakMap;function Nf(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Tf.get(r);return n===void 0&&(n=Function.toString.call(r),Tf.set(r,n)),n===ob}function tl(e){return vt(e)||Ye(15,e),e[pt].base_}function fi(e,t,r=!0){Hr(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Hr(e){let t=e[pt];return t?t.type_:Array.isArray(e)?1:Hn(e)?2:vi(e)?3:0}function mi(e,t){return Hr(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Qu(e,t){return Hr(e)===2?e.get(t):e[t]}function Ff(e,t,r){let n=Hr(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function ib(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hn(e){return e instanceof Map}function vi(e){return e instanceof Set}function Qr(e){return e.copy_||e.base_}function Wu(e,t){if(Hn(e))return new Map(e);if(vi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Nf(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[pt];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(Qn(e),n)}else{let n=Qn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function xa(e,t=!1){return Ca(e)||vt(e)||!ft(e)||(Hr(e)>1&&Object.defineProperties(e,{set:wa,add:wa,clear:wa,delete:wa}),Object.freeze(e),t&&Object.values(e).forEach(r=>xa(r,!0))),e}function ab(){Ye(2)}var wa={value:ab};function Ca(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Ku={};function zr(e){let t=Ku[e];return t||Ye(0,e),t}function sb(e,t){Ku[e]||(Ku[e]=t)}var gi;function Df(){return gi}function cb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function _f(e,t){t&&(zr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yu(e){Xu(e),e.drafts_.forEach(ub),e.drafts_=null}function Xu(e){e===gi&&(gi=e.parent_)}function kf(e){return gi=cb(gi,e)}function ub(e){let t=e[pt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Of(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[pt].modified_&&(Yu(t),Ye(4)),ft(e)&&(e=Aa(t,e),t.parent_||ba(t,e)),t.patches_&&zr("Patches").generateReplacementPatches_(r[pt].base_,e,t.patches_,t.inversePatches_)):e=Aa(t,r,[]),Yu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==el?e:void 0}function Aa(e,t,r){if(Ca(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[pt];if(!o)return fi(t,(i,a)=>Pf(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return ba(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,s=!1;o.type_===3&&(a=new Set(i),i.clear(),s=!0),fi(a,(c,u)=>Pf(e,o,i,c,u,r,s),n),ba(e,i,!1),r&&e.patches_&&zr("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Pf(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let s=Ca(o);if(!(s&&!a)){if(vt(o)){let c=i&&t&&t.type_!==3&&!mi(t.assigned_,n)?i.concat(n):void 0,u=Aa(e,o,c);if(Ff(r,n,u),vt(u))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(ft(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&s)return;Aa(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Hn(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ba(e,o)}}}function ba(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xa(t,r)}function lb(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Df(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=rl;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}var rl={get(e,t){if(t===pt)return e;let r=Qr(e);if(!mi(r,t))return db(e,r,t);let n=r[t];return e.finalized_||!ft(n)?n:n===Hu(e.base_,t)?(zu(e),e.copy_[t]=Zu(n,e)):n},has(e,t){return t in Qr(e)},ownKeys(e){return Reflect.ownKeys(Qr(e))},set(e,t,r){let n=Mf(Qr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Hu(Qr(e),t),i=o?.[pt];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ib(r,o)&&(r!==void 0||mi(e.base_,t)))return!0;zu(e),Ju(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 Hu(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,zu(e),Ju(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Qr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ye(11)},getPrototypeOf(e){return Qn(e.base_)},setPrototypeOf(){Ye(12)}},hi={};fi(rl,(e,t)=>{hi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return rl.set.call(this,e[0],t,r,e[0])};function Hu(e,t){let r=e[pt];return(r?Qr(r):e)[t]}function db(e,t,r){let n=Mf(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Mf(e,t){if(!(t in e))return;let r=Qn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Qn(r)}}function Ju(e){e.modified_||(e.modified_=!0,e.parent_&&Ju(e.parent_))}function zu(e){e.copy_||(e.copy_=Wu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(ft(t)){let i=kf(this),a=Zu(t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Yu(i):Xu(i)}return _f(i,n),Of(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===el&&(o=void 0),this.autoFreeze_&&xa(o,!0),n){let i=[],a=[];zr("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ye(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ft(e)||Ye(8),vt(e)&&(e=jf(e));let t=kf(this),r=Zu(e,void 0);return r[pt].isManual_=!0,Xu(t),r}finishDraft(e,t){let r=e&&e[pt];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return _f(n,t),Of(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=zr("Patches").applyPatches_;return vt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Zu(e,t){let r=Hn(e)?zr("MapSet").proxyMap_(e,t):vi(e)?zr("MapSet").proxySet_(e,t):lb(e,t);return(t?t.scope_:Df()).drafts_.push(r),r}function jf(e){return vt(e)||Ye(10,e),qf(e)}function qf(e){if(!ft(e)||Ca(e))return e;let t=e[pt],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wu(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Wu(e,!0);return fi(r,(o,i)=>{Ff(r,o,qf(i))},n),t&&(t.finalized_=!1),r}function Lf(){let t="replace",r="add",n="remove";function o(S,g,y,x){switch(S.type_){case 0:case 2:return a(S,g,y,x);case 1:return i(S,g,y,x);case 3:return s(S,g,y,x)}}function i(S,g,y,x){let{base_:E,assigned_:C}=S,I=S.copy_;I.length<E.length&&([E,I]=[I,E],[y,x]=[x,y]);for(let T=0;T<E.length;T++)if(C[T]&&I[T]!==E[T]){let _=g.concat([T]);y.push({op:t,path:_,value:v(I[T])}),x.push({op:t,path:_,value:v(E[T])})}for(let T=E.length;T<I.length;T++){let _=g.concat([T]);y.push({op:r,path:_,value:v(I[T])})}for(let T=I.length-1;E.length<=T;--T){let _=g.concat([T]);x.push({op:n,path:_})}}function a(S,g,y,x){let{base_:E,copy_:C}=S;fi(S.assigned_,(I,T)=>{let _=Qu(E,I),q=Qu(C,I),N=T?mi(E,I)?t:r:n;if(_===q&&N===t)return;let k=g.concat(I);y.push(N===n?{op:N,path:k}:{op:N,path:k,value:q}),x.push(N===r?{op:n,path:k}:N===n?{op:r,path:k,value:v(_)}:{op:t,path:k,value:v(_)})})}function s(S,g,y,x){let{base_:E,copy_:C}=S,I=0;E.forEach(T=>{if(!C.has(T)){let _=g.concat([I]);y.push({op:n,path:_,value:T}),x.unshift({op:r,path:_,value:T})}I++}),I=0,C.forEach(T=>{if(!E.has(T)){let _=g.concat([I]);y.push({op:r,path:_,value:T}),x.unshift({op:n,path:_,value:T})}I++})}function c(S,g,y,x){y.push({op:t,path:[],value:g===el?void 0:g}),x.push({op:t,path:[],value:S})}function u(S,g){return g.forEach(y=>{let{path:x,op:E}=y,C=S;for(let q=0;q<x.length-1;q++){let N=Hr(C),k=x[q];typeof k!="string"&&typeof k!="number"&&(k=""+k),(N===0||N===1)&&(k==="__proto__"||k==="constructor")&&Ye(19),typeof C=="function"&&k==="prototype"&&Ye(19),C=Qu(C,k),typeof C!="object"&&Ye(18,x.join("/"))}let I=Hr(C),T=h(y.value),_=x[x.length-1];switch(E){case t:switch(I){case 2:return C.set(_,T);case 3:Ye(16);default:return C[_]=T}case r:switch(I){case 1:return _==="-"?C.push(T):C.splice(_,0,T);case 2:return C.set(_,T);case 3:return C.add(T);default:return C[_]=T}case n:switch(I){case 1:return C.splice(_,1);case 2:return C.delete(_);case 3:return C.delete(y.value);default:return delete C[_]}default:Ye(17,E)}}),S}function h(S){if(!ft(S))return S;if(Array.isArray(S))return S.map(h);if(Hn(S))return new Map(Array.from(S.entries()).map(([y,x])=>[y,h(x)]));if(vi(S))return new Set(Array.from(S).map(h));let g=Object.create(Qn(S));for(let y in S)g[y]=h(S[y]);return mi(S,pi)&&(g[pi]=S[pi]),g}function v(S){return vt(S)?h(S):S}sb("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var yi=new pb,Jt=yi.produce,Ea=yi.produceWithPatches.bind(yi);var nl=yi.applyPatches.bind(yi);m();d();f();p();function fb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function mb(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function gb(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 Uf=e=>Array.isArray(e)?e:[e];function hb(e){let t=Array.isArray(e[0])?e[0]:e;return gb(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function yb(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var qF=Symbol();var LF=Object.getPrototypeOf({});var vb=class{constructor(e){this.value=e}deref(){return this.value}},Sb=typeof WeakRef<"u"?WeakRef:vb,wb=0,Vf=1;function Ra(){return{s:wb,v:void 0,o:null,p:null}}function zn(e,t={}){let r=Ra(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let v=0,S=c;v<S;v++){let g=arguments[v];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let x=y.get(g);x===void 0?(s=Ra(),y.set(g,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);let x=y.get(g);x===void 0?(s=Ra(),y.set(g,s)):s=x}}let u=s,h;if(s.s===Vf)h=s.v;else if(h=e.apply(null,arguments),i++,n){let v=o?.deref?.()??o;v!=null&&n(v,h)&&(h=v,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Sb(h):h}return u.s=Vf,u.v=h,h}return a.clearCache=()=>{r=Ra(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Gf(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),fb(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:v,memoizeOptions:S=[],argsMemoize:g=zn,argsMemoizeOptions:y=[],devModeChecks:x={}}=h,E=Uf(S),C=Uf(y),I=hb(o),T=v(function(){return i++,u.apply(null,arguments)},...E),_=!0,q=g(function(){a++;let k=yb(I,arguments);return s=T.apply(null,k),s},...C);return Object.assign(q,{resultFunc:u,memoizedResultFunc:T,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Ue=Gf(zn),Ab=Object.assign((e,t=Ue)=>{mb(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,c)=>(a[r[c]]=s,a),{}))},{withTypes:()=>Ab});m();d();f();p();function Bf(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var $f=Bf(),Qf=Bf;var bb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bn:Bn.apply(null,arguments)},nD=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},xb=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(st(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=>$n(n)&&n.type===e,r}var Zf=class Si extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Si.prototype)}static get[Symbol.species](){return Si}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Si(...t[0].concat(this)):new Si(...t.concat(this))}};function Hf(e){return ft(e)?Jt(e,()=>{}):e}function zf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Cb(e){return typeof e=="boolean"}var Eb=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Zf;return r&&(Cb(r)?a.push($f):a.push(Qf(r.extraArgument))),a},wi="RTK_autoBatch",Yn=()=>e=>({payload:e,meta:{[wi]:!0}}),Wf=e=>t=>{setTimeout(t,e)},Rb=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Wf(10):e.type==="callback"?e.queueNotification:Wf(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let v=()=>o&&h(),S=n.subscribe(v);return s.add(h),()=>{S(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[wi],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},Ib=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Zf(e);return n&&o.push(Rb(typeof n=="object"?n:void 0)),o};function em(e){let t=Eb(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=Gn(r);else throw new Error(st(1));let c;typeof n=="function"?c=n(t):c=t();let u=Bn;o&&(u=bb({trace:!1,...(typeof o=="object"&&o)}));let h=If(...c),v=Ib(h),S=typeof a=="function"?a(v):v(),g=u(...S);return $u(s,i,g)}function tm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(st(28));if(s in t)throw new Error(st(29));return t[s]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function Tb(e){return typeof e=="function"}function Me(e,t){let[r,n,o]=tm(t),i;if(Tb(e))i=()=>Hf(e());else{let s=Hf(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,v)=>{if(v)if(vt(h)){let g=v(h,c);return g===void 0?h:g}else{if(ft(h))return Jt(h,S=>v(S,c));{let S=v(h,c);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},s)}return a.getInitialState=i,a}var rm=(e,t)=>xb(e)?e.match(t):e(t);function Lt(...e){return t=>e.some(r=>rm(r,t))}function Kn(...e){return t=>e.every(r=>rm(r,t))}function ka(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 Ai(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Oa(...e){return e.length===0?t=>ka(t,["pending"]):Ai(e)?Lt(...e.map(t=>t.pending)):Oa()(e[0])}function Yr(...e){return e.length===0?t=>ka(t,["rejected"]):Ai(e)?Lt(...e.map(t=>t.rejected)):Yr()(e[0])}function bi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kn(Yr(...e),t):Ai(e)?Kn(Yr(...e),t):bi()(e[0])}function Zt(...e){return e.length===0?t=>ka(t,["fulfilled"]):Ai(e)?Lt(...e.map(t=>t.fulfilled)):Zt()(e[0])}function Pa(...e){return e.length===0?t=>ka(t,["pending","fulfilled","rejected"]):Ai(e)?Lt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Pa()(e[0])}var _b="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",xi=(e=21)=>{let t="",r=e;for(;r--;)t+=_b[Math.random()*64|0];return t},kb=["name","message","stack","code"],ol=class{constructor(e,t){xe(this,"_type");this.payload=e,this.meta=t}},Kf=class{constructor(e,t){xe(this,"_type");this.payload=e,this.meta=t}},Ob=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of kb)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},be=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(c,u,h,v)=>({payload:c,meta:{...(v||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=P(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=P(t+"/rejected",(c,u,h,v,S)=>({payload:v,error:(n&&n.serializeError||Ob)(c||"Rejected"),meta:{...(S||{}),arg:h,requestId:u,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,h,v)=>{let S=n?.idGenerator?n.idGenerator(c):xi(),g=new l.AbortController,y,x;function E(I){x=I,g.abort()}let C=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(c,{getState:h,extra:v});if(Nb(_)&&(_=yield _),_===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((N,k)=>{y=()=>{k({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",y)});u(i(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:h,extra:v}))),I=yield Promise.race([q,Promise.resolve(r(c,{dispatch:u,getState:h,extra:v,requestId:S,signal:g.signal,abort:E,rejectWithValue:(N,k)=>new ol(N,k),fulfillWithValue:(N,k)=>new Kf(N,k)})).then(N=>{if(N instanceof ol)throw N;return N instanceof Kf?o(N.payload,S,c,N.meta):o(N,S,c)})])}catch(_){I=_ instanceof ol?a(null,S,c,_.payload,_.meta):a(_,S,c)}finally{y&&g.signal.removeEventListener("abort",y)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||u(I),I})();return Object.assign(C,{abort:E,requestId:S,arg:c,unwrap(){return C.then(Pb)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Lt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Pb(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Nb(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var nm=Symbol.for("rtk-slice-createasyncthunk"),cD={[nm]:be};function Fb(e,t){return`${e}/${t}`}function Db({creators:e}={}){let t=e?.asyncThunk?.[nm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(st(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(jb()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,T){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(st(12));if(_ in c.sliceCaseReducersByType)throw new Error(st(13));return c.sliceCaseReducersByType[_]=T,u},addMatcher(I,T){return c.sliceMatchers.push({matcher:I,reducer:T}),u},exposeAction(I,T){return c.actionCreators[I]=T,u},exposeCaseReducer(I,T){return c.sliceCaseReducersByName[I]=T,u}};s.forEach(I=>{let T=a[I],_={reducerName:I,type:Fb(o,I),createNotation:typeof n.reducers=="function"};Lb(T)?Vb(_,T,u,t):qb(_,T,u)});function h(){let[I={},T=[],_=void 0]=typeof n.extraReducers=="function"?tm(n.extraReducers):[n.extraReducers],q={...I,...c.sliceCaseReducersByType};return Me(n.initialState,N=>{for(let k in q)N.addCase(k,q[k]);for(let k of c.sliceMatchers)N.addMatcher(k.matcher,k.reducer);for(let k of T)N.addMatcher(k.matcher,k.reducer);_&&N.addDefaultCase(_)})}let v=I=>I,S=new Map,g;function y(I,T){return g||(g=h()),g(I,T)}function x(){return g||(g=h()),g.getInitialState()}function E(I,T=!1){function _(N){let k=N[I];return typeof k>"u"&&T&&(k=x()),k}function q(N=v){let k=zf(S,T,()=>new WeakMap);return zf(k,N,()=>{let O={};for(let[D,U]of Object.entries(n.selectors??{}))O[D]=Mb(U,N,x,T);return O})}return{reducerPath:I,getSelectors:q,get selectors(){return q(_)},selectSlice:_}}let C={name:o,reducer:y,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:x,...E(i),injectInto(I,{reducerPath:T,..._}={}){let q=T??i;return I.inject({reducerPath:q,reducer:y},_),{...C,...E(q,!0)}}};return C}}function Mb(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var Xr=Db();function jb(){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 qb({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Ub(n))throw new Error(st(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?P(e,a):P(e))}function Lb(e){return e._reducerDefinitionType==="asyncThunk"}function Ub(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Vb({type:e,reducerName:t},r,n,o){if(!o)throw new Error(st(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,v=o(e,i,h);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),c&&n.addCase(v.rejected,c),u&&n.addMatcher(v.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ia,pending:s||Ia,rejected:c||Ia,settled:u||Ia})}function Ia(){}var Gb="task",om="listener",im="completed",sl="cancelled",Bb=`task-${sl}`,$b=`task-${im}`,il=`${om}-${sl}`,Qb=`${om}-${im}`,Na=class{constructor(e){xe(this,"name","TaskAbortError");xe(this,"message");this.code=e,this.message=`${Gb} ${sl} (reason: ${e})`}},cl=(e,t)=>{if(typeof e!="function")throw new TypeError(st(32))},Ta=()=>{},am=(e,t=Ta)=>(e.catch(t),e),sm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Wr=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Kr=e=>{if(e.aborted){let{reason:t}=e;throw new Na(t)}};function cm(e,t){let r=Ta;return new Promise((n,o)=>{let i=()=>o(new Na(e.reason));if(e.aborted){i();return}r=sm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ta})}var Hb=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Na?"cancelled":"rejected",error:r}}finally{t?.()}});return function Hb(_x5,_x6){return _ref5.apply(this,arguments)}}(),_a=e=>t=>am(cm(e,t).then(r=>(Kr(e),r))),um=e=>{let t=_a(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Wn}=Object,Yf={},Fa="listenerMiddleware",zb=(e,t)=>{let r=n=>sm(e,()=>Wr(n,e.reason));return(n,o)=>{cl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=Hb(/*#__PURE__*/_asyncToGenerator(function*(){Kr(e),Kr(i.signal);let s=yield n({pause:_a(i.signal),delay:um(i.signal),signal:i.signal});return Kr(i.signal),s}),()=>Wr(i,$b));return o?.autoJoin&&t.push(a.catch(Ta)),{result:_a(e)(a),cancel(){Wr(i,Bb)}}}},Wb=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Kr(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(v,S)=>{S.unsubscribe(),c([v,S.getState(),S.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield cm(t,Promise.race(s));return Kr(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>am(r(n,o))},lm=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(st(21));return cl(i,"options.listener"),{predicate:o,type:t,effect:i}},dm=Wn(e=>{let{type:t,predicate:r,effect:n}=lm(e);return{id:xi(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(st(22))}}},{withTypes:()=>dm}),Xf=(e,t)=>{let{type:r,effect:n,predicate:o}=lm(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},al=e=>{e.pending.forEach(t=>{Wr(t,il)})},Kb=e=>()=>{e.forEach(al),e.clear()},Jf=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},pm=Wn(P(`${Fa}/add`),{withTypes:()=>pm}),Yb=P(`${Fa}/removeAll`),fm=Wn(P(`${Fa}/remove`),{withTypes:()=>fm}),Xb=(...e)=>{console.error(`${Fa}/error`,...e)},mm=(e={})=>{let t=new Map,{extra:r,onError:n=Xb}=e;cl(n,"onError");let o=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),v=>{h.unsubscribe(),v?.cancelActive&&al(h)}),i=h=>{let v=Xf(t,h)??dm(h);return o(v)};Wn(i,{withTypes:()=>i});let a=h=>{let v=Xf(t,h);return v&&(v.unsubscribe(),h.cancelActive&&al(v)),!!v};Wn(a,{withTypes:()=>a});let s=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,v,S,g){let y=new l.AbortController,x=Wb(i,y.signal),E=[];try{h.pending.add(y),yield Promise.resolve(h.effect(v,Wn({},S,{getOriginalState:g,condition:(C,I)=>x(C,I).then(Boolean),take:x,delay:um(y.signal),pause:_a(y.signal),extra:r,signal:y.signal,fork:zb(y.signal,E),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((C,I,T)=>{C!==y&&(Wr(C,il),T.delete(C))})},cancel:()=>{Wr(y,il),h.pending.delete(y)},throwIfCancelled:()=>{Kr(y.signal)}})))}catch(C){C instanceof Na||Jf(n,C,{raisedBy:"effect"})}finally{yield Promise.all(E),Wr(y,Qb),h.pending.delete(y)}});return function s(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),c=Kb(t);return{middleware:h=>v=>S=>{if(!$n(S))return v(S);if(pm.match(S))return i(S.payload);if(Yb.match(S)){c();return}if(fm.match(S))return a(S.payload);let g=h.getState(),y=()=>{if(g===Yf)throw new Error(st(23));return g},x;try{if(x=v(S),t.size>0){let E=h.getState(),C=Array.from(t.values());for(let I of C){let T=!1;try{T=I.predicate(S,E,g)}catch(_){T=!1,Jf(n,_,{raisedBy:"predicate"})}T&&s(I,S,h,y)}}}finally{g=Yf}return x},startListening:i,stopListening:a,clearListeners:c}};var lD=Symbol.for("rtk-state-proxy-original");function st(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}m();d();f();p();var X=new H({required:!0,emptyAllowed:!1}),Xe=new H({required:!1,emptyAllowed:!1}),Je=new H({required:!0,emptyAllowed:!0}),bD=new H({required:!1,emptyAllowed:!0}),Da=new ge({each:X,required:!0}),gm=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),hm=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),xD=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),er=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),At=(e,t)=>{if("required"in t)return{payload:new lt({value:t}).validate({value:e}).value};let o=new ee({options:{required:!0},values:t}).validate(e);if(o)throw new si(o);return{payload:e}},j=(e,t)=>{try{return At(e,t)}catch(r){return{payload:e,error:er(r)}}},ym=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Sm(e,t,r,o,"Controller initialization error")},vm=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Sm(e,t,r,o,"Controller initialization error")},Sm=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var Xn="3.46.0",wm=["@coveo/atomic","@coveo/quantic"];var ul=()=>Xe,Am=()=>X,hr=P("configuration/updateBasicConfiguration",e=>j(e,{accessToken:Xe,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Xe})),Ut=P("configuration/updateSearchConfiguration",e=>j(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Xe,timezone:Xe,locale:Xe,authenticationProviders:new ge({required:!1,each:X})})),Jb={enabled:new ue({default:!0}),originContext:ul(),originLevel2:ul(),originLevel3:ul(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new Oe,anonymous:new ue({default:!1}),deviceId:Xe,userDisplayName:Xe,documentLocation:Xe,trackingId:hm,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ee({options:{required:!1},values:wm.reduce((e,t)=>(e[t]=gm,e),{})})},Jn=P("configuration/updateAnalyticsConfiguration",e=>j(e,Jb)),Zn=P("configuration/analytics/disable"),eo=P("configuration/analytics/enable"),Ma=P("configuration/analytics/originlevel2",e=>j(e,{originLevel2:Am()})),ja=P("configuration/analytics/originlevel3",e=>j(e,{originLevel3:Am()})),bm=P("knowledge/setAgentId",e=>j(e,new H({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var xm={q:new H,enableQuerySyntax:new ue,aq:new H,cq:new H,firstResult:new te({min:0}),numberOfResults:new te({min:0}),sortCriteria:new H,f:new ee,fExcluded:new ee,cf:new ee,nf:new ee,mnf:new ee,df:new ee,debug:new ue,sf:new ee,tab:new H,af:new ee};var yr=P("searchParameters/restore",e=>j(e,xm)),Cm=P("searchParameters/restoreTab",e=>j(e,X));m();d();f();p();var qa=P("debug/enable"),La=P("debug/disable");m();d();f();p();var Ua=()=>!1;var Va=Me(Ua(),e=>{e.addCase(qa,()=>!0).addCase(La,()=>!1).addCase(yr,(t,r)=>r.payload.debug??t)});m();d();f();p();var to=P("pipeline/set",e=>j(e,new H({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var Zb=P("history/undo"),ex=P("history/redo"),Vt=P("history/snapshot"),PM=be("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(Zb()),yield t(mt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),NM=be("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(ex()),yield t(mt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),mt=be("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var ro=()=>"";var no=Me(ro(),e=>{e.addCase(to,(t,r)=>r.payload).addCase(mt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ut,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var Ga=P("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var oo=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,u=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(s)||u.test(s)||s.indexOf(".")===-1?ll(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],ll(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ll(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}m();d();f();p();function tx(){return typeof navigator<"u"}function Em(){try{return typeof localStorage<"u"}catch{return!1}}function Rm(){try{return typeof sessionStorage<"u"}catch{return!1}}function Im(){return!!(tx()&&navigator.cookieEnabled)}var Tm=null;function _m(){return Tm||(Em()?localStorage:Im()?new dl:Rm()?sessionStorage:new pl)}var io=class io{getItem(t){return oo.get(`${io.prefix}${t}`)}removeItem(t){oo.erase(`${io.prefix}${t}`)}setItem(t,r,n){oo.set(`${io.prefix}${t}`,r,n)}};xe(io,"prefix","coveo_");var dl=io;var pl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Ba="__coveo.analytics.history",rx=20,nx=1e3*60,ox=75,Jr=class Jr{constructor(t){xe(this,"store");this.store=t||_m()}static getInstance(t){return Jr.instance||(Jr.instance=new Jr(t)),Jr.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ba);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Ba);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Ba,JSON.stringify(t.slice(0,rx)))}catch{}}clear(){try{this.store.removeItem(Ba)}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,ox)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>nx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};xe(Jr,"instance",null);var fl=Jr,bt=fl;m();d();f();p();m();d();f();p();var ao=Ue(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Xn}`));m();d();f();p();m();d();f();p();function tr(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 M(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var ve;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ve||(ve={}));function hl(){return typeof window<"u"}function _l(){return typeof navigator<"u"}function so(){return typeof document<"u"}function yl(){try{return typeof localStorage<"u"}catch{return!1}}function ix(){try{return typeof sessionStorage<"u"}catch{return!1}}function Bm(){return _l()&&navigator.cookieEnabled}var ax=[ve.click,ve.custom,ve.search,ve.view],sx=(e,t)=>ax.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:_l()?navigator.userAgent:"unknown"},t):t,Ei=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?km(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],km(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function km(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function cx(){return yl()?localStorage:Bm()?new Ri:ix()?sessionStorage:new uo}var Ri=class e{getItem(t){return Ei.get(`${e.prefix}${t}`)}removeItem(t){Ei.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ei.set(`${e.prefix}${t}`,r,n)}};Ri.prefix="coveo_";var vl=class{constructor(){this.cookieStorage=new Ri}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)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},$a="__coveo.analytics.history",ux=20,lx=1e3*60,dx=75,za=class{constructor(t){this.store=t||cx()}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 M(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 M(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem($a);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return M(this,void 0,void 0,function*(){try{let t=yield this.store.getItem($a);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem($a,JSON.stringify(t.slice(0,ux)))}catch{}}clear(){try{this.store.removeItem($a)}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,dx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>lx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var px=(e,t)=>M(void 0,void 0,void 0,function*(){return e===ve.view?(yield fx(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),fx=e=>M(void 0,void 0,void 0,function*(){let t=new za,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Qa,mx=new Uint8Array(16);function gx(){if(!Qa&&(Qa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qa(mx)}var hx=/^(?:[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 Wa(e){return typeof e=="string"&&hx.test(e)}var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function $m(e,t=0){return Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]}function yx(e){if(!Wa(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 vx(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Sx="6ba7b810-9dad-11d1-80b4-00c04fd430c8",wx="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ax(e,t,r){function n(o,i,a,s){var c;if(typeof o=="string"&&(o=vx(o)),typeof i=="string"&&(i=yx(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(i),u.set(o,i.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let h=0;h<16;++h)a[s+h]=u[h];return a}return $m(u)}try{n.name=e}catch{}return n.DNS=Sx,n.URL=wx,n}var bx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Om={randomUUID:bx};function Zr(e,t,r){if(Om.randomUUID&&!t&&!e)return Om.randomUUID();e=e||{};let n=e.random||(e.rng||gx)();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 $m(n)}function xx(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 ml(e,t){return e<<t|e>>>32-t}function Cx(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[a*64+c*4]<<24|e[a*64+c*4+1]<<16|e[a*64+c*4+2]<<8|e[a*64+c*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let g=0;g<16;++g)s[g]=i[a][g];for(let g=16;g<80;++g)s[g]=ml(s[g-3]^s[g-8]^s[g-14]^s[g-16],1);let c=r[0],u=r[1],h=r[2],v=r[3],S=r[4];for(let g=0;g<80;++g){let y=Math.floor(g/20),x=ml(c,5)+xx(y,u,h,v)+S+t[y]+s[g]>>>0;S=v,v=h,h=ml(u,30)>>>0,u=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Ex=Ax("v5",80,Cx),Pm=Ex,Qm="2.30.52",Nm=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ci={pageview:"pageview",event:"event"},Ka=class{constructor({client:t,uuidGenerator:r=Zr}){this.client=t,this.uuidGenerator=r}},Sl=class extends Ka{constructor({client:t,uuidGenerator:r=Zr}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Nm(window.location),this.lastReferrer=so()?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:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Ci.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ci.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ci.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ci.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 Nm(window.location)}},vr=class e{constructor(t,r){if(!Wa(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Wa(i)?new e(i,Number.parseInt(o)*1e3):null}};vr.cvo_cid="cvo_cid";vr.expirationTime=120;var wl=class extends Ka{constructor({client:t,uuidGenerator:r=Zr}){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 M(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(vr.cvo_cid,new vr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};wl.Id="link";var Ct=Object.keys;function Ha(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var gl=128,Hm=192,Fm=224,Dm=240;function Rx(e){return(e&248)===Dm?4:(e&Dm)===Fm?3:(e&Fm)===Hm?2:1}function Ix(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&gl)!=gl)break;if(r-=3,(n&Hm)!=gl){t-r>=Rx(n)*3&&(r=t);break}}return e.substring(0,r)}var Al={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"},Tx=Ct(Al).map(e=>Al[e]),_x=[...Tx].join("|"),kx=new RegExp(`^(${_x}$)`),Ox={svcAction:"svc_action",svcActionData:"svc_action_data"},Px=e=>Ct(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Al[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Nx=e=>kx.test(e),Fx=[Nx],Mm={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},jm={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ot={action:"pa",list:"pal",listSource:"pls"},Ya={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Dx=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],bl={id:"quoteId",affiliation:"quoteAffiliation"},xl={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Mx={add:ot,bookmark_add:ot,bookmark_remove:ot,click:ot,checkout:ot,checkout_option:ot,detail:ot,impression:ot,remove:ot,refund:Object.assign(Object.assign({},ot),Ya),purchase:Object.assign(Object.assign({},ot),Ya),quickview:ot,quote:Object.assign(Object.assign({},ot),bl),review:Object.assign(Object.assign({},ot),xl)},jx=Ct(Mm).map(e=>Mm[e]),qx=Ct(jm).map(e=>jm[e]),Lx=Ct(ot).map(e=>ot[e]),Ux=Ct(Ya).map(e=>Ya[e]),Vx=Ct(xl).map(e=>xl[e]),Gx=Ct(bl).map(e=>bl[e]),Bx=[...jx,"custom"].join("|"),$x=[...qx,"custom"].join("|"),zm="(pr[0-9]+)",Wm="(il[0-9]+pi[0-9]+)",Qx=new RegExp(`^${zm}(${Bx})$`),Hx=new RegExp(`^(${Wm}(${$x}))|(il[0-9]+nm)$`),zx=new RegExp(`^(${Lx.join("|")})$`),Wx=new RegExp(`^(${Ux.join("|")})$`),Kx=new RegExp(`^${zm}custom$`),Yx=new RegExp(`^${Wm}custom$`),Xx=new RegExp(`^(${[...Dx,...Vx,...Gx].join("|")})$`),Jx=e=>Qx.test(e),Zx=e=>Hx.test(e),eC=e=>zx.test(e),tC=e=>Wx.test(e),rC=e=>Xx.test(e),nC=[Zx,Jx,eC,tC,rC],oC=[Kx,Yx],iC={anonymizeIp:"aip"},aC={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},sC={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},cC=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],uC=Object.assign(Object.assign(Object.assign(Object.assign({},iC),aC),sC),cC.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Cl=Object.assign(Object.assign({},uC),Ox),lC=e=>{let t=!!e.action&&Mx[e.action]||{};return Ct(e).reduce((r,n)=>{let o=t[n]||Cl[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},dC=Ct(Cl).map(e=>Cl[e]),pC=e=>dC.indexOf(e)!==-1,fC=e=>e==="custom",mC=e=>[...nC,...Fx,pC,fC].some(t=>t(e)),gC=e=>Ct(e).reduce((t,r)=>{let n=hC(r);return n?Object.assign(Object.assign({},t),yC(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),hC=e=>{let t;return[...oC].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},yC=(e,t)=>Ct(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),El=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return M(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return M(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ve.click,ve.custom,ve.search,ve.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}},Rl=class{sendEvent(t,r){return M(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){return Promise.resolve()})}},qm=w.fetch,Xa=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=tr(c,["url"]),v;try{v=yield qm(u,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(v.ok){let S=yield v.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield qm(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}getVisitorIdParam(){return M(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"})}},Il=class{constructor(t,r){yl()&&Bm()?this.storage=new vl:yl()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new Xa(t),this.beaconClient=new El(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Tl=class{constructor(t,r){this.storage=r||new uo,this.client=new Xa(t)}getClientDependingOnEventType(t){return this.client}},Ja=class{constructor(){this.storage=new uo,this.client=new Rl}getClientDependingOnEventType(t){return this.client}},vC="xx",SC=e=>e?.startsWith(vC)||!1,wC=`
|
|
26
|
+
`;return new si(r)}var si=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},lt=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw cA(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}},Oe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ie(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 We(e){return e===void 0}function uA(e){return e===null}function ie(e){return We(e)||uA(e)}var ue=class{constructor(e={}){xe(this,"value");this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(lA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function lA(e){return We(e)||Zp(e)}function Zp(e){return typeof e=="boolean"}var te=class{constructor(e={}){xe(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(dA(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 dA(e){return We(e)||ef(e)}function ef(e){return typeof e=="number"&&!Number.isNaN(e)}var pA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){xe(this,"value");xe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Oe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(We(e))return null;if(!ua(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(pA.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 ua(e){return Object.prototype.toString.call(e)==="[object String]"}var ee=class{constructor(e={}){xe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(We(e))return this.config.options.required?"value is required and is currently undefined":null;if(!tf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ie(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function tf(e){return e!==void 0&&typeof e=="object"}var ge=class{constructor(e={}){xe(this,"value");this.config=e,this.value=new Oe(this.config)}validate(e){if(!ie(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ie(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&&ie(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 Zp(e)||ua(e)||ef(e)||tf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function rf(e){return Array.isArray(e)}var Pu=class{constructor(e){xe(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:We(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};m();d();f();p();function nf(e){return Array.isArray(e)}function la(e){return e.trim()===""}var fA=new Set(["1",1,"yes",!0]);function of(){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=>fA.has(r))}function af(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ci(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function da(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function mA(e){if(la(e.openingDelimiter)||la(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ie(e.content)||la(e.content))return e.content;if(e.highlights.length===0)return Un(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Un(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Un(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Un(e.content.slice(n))),r}function gA(e,t){return e=Un(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Nu(n,t.notMatchDelimiters):o?Nu(o,t.exactMatchDelimiters):i?Nu(i,t.correctionDelimiters):r)}function Nu(e,t){return t?t.open+e+t.close:e}function Un(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var vf=_t(mf(),1);m();d();f();p();var Mt=new Error("Failed to load reducers."),Vn=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},$r=class extends Error{constructor(r,n){super();xe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function gf(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function hf(e){return typeof e!="object"||!e?!1:Object.values(e).every(VA)}function VA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function yf(e){return e===429}var kt=class e{static call(t){return _asyncToGenerator(function*(){let r=GA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield A(i,a);if(yf(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,vf.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&yf(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Vn;case 404:throw new $r(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new $r(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=ci(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function Be(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pr(e,t="prod"){return`${Be(e,t)}/rest/search/v2`}function fa(e,t="prod"){return`${Be(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function GA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=BA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function BA(e,t){return t==="application/x-www-form-urlencoded"?hf(e)?gf(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var ma=e=>e;m();d();f();p();m();d();f();p();function ga(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function jt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:ga(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:ga(),extendedResults:{},searchAction:void 0}}m();d();f();p();function fr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mr=e=>{let{response:t}=e;return t.body?$A(e):QA(t)},$A=e=>zA(e)?WA(e):HA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},QA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function HA(e){return e.body.statusCode!==void 0}function zA(e){return e.body.exception!==void 0}var WA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var gr=class{constructor(){xe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();f();p();m();d();f();p();var di=class{constructor(t){xe(this,"_basePath");xe(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};m();d();f();p();function Sf(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var Xt=(e,t,r,n)=>{let o=new di(`${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 wf=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield kt.call({...Xt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:fr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Sf(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return KA(a)?{success:a}:{error:mr({response:r,body:a})}});return function wf(_x3,_x4){return _ref3.apply(this,arguments)}}();function KA(e){return typeof e=="string"}m();d();f();p();function YA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function XA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ha(e,t){if(t&&e.name==="AbortError")return{error:XA(e)};if(e instanceof $r)return{error:YA(e)};throw e}var ya=class{constructor(t){this.options=t;xe(this,"apiCallsQueues",{unknown:new gr,mainSearch:new gr,facetValues:new gr,foldingCollection:new gr,instantResults:new gr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/plan"),requestParams:fr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return ha(r);let n=yield r.json();return ZA(n)?{success:n}:{error:mr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:fr(t),..._this3.options});if(r instanceof Error)return ha(r);let n=yield r.json(),o={response:r,body:n};return JA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>kt.call({...Xt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return ha(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return Af(i)?(a.body=bf(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:mr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"POST","application/json","/facet"),requestParams:fr(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 kt.call({...Xt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Af(n)){let o={response:r,body:n};return o.body=bf(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return wf(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Xt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return eb(n)?{success:n}:{error:mr({response:r,body:n})}})()}},va=e=>e.success!==void 0,dt=e=>e.error!==void 0;function Af(e){return e.results!==void 0}function bf(e){let t=ga();return ie(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function JA(e){return e.completions!==void 0}function ZA(e){return e.preprocessingOutput!==void 0}function eb(e){return e.fields!==void 0}m();d();f();p();var xf=e=>e,Cf=e=>e,Ef=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function Ke(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 tb=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rf=tb,Bu=()=>Math.random().toString(36).substring(7).split("").join("."),rb={INIT:`@@redux/INIT${Bu()}`,REPLACE:`@@redux/REPLACE${Bu()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bu()}`},Sa=rb;function qt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function $u(e,t,r){if(typeof e!="function")throw new Error(Ke(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ke(1));return r($u)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((E,C)=>{a.set(C,E)}))}function h(){if(c)throw new Error(Ke(3));return o}function v(E){if(typeof E!="function")throw new Error(Ke(4));if(c)throw new Error(Ke(5));let C=!0;u();let I=s++;return a.set(I,E),function(){if(C){if(c)throw new Error(Ke(6));C=!1,u(),a.delete(I),i=null}}}function S(E){if(!qt(E))throw new Error(Ke(7));if(typeof E.type>"u")throw new Error(Ke(8));if(typeof E.type!="string")throw new Error(Ke(17));if(c)throw new Error(Ke(9));try{c=!0,o=n(o,E)}finally{c=!1}return(i=a).forEach(I=>{I()}),E}function g(E){if(typeof E!="function")throw new Error(Ke(10));n=E,S({type:Sa.REPLACE})}function y(){let E=v;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(Ke(11));function I(){let _=C;_.next&&_.next(h())}return I(),{unsubscribe:E(I)}},[Rf](){return this}}}return S({type:Sa.INIT}),{dispatch:S,subscribe:v,getState:h,replaceReducer:g,[Rf]:y}}function nb(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Sa.INIT})>"u")throw new Error(Ke(12));if(typeof r(void 0,{type:Sa.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function Gn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{nb(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let v=0;v<n.length;v++){let S=n[v],g=r[S],y=s[S],x=g(y,c);if(typeof x>"u"){let E=c&&c.type;throw new Error(Ke(14))}h[S]=x,u=u||x!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function Bn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function If(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ke(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=Bn(...s)(o.dispatch),{...o,dispatch:i}}}function $n(e){return qt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var el=Symbol.for("immer-nothing"),pi=Symbol.for("immer-draftable"),pt=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Qn=Object.getPrototypeOf;function vt(e){return!!e&&!!e[pt]}function ft(e){return e?Nf(e)||Array.isArray(e)||!!e[pi]||!!e.constructor?.[pi]||Hn(e)||vi(e):!1}var ob=Object.prototype.constructor.toString(),Tf=new WeakMap;function Nf(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Tf.get(r);return n===void 0&&(n=Function.toString.call(r),Tf.set(r,n)),n===ob}function tl(e){return vt(e)||Ye(15,e),e[pt].base_}function fi(e,t,r=!0){Hr(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Hr(e){let t=e[pt];return t?t.type_:Array.isArray(e)?1:Hn(e)?2:vi(e)?3:0}function mi(e,t){return Hr(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Qu(e,t){return Hr(e)===2?e.get(t):e[t]}function Ff(e,t,r){let n=Hr(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function ib(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hn(e){return e instanceof Map}function vi(e){return e instanceof Set}function Qr(e){return e.copy_||e.base_}function Wu(e,t){if(Hn(e))return new Map(e);if(vi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Nf(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[pt];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(Qn(e),n)}else{let n=Qn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function xa(e,t=!1){return Ca(e)||vt(e)||!ft(e)||(Hr(e)>1&&Object.defineProperties(e,{set:wa,add:wa,clear:wa,delete:wa}),Object.freeze(e),t&&Object.values(e).forEach(r=>xa(r,!0))),e}function ab(){Ye(2)}var wa={value:ab};function Ca(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Ku={};function zr(e){let t=Ku[e];return t||Ye(0,e),t}function sb(e,t){Ku[e]||(Ku[e]=t)}var gi;function Df(){return gi}function cb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function _f(e,t){t&&(zr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yu(e){Xu(e),e.drafts_.forEach(ub),e.drafts_=null}function Xu(e){e===gi&&(gi=e.parent_)}function kf(e){return gi=cb(gi,e)}function ub(e){let t=e[pt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Of(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[pt].modified_&&(Yu(t),Ye(4)),ft(e)&&(e=Aa(t,e),t.parent_||ba(t,e)),t.patches_&&zr("Patches").generateReplacementPatches_(r[pt].base_,e,t.patches_,t.inversePatches_)):e=Aa(t,r,[]),Yu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==el?e:void 0}function Aa(e,t,r){if(Ca(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[pt];if(!o)return fi(t,(i,a)=>Pf(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return ba(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,s=!1;o.type_===3&&(a=new Set(i),i.clear(),s=!0),fi(a,(c,u)=>Pf(e,o,i,c,u,r,s),n),ba(e,i,!1),r&&e.patches_&&zr("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Pf(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let s=Ca(o);if(!(s&&!a)){if(vt(o)){let c=i&&t&&t.type_!==3&&!mi(t.assigned_,n)?i.concat(n):void 0,u=Aa(e,o,c);if(Ff(r,n,u),vt(u))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(ft(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&s)return;Aa(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Hn(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ba(e,o)}}}function ba(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xa(t,r)}function lb(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Df(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=rl;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}var rl={get(e,t){if(t===pt)return e;let r=Qr(e);if(!mi(r,t))return db(e,r,t);let n=r[t];return e.finalized_||!ft(n)?n:n===Hu(e.base_,t)?(zu(e),e.copy_[t]=Zu(n,e)):n},has(e,t){return t in Qr(e)},ownKeys(e){return Reflect.ownKeys(Qr(e))},set(e,t,r){let n=Mf(Qr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Hu(Qr(e),t),i=o?.[pt];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ib(r,o)&&(r!==void 0||mi(e.base_,t)))return!0;zu(e),Ju(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 Hu(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,zu(e),Ju(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Qr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ye(11)},getPrototypeOf(e){return Qn(e.base_)},setPrototypeOf(){Ye(12)}},hi={};fi(rl,(e,t)=>{hi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return rl.set.call(this,e[0],t,r,e[0])};function Hu(e,t){let r=e[pt];return(r?Qr(r):e)[t]}function db(e,t,r){let n=Mf(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Mf(e,t){if(!(t in e))return;let r=Qn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Qn(r)}}function Ju(e){e.modified_||(e.modified_=!0,e.parent_&&Ju(e.parent_))}function zu(e){e.copy_||(e.copy_=Wu(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(ft(t)){let i=kf(this),a=Zu(t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Yu(i):Xu(i)}return _f(i,n),Of(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===el&&(o=void 0),this.autoFreeze_&&xa(o,!0),n){let i=[],a=[];zr("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ye(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ft(e)||Ye(8),vt(e)&&(e=jf(e));let t=kf(this),r=Zu(e,void 0);return r[pt].isManual_=!0,Xu(t),r}finishDraft(e,t){let r=e&&e[pt];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return _f(n,t),Of(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=zr("Patches").applyPatches_;return vt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Zu(e,t){let r=Hn(e)?zr("MapSet").proxyMap_(e,t):vi(e)?zr("MapSet").proxySet_(e,t):lb(e,t);return(t?t.scope_:Df()).drafts_.push(r),r}function jf(e){return vt(e)||Ye(10,e),qf(e)}function qf(e){if(!ft(e)||Ca(e))return e;let t=e[pt],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wu(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Wu(e,!0);return fi(r,(o,i)=>{Ff(r,o,qf(i))},n),t&&(t.finalized_=!1),r}function Lf(){let t="replace",r="add",n="remove";function o(S,g,y,x){switch(S.type_){case 0:case 2:return a(S,g,y,x);case 1:return i(S,g,y,x);case 3:return s(S,g,y,x)}}function i(S,g,y,x){let{base_:E,assigned_:C}=S,I=S.copy_;I.length<E.length&&([E,I]=[I,E],[y,x]=[x,y]);for(let T=0;T<E.length;T++)if(C[T]&&I[T]!==E[T]){let _=g.concat([T]);y.push({op:t,path:_,value:v(I[T])}),x.push({op:t,path:_,value:v(E[T])})}for(let T=E.length;T<I.length;T++){let _=g.concat([T]);y.push({op:r,path:_,value:v(I[T])})}for(let T=I.length-1;E.length<=T;--T){let _=g.concat([T]);x.push({op:n,path:_})}}function a(S,g,y,x){let{base_:E,copy_:C}=S;fi(S.assigned_,(I,T)=>{let _=Qu(E,I),q=Qu(C,I),N=T?mi(E,I)?t:r:n;if(_===q&&N===t)return;let k=g.concat(I);y.push(N===n?{op:N,path:k}:{op:N,path:k,value:q}),x.push(N===r?{op:n,path:k}:N===n?{op:r,path:k,value:v(_)}:{op:t,path:k,value:v(_)})})}function s(S,g,y,x){let{base_:E,copy_:C}=S,I=0;E.forEach(T=>{if(!C.has(T)){let _=g.concat([I]);y.push({op:n,path:_,value:T}),x.unshift({op:r,path:_,value:T})}I++}),I=0,C.forEach(T=>{if(!E.has(T)){let _=g.concat([I]);y.push({op:r,path:_,value:T}),x.unshift({op:n,path:_,value:T})}I++})}function c(S,g,y,x){y.push({op:t,path:[],value:g===el?void 0:g}),x.push({op:t,path:[],value:S})}function u(S,g){return g.forEach(y=>{let{path:x,op:E}=y,C=S;for(let q=0;q<x.length-1;q++){let N=Hr(C),k=x[q];typeof k!="string"&&typeof k!="number"&&(k=""+k),(N===0||N===1)&&(k==="__proto__"||k==="constructor")&&Ye(19),typeof C=="function"&&k==="prototype"&&Ye(19),C=Qu(C,k),typeof C!="object"&&Ye(18,x.join("/"))}let I=Hr(C),T=h(y.value),_=x[x.length-1];switch(E){case t:switch(I){case 2:return C.set(_,T);case 3:Ye(16);default:return C[_]=T}case r:switch(I){case 1:return _==="-"?C.push(T):C.splice(_,0,T);case 2:return C.set(_,T);case 3:return C.add(T);default:return C[_]=T}case n:switch(I){case 1:return C.splice(_,1);case 2:return C.delete(_);case 3:return C.delete(y.value);default:return delete C[_]}default:Ye(17,E)}}),S}function h(S){if(!ft(S))return S;if(Array.isArray(S))return S.map(h);if(Hn(S))return new Map(Array.from(S.entries()).map(([y,x])=>[y,h(x)]));if(vi(S))return new Set(Array.from(S).map(h));let g=Object.create(Qn(S));for(let y in S)g[y]=h(S[y]);return mi(S,pi)&&(g[pi]=S[pi]),g}function v(S){return vt(S)?h(S):S}sb("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var yi=new pb,Jt=yi.produce,Ea=yi.produceWithPatches.bind(yi);var nl=yi.applyPatches.bind(yi);m();d();f();p();function fb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function mb(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function gb(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 Uf=e=>Array.isArray(e)?e:[e];function hb(e){let t=Array.isArray(e[0])?e[0]:e;return gb(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function yb(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var qF=Symbol();var LF=Object.getPrototypeOf({});var vb=class{constructor(e){this.value=e}deref(){return this.value}},Sb=typeof WeakRef<"u"?WeakRef:vb,wb=0,Vf=1;function Ra(){return{s:wb,v:void 0,o:null,p:null}}function zn(e,t={}){let r=Ra(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let v=0,S=c;v<S;v++){let g=arguments[v];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let x=y.get(g);x===void 0?(s=Ra(),y.set(g,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);let x=y.get(g);x===void 0?(s=Ra(),y.set(g,s)):s=x}}let u=s,h;if(s.s===Vf)h=s.v;else if(h=e.apply(null,arguments),i++,n){let v=o?.deref?.()??o;v!=null&&n(v,h)&&(h=v,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Sb(h):h}return u.s=Vf,u.v=h,h}return a.clearCache=()=>{r=Ra(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Gf(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),fb(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:v,memoizeOptions:S=[],argsMemoize:g=zn,argsMemoizeOptions:y=[],devModeChecks:x={}}=h,E=Uf(S),C=Uf(y),I=hb(o),T=v(function(){return i++,u.apply(null,arguments)},...E),_=!0,q=g(function(){a++;let k=yb(I,arguments);return s=T.apply(null,k),s},...C);return Object.assign(q,{resultFunc:u,memoizedResultFunc:T,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Ue=Gf(zn),Ab=Object.assign((e,t=Ue)=>{mb(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,c)=>(a[r[c]]=s,a),{}))},{withTypes:()=>Ab});m();d();f();p();function Bf(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var $f=Bf(),Qf=Bf;var bb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Bn:Bn.apply(null,arguments)},nD=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},xb=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(st(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=>$n(n)&&n.type===e,r}var Zf=class Si extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Si.prototype)}static get[Symbol.species](){return Si}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Si(...t[0].concat(this)):new Si(...t.concat(this))}};function Hf(e){return ft(e)?Jt(e,()=>{}):e}function zf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Cb(e){return typeof e=="boolean"}var Eb=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Zf;return r&&(Cb(r)?a.push($f):a.push(Qf(r.extraArgument))),a},wi="RTK_autoBatch",Yn=()=>e=>({payload:e,meta:{[wi]:!0}}),Wf=e=>t=>{setTimeout(t,e)},Rb=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Wf(10):e.type==="callback"?e.queueNotification:Wf(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let v=()=>o&&h(),S=n.subscribe(v);return s.add(h),()=>{S(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[wi],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},Ib=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Zf(e);return n&&o.push(Rb(typeof n=="object"?n:void 0)),o};function em(e){let t=Eb(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=Gn(r);else throw new Error(st(1));let c;typeof n=="function"?c=n(t):c=t();let u=Bn;o&&(u=bb({trace:!1,...(typeof o=="object"&&o)}));let h=If(...c),v=Ib(h),S=typeof a=="function"?a(v):v(),g=u(...S);return $u(s,i,g)}function tm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(st(28));if(s in t)throw new Error(st(29));return t[s]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function Tb(e){return typeof e=="function"}function Me(e,t){let[r,n,o]=tm(t),i;if(Tb(e))i=()=>Hf(e());else{let s=Hf(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,v)=>{if(v)if(vt(h)){let g=v(h,c);return g===void 0?h:g}else{if(ft(h))return Jt(h,S=>v(S,c));{let S=v(h,c);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},s)}return a.getInitialState=i,a}var rm=(e,t)=>xb(e)?e.match(t):e(t);function Lt(...e){return t=>e.some(r=>rm(r,t))}function Kn(...e){return t=>e.every(r=>rm(r,t))}function ka(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 Ai(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Oa(...e){return e.length===0?t=>ka(t,["pending"]):Ai(e)?Lt(...e.map(t=>t.pending)):Oa()(e[0])}function Yr(...e){return e.length===0?t=>ka(t,["rejected"]):Ai(e)?Lt(...e.map(t=>t.rejected)):Yr()(e[0])}function bi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kn(Yr(...e),t):Ai(e)?Kn(Yr(...e),t):bi()(e[0])}function Zt(...e){return e.length===0?t=>ka(t,["fulfilled"]):Ai(e)?Lt(...e.map(t=>t.fulfilled)):Zt()(e[0])}function Pa(...e){return e.length===0?t=>ka(t,["pending","fulfilled","rejected"]):Ai(e)?Lt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Pa()(e[0])}var _b="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",xi=(e=21)=>{let t="",r=e;for(;r--;)t+=_b[Math.random()*64|0];return t},kb=["name","message","stack","code"],ol=class{constructor(e,t){xe(this,"_type");this.payload=e,this.meta=t}},Kf=class{constructor(e,t){xe(this,"_type");this.payload=e,this.meta=t}},Ob=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of kb)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},be=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(c,u,h,v)=>({payload:c,meta:{...(v||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=P(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=P(t+"/rejected",(c,u,h,v,S)=>({payload:v,error:(n&&n.serializeError||Ob)(c||"Rejected"),meta:{...(S||{}),arg:h,requestId:u,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,h,v)=>{let S=n?.idGenerator?n.idGenerator(c):xi(),g=new l.AbortController,y,x;function E(I){x=I,g.abort()}let C=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(c,{getState:h,extra:v});if(Nb(_)&&(_=yield _),_===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((N,k)=>{y=()=>{k({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",y)});u(i(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:h,extra:v}))),I=yield Promise.race([q,Promise.resolve(r(c,{dispatch:u,getState:h,extra:v,requestId:S,signal:g.signal,abort:E,rejectWithValue:(N,k)=>new ol(N,k),fulfillWithValue:(N,k)=>new Kf(N,k)})).then(N=>{if(N instanceof ol)throw N;return N instanceof Kf?o(N.payload,S,c,N.meta):o(N,S,c)})])}catch(_){I=_ instanceof ol?a(null,S,c,_.payload,_.meta):a(_,S,c)}finally{y&&g.signal.removeEventListener("abort",y)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||u(I),I})();return Object.assign(C,{abort:E,requestId:S,arg:c,unwrap(){return C.then(Pb)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Lt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Pb(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Nb(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var nm=Symbol.for("rtk-slice-createasyncthunk"),cD={[nm]:be};function Fb(e,t){return`${e}/${t}`}function Db({creators:e}={}){let t=e?.asyncThunk?.[nm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(st(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(jb()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,T){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(st(12));if(_ in c.sliceCaseReducersByType)throw new Error(st(13));return c.sliceCaseReducersByType[_]=T,u},addMatcher(I,T){return c.sliceMatchers.push({matcher:I,reducer:T}),u},exposeAction(I,T){return c.actionCreators[I]=T,u},exposeCaseReducer(I,T){return c.sliceCaseReducersByName[I]=T,u}};s.forEach(I=>{let T=a[I],_={reducerName:I,type:Fb(o,I),createNotation:typeof n.reducers=="function"};Lb(T)?Vb(_,T,u,t):qb(_,T,u)});function h(){let[I={},T=[],_=void 0]=typeof n.extraReducers=="function"?tm(n.extraReducers):[n.extraReducers],q={...I,...c.sliceCaseReducersByType};return Me(n.initialState,N=>{for(let k in q)N.addCase(k,q[k]);for(let k of c.sliceMatchers)N.addMatcher(k.matcher,k.reducer);for(let k of T)N.addMatcher(k.matcher,k.reducer);_&&N.addDefaultCase(_)})}let v=I=>I,S=new Map,g;function y(I,T){return g||(g=h()),g(I,T)}function x(){return g||(g=h()),g.getInitialState()}function E(I,T=!1){function _(N){let k=N[I];return typeof k>"u"&&T&&(k=x()),k}function q(N=v){let k=zf(S,T,()=>new WeakMap);return zf(k,N,()=>{let O={};for(let[D,U]of Object.entries(n.selectors??{}))O[D]=Mb(U,N,x,T);return O})}return{reducerPath:I,getSelectors:q,get selectors(){return q(_)},selectSlice:_}}let C={name:o,reducer:y,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:x,...E(i),injectInto(I,{reducerPath:T,..._}={}){let q=T??i;return I.inject({reducerPath:q,reducer:y},_),{...C,...E(q,!0)}}};return C}}function Mb(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var Xr=Db();function jb(){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 qb({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Ub(n))throw new Error(st(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?P(e,a):P(e))}function Lb(e){return e._reducerDefinitionType==="asyncThunk"}function Ub(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Vb({type:e,reducerName:t},r,n,o){if(!o)throw new Error(st(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,v=o(e,i,h);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),c&&n.addCase(v.rejected,c),u&&n.addMatcher(v.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ia,pending:s||Ia,rejected:c||Ia,settled:u||Ia})}function Ia(){}var Gb="task",om="listener",im="completed",sl="cancelled",Bb=`task-${sl}`,$b=`task-${im}`,il=`${om}-${sl}`,Qb=`${om}-${im}`,Na=class{constructor(e){xe(this,"name","TaskAbortError");xe(this,"message");this.code=e,this.message=`${Gb} ${sl} (reason: ${e})`}},cl=(e,t)=>{if(typeof e!="function")throw new TypeError(st(32))},Ta=()=>{},am=(e,t=Ta)=>(e.catch(t),e),sm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Wr=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Kr=e=>{if(e.aborted){let{reason:t}=e;throw new Na(t)}};function cm(e,t){let r=Ta;return new Promise((n,o)=>{let i=()=>o(new Na(e.reason));if(e.aborted){i();return}r=sm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ta})}var Hb=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Na?"cancelled":"rejected",error:r}}finally{t?.()}});return function Hb(_x5,_x6){return _ref5.apply(this,arguments)}}(),_a=e=>t=>am(cm(e,t).then(r=>(Kr(e),r))),um=e=>{let t=_a(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Wn}=Object,Yf={},Fa="listenerMiddleware",zb=(e,t)=>{let r=n=>sm(e,()=>Wr(n,e.reason));return(n,o)=>{cl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=Hb(/*#__PURE__*/_asyncToGenerator(function*(){Kr(e),Kr(i.signal);let s=yield n({pause:_a(i.signal),delay:um(i.signal),signal:i.signal});return Kr(i.signal),s}),()=>Wr(i,$b));return o?.autoJoin&&t.push(a.catch(Ta)),{result:_a(e)(a),cancel(){Wr(i,Bb)}}}},Wb=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Kr(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(v,S)=>{S.unsubscribe(),c([v,S.getState(),S.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield cm(t,Promise.race(s));return Kr(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>am(r(n,o))},lm=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(st(21));return cl(i,"options.listener"),{predicate:o,type:t,effect:i}},dm=Wn(e=>{let{type:t,predicate:r,effect:n}=lm(e);return{id:xi(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(st(22))}}},{withTypes:()=>dm}),Xf=(e,t)=>{let{type:r,effect:n,predicate:o}=lm(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},al=e=>{e.pending.forEach(t=>{Wr(t,il)})},Kb=e=>()=>{e.forEach(al),e.clear()},Jf=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},pm=Wn(P(`${Fa}/add`),{withTypes:()=>pm}),Yb=P(`${Fa}/removeAll`),fm=Wn(P(`${Fa}/remove`),{withTypes:()=>fm}),Xb=(...e)=>{console.error(`${Fa}/error`,...e)},mm=(e={})=>{let t=new Map,{extra:r,onError:n=Xb}=e;cl(n,"onError");let o=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),v=>{h.unsubscribe(),v?.cancelActive&&al(h)}),i=h=>{let v=Xf(t,h)??dm(h);return o(v)};Wn(i,{withTypes:()=>i});let a=h=>{let v=Xf(t,h);return v&&(v.unsubscribe(),h.cancelActive&&al(v)),!!v};Wn(a,{withTypes:()=>a});let s=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,v,S,g){let y=new l.AbortController,x=Wb(i,y.signal),E=[];try{h.pending.add(y),yield Promise.resolve(h.effect(v,Wn({},S,{getOriginalState:g,condition:(C,I)=>x(C,I).then(Boolean),take:x,delay:um(y.signal),pause:_a(y.signal),extra:r,signal:y.signal,fork:zb(y.signal,E),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((C,I,T)=>{C!==y&&(Wr(C,il),T.delete(C))})},cancel:()=>{Wr(y,il),h.pending.delete(y)},throwIfCancelled:()=>{Kr(y.signal)}})))}catch(C){C instanceof Na||Jf(n,C,{raisedBy:"effect"})}finally{yield Promise.all(E),Wr(y,Qb),h.pending.delete(y)}});return function s(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),c=Kb(t);return{middleware:h=>v=>S=>{if(!$n(S))return v(S);if(pm.match(S))return i(S.payload);if(Yb.match(S)){c();return}if(fm.match(S))return a(S.payload);let g=h.getState(),y=()=>{if(g===Yf)throw new Error(st(23));return g},x;try{if(x=v(S),t.size>0){let E=h.getState(),C=Array.from(t.values());for(let I of C){let T=!1;try{T=I.predicate(S,E,g)}catch(_){T=!1,Jf(n,_,{raisedBy:"predicate"})}T&&s(I,S,h,y)}}}finally{g=Yf}return x},startListening:i,stopListening:a,clearListeners:c}};var lD=Symbol.for("rtk-state-proxy-original");function st(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}m();d();f();p();var X=new H({required:!0,emptyAllowed:!1}),Xe=new H({required:!1,emptyAllowed:!1}),Je=new H({required:!0,emptyAllowed:!0}),bD=new H({required:!1,emptyAllowed:!0}),Da=new ge({each:X,required:!0}),gm=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),hm=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),xD=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),er=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),At=(e,t)=>{if("required"in t)return{payload:new lt({value:t}).validate({value:e}).value};let o=new ee({options:{required:!0},values:t}).validate(e);if(o)throw new si(o);return{payload:e}},j=(e,t)=>{try{return At(e,t)}catch(r){return{payload:e,error:er(r)}}},ym=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Sm(e,t,r,o,"Controller initialization error")},vm=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Sm(e,t,r,o,"Controller initialization error")},Sm=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var Xn="3.46.1",wm=["@coveo/atomic","@coveo/quantic"];var ul=()=>Xe,Am=()=>X,hr=P("configuration/updateBasicConfiguration",e=>j(e,{accessToken:Xe,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Xe})),Ut=P("configuration/updateSearchConfiguration",e=>j(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Xe,timezone:Xe,locale:Xe,authenticationProviders:new ge({required:!1,each:X})})),Jb={enabled:new ue({default:!0}),originContext:ul(),originLevel2:ul(),originLevel3:ul(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new Oe,anonymous:new ue({default:!1}),deviceId:Xe,userDisplayName:Xe,documentLocation:Xe,trackingId:hm,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ee({options:{required:!1},values:wm.reduce((e,t)=>(e[t]=gm,e),{})})},Jn=P("configuration/updateAnalyticsConfiguration",e=>j(e,Jb)),Zn=P("configuration/analytics/disable"),eo=P("configuration/analytics/enable"),Ma=P("configuration/analytics/originlevel2",e=>j(e,{originLevel2:Am()})),ja=P("configuration/analytics/originlevel3",e=>j(e,{originLevel3:Am()})),bm=P("knowledge/setAgentId",e=>j(e,new H({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var xm={q:new H,enableQuerySyntax:new ue,aq:new H,cq:new H,firstResult:new te({min:0}),numberOfResults:new te({min:0}),sortCriteria:new H,f:new ee,fExcluded:new ee,cf:new ee,nf:new ee,mnf:new ee,df:new ee,debug:new ue,sf:new ee,tab:new H,af:new ee};var yr=P("searchParameters/restore",e=>j(e,xm)),Cm=P("searchParameters/restoreTab",e=>j(e,X));m();d();f();p();var qa=P("debug/enable"),La=P("debug/disable");m();d();f();p();var Ua=()=>!1;var Va=Me(Ua(),e=>{e.addCase(qa,()=>!0).addCase(La,()=>!1).addCase(yr,(t,r)=>r.payload.debug??t)});m();d();f();p();var to=P("pipeline/set",e=>j(e,new H({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var Zb=P("history/undo"),ex=P("history/redo"),Vt=P("history/snapshot"),PM=be("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(Zb()),yield t(mt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),NM=be("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(ex()),yield t(mt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),mt=be("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var ro=()=>"";var no=Me(ro(),e=>{e.addCase(to,(t,r)=>r.payload).addCase(mt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ut,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var Ga=P("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var oo=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,u=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(s)||u.test(s)||s.indexOf(".")===-1?ll(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],ll(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ll(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}m();d();f();p();function tx(){return typeof navigator<"u"}function Em(){try{return typeof localStorage<"u"}catch{return!1}}function Rm(){try{return typeof sessionStorage<"u"}catch{return!1}}function Im(){return!!(tx()&&navigator.cookieEnabled)}var Tm=null;function _m(){return Tm||(Em()?localStorage:Im()?new dl:Rm()?sessionStorage:new pl)}var io=class io{getItem(t){return oo.get(`${io.prefix}${t}`)}removeItem(t){oo.erase(`${io.prefix}${t}`)}setItem(t,r,n){oo.set(`${io.prefix}${t}`,r,n)}};xe(io,"prefix","coveo_");var dl=io;var pl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Ba="__coveo.analytics.history",rx=20,nx=1e3*60,ox=75,Jr=class Jr{constructor(t){xe(this,"store");this.store=t||_m()}static getInstance(t){return Jr.instance||(Jr.instance=new Jr(t)),Jr.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ba);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Ba);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Ba,JSON.stringify(t.slice(0,rx)))}catch{}}clear(){try{this.store.removeItem(Ba)}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,ox)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>nx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};xe(Jr,"instance",null);var fl=Jr,bt=fl;m();d();f();p();m();d();f();p();var ao=Ue(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Xn}`));m();d();f();p();m();d();f();p();function tr(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 M(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var ve;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ve||(ve={}));function hl(){return typeof window<"u"}function _l(){return typeof navigator<"u"}function so(){return typeof document<"u"}function yl(){try{return typeof localStorage<"u"}catch{return!1}}function ix(){try{return typeof sessionStorage<"u"}catch{return!1}}function Bm(){return _l()&&navigator.cookieEnabled}var ax=[ve.click,ve.custom,ve.search,ve.view],sx=(e,t)=>ax.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:_l()?navigator.userAgent:"unknown"},t):t,Ei=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?km(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],km(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function km(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function cx(){return yl()?localStorage:Bm()?new Ri:ix()?sessionStorage:new uo}var Ri=class e{getItem(t){return Ei.get(`${e.prefix}${t}`)}removeItem(t){Ei.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ei.set(`${e.prefix}${t}`,r,n)}};Ri.prefix="coveo_";var vl=class{constructor(){this.cookieStorage=new Ri}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)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},$a="__coveo.analytics.history",ux=20,lx=1e3*60,dx=75,za=class{constructor(t){this.store=t||cx()}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 M(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 M(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem($a);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return M(this,void 0,void 0,function*(){try{let t=yield this.store.getItem($a);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem($a,JSON.stringify(t.slice(0,ux)))}catch{}}clear(){try{this.store.removeItem($a)}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,dx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>lx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var px=(e,t)=>M(void 0,void 0,void 0,function*(){return e===ve.view?(yield fx(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),fx=e=>M(void 0,void 0,void 0,function*(){let t=new za,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Qa,mx=new Uint8Array(16);function gx(){if(!Qa&&(Qa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qa(mx)}var hx=/^(?:[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 Wa(e){return typeof e=="string"&&hx.test(e)}var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function $m(e,t=0){return Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]}function yx(e){if(!Wa(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 vx(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Sx="6ba7b810-9dad-11d1-80b4-00c04fd430c8",wx="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ax(e,t,r){function n(o,i,a,s){var c;if(typeof o=="string"&&(o=vx(o)),typeof i=="string"&&(i=yx(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(i),u.set(o,i.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let h=0;h<16;++h)a[s+h]=u[h];return a}return $m(u)}try{n.name=e}catch{}return n.DNS=Sx,n.URL=wx,n}var bx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Om={randomUUID:bx};function Zr(e,t,r){if(Om.randomUUID&&!t&&!e)return Om.randomUUID();e=e||{};let n=e.random||(e.rng||gx)();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 $m(n)}function xx(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 ml(e,t){return e<<t|e>>>32-t}function Cx(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[a*64+c*4]<<24|e[a*64+c*4+1]<<16|e[a*64+c*4+2]<<8|e[a*64+c*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let g=0;g<16;++g)s[g]=i[a][g];for(let g=16;g<80;++g)s[g]=ml(s[g-3]^s[g-8]^s[g-14]^s[g-16],1);let c=r[0],u=r[1],h=r[2],v=r[3],S=r[4];for(let g=0;g<80;++g){let y=Math.floor(g/20),x=ml(c,5)+xx(y,u,h,v)+S+t[y]+s[g]>>>0;S=v,v=h,h=ml(u,30)>>>0,u=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Ex=Ax("v5",80,Cx),Pm=Ex,Qm="2.30.52",Nm=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ci={pageview:"pageview",event:"event"},Ka=class{constructor({client:t,uuidGenerator:r=Zr}){this.client=t,this.uuidGenerator=r}},Sl=class extends Ka{constructor({client:t,uuidGenerator:r=Zr}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Nm(window.location),this.lastReferrer=so()?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:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Ci.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ci.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ci.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ci.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 Nm(window.location)}},vr=class e{constructor(t,r){if(!Wa(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Wa(i)?new e(i,Number.parseInt(o)*1e3):null}};vr.cvo_cid="cvo_cid";vr.expirationTime=120;var wl=class extends Ka{constructor({client:t,uuidGenerator:r=Zr}){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 M(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(vr.cvo_cid,new vr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};wl.Id="link";var Ct=Object.keys;function Ha(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var gl=128,Hm=192,Fm=224,Dm=240;function Rx(e){return(e&248)===Dm?4:(e&Dm)===Fm?3:(e&Fm)===Hm?2:1}function Ix(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&gl)!=gl)break;if(r-=3,(n&Hm)!=gl){t-r>=Rx(n)*3&&(r=t);break}}return e.substring(0,r)}var Al={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"},Tx=Ct(Al).map(e=>Al[e]),_x=[...Tx].join("|"),kx=new RegExp(`^(${_x}$)`),Ox={svcAction:"svc_action",svcActionData:"svc_action_data"},Px=e=>Ct(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Al[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Nx=e=>kx.test(e),Fx=[Nx],Mm={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},jm={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ot={action:"pa",list:"pal",listSource:"pls"},Ya={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Dx=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],bl={id:"quoteId",affiliation:"quoteAffiliation"},xl={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Mx={add:ot,bookmark_add:ot,bookmark_remove:ot,click:ot,checkout:ot,checkout_option:ot,detail:ot,impression:ot,remove:ot,refund:Object.assign(Object.assign({},ot),Ya),purchase:Object.assign(Object.assign({},ot),Ya),quickview:ot,quote:Object.assign(Object.assign({},ot),bl),review:Object.assign(Object.assign({},ot),xl)},jx=Ct(Mm).map(e=>Mm[e]),qx=Ct(jm).map(e=>jm[e]),Lx=Ct(ot).map(e=>ot[e]),Ux=Ct(Ya).map(e=>Ya[e]),Vx=Ct(xl).map(e=>xl[e]),Gx=Ct(bl).map(e=>bl[e]),Bx=[...jx,"custom"].join("|"),$x=[...qx,"custom"].join("|"),zm="(pr[0-9]+)",Wm="(il[0-9]+pi[0-9]+)",Qx=new RegExp(`^${zm}(${Bx})$`),Hx=new RegExp(`^(${Wm}(${$x}))|(il[0-9]+nm)$`),zx=new RegExp(`^(${Lx.join("|")})$`),Wx=new RegExp(`^(${Ux.join("|")})$`),Kx=new RegExp(`^${zm}custom$`),Yx=new RegExp(`^${Wm}custom$`),Xx=new RegExp(`^(${[...Dx,...Vx,...Gx].join("|")})$`),Jx=e=>Qx.test(e),Zx=e=>Hx.test(e),eC=e=>zx.test(e),tC=e=>Wx.test(e),rC=e=>Xx.test(e),nC=[Zx,Jx,eC,tC,rC],oC=[Kx,Yx],iC={anonymizeIp:"aip"},aC={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},sC={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},cC=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],uC=Object.assign(Object.assign(Object.assign(Object.assign({},iC),aC),sC),cC.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Cl=Object.assign(Object.assign({},uC),Ox),lC=e=>{let t=!!e.action&&Mx[e.action]||{};return Ct(e).reduce((r,n)=>{let o=t[n]||Cl[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},dC=Ct(Cl).map(e=>Cl[e]),pC=e=>dC.indexOf(e)!==-1,fC=e=>e==="custom",mC=e=>[...nC,...Fx,pC,fC].some(t=>t(e)),gC=e=>Ct(e).reduce((t,r)=>{let n=hC(r);return n?Object.assign(Object.assign({},t),yC(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),hC=e=>{let t;return[...oC].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},yC=(e,t)=>Ct(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),El=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return M(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return M(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ve.click,ve.custom,ve.search,ve.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}},Rl=class{sendEvent(t,r){return M(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){return Promise.resolve()})}},qm=w.fetch,Xa=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=tr(c,["url"]),v;try{v=yield qm(u,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(v.ok){let S=yield v.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield qm(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}getVisitorIdParam(){return M(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"})}},Il=class{constructor(t,r){yl()&&Bm()?this.storage=new vl:yl()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new Xa(t),this.beaconClient=new El(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Tl=class{constructor(t,r){this.storage=r||new uo,this.client=new Xa(t)}getClientDependingOnEventType(t){return this.client}},Ja=class{constructor(){this.storage=new uo,this.client=new Rl}getClientDependingOnEventType(t){return this.client}},vC="xx",SC=e=>e?.startsWith(vC)||!1,wC=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
@@ -71,4 +71,4 @@ fast-json-patch/module/duplex.mjs:
|
|
|
71
71
|
*)
|
|
72
72
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
73
73
|
|
|
74
|
-
window.coveoQuanticVersion = '3.36.
|
|
74
|
+
window.coveoQuanticVersion = '3.36.7';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/quantic",
|
|
3
|
-
"version": "3.36.
|
|
3
|
+
"version": "3.36.7",
|
|
4
4
|
"description": "A Salesforce Lightning Web Component (LWC) library for building modern UIs interfacing with the Coveo platform",
|
|
5
5
|
"author": "coveo.com",
|
|
6
6
|
"homepage": "https://coveo.com",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"coveo.analytics": "2.30.45",
|
|
15
15
|
"dompurify": "3.2.6",
|
|
16
16
|
"marked": "12.0.2",
|
|
17
|
-
"@coveo/
|
|
18
|
-
"@coveo/
|
|
17
|
+
"@coveo/bueno": "1.1.7",
|
|
18
|
+
"@coveo/headless": "3.46.1"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": "^20.9.0 || ^22.11.0 || ^24.11.0"
|