@coveo/quantic 3.12.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
22
22
  `)}
23
23
 
24
24
  ${t}
25
- `;return new _r(r)}var _r=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},xe=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 Gp(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}},se=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&K(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function ge(e){return e===void 0}function Kp(e){return e===null}function K(e){return ge(e)||Kp(e)}var G=class{constructor(e={}){ae(this,"value");this.config=e,this.value=new se(e)}validate(e){let t=this.value.validate(e);return t||(Yp(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 Yp(e){return ge(e)||ks(e)}function ks(e){return typeof e=="number"&&!isNaN(e)}var J=class{constructor(e={}){ae(this,"value");this.value=new se(e)}validate(e){let t=this.value.validate(e);return t||(Jp(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Jp(e){return ge(e)||Os(e)}function Os(e){return typeof e=="boolean"}var Xp=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,j=class{constructor(e={}){ae(this,"value");ae(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new se(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ge(e))return null;if(!Rn(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&&!(Xp.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 Rn(e){return Object.prototype.toString.call(e)==="[object String]"}var H=class{constructor(e={}){ae(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ge(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ds(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&K(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 Ds(e){return e!==void 0&&typeof e=="object"}var X=class{constructor(e={}){ae(this,"value");this.config=e,this.value=new se(this.config)}validate(e){if(!K(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(K(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&&K(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 Os(e)||Rn(e)||ks(e)||Ds(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ms(e){return Array.isArray(e)}var Ii=class{constructor(e){ae(this,"value");this.config=e,this.value=new se(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ge(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};c();l();u();function qs(e){return Array.isArray(e)}function En(e){return e.trim()===""}function Ns(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}var Zp=new Set(["1",1,"yes",!0]);function _s(){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=>Zp.has(r))}function Vs(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Vr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function ef(e){if(En(e.openingDelimiter)||En(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(K(e.content)||En(e.content))return e.content;if(e.highlights.length===0)return Jt(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,p=a+i.length;if(p>t)break;r+=Jt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Jt(e.content.slice(a,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Jt(e.content.slice(n))),r}function tf(e,t){return e=Jt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Pi(n,t.notMatchDelimiters):o?Pi(o,t.exactMatchDelimiters):i?Pi(i,t.correctionDelimiters):r)}function Pi(e,t){return t?t.open+e+t.close:e}function Jt(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}c();l();u();c();l();u();var In=e=>e;c();l();u();var Ls=e=>e,js=e=>e,Us=e=>e;c();l();u();c();l();u();function Pn(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Be(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Pn(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Pn(),extendedResults:{}}}c();l();u();function ct(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var ut=e=>{let{response:t}=e;return t.body?rf(e):nf(t)},rf=e=>af(e)?sf(e):of(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},nf=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function of(e){return e.body.statusCode!==void 0}function af(e){return e.body.exception!==void 0}var sf=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});c();l();u();var Zs=Me(Ks(),1);c();l();u();c();l();u();var Df="recommendation-internal-options",Lb=Symbol.for(Df);var Qe=new Error("Failed to load reducers."),Xt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var _t=class extends Error{constructor(r,n){super();ae(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};c();l();u();function Ys(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Js(e){return typeof e!="object"||!e?!1:Object.values(e).every(Mf)}function Mf(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Xs(e){return e===429}var _e=class e{static call(t){return _asyncToGenerator(function*(){let r=qf(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield A(i,a);if(Xs(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Zs.backOff)(p,{retry:d=>{let g=d&&Xs(d.status);return g&&n.info("Platform retrying request"),g}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Xt;case 404:throw new _t(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new _t(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:p,...f}=t,d=Vr(f);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return d})()}};function we(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function lt(e,t="prod"){return`${we(e,t)}/rest/search/v2`}function Tn(e,t="prod"){return`${we(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function qf(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,p=e.method==="POST"||e.method==="PUT",f=Nf(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(p&&{body:f}),signal:a}}function Nf(e,t){return t==="application/x-www-form-urlencoded"?Js(e)?Ys(e):"":JSON.stringify(e)}c();l();u();var dt=class{constructor(){ae(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new s.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};c();l();u();c();l();u();var Ur=class{constructor(t){ae(this,"_basePath");ae(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}};c();l();u();function ec(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}c();l();u();var Ze=(e,t,r,n)=>{let o=new Ur(`${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 tc=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield _e.call({...Ze(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ct(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ec(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return _f(a)?{success:a}:{error:ut({response:r,body:a})}});return function tc(_x,_x2){return _ref2.apply(this,arguments)}}();function _f(e){return typeof e=="string"}c();l();u();function Vf(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Lf(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function kn(e,t){if(t&&e.name==="AbortError")return{error:Lf(e)};if(e instanceof _t)return{error:Vf(e)};throw e}var On=class{constructor(t){this.options=t;ae(this,"apiCallsQueues",{unknown:new dt,mainSearch:new dt,facetValues:new dt,foldingCollection:new dt,instantResults:new dt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"POST","application/json","/plan"),requestParams:ct(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return kn(r);let n=yield r.json();return Uf(n)?{success:n}:{error:ut({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ct(t),..._this3.options});if(r instanceof Error)return kn(r);let n=yield r.json(),o={response:r,body:n};return jf(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:ut(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>_e.call({...Ze(t,"POST","application/json",""),requestParams:ct(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return kn(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return rc(i)?(a.body=nc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:ut(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"POST","application/json","/facet"),requestParams:ct(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 _e.call({...Ze(t,"POST","application/json",""),requestParams:ct(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(rc(n)){let o={response:r,body:n};return o.body=nc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:ut({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return tc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Bf(n)?{success:n}:{error:ut({response:r,body:n})}})()}},Dn=e=>e.success!==void 0,Re=e=>e.error!==void 0;function rc(e){return e.results!==void 0}function nc(e){let t=Pn();return K(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function jf(e){return e.completions!==void 0}function Uf(e){return e.preprocessingOutput!==void 0}function Bf(e){return e.fields!==void 0}c();l();u();c();l();u();c();l();u();function he(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 Qf=typeof Symbol=="function"&&Symbol.observable||"@@observable",oc=Qf,Vi=()=>Math.random().toString(36).substring(7).split("").join("."),$f={INIT:`@@redux/INIT${Vi()}`,REPLACE:`@@redux/REPLACE${Vi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Vi()}`},Mn=$f;function $e(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 Li(e,t,r){if(typeof e!="function")throw new Error(he(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(he(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(he(1));return r(Li)(e,t)}let n=e,o=t,i=new Map,a=i,p=0,f=!1;function d(){a===i&&(a=new Map,i.forEach((R,x)=>{a.set(x,R)}))}function g(){if(f)throw new Error(he(3));return o}function y(R){if(typeof R!="function")throw new Error(he(4));if(f)throw new Error(he(5));let x=!0;d();let v=p++;return a.set(v,R),function(){if(x){if(f)throw new Error(he(6));x=!1,d(),a.delete(v),i=null}}}function h(R){if(!$e(R))throw new Error(he(7));if(typeof R.type>"u")throw new Error(he(8));if(typeof R.type!="string")throw new Error(he(17));if(f)throw new Error(he(9));try{f=!0,o=n(o,R)}finally{f=!1}return(i=a).forEach(v=>{v()}),R}function m(R){if(typeof R!="function")throw new Error(he(10));n=R,h({type:Mn.REPLACE})}function S(){let R=y;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(he(11));function v(){let I=x;I.next&&I.next(g())}return v(),{unsubscribe:R(v)}},[oc](){return this}}}return h({type:Mn.INIT}),{dispatch:h,subscribe:y,getState:g,replaceReducer:m,[oc]:S}}function Hf(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Mn.INIT})>"u")throw new Error(he(12));if(typeof r(void 0,{type:Mn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(he(13))})}function Zt(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let p=t[a];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{Hf(r)}catch(a){i=a}return function(p={},f){if(i)throw i;let d=!1,g={};for(let y=0;y<n.length;y++){let h=n[y],m=r[h],S=p[h],C=m(S,f);if(typeof C>"u"){let R=f&&f.type;throw new Error(he(14))}g[h]=C,d=d||C!==S}return d=d||n.length!==Object.keys(p).length,d?g:p}}function er(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ic(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(he(15))},a={getState:o.getState,dispatch:(f,...d)=>i(f,...d)},p=e.map(f=>f(a));return i=er(...p)(o.dispatch),{...o,dispatch:i}}}function qn(e){return $e(e)&&"type"in e&&typeof e.type=="string"}c();l();u();var Ki=Symbol.for("immer-nothing"),Br=Symbol.for("immer-draftable"),Ee=Symbol.for("immer-state");function ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lt=Object.getPrototypeOf;function Te(e){return!!e&&!!e[Ee]}function Ie(e){return e?lc(e)||Array.isArray(e)||!!e[Br]||!!e.constructor?.[Br]||Wr(e)||Gr(e):!1}var zf=Object.prototype.constructor.toString();function lc(e){if(!e||typeof e!="object")return!1;let t=Lt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===zf}function Yi(e){return Te(e)||ye(15,e),e[Ee].base_}function Qr(e,t){jt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function jt(e){let t=e[Ee];return t?t.type_:Array.isArray(e)?1:Wr(e)?2:Gr(e)?3:0}function $r(e,t){return jt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ji(e,t){return jt(e)===2?e.get(t):e[t]}function dc(e,t,r){let n=jt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Wf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Wr(e){return e instanceof Map}function Gr(e){return e instanceof Set}function Vt(e){return e.copy_||e.base_}function Qi(e,t){if(Wr(e))return new Map(e);if(Gr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=lc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ee];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],p=n[a];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[a]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[a]})}return Object.create(Lt(e),n)}else{let n=Lt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Vn(e,t=!1){return Ln(e)||Te(e)||!Ie(e)||(jt(e)>1&&(e.set=e.add=e.clear=e.delete=Gf),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Vn(n,!0))),e}function Gf(){ye(2)}function Ln(e){return Object.isFrozen(e)}var $i={};function Ut(e){let t=$i[e];return t||ye(0,e),t}function Kf(e,t){$i[e]||($i[e]=t)}var Hr;function pc(){return Hr}function Yf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ac(e,t){t&&(Ut("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Hi(e){zi(e),e.drafts_.forEach(Jf),e.drafts_=null}function zi(e){e===Hr&&(Hr=e.parent_)}function sc(e){return Hr=Yf(Hr,e)}function Jf(e){let t=e[Ee];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function cc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ee].modified_&&(Hi(t),ye(4)),Ie(e)&&(e=Nn(t,e),t.parent_||_n(t,e)),t.patches_&&Ut("Patches").generateReplacementPatches_(r[Ee].base_,e,t.patches_,t.inversePatches_)):e=Nn(t,r,[]),Hi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ki?e:void 0}function Nn(e,t,r){if(Ln(t))return t;let n=t[Ee];if(!n)return Qr(t,(o,i)=>uc(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return _n(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),Qr(i,(p,f)=>uc(e,n,o,p,f,r,a)),_n(e,o,!1),r&&e.patches_&&Ut("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function uc(e,t,r,n,o,i,a){if(Te(o)){let p=i&&t&&t.type_!==3&&!$r(t.assigned_,n)?i.concat(n):void 0,f=Nn(e,o,p);if(dc(r,n,f),Te(f))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(Ie(o)&&!Ln(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Nn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&_n(e,o)}}function _n(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Vn(t,r)}function Xf(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:pc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=Ji;r&&(o=[n],i=zr);let{revoke:a,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=a,p}var Ji={get(e,t){if(t===Ee)return e;let r=Vt(e);if(!$r(r,t))return Zf(e,r,t);let n=r[t];return e.finalized_||!Ie(n)?n:n===Ui(e.base_,t)?(Bi(e),e.copy_[t]=Gi(n,e)):n},has(e,t){return t in Vt(e)},ownKeys(e){return Reflect.ownKeys(Vt(e))},set(e,t,r){let n=fc(Vt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Ui(Vt(e),t),i=o?.[Ee];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Wf(r,o)&&(r!==void 0||$r(e.base_,t)))return!0;Bi(e),Wi(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 Ui(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Bi(e),Wi(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Vt(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 Lt(e.base_)},setPrototypeOf(){ye(12)}},zr={};Qr(Ji,(e,t)=>{zr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});zr.deleteProperty=function(e,t){return zr.set.call(this,e,t,void 0)};zr.set=function(e,t,r){return Ji.set.call(this,e[0],t,r,e[0])};function Ui(e,t){let r=e[Ee];return(r?Vt(r):e)[t]}function Zf(e,t,r){let n=fc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function fc(e,t){if(!(t in e))return;let r=Lt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Lt(r)}}function Wi(e){e.modified_||(e.modified_=!0,e.parent_&&Wi(e.parent_))}function Bi(e){e.copy_||(e.copy_=Qi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var em=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...d){return a.produce(f,g=>r.call(this,g,...d))}}typeof r!="function"&&ye(6),n!==void 0&&typeof n!="function"&&ye(7);let o;if(Ie(t)){let i=sc(this),a=Gi(t,void 0),p=!0;try{o=r(a),p=!1}finally{p?Hi(i):zi(i)}return ac(i,n),cc(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Ki&&(o=void 0),this.autoFreeze_&&Vn(o,!0),n){let i=[],a=[];Ut("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,...p)=>this.produceWithPatches(a,f=>t(f,...p));let n,o;return[this.produce(t,r,(a,p)=>{n=a,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ie(e)||ye(8),Te(e)&&(e=mc(e));let t=sc(this),r=Gi(e,void 0);return r[Ee].isManual_=!0,zi(t),r}finishDraft(e,t){let r=e&&e[Ee];(!r||!r.isManual_)&&ye(9);let{scope_:n}=r;return ac(n,t),cc(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Ut("Patches").applyPatches_;return Te(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Gi(e,t){let r=Wr(e)?Ut("MapSet").proxyMap_(e,t):Gr(e)?Ut("MapSet").proxySet_(e,t):Xf(e,t);return(t?t.scope_:pc()).drafts_.push(r),r}function mc(e){return Te(e)||ye(10,e),gc(e)}function gc(e){if(!Ie(e)||Ln(e))return e;let t=e[Ee],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Qi(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Qi(e,!0);return Qr(r,(n,o)=>{dc(r,n,gc(o))}),t&&(t.finalized_=!1),r}function hc(){let t="replace",r="add",n="remove";function o(h,m,S,C){switch(h.type_){case 0:case 2:return a(h,m,S,C);case 1:return i(h,m,S,C);case 3:return p(h,m,S,C)}}function i(h,m,S,C){let{base_:R,assigned_:x}=h,v=h.copy_;v.length<R.length&&([R,v]=[v,R],[S,C]=[C,S]);for(let w=0;w<R.length;w++)if(x[w]&&v[w]!==R[w]){let I=m.concat([w]);S.push({op:t,path:I,value:y(v[w])}),C.push({op:t,path:I,value:y(R[w])})}for(let w=R.length;w<v.length;w++){let I=m.concat([w]);S.push({op:r,path:I,value:y(v[w])})}for(let w=v.length-1;R.length<=w;--w){let I=m.concat([w]);C.push({op:n,path:I})}}function a(h,m,S,C){let{base_:R,copy_:x}=h;Qr(h.assigned_,(v,w)=>{let I=ji(R,v),q=ji(x,v),F=w?$r(R,v)?t:r:n;if(I===q&&F===t)return;let E=m.concat(v);S.push(F===n?{op:F,path:E}:{op:F,path:E,value:q}),C.push(F===r?{op:n,path:E}:F===n?{op:r,path:E,value:y(I)}:{op:t,path:E,value:y(I)})})}function p(h,m,S,C){let{base_:R,copy_:x}=h,v=0;R.forEach(w=>{if(!x.has(w)){let I=m.concat([v]);S.push({op:n,path:I,value:w}),C.unshift({op:r,path:I,value:w})}v++}),v=0,x.forEach(w=>{if(!R.has(w)){let I=m.concat([v]);S.push({op:r,path:I,value:w}),C.unshift({op:n,path:I,value:w})}v++})}function f(h,m,S,C){S.push({op:t,path:[],value:m===Ki?void 0:m}),C.push({op:t,path:[],value:h})}function d(h,m){return m.forEach(S=>{let{path:C,op:R}=S,x=h;for(let q=0;q<C.length-1;q++){let F=jt(x),E=C[q];typeof E!="string"&&typeof E!="number"&&(E=""+E),(F===0||F===1)&&(E==="__proto__"||E==="constructor")&&ye(19),typeof x=="function"&&E==="prototype"&&ye(19),x=ji(x,E),typeof x!="object"&&ye(18,C.join("/"))}let v=jt(x),w=g(S.value),I=C[C.length-1];switch(R){case t:switch(v){case 2:return x.set(I,w);case 3:ye(16);default:return x[I]=w}case r:switch(v){case 1:return I==="-"?x.push(w):x.splice(I,0,w);case 2:return x.set(I,w);case 3:return x.add(w);default:return x[I]=w}case n:switch(v){case 1:return x.splice(I,1);case 2:return x.delete(I);case 3:return x.delete(S.value);default:return delete x[I]}default:ye(17,R)}}),h}function g(h){if(!Ie(h))return h;if(Array.isArray(h))return h.map(g);if(Wr(h))return new Map(Array.from(h.entries()).map(([S,C])=>[S,g(C)]));if(Gr(h))return new Set(Array.from(h).map(g));let m=Object.create(Lt(h));for(let S in h)m[S]=g(h[S]);return $r(h,Br)&&(m[Br]=h[Br]),m}function y(h){return Te(h)?g(h):h}Kf("Patches",{applyPatches_:d,generatePatches_:o,generateReplacementPatches_:f})}var ke=new em,et=ke.produce,jn=ke.produceWithPatches.bind(ke),aw=ke.setAutoFreeze.bind(ke),sw=ke.setUseStrictShallowCopy.bind(ke),Xi=ke.applyPatches.bind(ke),cw=ke.createDraft.bind(ke),uw=ke.finishDraft.bind(ke);c();l();u();function tm(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rm(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function nm(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 yc=e=>Array.isArray(e)?e:[e];function om(e){let t=Array.isArray(e[0])?e[0]:e;return nm(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function im(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var gw=Symbol();var hw=Object.getPrototypeOf({});var am=class{constructor(e){this.value=e}deref(){return this.value}},sm=typeof WeakRef<"u"?WeakRef:am,cm=0,Sc=1;function Un(){return{s:cm,v:void 0,o:null,p:null}}function tr(e,t={}){let r=Un(),{resultEqualityCheck:n}=t,o,i=0;function a(){let p=r,{length:f}=arguments;for(let y=0,h=f;y<h;y++){let m=arguments[y];if(typeof m=="function"||typeof m=="object"&&m!==null){let S=p.o;S===null&&(p.o=S=new WeakMap);let C=S.get(m);C===void 0?(p=Un(),S.set(m,p)):p=C}else{let S=p.p;S===null&&(p.p=S=new Map);let C=S.get(m);C===void 0?(p=Un(),S.set(m,p)):p=C}}let d=p,g;if(p.s===Sc)g=p.v;else if(g=e.apply(null,arguments),i++,n){let y=o?.deref?.()??o;y!=null&&n(y,g)&&(g=y,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new sm(g):g}return d.s=Sc,d.v=g,g}return a.clearCache=()=>{r=Un(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function vc(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,p,f={},d=o.pop();typeof d=="object"&&(f=d,d=o.pop()),tm(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);let g={...r,...f},{memoize:y,memoizeOptions:h=[],argsMemoize:m=tr,argsMemoizeOptions:S=[],devModeChecks:C={}}=g,R=yc(h),x=yc(S),v=om(o),w=y(function(){return i++,d.apply(null,arguments)},...R),I=!0,q=m(function(){a++;let E=im(v,arguments);return p=w.apply(null,E),p},...x);return Object.assign(q,{resultFunc:d,memoizedResultFunc:w,dependencies:v,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:y,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var le=vc(tr),um=Object.assign((e,t=le)=>{rm(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,p,f)=>(a[r[f]]=p,a),{}))},{withTypes:()=>um});c();l();u();function Cc(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var bc=Cc(),Ac=Cc;var lm=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?er:er.apply(null,arguments)},Ow=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},dm=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ve(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=>qn(n)&&n.type===e,r}var Ic=class Kr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Kr.prototype)}static get[Symbol.species](){return Kr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Kr(...t[0].concat(this)):new Kr(...t.concat(this))}};function wc(e){return Ie(e)?et(e,()=>{}):e}function xc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function pm(e){return typeof e=="boolean"}var fm=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Ic;return r&&(pm(r)?a.push(bc):a.push(Ac(r.extraArgument))),a},pt="RTK_autoBatch",nr=()=>e=>({payload:e,meta:{[pt]:!0}}),Rc=e=>t=>{setTimeout(t,e)},mm=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Rc(10):e.type==="callback"?e.queueNotification:Rc(e.timeout),d=()=>{a=!1,i&&(i=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let y=()=>o&&g(),h=n.subscribe(y);return p.add(g),()=>{h(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[pt],i=!o,i&&(a||(a=!0,f(d))),n.dispatch(g)}finally{o=!0}}})},gm=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Ic(e);return n&&o.push(mm(typeof n=="object"?n:void 0)),o};function Pc(e){let t=fm(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},p;if(typeof r=="function")p=r;else if($e(r))p=Zt(r);else throw new Error(Ve(1));let f;typeof n=="function"?f=n(t):f=t();let d=er;o&&(d=lm({trace:!1,...(typeof o=="object"&&o)}));let g=ic(...f),y=gm(g),h=typeof a=="function"?a(y):y(),m=d(...h);return Li(p,i,m)}function Fc(e){let t={},r=[],n,o={addCase(i,a){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Ve(28));if(p in t)throw new Error(Ve(29));return t[p]=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 hm(e){return typeof e=="function"}function ue(e,t){let[r,n,o]=Fc(t),i;if(hm(e))i=()=>wc(e());else{let p=wc(e);i=()=>p}function a(p=i(),f){let d=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return d.filter(g=>!!g).length===0&&(d=[o]),d.reduce((g,y)=>{if(y)if(Te(g)){let m=y(g,f);return m===void 0?g:m}else{if(Ie(g))return et(g,h=>y(h,f));{let h=y(g,f);if(h===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return g},p)}return a.getInitialState=i,a}var Tc=(e,t)=>dm(e)?e.match(t):e(t);function He(...e){return t=>e.some(r=>Tc(r,t))}function rr(...e){return t=>e.every(r=>Tc(r,t))}function Qn(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 Yr(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function $n(...e){return e.length===0?t=>Qn(t,["pending"]):Yr(e)?He(...e.map(t=>t.pending)):$n()(e[0])}function Bt(...e){return e.length===0?t=>Qn(t,["rejected"]):Yr(e)?He(...e.map(t=>t.rejected)):Bt()(e[0])}function Jr(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?rr(Bt(...e),t):Yr(e)?rr(Bt(...e),t):Jr()(e[0])}function tt(...e){return e.length===0?t=>Qn(t,["fulfilled"]):Yr(e)?He(...e.map(t=>t.fulfilled)):tt()(e[0])}function Hn(...e){return e.length===0?t=>Qn(t,["pending","fulfilled","rejected"]):Yr(e)?He(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Hn()(e[0])}var ym="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",zn=(e=21)=>{let t="",r=e;for(;r--;)t+=ym[Math.random()*64|0];return t},Sm=["name","message","stack","code"],Zi=class{constructor(e,t){ae(this,"_type");this.payload=e,this.meta=t}},Ec=class{constructor(e,t){ae(this,"_type");this.payload=e,this.meta=t}},vm=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Sm)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},re=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,d,g,y)=>({payload:f,meta:{...(y||{}),arg:g,requestId:d,requestStatus:"fulfilled"}})),i=P(t+"/pending",(f,d,g)=>({payload:void 0,meta:{...(g||{}),arg:d,requestId:f,requestStatus:"pending"}})),a=P(t+"/rejected",(f,d,g,y,h)=>({payload:y,error:(n&&n.serializeError||vm)(f||"Rejected"),meta:{...(h||{}),arg:g,requestId:d,rejectedWithValue:!!y,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(d,g,y)=>{let h=n?.idGenerator?n.idGenerator(f):zn(),m=new s.AbortController,S,C;function R(v){C=v,m.abort()}let x=_asyncToGenerator(function*(){let v;try{let I=n?.condition?.(f,{getState:g,extra:y});if(bm(I)&&(I=yield I),I===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((F,E)=>{S=()=>{E({name:"AbortError",message:C||"Aborted"})},m.signal.addEventListener("abort",S)});d(i(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:g,extra:y}))),v=yield Promise.race([q,Promise.resolve(r(f,{dispatch:d,getState:g,extra:y,requestId:h,signal:m.signal,abort:R,rejectWithValue:(F,E)=>new Zi(F,E),fulfillWithValue:(F,E)=>new Ec(F,E)})).then(F=>{if(F instanceof Zi)throw F;return F instanceof Ec?o(F.payload,h,f,F.meta):o(F,h,f)})])}catch(I){v=I instanceof Zi?a(null,h,f,I.payload,I.meta):a(I,h,f)}finally{S&&m.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(v)&&v.meta.condition||d(v),v})();return Object.assign(x,{abort:R,requestId:h,arg:f,unwrap(){return x.then(Cm)}})}}return Object.assign(p,{pending:i,rejected:a,fulfilled:o,settled:He(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Cm(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function bm(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var kc=Symbol.for("rtk-slice-createasyncthunk"),_w={[kc]:re};function Am(e,t){return`${e}/${t}`}function wm({creators:e}={}){let t=e?.asyncThunk?.[kc];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ve(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Rm()):n.reducers)||{},p=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(v,w){let I=typeof v=="string"?v:v.type;if(!I)throw new Error(Ve(12));if(I in f.sliceCaseReducersByType)throw new Error(Ve(13));return f.sliceCaseReducersByType[I]=w,d},addMatcher(v,w){return f.sliceMatchers.push({matcher:v,reducer:w}),d},exposeAction(v,w){return f.actionCreators[v]=w,d},exposeCaseReducer(v,w){return f.sliceCaseReducersByName[v]=w,d}};p.forEach(v=>{let w=a[v],I={reducerName:v,type:Am(o,v),createNotation:typeof n.reducers=="function"};Im(w)?Fm(I,w,d,t):Em(I,w,d)});function g(){let[v={},w=[],I=void 0]=typeof n.extraReducers=="function"?Fc(n.extraReducers):[n.extraReducers],q={...v,...f.sliceCaseReducersByType};return ue(n.initialState,F=>{for(let E in q)F.addCase(E,q[E]);for(let E of f.sliceMatchers)F.addMatcher(E.matcher,E.reducer);for(let E of w)F.addMatcher(E.matcher,E.reducer);I&&F.addDefaultCase(I)})}let y=v=>v,h=new Map,m;function S(v,w){return m||(m=g()),m(v,w)}function C(){return m||(m=g()),m.getInitialState()}function R(v,w=!1){function I(F){let E=F[v];return typeof E>"u"&&w&&(E=C()),E}function q(F=y){let E=xc(h,w,()=>new WeakMap);return xc(E,F,()=>{let D={};for(let[k,L]of Object.entries(n.selectors??{}))D[k]=xm(L,F,C,w);return D})}return{reducerPath:v,getSelectors:q,get selectors(){return q(I)},selectSlice:I}}let x={name:o,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(v,{reducerPath:w,...I}={}){let q=w??i;return v.inject({reducerPath:q,reducer:S},I),{...x,...R(q,!0)}}};return x}}function xm(e,t,r,n){function o(i,...a){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...a)}return o.unwrapped=e,o}var Qt=wm();function Rm(){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 Em({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Pm(n))throw new Error(Ve(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 Im(e){return e._reducerDefinitionType==="asyncThunk"}function Pm(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Fm({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ve(18));let{payloadCreator:i,fulfilled:a,pending:p,rejected:f,settled:d,options:g}=r,y=o(e,i,g);n.exposeAction(t,y),a&&n.addCase(y.fulfilled,a),p&&n.addCase(y.pending,p),f&&n.addCase(y.rejected,f),d&&n.addMatcher(y.settled,d),n.exposeCaseReducer(t,{fulfilled:a||Bn,pending:p||Bn,rejected:f||Bn,settled:d||Bn})}function Bn(){}var Oc="listener",Dc="completed",Mc="cancelled",Vw=`task-${Mc}`,Lw=`task-${Dc}`,jw=`${Oc}-${Mc}`,Uw=`${Oc}-${Dc}`;var{assign:qc}=Object;var ea="listenerMiddleware";var Tm=qc(P(`${ea}/add`),{withTypes:()=>Tm}),Bw=P(`${ea}/removeAll`),km=qc(P(`${ea}/remove`),{withTypes:()=>km});var Qw=Symbol.for("rtk-state-proxy-original");function Ve(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. `}c();l();u();var z=new j({required:!0,emptyAllowed:!1}),pe=new j({required:!1,emptyAllowed:!1}),Se=new j({required:!0,emptyAllowed:!0}),tx=new j({required:!1,emptyAllowed:!0}),Wn=new X({each:z,required:!0}),Nc=new j({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),rt=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),qe=(e,t)=>{if("required"in t)return{payload:new xe({value:t}).validate({value:e}).value};let o=new H({options:{required:!0},values:t}).validate(e);if(o)throw new _r(o);return{payload:e}},V=(e,t)=>{try{return qe(e,t)}catch(r){return{payload:e,error:rt(r)}}},_c=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Lc(e,t,r,o,"Controller initialization error")},Vc=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Lc(e,t,r,o,"Controller initialization error")},Lc=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};c();l();u();var or="3.13.1",jc=["@coveo/atomic","@coveo/quantic"];var ta=()=>pe,Uc=()=>z,ft=P("configuration/updateBasicConfiguration",e=>V(e,{accessToken:pe,environment:new j({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:pe})),ze=P("configuration/updateSearchConfiguration",e=>V(e,{proxyBaseUrl:new j({required:!1,url:!0}),pipeline:new j({required:!1,emptyAllowed:!0}),searchHub:pe,timezone:pe,locale:pe,authenticationProviders:new X({required:!1,each:z})})),Om={enabled:new J({default:!0}),originContext:ta(),originLevel2:ta(),originLevel3:ta(),proxyBaseUrl:new j({required:!1,url:!0}),runtimeEnvironment:new se,anonymous:new J({default:!1}),deviceId:pe,userDisplayName:pe,documentLocation:pe,trackingId:pe,analyticsMode:new j({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new H({options:{required:!1},values:jc.reduce((e,t)=>(e[t]=Nc,e),{})})},ir=P("configuration/updateAnalyticsConfiguration",e=>V(e,Om)),ar=P("configuration/analytics/disable"),sr=P("configuration/analytics/enable"),Gn=P("configuration/analytics/originlevel2",e=>V(e,{originLevel2:Uc()})),Kn=P("configuration/analytics/originlevel3",e=>V(e,{originLevel3:Uc()}));c();l();u();c();l();u();c();l();u();var Bc={q:new j,enableQuerySyntax:new J,aq:new j,cq:new j,firstResult:new G({min:0}),numberOfResults:new G({min:0}),sortCriteria:new j,f:new H,fExcluded:new H,cf:new H,nf:new H,mnf:new H,df:new H,debug:new J,sf:new H,tab:new j,af:new H};var mt=P("searchParameters/restore",e=>V(e,Bc));c();l();u();var Yn=P("debug/enable"),Jn=P("debug/disable");c();l();u();var Xn=()=>!1;var Zn=ue(Xn(),e=>{e.addCase(Yn,()=>!0).addCase(Jn,()=>!1).addCase(mt,(t,r)=>r.payload.debug??t)});c();l();u();var cr=P("pipeline/set",e=>V(e,new j({required:!0,emptyAllowed:!0})));c();l();u();c();l();u();var Dm=P("history/undo"),Mm=P("history/redo"),We=P("history/snapshot"),oR=re("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Dm()),yield t(Pe())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),iR=re("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Mm()),yield t(Pe())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Pe=re("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());c();l();u();var ur=()=>"";var lr=ue(ur(),e=>{e.addCase(cr,(t,r)=>r.payload).addCase(Pe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(ze,(t,r)=>r.payload.pipeline||t)});c();l();u();c();l();u();c();l();u();c();l();u();function nt(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 T(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 p(g){try{d(n.next(g))}catch(y){a(y)}}function f(g){try{d(n.throw(g))}catch(y){a(y)}}function d(g){g.done?i(g.value):o(g.value).then(p,f)}d((n=n.apply(e,t||[])).next())})}var Z;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Z||(Z={}));function oa(){return typeof window<"u"}function ya(){return typeof navigator<"u"}function dr(){return typeof document<"u"}function ia(){try{return typeof localStorage<"u"}catch{return!1}}function qm(){try{return typeof sessionStorage<"u"}catch{return!1}}function ru(){return ya()&&navigator.cookieEnabled}var Nm=[Z.click,Z.custom,Z.search,Z.view],_m=(e,t)=>Nm.indexOf(e)!==-1?Object.assign({language:dr()?document.documentElement.lang:"unknown",userAgent:ya()?navigator.userAgent:"unknown"},t):t,en=class e{static set(t,r,n){var o,i,a,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Qc(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],Qc(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 Qc(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Vm(){return ia()?localStorage:ru()?new tn:qm()?sessionStorage:new fr}var tn=class e{getItem(t){return en.get(`${e.prefix}${t}`)}removeItem(t){en.erase(`${e.prefix}${t}`)}setItem(t,r,n){en.set(`${e.prefix}${t}`,r,n)}};tn.prefix="coveo_";var aa=class{constructor(){this.cookieStorage=new tn}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)}},fr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Xr="__coveo.analytics.history",nu=20,ou=1e3*60,iu=75,mr=class{constructor(t){this.store=t||Vm()}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 T(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 T(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Xr);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return T(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Xr);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Xr,JSON.stringify(t.slice(0,nu)))}catch{}}clear(){try{this.store.removeItem(Xr)}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,iu)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>ou:!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))}},au=Object.freeze({__proto__:null,HistoryStore:mr,MAX_NUMBER_OF_HISTORY_ELEMENTS:nu,MAX_VALUE_SIZE:iu,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:ou,STORE_KEY:Xr,default:mr}),Lm=(e,t)=>T(void 0,void 0,void 0,function*(){return e===Z.view?(yield jm(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),jm=e=>T(void 0,void 0,void 0,function*(){let t=new mr,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),eo,Um=new Uint8Array(16);function Bm(){if(!eo&&(eo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!eo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eo(Um)}var Qm=/^(?:[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 ro(e){return typeof e=="string"&&Qm.test(e)}var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function su(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}function $m(e){if(!ro(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 Hm(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var zm="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Wm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Gm(e,t,r){function n(o,i,a,p){var f;if(typeof o=="string"&&(o=Hm(o)),typeof i=="string"&&(i=$m(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let d=new Uint8Array(16+o.length);if(d.set(i),d.set(o,i.length),d=r(d),d[6]=d[6]&15|t,d[8]=d[8]&63|128,a){p=p||0;for(let g=0;g<16;++g)a[p+g]=d[g];return a}return su(d)}try{n.name=e}catch{}return n.DNS=zm,n.URL=Wm,n}var Km=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$c={randomUUID:Km};function $t(e,t,r){if($c.randomUUID&&!t&&!e)return $c.randomUUID();e=e||{};let n=e.random||(e.rng||Bm)();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 su(n)}function Ym(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 ra(e,t){return e<<t|e>>>32-t}function Jm(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 p=0;p<a.length;++p)e.push(a.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=p}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 p=new Uint32Array(80);for(let m=0;m<16;++m)p[m]=i[a][m];for(let m=16;m<80;++m)p[m]=ra(p[m-3]^p[m-8]^p[m-14]^p[m-16],1);let f=r[0],d=r[1],g=r[2],y=r[3],h=r[4];for(let m=0;m<80;++m){let S=Math.floor(m/20),C=ra(f,5)+Ym(S,d,g,y)+h+t[S]+p[m]>>>0;h=y,y=g,g=ra(d,30)>>>0,d=f,f=C}r[0]=r[0]+f>>>0,r[1]=r[1]+d>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+h>>>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 Xm=Gm("v5",80,Jm),Hc=Xm,cu="2.30.42",zc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Zr={pageview:"pageview",event:"event"},no=class{constructor({client:t,uuidGenerator:r=$t}){this.client=t,this.uuidGenerator=r}},sa=class extends no{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=zc(window.location),this.lastReferrer=dr()?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:dr()?document.title:"",encoding:dr()?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===Zr.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Zr.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Zr.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Zr.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 zc(window.location)}},gt=class e{constructor(t,r){if(!ro(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 ro(i)?new e(i,Number.parseInt(o)*1e3):null}};gt.cvo_cid="cvo_cid";gt.expirationTime=120;var ca=class extends no{constructor({client:t,uuidGenerator:r=$t}){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 T(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(gt.cvo_cid,new gt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ca.Id="link";var Ne=Object.keys;function to(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var na=128,uu=192,Wc=224,Gc=240;function Zm(e){return(e&248)===Gc?4:(e&Gc)===Wc?3:(e&Wc)===uu?2:1}function eg(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&na)!=na)break;if(r-=3,(n&uu)!=na){t-r>=Zm(n)*3&&(r=t);break}}return e.substring(0,r)}var ua={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"},tg=Ne(ua).map(e=>ua[e]),rg=[...tg].join("|"),ng=new RegExp(`^(${rg}$)`),og={svcAction:"svc_action",svcActionData:"svc_action_data"},ig=e=>Ne(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=ua[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),ag=e=>ng.test(e),sg=[ag],Kc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Yc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},be={action:"pa",list:"pal",listSource:"pls"},oo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},cg=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],la={id:"quoteId",affiliation:"quoteAffiliation"},da={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ug={add:be,bookmark_add:be,bookmark_remove:be,click:be,checkout:be,checkout_option:be,detail:be,impression:be,remove:be,refund:Object.assign(Object.assign({},be),oo),purchase:Object.assign(Object.assign({},be),oo),quickview:be,quote:Object.assign(Object.assign({},be),la),review:Object.assign(Object.assign({},be),da)},lg=Ne(Kc).map(e=>Kc[e]),dg=Ne(Yc).map(e=>Yc[e]),pg=Ne(be).map(e=>be[e]),fg=Ne(oo).map(e=>oo[e]),mg=Ne(da).map(e=>da[e]),gg=Ne(la).map(e=>la[e]),hg=[...lg,"custom"].join("|"),yg=[...dg,"custom"].join("|"),lu="(pr[0-9]+)",du="(il[0-9]+pi[0-9]+)",Sg=new RegExp(`^${lu}(${hg})$`),vg=new RegExp(`^(${du}(${yg}))|(il[0-9]+nm)$`),Cg=new RegExp(`^(${pg.join("|")})$`),bg=new RegExp(`^(${fg.join("|")})$`),Ag=new RegExp(`^${lu}custom$`),wg=new RegExp(`^${du}custom$`),xg=new RegExp(`^(${[...cg,...mg,...gg].join("|")})$`),Rg=e=>Sg.test(e),Eg=e=>vg.test(e),Ig=e=>Cg.test(e),Pg=e=>bg.test(e),Fg=e=>xg.test(e),Tg=[Eg,Rg,Ig,Pg,Fg],kg=[Ag,wg],Og={anonymizeIp:"aip"},Dg={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Mg={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},qg=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Ng=Object.assign(Object.assign(Object.assign(Object.assign({},Og),Dg),Mg),qg.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),pa=Object.assign(Object.assign({},Ng),og),_g=e=>{let t=!!e.action&&ug[e.action]||{};return Ne(e).reduce((r,n)=>{let o=t[n]||pa[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Vg=Ne(pa).map(e=>pa[e]),Lg=e=>Vg.indexOf(e)!==-1,jg=e=>e==="custom",Ug=e=>[...Tg,...sg,Lg,jg].some(t=>t(e)),Bg=e=>Ne(e).reduce((t,r)=>{let n=Qg(r);return n?Object.assign(Object.assign({},t),$g(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Qg=e=>{let t;return[...kg].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},$g=(e,t)=>Ne(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),fa=class{constructor(t){this.opts=t}sendEvent(t,r){return T(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:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,p),d=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,d)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return T(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:p,body:f}=a;o=p||t;try{i=JSON.parse(f)}catch(d){console.error("Unable to process the request body as a JSON string",d)}}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 T(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[Z.click,Z.custom,Z.search,Z.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}},ma=class{sendEvent(t,r){return T(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return T(this,void 0,void 0,function*(){return Promise.resolve()})}},Jc=b.fetch,io=class{constructor(t){this.opts=t}sendEvent(t,r){return T(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),i?yield i(p,"analyticsFetch"):{}),{url:d}=f,g=nt(f,["url"]),y;try{y=yield Jc(d,g)}catch(h){console.error("An error has occured when sending the event.",h);return}if(y.ok){let h=yield y.json();return h.visitorId&&o.setCurrentVisitorId(h.visitorId),h}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return T(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Jc(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Z.click,Z.custom,Z.search,Z.view].indexOf(t)!==-1}getVisitorIdParam(){return T(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"})}},ga=class{constructor(t,r){ia()&&ru()?this.storage=new aa:ia()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new fr),this.client=new io(t),this.beaconClient=new fa(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}},ha=class{constructor(t,r){this.storage=r||new fr,this.client=new io(t)}getClientDependingOnEventType(t){return this.client}},ao=class{constructor(){this.storage=new fr,this.client=new ma}getClientDependingOnEventType(t){return this.client}},Hg="xx",zg=e=>e?.startsWith(Hg)||!1,Wg=`
25
+ `;return new _r(r)}var _r=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},xe=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 Gp(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}},se=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&K(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function ge(e){return e===void 0}function Kp(e){return e===null}function K(e){return ge(e)||Kp(e)}var G=class{constructor(e={}){ae(this,"value");this.config=e,this.value=new se(e)}validate(e){let t=this.value.validate(e);return t||(Yp(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 Yp(e){return ge(e)||ks(e)}function ks(e){return typeof e=="number"&&!isNaN(e)}var J=class{constructor(e={}){ae(this,"value");this.value=new se(e)}validate(e){let t=this.value.validate(e);return t||(Jp(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Jp(e){return ge(e)||Os(e)}function Os(e){return typeof e=="boolean"}var Xp=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,j=class{constructor(e={}){ae(this,"value");ae(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new se(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ge(e))return null;if(!Rn(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&&!(Xp.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 Rn(e){return Object.prototype.toString.call(e)==="[object String]"}var H=class{constructor(e={}){ae(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ge(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ds(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&K(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 Ds(e){return e!==void 0&&typeof e=="object"}var X=class{constructor(e={}){ae(this,"value");this.config=e,this.value=new se(this.config)}validate(e){if(!K(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(K(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&&K(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 Os(e)||Rn(e)||ks(e)||Ds(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ms(e){return Array.isArray(e)}var Ii=class{constructor(e){ae(this,"value");this.config=e,this.value=new se(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ge(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};c();l();u();function qs(e){return Array.isArray(e)}function En(e){return e.trim()===""}function Ns(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}var Zp=new Set(["1",1,"yes",!0]);function _s(){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=>Zp.has(r))}function Vs(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Vr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function ef(e){if(En(e.openingDelimiter)||En(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(K(e.content)||En(e.content))return e.content;if(e.highlights.length===0)return Jt(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,p=a+i.length;if(p>t)break;r+=Jt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Jt(e.content.slice(a,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Jt(e.content.slice(n))),r}function tf(e,t){return e=Jt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Pi(n,t.notMatchDelimiters):o?Pi(o,t.exactMatchDelimiters):i?Pi(i,t.correctionDelimiters):r)}function Pi(e,t){return t?t.open+e+t.close:e}function Jt(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}c();l();u();c();l();u();var In=e=>e;c();l();u();var Ls=e=>e,js=e=>e,Us=e=>e;c();l();u();c();l();u();function Pn(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Be(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Pn(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Pn(),extendedResults:{}}}c();l();u();function ct(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var ut=e=>{let{response:t}=e;return t.body?rf(e):nf(t)},rf=e=>af(e)?sf(e):of(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},nf=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function of(e){return e.body.statusCode!==void 0}function af(e){return e.body.exception!==void 0}var sf=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});c();l();u();var Zs=Me(Ks(),1);c();l();u();c();l();u();var Df="recommendation-internal-options",Lb=Symbol.for(Df);var Qe=new Error("Failed to load reducers."),Xt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var _t=class extends Error{constructor(r,n){super();ae(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};c();l();u();function Ys(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Js(e){return typeof e!="object"||!e?!1:Object.values(e).every(Mf)}function Mf(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Xs(e){return e===429}var _e=class e{static call(t){return _asyncToGenerator(function*(){let r=qf(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield A(i,a);if(Xs(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Zs.backOff)(p,{retry:d=>{let g=d&&Xs(d.status);return g&&n.info("Platform retrying request"),g}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Xt;case 404:throw new _t(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new _t(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:p,...f}=t,d=Vr(f);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return d})()}};function we(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function lt(e,t="prod"){return`${we(e,t)}/rest/search/v2`}function Tn(e,t="prod"){return`${we(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function qf(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,p=e.method==="POST"||e.method==="PUT",f=Nf(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(p&&{body:f}),signal:a}}function Nf(e,t){return t==="application/x-www-form-urlencoded"?Js(e)?Ys(e):"":JSON.stringify(e)}c();l();u();var dt=class{constructor(){ae(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new s.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};c();l();u();c();l();u();var Ur=class{constructor(t){ae(this,"_basePath");ae(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}};c();l();u();function ec(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}c();l();u();var Ze=(e,t,r,n)=>{let o=new Ur(`${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 tc=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield _e.call({...Ze(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ct(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ec(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return _f(a)?{success:a}:{error:ut({response:r,body:a})}});return function tc(_x,_x2){return _ref2.apply(this,arguments)}}();function _f(e){return typeof e=="string"}c();l();u();function Vf(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Lf(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function kn(e,t){if(t&&e.name==="AbortError")return{error:Lf(e)};if(e instanceof _t)return{error:Vf(e)};throw e}var On=class{constructor(t){this.options=t;ae(this,"apiCallsQueues",{unknown:new dt,mainSearch:new dt,facetValues:new dt,foldingCollection:new dt,instantResults:new dt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"POST","application/json","/plan"),requestParams:ct(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return kn(r);let n=yield r.json();return Uf(n)?{success:n}:{error:ut({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ct(t),..._this3.options});if(r instanceof Error)return kn(r);let n=yield r.json(),o={response:r,body:n};return jf(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:ut(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>_e.call({...Ze(t,"POST","application/json",""),requestParams:ct(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return kn(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return rc(i)?(a.body=nc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:ut(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"POST","application/json","/facet"),requestParams:ct(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 _e.call({...Ze(t,"POST","application/json",""),requestParams:ct(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(rc(n)){let o={response:r,body:n};return o.body=nc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:ut({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return tc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield _e.call({...Ze(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Bf(n)?{success:n}:{error:ut({response:r,body:n})}})()}},Dn=e=>e.success!==void 0,Re=e=>e.error!==void 0;function rc(e){return e.results!==void 0}function nc(e){let t=Pn();return K(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function jf(e){return e.completions!==void 0}function Uf(e){return e.preprocessingOutput!==void 0}function Bf(e){return e.fields!==void 0}c();l();u();c();l();u();c();l();u();function he(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 Qf=typeof Symbol=="function"&&Symbol.observable||"@@observable",oc=Qf,Vi=()=>Math.random().toString(36).substring(7).split("").join("."),$f={INIT:`@@redux/INIT${Vi()}`,REPLACE:`@@redux/REPLACE${Vi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Vi()}`},Mn=$f;function $e(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 Li(e,t,r){if(typeof e!="function")throw new Error(he(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(he(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(he(1));return r(Li)(e,t)}let n=e,o=t,i=new Map,a=i,p=0,f=!1;function d(){a===i&&(a=new Map,i.forEach((R,x)=>{a.set(x,R)}))}function g(){if(f)throw new Error(he(3));return o}function y(R){if(typeof R!="function")throw new Error(he(4));if(f)throw new Error(he(5));let x=!0;d();let v=p++;return a.set(v,R),function(){if(x){if(f)throw new Error(he(6));x=!1,d(),a.delete(v),i=null}}}function h(R){if(!$e(R))throw new Error(he(7));if(typeof R.type>"u")throw new Error(he(8));if(typeof R.type!="string")throw new Error(he(17));if(f)throw new Error(he(9));try{f=!0,o=n(o,R)}finally{f=!1}return(i=a).forEach(v=>{v()}),R}function m(R){if(typeof R!="function")throw new Error(he(10));n=R,h({type:Mn.REPLACE})}function S(){let R=y;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(he(11));function v(){let I=x;I.next&&I.next(g())}return v(),{unsubscribe:R(v)}},[oc](){return this}}}return h({type:Mn.INIT}),{dispatch:h,subscribe:y,getState:g,replaceReducer:m,[oc]:S}}function Hf(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Mn.INIT})>"u")throw new Error(he(12));if(typeof r(void 0,{type:Mn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(he(13))})}function Zt(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let p=t[a];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{Hf(r)}catch(a){i=a}return function(p={},f){if(i)throw i;let d=!1,g={};for(let y=0;y<n.length;y++){let h=n[y],m=r[h],S=p[h],C=m(S,f);if(typeof C>"u"){let R=f&&f.type;throw new Error(he(14))}g[h]=C,d=d||C!==S}return d=d||n.length!==Object.keys(p).length,d?g:p}}function er(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ic(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(he(15))},a={getState:o.getState,dispatch:(f,...d)=>i(f,...d)},p=e.map(f=>f(a));return i=er(...p)(o.dispatch),{...o,dispatch:i}}}function qn(e){return $e(e)&&"type"in e&&typeof e.type=="string"}c();l();u();var Ki=Symbol.for("immer-nothing"),Br=Symbol.for("immer-draftable"),Ee=Symbol.for("immer-state");function ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lt=Object.getPrototypeOf;function Te(e){return!!e&&!!e[Ee]}function Ie(e){return e?lc(e)||Array.isArray(e)||!!e[Br]||!!e.constructor?.[Br]||Wr(e)||Gr(e):!1}var zf=Object.prototype.constructor.toString();function lc(e){if(!e||typeof e!="object")return!1;let t=Lt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===zf}function Yi(e){return Te(e)||ye(15,e),e[Ee].base_}function Qr(e,t){jt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function jt(e){let t=e[Ee];return t?t.type_:Array.isArray(e)?1:Wr(e)?2:Gr(e)?3:0}function $r(e,t){return jt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ji(e,t){return jt(e)===2?e.get(t):e[t]}function dc(e,t,r){let n=jt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Wf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Wr(e){return e instanceof Map}function Gr(e){return e instanceof Set}function Vt(e){return e.copy_||e.base_}function Qi(e,t){if(Wr(e))return new Map(e);if(Gr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=lc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ee];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],p=n[a];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[a]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[a]})}return Object.create(Lt(e),n)}else{let n=Lt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Vn(e,t=!1){return Ln(e)||Te(e)||!Ie(e)||(jt(e)>1&&(e.set=e.add=e.clear=e.delete=Gf),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Vn(n,!0))),e}function Gf(){ye(2)}function Ln(e){return Object.isFrozen(e)}var $i={};function Ut(e){let t=$i[e];return t||ye(0,e),t}function Kf(e,t){$i[e]||($i[e]=t)}var Hr;function pc(){return Hr}function Yf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ac(e,t){t&&(Ut("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Hi(e){zi(e),e.drafts_.forEach(Jf),e.drafts_=null}function zi(e){e===Hr&&(Hr=e.parent_)}function sc(e){return Hr=Yf(Hr,e)}function Jf(e){let t=e[Ee];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function cc(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ee].modified_&&(Hi(t),ye(4)),Ie(e)&&(e=Nn(t,e),t.parent_||_n(t,e)),t.patches_&&Ut("Patches").generateReplacementPatches_(r[Ee].base_,e,t.patches_,t.inversePatches_)):e=Nn(t,r,[]),Hi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ki?e:void 0}function Nn(e,t,r){if(Ln(t))return t;let n=t[Ee];if(!n)return Qr(t,(o,i)=>uc(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return _n(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),Qr(i,(p,f)=>uc(e,n,o,p,f,r,a)),_n(e,o,!1),r&&e.patches_&&Ut("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function uc(e,t,r,n,o,i,a){if(Te(o)){let p=i&&t&&t.type_!==3&&!$r(t.assigned_,n)?i.concat(n):void 0,f=Nn(e,o,p);if(dc(r,n,f),Te(f))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(Ie(o)&&!Ln(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Nn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&_n(e,o)}}function _n(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Vn(t,r)}function Xf(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:pc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=Ji;r&&(o=[n],i=zr);let{revoke:a,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=a,p}var Ji={get(e,t){if(t===Ee)return e;let r=Vt(e);if(!$r(r,t))return Zf(e,r,t);let n=r[t];return e.finalized_||!Ie(n)?n:n===Ui(e.base_,t)?(Bi(e),e.copy_[t]=Gi(n,e)):n},has(e,t){return t in Vt(e)},ownKeys(e){return Reflect.ownKeys(Vt(e))},set(e,t,r){let n=fc(Vt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Ui(Vt(e),t),i=o?.[Ee];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Wf(r,o)&&(r!==void 0||$r(e.base_,t)))return!0;Bi(e),Wi(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 Ui(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Bi(e),Wi(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Vt(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 Lt(e.base_)},setPrototypeOf(){ye(12)}},zr={};Qr(Ji,(e,t)=>{zr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});zr.deleteProperty=function(e,t){return zr.set.call(this,e,t,void 0)};zr.set=function(e,t,r){return Ji.set.call(this,e[0],t,r,e[0])};function Ui(e,t){let r=e[Ee];return(r?Vt(r):e)[t]}function Zf(e,t,r){let n=fc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function fc(e,t){if(!(t in e))return;let r=Lt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Lt(r)}}function Wi(e){e.modified_||(e.modified_=!0,e.parent_&&Wi(e.parent_))}function Bi(e){e.copy_||(e.copy_=Qi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var em=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...d){return a.produce(f,g=>r.call(this,g,...d))}}typeof r!="function"&&ye(6),n!==void 0&&typeof n!="function"&&ye(7);let o;if(Ie(t)){let i=sc(this),a=Gi(t,void 0),p=!0;try{o=r(a),p=!1}finally{p?Hi(i):zi(i)}return ac(i,n),cc(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Ki&&(o=void 0),this.autoFreeze_&&Vn(o,!0),n){let i=[],a=[];Ut("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,...p)=>this.produceWithPatches(a,f=>t(f,...p));let n,o;return[this.produce(t,r,(a,p)=>{n=a,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ie(e)||ye(8),Te(e)&&(e=mc(e));let t=sc(this),r=Gi(e,void 0);return r[Ee].isManual_=!0,zi(t),r}finishDraft(e,t){let r=e&&e[Ee];(!r||!r.isManual_)&&ye(9);let{scope_:n}=r;return ac(n,t),cc(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Ut("Patches").applyPatches_;return Te(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Gi(e,t){let r=Wr(e)?Ut("MapSet").proxyMap_(e,t):Gr(e)?Ut("MapSet").proxySet_(e,t):Xf(e,t);return(t?t.scope_:pc()).drafts_.push(r),r}function mc(e){return Te(e)||ye(10,e),gc(e)}function gc(e){if(!Ie(e)||Ln(e))return e;let t=e[Ee],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Qi(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Qi(e,!0);return Qr(r,(n,o)=>{dc(r,n,gc(o))}),t&&(t.finalized_=!1),r}function hc(){let t="replace",r="add",n="remove";function o(h,m,S,C){switch(h.type_){case 0:case 2:return a(h,m,S,C);case 1:return i(h,m,S,C);case 3:return p(h,m,S,C)}}function i(h,m,S,C){let{base_:R,assigned_:x}=h,v=h.copy_;v.length<R.length&&([R,v]=[v,R],[S,C]=[C,S]);for(let w=0;w<R.length;w++)if(x[w]&&v[w]!==R[w]){let I=m.concat([w]);S.push({op:t,path:I,value:y(v[w])}),C.push({op:t,path:I,value:y(R[w])})}for(let w=R.length;w<v.length;w++){let I=m.concat([w]);S.push({op:r,path:I,value:y(v[w])})}for(let w=v.length-1;R.length<=w;--w){let I=m.concat([w]);C.push({op:n,path:I})}}function a(h,m,S,C){let{base_:R,copy_:x}=h;Qr(h.assigned_,(v,w)=>{let I=ji(R,v),q=ji(x,v),F=w?$r(R,v)?t:r:n;if(I===q&&F===t)return;let E=m.concat(v);S.push(F===n?{op:F,path:E}:{op:F,path:E,value:q}),C.push(F===r?{op:n,path:E}:F===n?{op:r,path:E,value:y(I)}:{op:t,path:E,value:y(I)})})}function p(h,m,S,C){let{base_:R,copy_:x}=h,v=0;R.forEach(w=>{if(!x.has(w)){let I=m.concat([v]);S.push({op:n,path:I,value:w}),C.unshift({op:r,path:I,value:w})}v++}),v=0,x.forEach(w=>{if(!R.has(w)){let I=m.concat([v]);S.push({op:r,path:I,value:w}),C.unshift({op:n,path:I,value:w})}v++})}function f(h,m,S,C){S.push({op:t,path:[],value:m===Ki?void 0:m}),C.push({op:t,path:[],value:h})}function d(h,m){return m.forEach(S=>{let{path:C,op:R}=S,x=h;for(let q=0;q<C.length-1;q++){let F=jt(x),E=C[q];typeof E!="string"&&typeof E!="number"&&(E=""+E),(F===0||F===1)&&(E==="__proto__"||E==="constructor")&&ye(19),typeof x=="function"&&E==="prototype"&&ye(19),x=ji(x,E),typeof x!="object"&&ye(18,C.join("/"))}let v=jt(x),w=g(S.value),I=C[C.length-1];switch(R){case t:switch(v){case 2:return x.set(I,w);case 3:ye(16);default:return x[I]=w}case r:switch(v){case 1:return I==="-"?x.push(w):x.splice(I,0,w);case 2:return x.set(I,w);case 3:return x.add(w);default:return x[I]=w}case n:switch(v){case 1:return x.splice(I,1);case 2:return x.delete(I);case 3:return x.delete(S.value);default:return delete x[I]}default:ye(17,R)}}),h}function g(h){if(!Ie(h))return h;if(Array.isArray(h))return h.map(g);if(Wr(h))return new Map(Array.from(h.entries()).map(([S,C])=>[S,g(C)]));if(Gr(h))return new Set(Array.from(h).map(g));let m=Object.create(Lt(h));for(let S in h)m[S]=g(h[S]);return $r(h,Br)&&(m[Br]=h[Br]),m}function y(h){return Te(h)?g(h):h}Kf("Patches",{applyPatches_:d,generatePatches_:o,generateReplacementPatches_:f})}var ke=new em,et=ke.produce,jn=ke.produceWithPatches.bind(ke),aw=ke.setAutoFreeze.bind(ke),sw=ke.setUseStrictShallowCopy.bind(ke),Xi=ke.applyPatches.bind(ke),cw=ke.createDraft.bind(ke),uw=ke.finishDraft.bind(ke);c();l();u();function tm(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rm(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function nm(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 yc=e=>Array.isArray(e)?e:[e];function om(e){let t=Array.isArray(e[0])?e[0]:e;return nm(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function im(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var gw=Symbol();var hw=Object.getPrototypeOf({});var am=class{constructor(e){this.value=e}deref(){return this.value}},sm=typeof WeakRef<"u"?WeakRef:am,cm=0,Sc=1;function Un(){return{s:cm,v:void 0,o:null,p:null}}function tr(e,t={}){let r=Un(),{resultEqualityCheck:n}=t,o,i=0;function a(){let p=r,{length:f}=arguments;for(let y=0,h=f;y<h;y++){let m=arguments[y];if(typeof m=="function"||typeof m=="object"&&m!==null){let S=p.o;S===null&&(p.o=S=new WeakMap);let C=S.get(m);C===void 0?(p=Un(),S.set(m,p)):p=C}else{let S=p.p;S===null&&(p.p=S=new Map);let C=S.get(m);C===void 0?(p=Un(),S.set(m,p)):p=C}}let d=p,g;if(p.s===Sc)g=p.v;else if(g=e.apply(null,arguments),i++,n){let y=o?.deref?.()??o;y!=null&&n(y,g)&&(g=y,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new sm(g):g}return d.s=Sc,d.v=g,g}return a.clearCache=()=>{r=Un(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function vc(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,p,f={},d=o.pop();typeof d=="object"&&(f=d,d=o.pop()),tm(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);let g={...r,...f},{memoize:y,memoizeOptions:h=[],argsMemoize:m=tr,argsMemoizeOptions:S=[],devModeChecks:C={}}=g,R=yc(h),x=yc(S),v=om(o),w=y(function(){return i++,d.apply(null,arguments)},...R),I=!0,q=m(function(){a++;let E=im(v,arguments);return p=w.apply(null,E),p},...x);return Object.assign(q,{resultFunc:d,memoizedResultFunc:w,dependencies:v,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:y,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var le=vc(tr),um=Object.assign((e,t=le)=>{rm(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,p,f)=>(a[r[f]]=p,a),{}))},{withTypes:()=>um});c();l();u();function Cc(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var bc=Cc(),Ac=Cc;var lm=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?er:er.apply(null,arguments)},Ow=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},dm=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ve(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=>qn(n)&&n.type===e,r}var Ic=class Kr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Kr.prototype)}static get[Symbol.species](){return Kr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Kr(...t[0].concat(this)):new Kr(...t.concat(this))}};function wc(e){return Ie(e)?et(e,()=>{}):e}function xc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function pm(e){return typeof e=="boolean"}var fm=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Ic;return r&&(pm(r)?a.push(bc):a.push(Ac(r.extraArgument))),a},pt="RTK_autoBatch",nr=()=>e=>({payload:e,meta:{[pt]:!0}}),Rc=e=>t=>{setTimeout(t,e)},mm=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Rc(10):e.type==="callback"?e.queueNotification:Rc(e.timeout),d=()=>{a=!1,i&&(i=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let y=()=>o&&g(),h=n.subscribe(y);return p.add(g),()=>{h(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[pt],i=!o,i&&(a||(a=!0,f(d))),n.dispatch(g)}finally{o=!0}}})},gm=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Ic(e);return n&&o.push(mm(typeof n=="object"?n:void 0)),o};function Pc(e){let t=fm(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},p;if(typeof r=="function")p=r;else if($e(r))p=Zt(r);else throw new Error(Ve(1));let f;typeof n=="function"?f=n(t):f=t();let d=er;o&&(d=lm({trace:!1,...(typeof o=="object"&&o)}));let g=ic(...f),y=gm(g),h=typeof a=="function"?a(y):y(),m=d(...h);return Li(p,i,m)}function Fc(e){let t={},r=[],n,o={addCase(i,a){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Ve(28));if(p in t)throw new Error(Ve(29));return t[p]=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 hm(e){return typeof e=="function"}function ue(e,t){let[r,n,o]=Fc(t),i;if(hm(e))i=()=>wc(e());else{let p=wc(e);i=()=>p}function a(p=i(),f){let d=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return d.filter(g=>!!g).length===0&&(d=[o]),d.reduce((g,y)=>{if(y)if(Te(g)){let m=y(g,f);return m===void 0?g:m}else{if(Ie(g))return et(g,h=>y(h,f));{let h=y(g,f);if(h===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return g},p)}return a.getInitialState=i,a}var Tc=(e,t)=>dm(e)?e.match(t):e(t);function He(...e){return t=>e.some(r=>Tc(r,t))}function rr(...e){return t=>e.every(r=>Tc(r,t))}function Qn(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 Yr(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function $n(...e){return e.length===0?t=>Qn(t,["pending"]):Yr(e)?He(...e.map(t=>t.pending)):$n()(e[0])}function Bt(...e){return e.length===0?t=>Qn(t,["rejected"]):Yr(e)?He(...e.map(t=>t.rejected)):Bt()(e[0])}function Jr(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?rr(Bt(...e),t):Yr(e)?rr(Bt(...e),t):Jr()(e[0])}function tt(...e){return e.length===0?t=>Qn(t,["fulfilled"]):Yr(e)?He(...e.map(t=>t.fulfilled)):tt()(e[0])}function Hn(...e){return e.length===0?t=>Qn(t,["pending","fulfilled","rejected"]):Yr(e)?He(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Hn()(e[0])}var ym="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",zn=(e=21)=>{let t="",r=e;for(;r--;)t+=ym[Math.random()*64|0];return t},Sm=["name","message","stack","code"],Zi=class{constructor(e,t){ae(this,"_type");this.payload=e,this.meta=t}},Ec=class{constructor(e,t){ae(this,"_type");this.payload=e,this.meta=t}},vm=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Sm)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},re=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,d,g,y)=>({payload:f,meta:{...(y||{}),arg:g,requestId:d,requestStatus:"fulfilled"}})),i=P(t+"/pending",(f,d,g)=>({payload:void 0,meta:{...(g||{}),arg:d,requestId:f,requestStatus:"pending"}})),a=P(t+"/rejected",(f,d,g,y,h)=>({payload:y,error:(n&&n.serializeError||vm)(f||"Rejected"),meta:{...(h||{}),arg:g,requestId:d,rejectedWithValue:!!y,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(d,g,y)=>{let h=n?.idGenerator?n.idGenerator(f):zn(),m=new s.AbortController,S,C;function R(v){C=v,m.abort()}let x=_asyncToGenerator(function*(){let v;try{let I=n?.condition?.(f,{getState:g,extra:y});if(bm(I)&&(I=yield I),I===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((F,E)=>{S=()=>{E({name:"AbortError",message:C||"Aborted"})},m.signal.addEventListener("abort",S)});d(i(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:g,extra:y}))),v=yield Promise.race([q,Promise.resolve(r(f,{dispatch:d,getState:g,extra:y,requestId:h,signal:m.signal,abort:R,rejectWithValue:(F,E)=>new Zi(F,E),fulfillWithValue:(F,E)=>new Ec(F,E)})).then(F=>{if(F instanceof Zi)throw F;return F instanceof Ec?o(F.payload,h,f,F.meta):o(F,h,f)})])}catch(I){v=I instanceof Zi?a(null,h,f,I.payload,I.meta):a(I,h,f)}finally{S&&m.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(v)&&v.meta.condition||d(v),v})();return Object.assign(x,{abort:R,requestId:h,arg:f,unwrap(){return x.then(Cm)}})}}return Object.assign(p,{pending:i,rejected:a,fulfilled:o,settled:He(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Cm(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function bm(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var kc=Symbol.for("rtk-slice-createasyncthunk"),_w={[kc]:re};function Am(e,t){return`${e}/${t}`}function wm({creators:e}={}){let t=e?.asyncThunk?.[kc];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ve(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Rm()):n.reducers)||{},p=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(v,w){let I=typeof v=="string"?v:v.type;if(!I)throw new Error(Ve(12));if(I in f.sliceCaseReducersByType)throw new Error(Ve(13));return f.sliceCaseReducersByType[I]=w,d},addMatcher(v,w){return f.sliceMatchers.push({matcher:v,reducer:w}),d},exposeAction(v,w){return f.actionCreators[v]=w,d},exposeCaseReducer(v,w){return f.sliceCaseReducersByName[v]=w,d}};p.forEach(v=>{let w=a[v],I={reducerName:v,type:Am(o,v),createNotation:typeof n.reducers=="function"};Im(w)?Fm(I,w,d,t):Em(I,w,d)});function g(){let[v={},w=[],I=void 0]=typeof n.extraReducers=="function"?Fc(n.extraReducers):[n.extraReducers],q={...v,...f.sliceCaseReducersByType};return ue(n.initialState,F=>{for(let E in q)F.addCase(E,q[E]);for(let E of f.sliceMatchers)F.addMatcher(E.matcher,E.reducer);for(let E of w)F.addMatcher(E.matcher,E.reducer);I&&F.addDefaultCase(I)})}let y=v=>v,h=new Map,m;function S(v,w){return m||(m=g()),m(v,w)}function C(){return m||(m=g()),m.getInitialState()}function R(v,w=!1){function I(F){let E=F[v];return typeof E>"u"&&w&&(E=C()),E}function q(F=y){let E=xc(h,w,()=>new WeakMap);return xc(E,F,()=>{let D={};for(let[k,L]of Object.entries(n.selectors??{}))D[k]=xm(L,F,C,w);return D})}return{reducerPath:v,getSelectors:q,get selectors(){return q(I)},selectSlice:I}}let x={name:o,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(v,{reducerPath:w,...I}={}){let q=w??i;return v.inject({reducerPath:q,reducer:S},I),{...x,...R(q,!0)}}};return x}}function xm(e,t,r,n){function o(i,...a){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...a)}return o.unwrapped=e,o}var Qt=wm();function Rm(){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 Em({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Pm(n))throw new Error(Ve(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 Im(e){return e._reducerDefinitionType==="asyncThunk"}function Pm(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Fm({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ve(18));let{payloadCreator:i,fulfilled:a,pending:p,rejected:f,settled:d,options:g}=r,y=o(e,i,g);n.exposeAction(t,y),a&&n.addCase(y.fulfilled,a),p&&n.addCase(y.pending,p),f&&n.addCase(y.rejected,f),d&&n.addMatcher(y.settled,d),n.exposeCaseReducer(t,{fulfilled:a||Bn,pending:p||Bn,rejected:f||Bn,settled:d||Bn})}function Bn(){}var Oc="listener",Dc="completed",Mc="cancelled",Vw=`task-${Mc}`,Lw=`task-${Dc}`,jw=`${Oc}-${Mc}`,Uw=`${Oc}-${Dc}`;var{assign:qc}=Object;var ea="listenerMiddleware";var Tm=qc(P(`${ea}/add`),{withTypes:()=>Tm}),Bw=P(`${ea}/removeAll`),km=qc(P(`${ea}/remove`),{withTypes:()=>km});var Qw=Symbol.for("rtk-state-proxy-original");function Ve(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. `}c();l();u();var z=new j({required:!0,emptyAllowed:!1}),pe=new j({required:!1,emptyAllowed:!1}),Se=new j({required:!0,emptyAllowed:!0}),tx=new j({required:!1,emptyAllowed:!0}),Wn=new X({each:z,required:!0}),Nc=new j({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),rt=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),qe=(e,t)=>{if("required"in t)return{payload:new xe({value:t}).validate({value:e}).value};let o=new H({options:{required:!0},values:t}).validate(e);if(o)throw new _r(o);return{payload:e}},V=(e,t)=>{try{return qe(e,t)}catch(r){return{payload:e,error:rt(r)}}},_c=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Lc(e,t,r,o,"Controller initialization error")},Vc=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Lc(e,t,r,o,"Controller initialization error")},Lc=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};c();l();u();var or="3.13.2",jc=["@coveo/atomic","@coveo/quantic"];var ta=()=>pe,Uc=()=>z,ft=P("configuration/updateBasicConfiguration",e=>V(e,{accessToken:pe,environment:new j({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:pe})),ze=P("configuration/updateSearchConfiguration",e=>V(e,{proxyBaseUrl:new j({required:!1,url:!0}),pipeline:new j({required:!1,emptyAllowed:!0}),searchHub:pe,timezone:pe,locale:pe,authenticationProviders:new X({required:!1,each:z})})),Om={enabled:new J({default:!0}),originContext:ta(),originLevel2:ta(),originLevel3:ta(),proxyBaseUrl:new j({required:!1,url:!0}),runtimeEnvironment:new se,anonymous:new J({default:!1}),deviceId:pe,userDisplayName:pe,documentLocation:pe,trackingId:pe,analyticsMode:new j({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new H({options:{required:!1},values:jc.reduce((e,t)=>(e[t]=Nc,e),{})})},ir=P("configuration/updateAnalyticsConfiguration",e=>V(e,Om)),ar=P("configuration/analytics/disable"),sr=P("configuration/analytics/enable"),Gn=P("configuration/analytics/originlevel2",e=>V(e,{originLevel2:Uc()})),Kn=P("configuration/analytics/originlevel3",e=>V(e,{originLevel3:Uc()}));c();l();u();c();l();u();c();l();u();var Bc={q:new j,enableQuerySyntax:new J,aq:new j,cq:new j,firstResult:new G({min:0}),numberOfResults:new G({min:0}),sortCriteria:new j,f:new H,fExcluded:new H,cf:new H,nf:new H,mnf:new H,df:new H,debug:new J,sf:new H,tab:new j,af:new H};var mt=P("searchParameters/restore",e=>V(e,Bc));c();l();u();var Yn=P("debug/enable"),Jn=P("debug/disable");c();l();u();var Xn=()=>!1;var Zn=ue(Xn(),e=>{e.addCase(Yn,()=>!0).addCase(Jn,()=>!1).addCase(mt,(t,r)=>r.payload.debug??t)});c();l();u();var cr=P("pipeline/set",e=>V(e,new j({required:!0,emptyAllowed:!0})));c();l();u();c();l();u();var Dm=P("history/undo"),Mm=P("history/redo"),We=P("history/snapshot"),oR=re("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Dm()),yield t(Pe())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),iR=re("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Mm()),yield t(Pe())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),Pe=re("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());c();l();u();var ur=()=>"";var lr=ue(ur(),e=>{e.addCase(cr,(t,r)=>r.payload).addCase(Pe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(ze,(t,r)=>r.payload.pipeline||t)});c();l();u();c();l();u();c();l();u();c();l();u();function nt(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 T(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 p(g){try{d(n.next(g))}catch(y){a(y)}}function f(g){try{d(n.throw(g))}catch(y){a(y)}}function d(g){g.done?i(g.value):o(g.value).then(p,f)}d((n=n.apply(e,t||[])).next())})}var Z;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Z||(Z={}));function oa(){return typeof window<"u"}function ya(){return typeof navigator<"u"}function dr(){return typeof document<"u"}function ia(){try{return typeof localStorage<"u"}catch{return!1}}function qm(){try{return typeof sessionStorage<"u"}catch{return!1}}function ru(){return ya()&&navigator.cookieEnabled}var Nm=[Z.click,Z.custom,Z.search,Z.view],_m=(e,t)=>Nm.indexOf(e)!==-1?Object.assign({language:dr()?document.documentElement.lang:"unknown",userAgent:ya()?navigator.userAgent:"unknown"},t):t,en=class e{static set(t,r,n){var o,i,a,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Qc(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],Qc(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 Qc(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Vm(){return ia()?localStorage:ru()?new tn:qm()?sessionStorage:new fr}var tn=class e{getItem(t){return en.get(`${e.prefix}${t}`)}removeItem(t){en.erase(`${e.prefix}${t}`)}setItem(t,r,n){en.set(`${e.prefix}${t}`,r,n)}};tn.prefix="coveo_";var aa=class{constructor(){this.cookieStorage=new tn}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)}},fr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Xr="__coveo.analytics.history",nu=20,ou=1e3*60,iu=75,mr=class{constructor(t){this.store=t||Vm()}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 T(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 T(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Xr);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return T(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Xr);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Xr,JSON.stringify(t.slice(0,nu)))}catch{}}clear(){try{this.store.removeItem(Xr)}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,iu)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>ou:!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))}},au=Object.freeze({__proto__:null,HistoryStore:mr,MAX_NUMBER_OF_HISTORY_ELEMENTS:nu,MAX_VALUE_SIZE:iu,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:ou,STORE_KEY:Xr,default:mr}),Lm=(e,t)=>T(void 0,void 0,void 0,function*(){return e===Z.view?(yield jm(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),jm=e=>T(void 0,void 0,void 0,function*(){let t=new mr,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),eo,Um=new Uint8Array(16);function Bm(){if(!eo&&(eo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!eo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eo(Um)}var Qm=/^(?:[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 ro(e){return typeof e=="string"&&Qm.test(e)}var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function su(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}function $m(e){if(!ro(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 Hm(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var zm="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Wm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Gm(e,t,r){function n(o,i,a,p){var f;if(typeof o=="string"&&(o=Hm(o)),typeof i=="string"&&(i=$m(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let d=new Uint8Array(16+o.length);if(d.set(i),d.set(o,i.length),d=r(d),d[6]=d[6]&15|t,d[8]=d[8]&63|128,a){p=p||0;for(let g=0;g<16;++g)a[p+g]=d[g];return a}return su(d)}try{n.name=e}catch{}return n.DNS=zm,n.URL=Wm,n}var Km=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$c={randomUUID:Km};function $t(e,t,r){if($c.randomUUID&&!t&&!e)return $c.randomUUID();e=e||{};let n=e.random||(e.rng||Bm)();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 su(n)}function Ym(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 ra(e,t){return e<<t|e>>>32-t}function Jm(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 p=0;p<a.length;++p)e.push(a.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=p}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 p=new Uint32Array(80);for(let m=0;m<16;++m)p[m]=i[a][m];for(let m=16;m<80;++m)p[m]=ra(p[m-3]^p[m-8]^p[m-14]^p[m-16],1);let f=r[0],d=r[1],g=r[2],y=r[3],h=r[4];for(let m=0;m<80;++m){let S=Math.floor(m/20),C=ra(f,5)+Ym(S,d,g,y)+h+t[S]+p[m]>>>0;h=y,y=g,g=ra(d,30)>>>0,d=f,f=C}r[0]=r[0]+f>>>0,r[1]=r[1]+d>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+h>>>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 Xm=Gm("v5",80,Jm),Hc=Xm,cu="2.30.42",zc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Zr={pageview:"pageview",event:"event"},no=class{constructor({client:t,uuidGenerator:r=$t}){this.client=t,this.uuidGenerator=r}},sa=class extends no{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=zc(window.location),this.lastReferrer=dr()?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:dr()?document.title:"",encoding:dr()?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===Zr.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Zr.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Zr.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Zr.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 zc(window.location)}},gt=class e{constructor(t,r){if(!ro(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 ro(i)?new e(i,Number.parseInt(o)*1e3):null}};gt.cvo_cid="cvo_cid";gt.expirationTime=120;var ca=class extends no{constructor({client:t,uuidGenerator:r=$t}){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 T(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(gt.cvo_cid,new gt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ca.Id="link";var Ne=Object.keys;function to(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var na=128,uu=192,Wc=224,Gc=240;function Zm(e){return(e&248)===Gc?4:(e&Gc)===Wc?3:(e&Wc)===uu?2:1}function eg(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&na)!=na)break;if(r-=3,(n&uu)!=na){t-r>=Zm(n)*3&&(r=t);break}}return e.substring(0,r)}var ua={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"},tg=Ne(ua).map(e=>ua[e]),rg=[...tg].join("|"),ng=new RegExp(`^(${rg}$)`),og={svcAction:"svc_action",svcActionData:"svc_action_data"},ig=e=>Ne(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=ua[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),ag=e=>ng.test(e),sg=[ag],Kc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Yc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},be={action:"pa",list:"pal",listSource:"pls"},oo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},cg=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],la={id:"quoteId",affiliation:"quoteAffiliation"},da={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ug={add:be,bookmark_add:be,bookmark_remove:be,click:be,checkout:be,checkout_option:be,detail:be,impression:be,remove:be,refund:Object.assign(Object.assign({},be),oo),purchase:Object.assign(Object.assign({},be),oo),quickview:be,quote:Object.assign(Object.assign({},be),la),review:Object.assign(Object.assign({},be),da)},lg=Ne(Kc).map(e=>Kc[e]),dg=Ne(Yc).map(e=>Yc[e]),pg=Ne(be).map(e=>be[e]),fg=Ne(oo).map(e=>oo[e]),mg=Ne(da).map(e=>da[e]),gg=Ne(la).map(e=>la[e]),hg=[...lg,"custom"].join("|"),yg=[...dg,"custom"].join("|"),lu="(pr[0-9]+)",du="(il[0-9]+pi[0-9]+)",Sg=new RegExp(`^${lu}(${hg})$`),vg=new RegExp(`^(${du}(${yg}))|(il[0-9]+nm)$`),Cg=new RegExp(`^(${pg.join("|")})$`),bg=new RegExp(`^(${fg.join("|")})$`),Ag=new RegExp(`^${lu}custom$`),wg=new RegExp(`^${du}custom$`),xg=new RegExp(`^(${[...cg,...mg,...gg].join("|")})$`),Rg=e=>Sg.test(e),Eg=e=>vg.test(e),Ig=e=>Cg.test(e),Pg=e=>bg.test(e),Fg=e=>xg.test(e),Tg=[Eg,Rg,Ig,Pg,Fg],kg=[Ag,wg],Og={anonymizeIp:"aip"},Dg={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Mg={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},qg=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Ng=Object.assign(Object.assign(Object.assign(Object.assign({},Og),Dg),Mg),qg.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),pa=Object.assign(Object.assign({},Ng),og),_g=e=>{let t=!!e.action&&ug[e.action]||{};return Ne(e).reduce((r,n)=>{let o=t[n]||pa[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Vg=Ne(pa).map(e=>pa[e]),Lg=e=>Vg.indexOf(e)!==-1,jg=e=>e==="custom",Ug=e=>[...Tg,...sg,Lg,jg].some(t=>t(e)),Bg=e=>Ne(e).reduce((t,r)=>{let n=Qg(r);return n?Object.assign(Object.assign({},t),$g(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Qg=e=>{let t;return[...kg].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},$g=(e,t)=>Ne(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),fa=class{constructor(t){this.opts=t}sendEvent(t,r){return T(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:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,p),d=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,d)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return T(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:p,body:f}=a;o=p||t;try{i=JSON.parse(f)}catch(d){console.error("Unable to process the request body as a JSON string",d)}}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 T(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[Z.click,Z.custom,Z.search,Z.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}},ma=class{sendEvent(t,r){return T(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return T(this,void 0,void 0,function*(){return Promise.resolve()})}},Jc=b.fetch,io=class{constructor(t){this.opts=t}sendEvent(t,r){return T(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),i?yield i(p,"analyticsFetch"):{}),{url:d}=f,g=nt(f,["url"]),y;try{y=yield Jc(d,g)}catch(h){console.error("An error has occured when sending the event.",h);return}if(y.ok){let h=yield y.json();return h.visitorId&&o.setCurrentVisitorId(h.visitorId),h}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return T(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Jc(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Z.click,Z.custom,Z.search,Z.view].indexOf(t)!==-1}getVisitorIdParam(){return T(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"})}},ga=class{constructor(t,r){ia()&&ru()?this.storage=new aa:ia()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new fr),this.client=new io(t),this.beaconClient=new fa(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}},ha=class{constructor(t,r){this.storage=r||new fr,this.client=new io(t)}getClientDependingOnEventType(t){return this.client}},ao=class{constructor(){this.storage=new fr,this.client=new ma}getClientDependingOnEventType(t){return this.client}},Hg="xx",zg=e=>e?.startsWith(Hg)||!1,Wg=`
26
26
  We've detected you're using React Native but have not provided the corresponding runtime,
27
27
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
28
28
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
@@ -43,4 +43,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
43
43
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
44
  * See the License for the specific language governing permissions and
45
45
  * limitations under the License.
46
- */if(__exports!=exports)module.exports=exports;return module.exports});
46
+ */if(__exports!=exports)module.exports=exports;return module.exports});
47
+
48
+ window.coveoQuanticVersion = '3.12.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/quantic",
3
- "version": "3.12.0",
3
+ "version": "3.12.1",
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",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@coveo/bueno": "1.0.7",
54
- "@coveo/headless": "3.13.1",
54
+ "@coveo/headless": "3.13.2",
55
55
  "dompurify": "3.2.3",
56
56
  "marked": "12.0.2",
57
57
  "fs-extra": "11.2.0"