@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.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +4 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-ssr-engine/types/common.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/ssr-engine/types/common.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/errors.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +4 -2
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +4 -2
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +4 -2
- package/package.json +2 -2
|
@@ -23,7 +23,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
23
23
|
|
|
24
24
|
${t}
|
|
25
25
|
`;return new rs(r)}var rs=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ie=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw ev(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}},Ce=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&te(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function je(e){return e===void 0}function tv(e){return e===null}function te(e){return je(e)||tv(e)}var W=class{constructor(e={}){Se(this,"value");this.config=e,this.value=new Ce(e)}validate(e){let t=this.value.validate(e);return t||(rv(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 rv(e){return je(e)||jg(e)}function jg(e){return typeof e=="number"&&!isNaN(e)}var ee=class{constructor(e={}){Se(this,"value");this.value=new Ce(e)}validate(e){let t=this.value.validate(e);return t||(nv(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function nv(e){return je(e)||Tc(e)}function Tc(e){return typeof e=="boolean"}var ov=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,T=class{constructor(e={}){Se(this,"value");Se(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Ce(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,l=this.value.validate(e);if(l)return l;if(je(e))return null;if(!No(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(ov.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 No(e){return Object.prototype.toString.call(e)==="[object String]"}var M=class{constructor(e={}){Se(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(je(e))return this.config.options.required?"value is required and is currently undefined":null;if(!$g(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&te(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=" "+a)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function $g(e){return e!==void 0&&typeof e=="object"}var Y=class{constructor(e={}){Se(this,"value");this.config=e,this.value=new Ce(this.config)}validate(e){if(!te(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(te(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&&te(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 Tc(e)||No(e)||jg(e)||$g(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Mo(e){return Array.isArray(e)}var Nt=class{constructor(e){Se(this,"value");this.config=e,this.value=new Ce(e)}validate(e){let t=this.value.validate(e);return t!==null?t:je(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};s();u();c();var tn=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Oc(e){return Array.isArray(e)}function kc(e){return e.trim()===""}function Gg(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function av(e){return btoa(encodeURI(e))}function qc(e,t){let{[e]:r,...n}=t;return n}function Lo(e){return av(JSON.stringify(e))}var iv=new Set(["1",1,"yes",!0]);function Wg(){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=>iv.has(r))}function Hg(e){let t={};for(let[r,n]of e)t[r]=n;return t}function zg(e,t,r){return clearTimeout(t),setTimeout(e,r)}function ns(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function sv(e){if(kc(e.openingDelimiter)||kc(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(te(e.content)||kc(e.content))return e.content;if(e.highlights.length===0)return Qo(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],l=a.offset,d=l+a.length;if(d>t)break;r+=Qo(e.content.slice(n,l)),r+=e.openingDelimiter,r+=Qo(e.content.slice(l,d)),r+=e.closingDelimiter,n=d}return n!==t&&(r+=Qo(e.content.slice(n))),r}function Up(e,t){return e=Qo(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Bp(n,t.notMatchDelimiters):o?Bp(o,t.exactMatchDelimiters):a?Bp(a,t.correctionDelimiters):r)}function Bp(e,t){return t?t.open+e+t.close:e}function Qo(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}s();u();c();s();u();c();s();u();c();s();u();c();s();u();c();function Yg(_x2,_x3){return _Yg.apply(this,arguments)}function _Yg(){_Yg=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Yg.apply(this,arguments)}function Jg(e){let t,r,n,o=!1;return function(l){t===void 0?(t=l,r=0,n=-1):t=cv(t,l);let d=t.length,p=0;for(;r<d;){o&&(t[r]===10&&(p=++r),o=!1);let m=-1;for(;r<d&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-p);break;case 13:o=!0;case 10:m=r;break}if(m===-1)break;e(t.subarray(p,m),n),p=r,n=-1}p===d?t=void 0:p!==0&&(t=t.subarray(p),r-=p)}}function Xg(e,t,r){let n=Kg(),o=new TextDecoder;return function(l,d){if(l.length===0)r?.(n),n=Kg();else if(d>0){let p=o.decode(l.subarray(0,d)),m=d+(l[d+1]===32?2:1),S=o.decode(l.subarray(m));switch(p){case"data":n.data=n.data?n.data+`
|
|
26
|
-
`+S:S;break;case"event":n.event=S;break;case"id":e(n.id=S);break;case"retry":let C=parseInt(S,10);isNaN(C)||t(n.retry=C);break}}}}function cv(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Kg(){return{data:"",event:"",id:"",retry:void 0}}var uv=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},Dc="text/event-stream",lv=1e3,Zg="last-event-id";function eS(){typeof window<"u"}function os(e,t){var{signal:r,headers:n,onopen:o,onmessage:a,onclose:l,onerror:d,openWhenHidden:p,fetch:m}=t,S=uv(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((C,h)=>{let y=Object.assign({},n);y.accept||(y.accept=Dc);let x;function b(){x?.abort(),document.hidden||N()}!p&&eS()&&document.addEventListener("visibilitychange",b);let F=lv,R=0;function A(){eS()&&document.removeEventListener("visibilitychange",b),clearTimeout(R),x?.abort()}r?.addEventListener("abort",()=>{A(),C()});let P=m??P,I=o??dv;function N(){return _N2.apply(this,arguments)}function _N2(){_N2=_asyncToGenerator(function*(){var O;x=typeof i.AbortController>"u"?null:new i.AbortController;try{let E=yield P(e,Object.assign(Object.assign({},S),{headers:y,signal:x?.signal}));yield I(E),yield Yg(E.body,Jg(Xg(V=>{V?y[Zg]=V:delete y[Zg]},V=>{F=V},a))),l?.(),A(),C()}catch(E){if(!x?.signal.aborted)try{let V=(O=d?.(E))!==null&&O!==void 0?O:F;clearTimeout(R),R=setTimeout(N,V)}catch(V){A(),h(V)}}});return _N2.apply(this,arguments)}N()})}function dv(e){let t=e.headers.get("content-type");if(!t?.startsWith(Dc))throw new Error(`Expected content-type to be ${Dc}, Actual: ${t}`)}s();u();c();var rn=class{constructor(t){Se(this,"_basePath");Se(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var pv=(e,t,r)=>new rn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,tS=3,mv=5e3,fv="text/event-stream",Gp=1,jp=class extends Error{},as=class extends Error{constructor(r){super(r.message);this.payload=r}},$p=class{constructor(){Se(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Vc=class{constructor(t){Se(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:l}=t,{write:d,abort:p,close:m,resetAnswer:S}=r,C=new $p;if(!a){this.logger.error("No stream ID found");return}let h=0,y,x=()=>{y&&!C.isActive(y)&&(F?.abort(),S(),R())},b=()=>{C.remove(y),y=zg(x,y,mv),C.add(y)},F=new i.AbortController,R=()=>os(pv(n,o,a),{method:"GET",fetch:g,headers:{Authorization:`Bearer ${l}`,accept:"*/*"},openWhenHidden:!0,signal:F?.signal,onopen(A){return _asyncToGenerator(function*(){if(A.ok&&A.headers.get("content-type")===fv)return;throw A.status>=400&&A.status<500&&A.status!==429?new as({message:"Error opening stream",code:A.status}):new jp})()},onmessage:A=>{if(F?.signal.aborted)return;let P=JSON.parse(A.data);if(P.finishReason==="ERROR"){C.remove(y),F?.abort(),p({message:P.errorMessage,code:P.statusCode});return}d(P),h=0,P.finishReason==="COMPLETED"?(C.remove(y),m()):b()},onerror:A=>{if(!F?.signal.aborted){if(C.remove(y),A instanceof as)throw F?.abort(),p(A),A;if(++h>tS){this.logger.info("Maximum retry exceeded.");let P={message:"Failed to complete stream.",code:Gp};throw F?.abort(),p(P),new as(P)}this.logger.info(`Retrying...(${h}/${tS})`),S()}}});return R(),F}};s();u();c();var mS=yt(uS(),1);s();u();c();s();u();c();var Bv="recommendation-internal-options",nQ=Symbol.for(Bv);var j=new Error("Failed to load reducers."),Bo=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var ro=class extends Error{constructor(r,n){super();Se(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};s();u();c();function lS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function dS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Uv)}function Uv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function pS(e){return e===429}var Ct=class e{static call(t){return _asyncToGenerator(function*(){let r=_v(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...l}=o,d=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let p=yield g(a,l);if(pS(p.status))throw p;return p});return function d(){return _ref.apply(this,arguments)}}();try{let p=yield(0,mS.backOff)(d,{retry:m=>{let S=m&&pS(m.status);return S&&n.info("Platform retrying request"),S}});switch(p.status){case 419:case 401:throw n.info("Platform renewing token"),new Bo;case 404:throw new ro(a,p.status);default:return n.info({response:p,requestInfo:o},"Platform response"),p}}catch(p){return p.message==="Failed to fetch"?new ro(a):p}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:l}=r,{signal:d,...p}=t,m=ns(p);try{let S=yield o(t,n,l);return{...t,...S}}catch(S){a.error(S,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function $e(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Te(e,t="prod"){return`${$e(e,t)}/rest/search/v2`}function Mc(e,t="prod"){return`${$e(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function _v(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:l}=e,d=e.method==="POST"||e.method==="PUT",p=jv(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(d&&{body:p}),signal:l}}function jv(e,t){return t==="application/x-www-form-urlencoded"?dS(e)?lS(e):"":JSON.stringify(e)}s();u();c();var Lc=e=>e;s();u();c();var fS=e=>e,gS=e=>e,SS=e=>e;s();u();c();s();u();c();function Uo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function lt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Uo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Uo(),extendedResults:{}}}s();u();c();function nn(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var on=e=>{let{response:t}=e;return t.body?$v(e):Gv(t)},$v=e=>Hv(e)?zv(e):Wv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Gv=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Wv(e){return e.body.statusCode!==void 0}function Hv(e){return e.body.exception!==void 0}var zv=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});s();u();c();var an=class{constructor(){Se(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new i.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};s();u();c();s();u();c();function hS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}s();u();c();var Nr=(e,t,r,n)=>{let o=new rn(`${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 yS=(e,t)=>{let r=new rn(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},CS=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Ct.call({...Nr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:nn(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=hS(r),o=yield r.arrayBuffer(),l=new TextDecoder(n).decode(o);return Kv(l)?{success:l}:{error:on({response:r,body:l})}});return function CS(_x4,_x5){return _ref2.apply(this,arguments)}}();function Kv(e){return typeof e=="string"}s();u();c();function Yv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Jv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function cs(e,t){if(t&&e.name==="AbortError")return{error:Jv(e)};if(e instanceof ro)return{error:Yv(e)};throw e}var Qc=class{constructor(t){this.options=t;Se(this,"apiCallsQueues",{unknown:new an,mainSearch:new an,facetValues:new an,foldingCollection:new an,instantResults:new an})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"POST","application/json","/plan"),requestParams:nn(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return cs(r);let n=yield r.json();return Zv(n)?{success:n}:{error:on({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:nn(t),..._this3.options});if(r instanceof Error)return cs(r);let n=yield r.json(),o={response:r,body:n};return Xv(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:on(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(d=>Ct.call({...Nr(t,"POST","application/json",""),requestParams:nn(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:d??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return cs(o,r?.disableAbortWarning);let a=yield o.json(),l={response:o,body:a};return xS(a)?(l.body=AS(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(l)).body}):{error:on(l)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"POST","application/json","/facet"),requestParams:nn(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 Ct.call({...Nr(t,"POST","application/json",""),requestParams:nn(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(xS(n)){let o={response:r,body:n};return o.body=AS(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:on({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return CS(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return eP(n)?{success:n}:{error:on({response:r,body:n})}})()}},Bc=e=>e.success!==void 0,Ne=e=>e.error!==void 0;function xS(e){return e.results!==void 0}function AS(e){let t=Uo();return te(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Xv(e){return e.completions!==void 0}function Zv(e){return e.preprocessingOutput!==void 0}function eP(e){return e.fields!==void 0}s();u();c();s();u();c();var U=new T({required:!0,emptyAllowed:!1}),Re=new T({required:!1,emptyAllowed:!1}),he=new T({required:!0,emptyAllowed:!0}),FS=new T({required:!1,emptyAllowed:!0}),Uc=new Y({each:U,required:!0}),RS=new T({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Mr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),xt=(e,t)=>{if("required"in t)return{payload:new ie({value:t}).validate({value:e}).value};let o=new M({options:{required:!0},values:t}).validate(e);if(o)throw new rs(o);return{payload:e}},w=(e,t)=>{try{return xt(e,t)}catch(r){return{payload:e,error:Mr(r)}}},Oe=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return bS(e,t,r,o,"Controller initialization error")},Ae=(e,t,r,n)=>{let o=`Check the options of ${n}`;return bS(e,t,r,o,"Controller initialization error")},bS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};s();u();c();s();u();c();s();u();c();function Ge(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var tP=typeof Symbol=="function"&&Symbol.observable||"@@observable",vS=tP,em=()=>Math.random().toString(36).substring(7).split("").join("."),rP={INIT:`@@redux/INIT${em()}`,REPLACE:`@@redux/REPLACE${em()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${em()}`},_c=rP;function zt(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 tm(e,t,r){if(typeof e!="function")throw new Error(Ge(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ge(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ge(1));return r(tm)(e,t)}let n=e,o=t,a=new Map,l=a,d=0,p=!1;function m(){l===a&&(l=new Map,a.forEach((F,R)=>{l.set(R,F)}))}function S(){if(p)throw new Error(Ge(3));return o}function C(F){if(typeof F!="function")throw new Error(Ge(4));if(p)throw new Error(Ge(5));let R=!0;m();let A=d++;return l.set(A,F),function(){if(R){if(p)throw new Error(Ge(6));R=!1,m(),l.delete(A),a=null}}}function h(F){if(!zt(F))throw new Error(Ge(7));if(typeof F.type>"u")throw new Error(Ge(8));if(typeof F.type!="string")throw new Error(Ge(17));if(p)throw new Error(Ge(9));try{p=!0,o=n(o,F)}finally{p=!1}return(a=l).forEach(A=>{A()}),F}function y(F){if(typeof F!="function")throw new Error(Ge(10));n=F,h({type:_c.REPLACE})}function x(){let F=C;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ge(11));function A(){let I=R;I.next&&I.next(S())}return A(),{unsubscribe:F(A)}},[vS](){return this}}}return h({type:_c.INIT}),{dispatch:h,subscribe:C,getState:S,replaceReducer:y,[vS]:x}}function nP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:_c.INIT})>"u")throw new Error(Ge(12));if(typeof r(void 0,{type:_c.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ge(13))})}function _o(e){let t=Object.keys(e),r={};for(let l=0;l<t.length;l++){let d=t[l];typeof e[d]=="function"&&(r[d]=e[d])}let n=Object.keys(r),o,a;try{nP(r)}catch(l){a=l}return function(d={},p){if(a)throw a;let m=!1,S={};for(let C=0;C<n.length;C++){let h=n[C],y=r[h],x=d[h],b=y(x,p);if(typeof b>"u"){let F=p&&p.type;throw new Error(Ge(14))}S[h]=b,m=m||b!==x}return m=m||n.length!==Object.keys(d).length,m?S:d}}function jo(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function PS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Ge(15))},l={getState:o.getState,dispatch:(p,...m)=>a(p,...m)},d=e.map(p=>p(l));return a=jo(...d)(o.dispatch),{...o,dispatch:a}}}function jc(e){return zt(e)&&"type"in e&&typeof e.type=="string"}s();u();c();var dm=Symbol.for("immer-nothing"),us=Symbol.for("immer-draftable"),rt=Symbol.for("immer-state");function We(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oo=Object.getPrototypeOf;function dt(e){return!!e&&!!e[rt]}function nt(e){return e?OS(e)||Array.isArray(e)||!!e[us]||!!e.constructor?.[us]||fs(e)||gs(e):!1}var oP=Object.prototype.constructor.toString();function OS(e){if(!e||typeof e!="object")return!1;let t=oo(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)===oP}function pm(e){return dt(e)||We(15,e),e[rt].base_}function ls(e,t){ao(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function ao(e){let t=e[rt];return t?t.type_:Array.isArray(e)?1:fs(e)?2:gs(e)?3:0}function ds(e,t){return ao(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function rm(e,t){return ao(e)===2?e.get(t):e[t]}function kS(e,t,r){let n=ao(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function aP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function fs(e){return e instanceof Map}function gs(e){return e instanceof Set}function no(e){return e.copy_||e.base_}function am(e,t){if(fs(e))return new Map(e);if(gs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=OS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[rt];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let l=o[a],d=n[l];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(n[l]={configurable:!0,writable:!0,enumerable:d.enumerable,value:e[l]})}return Object.create(oo(e),n)}else{let n=oo(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Wc(e,t=!1){return Hc(e)||dt(e)||!nt(e)||(ao(e)>1&&(e.set=e.add=e.clear=e.delete=iP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Wc(n,!0))),e}function iP(){We(2)}function Hc(e){return Object.isFrozen(e)}var im={};function io(e){let t=im[e];return t||We(0,e),t}function sP(e,t){im[e]||(im[e]=t)}var ps;function qS(){return ps}function cP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wS(e,t){t&&(io("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sm(e){cm(e),e.drafts_.forEach(uP),e.drafts_=null}function cm(e){e===ps&&(ps=e.parent_)}function ES(e){return ps=cP(ps,e)}function uP(e){let t=e[rt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function IS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[rt].modified_&&(sm(t),We(4)),nt(e)&&(e=$c(t,e),t.parent_||Gc(t,e)),t.patches_&&io("Patches").generateReplacementPatches_(r[rt].base_,e,t.patches_,t.inversePatches_)):e=$c(t,r,[]),sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==dm?e:void 0}function $c(e,t,r){if(Hc(t))return t;let n=t[rt];if(!n)return ls(t,(o,a)=>TS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Gc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,l=!1;n.type_===3&&(a=new Set(o),o.clear(),l=!0),ls(a,(d,p)=>TS(e,n,o,d,p,r,l)),Gc(e,o,!1),r&&e.patches_&&io("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function TS(e,t,r,n,o,a,l){if(dt(o)){let d=a&&t&&t.type_!==3&&!ds(t.assigned_,n)?a.concat(n):void 0,p=$c(e,o,d);if(kS(r,n,p),dt(p))e.canAutoFreeze_=!1;else return}else l&&r.add(o);if(nt(o)&&!Hc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;$c(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Gc(e,o)}}function Gc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Wc(t,r)}function lP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:qS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=mm;r&&(o=[n],a=ms);let{revoke:l,proxy:d}=Proxy.revocable(o,a);return n.draft_=d,n.revoke_=l,d}var mm={get(e,t){if(t===rt)return e;let r=no(e);if(!ds(r,t))return dP(e,r,t);let n=r[t];return e.finalized_||!nt(n)?n:n===nm(e.base_,t)?(om(e),e.copy_[t]=lm(n,e)):n},has(e,t){return t in no(e)},ownKeys(e){return Reflect.ownKeys(no(e))},set(e,t,r){let n=DS(no(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=nm(no(e),t),a=o?.[rt];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(aP(r,o)&&(r!==void 0||ds(e.base_,t)))return!0;om(e),um(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 nm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,om(e),um(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=no(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){We(11)},getPrototypeOf(e){return oo(e.base_)},setPrototypeOf(){We(12)}},ms={};ls(mm,(e,t)=>{ms[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ms.deleteProperty=function(e,t){return ms.set.call(this,e,t,void 0)};ms.set=function(e,t,r){return mm.set.call(this,e[0],t,r,e[0])};function nm(e,t){let r=e[rt];return(r?no(r):e)[t]}function dP(e,t,r){let n=DS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function DS(e,t){if(!(t in e))return;let r=oo(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=oo(r)}}function um(e){e.modified_||(e.modified_=!0,e.parent_&&um(e.parent_))}function om(e){e.copy_||(e.copy_=am(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let l=this;return function(p=a,...m){return l.produce(p,S=>r.call(this,S,...m))}}typeof r!="function"&&We(6),n!==void 0&&typeof n!="function"&&We(7);let o;if(nt(t)){let a=ES(this),l=lm(t,void 0),d=!0;try{o=r(l),d=!1}finally{d?sm(a):cm(a)}return wS(a,n),IS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===dm&&(o=void 0),this.autoFreeze_&&Wc(o,!0),n){let a=[],l=[];io("Patches").generateReplacementPatches_(t,o,a,l),n(a,l)}return o}else We(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(l,...d)=>this.produceWithPatches(l,p=>t(p,...d));let n,o;return[this.produce(t,r,(l,d)=>{n=l,o=d}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){nt(e)||We(8),dt(e)&&(e=VS(e));let t=ES(this),r=lm(e,void 0);return r[rt].isManual_=!0,cm(t),r}finishDraft(e,t){let r=e&&e[rt];(!r||!r.isManual_)&&We(9);let{scope_:n}=r;return wS(n,t),IS(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=io("Patches").applyPatches_;return dt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function lm(e,t){let r=fs(e)?io("MapSet").proxyMap_(e,t):gs(e)?io("MapSet").proxySet_(e,t):lP(e,t);return(t?t.scope_:qS()).drafts_.push(r),r}function VS(e){return dt(e)||We(10,e),NS(e)}function NS(e){if(!nt(e)||Hc(e))return e;let t=e[rt],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=am(e,t.scope_.immer_.useStrictShallowCopy_)}else r=am(e,!0);return ls(r,(n,o)=>{kS(r,n,NS(o))}),t&&(t.finalized_=!1),r}function MS(){let t="replace",r="add",n="remove";function o(h,y,x,b){switch(h.type_){case 0:case 2:return l(h,y,x,b);case 1:return a(h,y,x,b);case 3:return d(h,y,x,b)}}function a(h,y,x,b){let{base_:F,assigned_:R}=h,A=h.copy_;A.length<F.length&&([F,A]=[A,F],[x,b]=[b,x]);for(let P=0;P<F.length;P++)if(R[P]&&A[P]!==F[P]){let I=y.concat([P]);x.push({op:t,path:I,value:C(A[P])}),b.push({op:t,path:I,value:C(F[P])})}for(let P=F.length;P<A.length;P++){let I=y.concat([P]);x.push({op:r,path:I,value:C(A[P])})}for(let P=A.length-1;F.length<=P;--P){let I=y.concat([P]);b.push({op:n,path:I})}}function l(h,y,x,b){let{base_:F,copy_:R}=h;ls(h.assigned_,(A,P)=>{let I=rm(F,A),N=rm(R,A),O=P?ds(F,A)?t:r:n;if(I===N&&O===t)return;let E=y.concat(A);x.push(O===n?{op:O,path:E}:{op:O,path:E,value:N}),b.push(O===r?{op:n,path:E}:O===n?{op:r,path:E,value:C(I)}:{op:t,path:E,value:C(I)})})}function d(h,y,x,b){let{base_:F,copy_:R}=h,A=0;F.forEach(P=>{if(!R.has(P)){let I=y.concat([A]);x.push({op:n,path:I,value:P}),b.unshift({op:r,path:I,value:P})}A++}),A=0,R.forEach(P=>{if(!F.has(P)){let I=y.concat([A]);x.push({op:r,path:I,value:P}),b.unshift({op:n,path:I,value:P})}A++})}function p(h,y,x,b){x.push({op:t,path:[],value:y===dm?void 0:y}),b.push({op:t,path:[],value:h})}function m(h,y){return y.forEach(x=>{let{path:b,op:F}=x,R=h;for(let N=0;N<b.length-1;N++){let O=ao(R),E=b[N];typeof E!="string"&&typeof E!="number"&&(E=""+E),(O===0||O===1)&&(E==="__proto__"||E==="constructor")&&We(19),typeof R=="function"&&E==="prototype"&&We(19),R=rm(R,E),typeof R!="object"&&We(18,b.join("/"))}let A=ao(R),P=S(x.value),I=b[b.length-1];switch(F){case t:switch(A){case 2:return R.set(I,P);case 3:We(16);default:return R[I]=P}case r:switch(A){case 1:return I==="-"?R.push(P):R.splice(I,0,P);case 2:return R.set(I,P);case 3:return R.add(P);default:return R[I]=P}case n:switch(A){case 1:return R.splice(I,1);case 2:return R.delete(I);case 3:return R.delete(x.value);default:return delete R[I]}default:We(17,F)}}),h}function S(h){if(!nt(h))return h;if(Array.isArray(h))return h.map(S);if(fs(h))return new Map(Array.from(h.entries()).map(([x,b])=>[x,S(b)]));if(gs(h))return new Set(Array.from(h).map(S));let y=Object.create(oo(h));for(let x in h)y[x]=S(h[x]);return ds(h,us)&&(y[us]=h[us]),y}function C(h){return dt(h)?S(h):h}sP("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:p})}var pt=new pP,Lr=pt.produce,zc=pt.produceWithPatches.bind(pt),_0=pt.setAutoFreeze.bind(pt),j0=pt.setUseStrictShallowCopy.bind(pt),fm=pt.applyPatches.bind(pt),$0=pt.createDraft.bind(pt),G0=pt.finishDraft.bind(pt);s();u();c();function mP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function fP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function gP(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 LS=e=>Array.isArray(e)?e:[e];function SP(e){let t=Array.isArray(e[0])?e[0]:e;return gP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function hP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var J0=Symbol();var X0=Object.getPrototypeOf({});var yP=class{constructor(e){this.value=e}deref(){return this.value}},CP=typeof WeakRef<"u"?WeakRef:yP,xP=0,QS=1;function Kc(){return{s:xP,v:void 0,o:null,p:null}}function $o(e,t={}){let r=Kc(),{resultEqualityCheck:n}=t,o,a=0;function l(){let d=r,{length:p}=arguments;for(let C=0,h=p;C<h;C++){let y=arguments[C];if(typeof y=="function"||typeof y=="object"&&y!==null){let x=d.o;x===null&&(d.o=x=new WeakMap);let b=x.get(y);b===void 0?(d=Kc(),x.set(y,d)):d=b}else{let x=d.p;x===null&&(d.p=x=new Map);let b=x.get(y);b===void 0?(d=Kc(),x.set(y,d)):d=b}}let m=d,S;if(d.s===QS)S=d.v;else if(S=e.apply(null,arguments),a++,n){let C=o?.deref?.()??o;C!=null&&n(C,S)&&(S=C,a!==0&&a--),o=typeof S=="object"&&S!==null||typeof S=="function"?new CP(S):S}return m.s=QS,m.v=S,S}return l.clearCache=()=>{r=Kc(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function BS(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,l=0,d,p={},m=o.pop();typeof m=="object"&&(p=m,m=o.pop()),mP(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let S={...r,...p},{memoize:C,memoizeOptions:h=[],argsMemoize:y=$o,argsMemoizeOptions:x=[],devModeChecks:b={}}=S,F=LS(h),R=LS(x),A=SP(o),P=C(function(){return a++,m.apply(null,arguments)},...F),I=!0,N=y(function(){l++;let E=hP(A,arguments);return d=P.apply(null,E),d},...R);return Object.assign(N,{resultFunc:m,memoizedResultFunc:P,dependencies:A,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>d,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:C,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var ue=BS($o),AP=Object.assign((e,t=ue)=>{fP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((l,d,p)=>(l[r[p]]=d,l),{}))},{withTypes:()=>AP});s();u();c();function US(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var _S=US(),jS=US;var FP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jo:jo.apply(null,arguments)},fB=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},RP=e=>e&&typeof e.match=="function";function v(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Mt(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=>jc(n)&&n.type===e,r}var zS=class Ss extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ss.prototype)}static get[Symbol.species](){return Ss}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ss(...t[0].concat(this)):new Ss(...t.concat(this))}};function $S(e){return nt(e)?Lr(e,()=>{}):e}function GS(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function bP(e){return typeof e=="boolean"}var vP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},l=new zS;return r&&(bP(r)?l.push(_S):l.push(jS(r.extraArgument))),l},sn="RTK_autoBatch",Wo=()=>e=>({payload:e,meta:{[sn]:!0}}),WS=e=>t=>{setTimeout(t,e)},PP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,l=!1,d=new Set,p=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:WS(10):e.type==="callback"?e.queueNotification:WS(e.timeout),m=()=>{l=!1,a&&(a=!1,d.forEach(S=>S()))};return Object.assign({},n,{subscribe(S){let C=()=>o&&S(),h=n.subscribe(C);return d.add(S),()=>{h(),d.delete(S)}},dispatch(S){try{return o=!S?.meta?.[sn],a=!o,a&&(l||(l=!0,p(m))),n.dispatch(S)}finally{o=!0}}})},wP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new zS(e);return n&&o.push(PP(typeof n=="object"?n:void 0)),o};function KS(e){let t=vP(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{},d;if(typeof r=="function")d=r;else if(zt(r))d=_o(r);else throw new Error(Mt(1));let p;typeof n=="function"?p=n(t):p=t();let m=jo;o&&(m=FP({trace:!1,...(typeof o=="object"&&o)}));let S=PS(...p),C=wP(S),h=typeof l=="function"?l(C):C(),y=m(...h);return tm(d,a,y)}function YS(e){let t={},r=[],n,o={addCase(a,l){let d=typeof a=="string"?a:a.type;if(!d)throw new Error(Mt(28));if(d in t)throw new Error(Mt(29));return t[d]=l,o},addMatcher(a,l){return r.push({matcher:a,reducer:l}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function EP(e){return typeof e=="function"}function J(e,t){let[r,n,o]=YS(t),a;if(EP(e))a=()=>$S(e());else{let d=$S(e);a=()=>d}function l(d=a(),p){let m=[r[p.type],...n.filter(({matcher:S})=>S(p)).map(({reducer:S})=>S)];return m.filter(S=>!!S).length===0&&(m=[o]),m.reduce((S,C)=>{if(C)if(dt(S)){let y=C(S,p);return y===void 0?S:y}else{if(nt(S))return Lr(S,h=>C(h,p));{let h=C(S,p);if(h===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return S},d)}return l.getInitialState=a,l}var JS=(e,t)=>RP(e)?e.match(t):e(t);function Kt(...e){return t=>e.some(r=>JS(r,t))}function Go(...e){return t=>e.every(r=>JS(r,t))}function Jc(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 hs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Xc(...e){return e.length===0?t=>Jc(t,["pending"]):hs(e)?Kt(...e.map(t=>t.pending)):Xc()(e[0])}function so(...e){return e.length===0?t=>Jc(t,["rejected"]):hs(e)?Kt(...e.map(t=>t.rejected)):so()(e[0])}function ys(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Go(so(...e),t):hs(e)?Go(so(...e),t):ys()(e[0])}function Qr(...e){return e.length===0?t=>Jc(t,["fulfilled"]):hs(e)?Kt(...e.map(t=>t.fulfilled)):Qr()(e[0])}function Zc(...e){return e.length===0?t=>Jc(t,["pending","fulfilled","rejected"]):hs(e)?Kt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Zc()(e[0])}var IP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",eu=(e=21)=>{let t="",r=e;for(;r--;)t+=IP[Math.random()*64|0];return t},TP=["name","message","stack","code"],gm=class{constructor(e,t){Se(this,"_type");this.payload=e,this.meta=t}},HS=class{constructor(e,t){Se(this,"_type");this.payload=e,this.meta=t}},OP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of TP)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ne=(()=>{function e(t,r,n){let o=v(t+"/fulfilled",(p,m,S,C)=>({payload:p,meta:{...(C||{}),arg:S,requestId:m,requestStatus:"fulfilled"}})),a=v(t+"/pending",(p,m,S)=>({payload:void 0,meta:{...(S||{}),arg:m,requestId:p,requestStatus:"pending"}})),l=v(t+"/rejected",(p,m,S,C,h)=>({payload:C,error:(n&&n.serializeError||OP)(p||"Rejected"),meta:{...(h||{}),arg:S,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:p?.name==="AbortError",condition:p?.name==="ConditionError"}}));function d(p){return(m,S,C)=>{let h=n?.idGenerator?n.idGenerator(p):eu(),y=new i.AbortController,x,b;function F(A){b=A,y.abort()}let R=_asyncToGenerator(function*(){let A;try{let I=n?.condition?.(p,{getState:S,extra:C});if(qP(I)&&(I=yield I),I===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((O,E)=>{x=()=>{E({name:"AbortError",message:b||"Aborted"})},y.signal.addEventListener("abort",x)});m(a(h,p,n?.getPendingMeta?.({requestId:h,arg:p},{getState:S,extra:C}))),A=yield Promise.race([N,Promise.resolve(r(p,{dispatch:m,getState:S,extra:C,requestId:h,signal:y.signal,abort:F,rejectWithValue:(O,E)=>new gm(O,E),fulfillWithValue:(O,E)=>new HS(O,E)})).then(O=>{if(O instanceof gm)throw O;return O instanceof HS?o(O.payload,h,p,O.meta):o(O,h,p)})])}catch(I){A=I instanceof gm?l(null,h,p,I.payload,I.meta):l(I,h,p)}finally{x&&y.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&l.match(A)&&A.meta.condition||m(A),A})();return Object.assign(R,{abort:F,requestId:h,arg:p,unwrap(){return R.then(kP)}})}}return Object.assign(d,{pending:a,rejected:l,fulfilled:o,settled:Kt(l,o),typePrefix:t})}return e.withTypes=()=>e,e})();function kP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function qP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var XS=Symbol.for("rtk-slice-createasyncthunk"),CB={[XS]:ne};function DP(e,t){return`${e}/${t}`}function VP({creators:e}={}){let t=e?.asyncThunk?.[XS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Mt(11));typeof process<"u";let l=(typeof n.reducers=="function"?n.reducers(MP()):n.reducers)||{},d=Object.keys(l),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(A,P){let I=typeof A=="string"?A:A.type;if(!I)throw new Error(Mt(12));if(I in p.sliceCaseReducersByType)throw new Error(Mt(13));return p.sliceCaseReducersByType[I]=P,m},addMatcher(A,P){return p.sliceMatchers.push({matcher:A,reducer:P}),m},exposeAction(A,P){return p.actionCreators[A]=P,m},exposeCaseReducer(A,P){return p.sliceCaseReducersByName[A]=P,m}};d.forEach(A=>{let P=l[A],I={reducerName:A,type:DP(o,A),createNotation:typeof n.reducers=="function"};QP(P)?UP(I,P,m,t):LP(I,P,m)});function S(){let[A={},P=[],I=void 0]=typeof n.extraReducers=="function"?YS(n.extraReducers):[n.extraReducers],N={...A,...p.sliceCaseReducersByType};return J(n.initialState,O=>{for(let E in N)O.addCase(E,N[E]);for(let E of p.sliceMatchers)O.addMatcher(E.matcher,E.reducer);for(let E of P)O.addMatcher(E.matcher,E.reducer);I&&O.addDefaultCase(I)})}let C=A=>A,h=new Map,y;function x(A,P){return y||(y=S()),y(A,P)}function b(){return y||(y=S()),y.getInitialState()}function F(A,P=!1){function I(O){let E=O[A];return typeof E>"u"&&P&&(E=b()),E}function N(O=C){let E=GS(h,P,()=>new WeakMap);return GS(E,O,()=>{let V={};for(let[k,$]of Object.entries(n.selectors??{}))V[k]=NP($,O,b,P);return V})}return{reducerPath:A,getSelectors:N,get selectors(){return N(I)},selectSlice:I}}let R={name:o,reducer:x,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:b,...F(a),injectInto(A,{reducerPath:P,...I}={}){let N=P??a;return A.inject({reducerPath:N,reducer:x},I),{...R,...F(N,!0)}}};return R}}function NP(e,t,r,n){function o(a,...l){let d=t(a);return typeof d>"u"&&n&&(d=r()),e(d,...l)}return o.unwrapped=e,o}var co=VP();function MP(){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 LP({type:e,reducerName:t,createNotation:r},n,o){let a,l;if("reducer"in n){if(r&&!BP(n))throw new Error(Mt(17));a=n.reducer,l=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?v(e,l):v(e))}function QP(e){return e._reducerDefinitionType==="asyncThunk"}function BP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function UP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Mt(18));let{payloadCreator:a,fulfilled:l,pending:d,rejected:p,settled:m,options:S}=r,C=o(e,a,S);n.exposeAction(t,C),l&&n.addCase(C.fulfilled,l),d&&n.addCase(C.pending,d),p&&n.addCase(C.rejected,p),m&&n.addMatcher(C.settled,m),n.exposeCaseReducer(t,{fulfilled:l||Yc,pending:d||Yc,rejected:p||Yc,settled:m||Yc})}function Yc(){}var ZS="listener",eh="completed",th="cancelled",xB=`task-${th}`,AB=`task-${eh}`,FB=`${ZS}-${th}`,RB=`${ZS}-${eh}`;var{assign:rh}=Object;var Sm="listenerMiddleware";var _P=rh(v(`${Sm}/add`),{withTypes:()=>_P}),bB=v(`${Sm}/removeAll`),jP=rh(v(`${Sm}/remove`),{withTypes:()=>jP});var vB=Symbol.for("rtk-state-proxy-original");function Mt(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. `}s();u();c();s();u();c();function $P({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:l}=e;l!=="disabled"&&(n.call(r),t.send(o,a,r))}var GP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function WP(e){return typeof e=="string"&&GP.test(e)}var He=[];for(tu=0;tu<256;++tu)He.push((tu+256).toString(16).slice(1));var tu;function HP(e,t=0){return(He[e[t+0]]+He[e[t+1]]+He[e[t+2]]+He[e[t+3]]+"-"+He[e[t+4]]+He[e[t+5]]+"-"+He[e[t+6]]+He[e[t+7]]+"-"+He[e[t+8]]+He[e[t+9]]+"-"+He[e[t+10]]+He[e[t+11]]+He[e[t+12]]+He[e[t+13]]+He[e[t+14]]+He[e[t+15]]).toLowerCase()}var ru,zP=new Uint8Array(16);function KP(){if(!ru&&(ru=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ru))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ru(zP)}var YP=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nh={randomUUID:YP};function JP(e,t,r){if(nh.randomUUID&&!t&&!e)return nh.randomUUID();e=e||{};var n=e.random||(e.rng||KP)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return HP(n)}function XP(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&WP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var ah="0.8.1";function ZP(e){let{trackingId:t}=e;return{trackingId:t}}function ew(e){return(e.source||[]).concat([`relay@${ah}`])}function ih(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:l}=r,d=ZP(t),p=n.getClientId();return Object.freeze({type:e,config:d,ts:Date.now(),source:ew(t),clientId:p,userAgent:l(),referrer:o(),location:a()})}function tw(e,t,r,n,o){return{...t,meta:ih(e,r,n,o)}}var rw="*";function nw(){let e=[];function t({type:p,callback:m}){return e.findIndex(S=>S.type===p&&S.callback===m)}function r(p,m){return p.type==="*"||m===p.type}function n(p){return t(p)<0&&e.push(p),()=>d(p.type,p.callback)}function o(p){e.forEach(m=>{if(r(m,p.meta.type))try{m.callback(p)}catch(S){console.error(S)}})}function a(p){if(p===rw)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===p&&e.splice(m,1)}function l(p){let m=t(p);m>=0&&e.splice(m,1)}function d(p,m){m?l({type:p,callback:m}):a(p)}return{add:n,call:o,remove:d}}function oh({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source})})}function ow(e){let t=oh(e);return{get:()=>t,update:r=>{t=oh({...t,...r})}}}function aw(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var hm=iw();function iw(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let l=a.replace(/^\s+/,"");if(l.lastIndexOf(n,0)===0)return l.substring(n.length,l.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),l=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,d=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${l}${d};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function sw(){return{getItem(e){return hm.getItem(e)||localStorage.getItem(e)},removeItem(e){hm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),hm.setItem(e,t,31556952e3)}}}function cw(){let e=document.referrer;return e===""?null:e}function uw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(aw().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>cw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>JP(),storage:sw()}}function lw(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function dw(){return{getItem(){return null},removeItem(){},setItem(){}}}function pw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:dw()}}function mw(e){return e.get().mode!=="disabled"&&fw()&&lw()?uw():pw()}function fw(){try{return typeof window=="object"}catch{return!1}}function gw(e){return{get:()=>Object.freeze(mw(e))}}function sh(e){let t=ow(e),r=nw(),n=gw(t),o=XP(n);return{emit:(a,l)=>{let d=t.get(),p=n.get(),m=tw(a,l,d,p,o);return $P({config:d,environment:p,event:m,listenerManager:r})},getMeta:a=>ih(a,t.get(),n.get(),o),on:(a,l)=>r.add({type:a,callback:l}),off:(a,l)=>r.remove(a,l),updateConfig:a=>t.update(a),version:ah}}s();u();c();s();u();c();var cn="3.13.1",ch=["@coveo/atomic","@coveo/quantic"];var Yt=ue(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${cn}`));var Ho=ue(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Yt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},l)=>sh({mode:a?"emit":"disabled",url:o??Mc(e,t),token:r,trackingId:n,source:l}));s();u();c();s();u();c();function Br(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 q(e,t,r,n){function o(a){return a instanceof r?a:new r(function(l){l(a)})}return new(r||(r=Promise))(function(a,l){function d(S){try{m(n.next(S))}catch(C){l(C)}}function p(S){try{m(n.throw(S))}catch(C){l(C)}}function m(S){S.done?a(S.value):o(S.value).then(d,p)}m((n=n.apply(e,t||[])).next())})}var de;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(de||(de={}));function xm(){return typeof window<"u"}function qm(){return typeof navigator<"u"}function zo(){return typeof document<"u"}function Am(){try{return typeof localStorage<"u"}catch{return!1}}function Sw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Fh(){return qm()&&navigator.cookieEnabled}var hw=[de.click,de.custom,de.search,de.view],yw=(e,t)=>hw.indexOf(e)!==-1?Object.assign({language:zo()?document.documentElement.lang:"unknown",userAgent:qm()?navigator.userAgent:"unknown"},t):t,As=class e{static set(t,r,n){var o,a,l,d;n&&(a=new Date,a.setTime(a.getTime()+n)),d=window.location.hostname,d.indexOf(".")===-1?uh(t,r,a):(l=d.split("."),o=l[l.length-2]+"."+l[l.length-1],uh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function uh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Cw(){return Am()?localStorage:Fh()?new Fs:Sw()?sessionStorage:new Yo}var Fs=class e{getItem(t){return As.get(`${e.prefix}${t}`)}removeItem(t){As.erase(`${e.prefix}${t}`)}setItem(t,r,n){As.set(`${e.prefix}${t}`,r,n)}};Fs.prefix="coveo_";var Fm=class{constructor(){this.cookieStorage=new Fs}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Yo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Cs="__coveo.analytics.history",Rh=20,bh=1e3*60,vh=75,Jo=class{constructor(t){this.store=t||Cw()}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 q(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 q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Cs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Cs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Cs,JSON.stringify(t.slice(0,Rh)))}catch{}}clear(){try{this.store.removeItem(Cs)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,vh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>bh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},Ph=Object.freeze({__proto__:null,HistoryStore:Jo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Rh,MAX_VALUE_SIZE:vh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:bh,STORE_KEY:Cs,default:Jo}),xw=(e,t)=>q(void 0,void 0,void 0,function*(){return e===de.view?(yield Aw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Aw=e=>q(void 0,void 0,void 0,function*(){let t=new Jo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),nu,Fw=new Uint8Array(16);function Rw(){if(!nu&&(nu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!nu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return nu(Fw)}var bw=/^(?:[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 au(e){return typeof e=="string"&&bw.test(e)}var ze=[];for(let e=0;e<256;++e)ze.push((e+256).toString(16).slice(1));function wh(e,t=0){return(ze[e[t+0]]+ze[e[t+1]]+ze[e[t+2]]+ze[e[t+3]]+"-"+ze[e[t+4]]+ze[e[t+5]]+"-"+ze[e[t+6]]+ze[e[t+7]]+"-"+ze[e[t+8]]+ze[e[t+9]]+"-"+ze[e[t+10]]+ze[e[t+11]]+ze[e[t+12]]+ze[e[t+13]]+ze[e[t+14]]+ze[e[t+15]]).toLowerCase()}function vw(e){if(!au(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 Pw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ww="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ew="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Iw(e,t,r){function n(o,a,l,d){var p;if(typeof o=="string"&&(o=Pw(o)),typeof a=="string"&&(a=vw(a)),((p=a)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,l){d=d||0;for(let S=0;S<16;++S)l[d+S]=m[S];return l}return wh(m)}try{n.name=e}catch{}return n.DNS=ww,n.URL=Ew,n}var Tw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lh={randomUUID:Tw};function uo(e,t,r){if(lh.randomUUID&&!t&&!e)return lh.randomUUID();e=e||{};let n=e.random||(e.rng||Rw)();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 wh(n)}function Ow(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 ym(e,t){return e<<t|e>>>32-t}function kw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let l=unescape(encodeURIComponent(e));e=[];for(let d=0;d<l.length;++d)e.push(l.charCodeAt(d))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let l=0;l<o;++l){let d=new Uint32Array(16);for(let p=0;p<16;++p)d[p]=e[l*64+p*4]<<24|e[l*64+p*4+1]<<16|e[l*64+p*4+2]<<8|e[l*64+p*4+3];a[l]=d}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let l=0;l<o;++l){let d=new Uint32Array(80);for(let y=0;y<16;++y)d[y]=a[l][y];for(let y=16;y<80;++y)d[y]=ym(d[y-3]^d[y-8]^d[y-14]^d[y-16],1);let p=r[0],m=r[1],S=r[2],C=r[3],h=r[4];for(let y=0;y<80;++y){let x=Math.floor(y/20),b=ym(p,5)+Ow(x,m,S,C)+h+t[x]+d[y]>>>0;h=C,C=S,S=ym(m,30)>>>0,m=p,p=b}r[0]=r[0]+p>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+S>>>0,r[3]=r[3]+C>>>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 qw=Iw("v5",80,kw),dh=qw,Eh="2.30.42",ph=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,xs={pageview:"pageview",event:"event"},iu=class{constructor({client:t,uuidGenerator:r=uo}){this.client=t,this.uuidGenerator=r}},Rm=class extends iu{constructor({client:t,uuidGenerator:r=uo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ph(window.location),this.lastReferrer=zo()?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:zo()?document.title:"",encoding:zo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===xs.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===xs.pageview?this.nextPageViewId:this.pageViewId,referrer:t===xs.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===xs.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 ph(window.location)}},un=class e{constructor(t,r){if(!au(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return au(a)?new e(a,Number.parseInt(o)*1e3):null}};un.cvo_cid="cvo_cid";un.expirationTime=120;var bm=class extends iu{constructor({client:t,uuidGenerator:r=uo}){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 q(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(un.cvo_cid,new un(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};bm.Id="link";var At=Object.keys;function ou(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Cm=128,Ih=192,mh=224,fh=240;function Dw(e){return(e&248)===fh?4:(e&fh)===mh?3:(e&mh)===Ih?2:1}function Vw(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&Cm)!=Cm)break;if(r-=3,(n&Ih)!=Cm){t-r>=Dw(n)*3&&(r=t);break}}return e.substring(0,r)}var vm={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"},Nw=At(vm).map(e=>vm[e]),Mw=[...Nw].join("|"),Lw=new RegExp(`^(${Mw}$)`),Qw={svcAction:"svc_action",svcActionData:"svc_action_data"},Bw=e=>At(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=vm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Uw=e=>Lw.test(e),_w=[Uw],gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Sh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ke={action:"pa",list:"pal",listSource:"pls"},su={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},jw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Pm={id:"quoteId",affiliation:"quoteAffiliation"},wm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},$w={add:Ke,bookmark_add:Ke,bookmark_remove:Ke,click:Ke,checkout:Ke,checkout_option:Ke,detail:Ke,impression:Ke,remove:Ke,refund:Object.assign(Object.assign({},Ke),su),purchase:Object.assign(Object.assign({},Ke),su),quickview:Ke,quote:Object.assign(Object.assign({},Ke),Pm),review:Object.assign(Object.assign({},Ke),wm)},Gw=At(gh).map(e=>gh[e]),Ww=At(Sh).map(e=>Sh[e]),Hw=At(Ke).map(e=>Ke[e]),zw=At(su).map(e=>su[e]),Kw=At(wm).map(e=>wm[e]),Yw=At(Pm).map(e=>Pm[e]),Jw=[...Gw,"custom"].join("|"),Xw=[...Ww,"custom"].join("|"),Th="(pr[0-9]+)",Oh="(il[0-9]+pi[0-9]+)",Zw=new RegExp(`^${Th}(${Jw})$`),eE=new RegExp(`^(${Oh}(${Xw}))|(il[0-9]+nm)$`),tE=new RegExp(`^(${Hw.join("|")})$`),rE=new RegExp(`^(${zw.join("|")})$`),nE=new RegExp(`^${Th}custom$`),oE=new RegExp(`^${Oh}custom$`),aE=new RegExp(`^(${[...jw,...Kw,...Yw].join("|")})$`),iE=e=>Zw.test(e),sE=e=>eE.test(e),cE=e=>tE.test(e),uE=e=>rE.test(e),lE=e=>aE.test(e),dE=[sE,iE,cE,uE,lE],pE=[nE,oE],mE={anonymizeIp:"aip"},fE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},gE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},SE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],hE=Object.assign(Object.assign(Object.assign(Object.assign({},mE),fE),gE),SE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Em=Object.assign(Object.assign({},hE),Qw),yE=e=>{let t=!!e.action&&$w[e.action]||{};return At(e).reduce((r,n)=>{let o=t[n]||Em[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},CE=At(Em).map(e=>Em[e]),xE=e=>CE.indexOf(e)!==-1,AE=e=>e==="custom",FE=e=>[...dE,..._w,xE,AE].some(t=>t(e)),RE=e=>At(e).reduce((t,r)=>{let n=bE(r);return n?Object.assign(Object.assign({},t),vE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),bE=e=>{let t;return[...pE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},vE=(e,t)=>At(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Im=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:l,payload:d}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),p=this.encodeForEventType(t,d),m=new Blob([p],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(l,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(this,void 0,void 0,function*(){let o=t,a=r;if(n){let l=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:d,body:p}=l;o=d||t;try{a=JSON.parse(p)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[de.click,de.custom,de.search,de.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}},Tm=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},hh=f.fetch,cu=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,l=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",d={url:`${n}/analytics/${t}${l}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},p=Object.assign(Object.assign({},d),a?yield a(d,"analyticsFetch"):{}),{url:m}=p,S=Br(p,["url"]),C;try{C=yield hh(m,S)}catch(h){console.error("An error has occured when sending the event.",h);return}if(C.ok){let h=yield C.json();return h.visitorId&&o.setCurrentVisitorId(h.visitorId),h}else{try{C.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,C,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield hh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[de.click,de.custom,de.search,de.view].indexOf(t)!==-1}getVisitorIdParam(){return q(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"})}},Om=class{constructor(t,r){Am()&&Fh()?this.storage=new Fm:Am()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Yo),this.client=new cu(t),this.beaconClient=new Im(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},km=class{constructor(t,r){this.storage=r||new Yo,this.client=new cu(t)}getClientDependingOnEventType(t){return this.client}},uu=class{constructor(){this.storage=new Yo,this.client=new Tm}getClientDependingOnEventType(t){return this.client}},PE="xx",wE=e=>e?.startsWith(PE)||!1,EE=`
|
|
26
|
+
`+S:S;break;case"event":n.event=S;break;case"id":e(n.id=S);break;case"retry":let C=parseInt(S,10);isNaN(C)||t(n.retry=C);break}}}}function cv(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Kg(){return{data:"",event:"",id:"",retry:void 0}}var uv=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},Dc="text/event-stream",lv=1e3,Zg="last-event-id";function eS(){typeof window<"u"}function os(e,t){var{signal:r,headers:n,onopen:o,onmessage:a,onclose:l,onerror:d,openWhenHidden:p,fetch:m}=t,S=uv(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((C,h)=>{let y=Object.assign({},n);y.accept||(y.accept=Dc);let x;function b(){x?.abort(),document.hidden||N()}!p&&eS()&&document.addEventListener("visibilitychange",b);let F=lv,R=0;function A(){eS()&&document.removeEventListener("visibilitychange",b),clearTimeout(R),x?.abort()}r?.addEventListener("abort",()=>{A(),C()});let P=m??P,I=o??dv;function N(){return _N2.apply(this,arguments)}function _N2(){_N2=_asyncToGenerator(function*(){var O;x=typeof i.AbortController>"u"?null:new i.AbortController;try{let E=yield P(e,Object.assign(Object.assign({},S),{headers:y,signal:x?.signal}));yield I(E),yield Yg(E.body,Jg(Xg(V=>{V?y[Zg]=V:delete y[Zg]},V=>{F=V},a))),l?.(),A(),C()}catch(E){if(!x?.signal.aborted)try{let V=(O=d?.(E))!==null&&O!==void 0?O:F;clearTimeout(R),R=setTimeout(N,V)}catch(V){A(),h(V)}}});return _N2.apply(this,arguments)}N()})}function dv(e){let t=e.headers.get("content-type");if(!t?.startsWith(Dc))throw new Error(`Expected content-type to be ${Dc}, Actual: ${t}`)}s();u();c();var rn=class{constructor(t){Se(this,"_basePath");Se(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var pv=(e,t,r)=>new rn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,tS=3,mv=5e3,fv="text/event-stream",Gp=1,jp=class extends Error{},as=class extends Error{constructor(r){super(r.message);this.payload=r}},$p=class{constructor(){Se(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Vc=class{constructor(t){Se(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:l}=t,{write:d,abort:p,close:m,resetAnswer:S}=r,C=new $p;if(!a){this.logger.error("No stream ID found");return}let h=0,y,x=()=>{y&&!C.isActive(y)&&(F?.abort(),S(),R())},b=()=>{C.remove(y),y=zg(x,y,mv),C.add(y)},F=new i.AbortController,R=()=>os(pv(n,o,a),{method:"GET",fetch:g,headers:{Authorization:`Bearer ${l}`,accept:"*/*"},openWhenHidden:!0,signal:F?.signal,onopen(A){return _asyncToGenerator(function*(){if(A.ok&&A.headers.get("content-type")===fv)return;throw A.status>=400&&A.status<500&&A.status!==429?new as({message:"Error opening stream",code:A.status}):new jp})()},onmessage:A=>{if(F?.signal.aborted)return;let P=JSON.parse(A.data);if(P.finishReason==="ERROR"){C.remove(y),F?.abort(),p({message:P.errorMessage,code:P.statusCode});return}d(P),h=0,P.finishReason==="COMPLETED"?(C.remove(y),m()):b()},onerror:A=>{if(!F?.signal.aborted){if(C.remove(y),A instanceof as)throw F?.abort(),p(A),A;if(++h>tS){this.logger.info("Maximum retry exceeded.");let P={message:"Failed to complete stream.",code:Gp};throw F?.abort(),p(P),new as(P)}this.logger.info(`Retrying...(${h}/${tS})`),S()}}});return R(),F}};s();u();c();var mS=yt(uS(),1);s();u();c();s();u();c();var Bv="recommendation-internal-options",nQ=Symbol.for(Bv);var j=new Error("Failed to load reducers."),Bo=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var ro=class extends Error{constructor(r,n){super();Se(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};s();u();c();function lS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function dS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Uv)}function Uv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function pS(e){return e===429}var Ct=class e{static call(t){return _asyncToGenerator(function*(){let r=_v(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...l}=o,d=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let p=yield g(a,l);if(pS(p.status))throw p;return p});return function d(){return _ref.apply(this,arguments)}}();try{let p=yield(0,mS.backOff)(d,{retry:m=>{let S=m&&pS(m.status);return S&&n.info("Platform retrying request"),S}});switch(p.status){case 419:case 401:throw n.info("Platform renewing token"),new Bo;case 404:throw new ro(a,p.status);default:return n.info({response:p,requestInfo:o},"Platform response"),p}}catch(p){return p.message==="Failed to fetch"?new ro(a):p}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:l}=r,{signal:d,...p}=t,m=ns(p);try{let S=yield o(t,n,l);return{...t,...S}}catch(S){a.error(S,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function $e(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Te(e,t="prod"){return`${$e(e,t)}/rest/search/v2`}function Mc(e,t="prod"){return`${$e(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function _v(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:l}=e,d=e.method==="POST"||e.method==="PUT",p=jv(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(d&&{body:p}),signal:l}}function jv(e,t){return t==="application/x-www-form-urlencoded"?dS(e)?lS(e):"":JSON.stringify(e)}s();u();c();var Lc=e=>e;s();u();c();var fS=e=>e,gS=e=>e,SS=e=>e;s();u();c();s();u();c();function Uo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function lt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Uo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Uo(),extendedResults:{}}}s();u();c();function nn(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var on=e=>{let{response:t}=e;return t.body?$v(e):Gv(t)},$v=e=>Hv(e)?zv(e):Wv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Gv=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Wv(e){return e.body.statusCode!==void 0}function Hv(e){return e.body.exception!==void 0}var zv=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});s();u();c();var an=class{constructor(){Se(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new i.AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};s();u();c();s();u();c();function hS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}s();u();c();var Nr=(e,t,r,n)=>{let o=new rn(`${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 yS=(e,t)=>{let r=new rn(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},CS=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Ct.call({...Nr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:nn(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=hS(r),o=yield r.arrayBuffer(),l=new TextDecoder(n).decode(o);return Kv(l)?{success:l}:{error:on({response:r,body:l})}});return function CS(_x4,_x5){return _ref2.apply(this,arguments)}}();function Kv(e){return typeof e=="string"}s();u();c();function Yv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Jv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function cs(e,t){if(t&&e.name==="AbortError")return{error:Jv(e)};if(e instanceof ro)return{error:Yv(e)};throw e}var Qc=class{constructor(t){this.options=t;Se(this,"apiCallsQueues",{unknown:new an,mainSearch:new an,facetValues:new an,foldingCollection:new an,instantResults:new an})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"POST","application/json","/plan"),requestParams:nn(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return cs(r);let n=yield r.json();return Zv(n)?{success:n}:{error:on({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:nn(t),..._this3.options});if(r instanceof Error)return cs(r);let n=yield r.json(),o={response:r,body:n};return Xv(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:on(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(d=>Ct.call({...Nr(t,"POST","application/json",""),requestParams:nn(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:d??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return cs(o,r?.disableAbortWarning);let a=yield o.json(),l={response:o,body:a};return xS(a)?(l.body=AS(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(l)).body}):{error:on(l)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"POST","application/json","/facet"),requestParams:nn(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 Ct.call({...Nr(t,"POST","application/json",""),requestParams:nn(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(xS(n)){let o={response:r,body:n};return o.body=AS(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:on({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return CS(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Ct.call({...Nr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return eP(n)?{success:n}:{error:on({response:r,body:n})}})()}},Bc=e=>e.success!==void 0,Ne=e=>e.error!==void 0;function xS(e){return e.results!==void 0}function AS(e){let t=Uo();return te(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Xv(e){return e.completions!==void 0}function Zv(e){return e.preprocessingOutput!==void 0}function eP(e){return e.fields!==void 0}s();u();c();s();u();c();var U=new T({required:!0,emptyAllowed:!1}),Re=new T({required:!1,emptyAllowed:!1}),he=new T({required:!0,emptyAllowed:!0}),FS=new T({required:!1,emptyAllowed:!0}),Uc=new Y({each:U,required:!0}),RS=new T({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Mr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),xt=(e,t)=>{if("required"in t)return{payload:new ie({value:t}).validate({value:e}).value};let o=new M({options:{required:!0},values:t}).validate(e);if(o)throw new rs(o);return{payload:e}},w=(e,t)=>{try{return xt(e,t)}catch(r){return{payload:e,error:Mr(r)}}},Oe=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return bS(e,t,r,o,"Controller initialization error")},Ae=(e,t,r,n)=>{let o=`Check the options of ${n}`;return bS(e,t,r,o,"Controller initialization error")},bS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};s();u();c();s();u();c();s();u();c();function Ge(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var tP=typeof Symbol=="function"&&Symbol.observable||"@@observable",vS=tP,em=()=>Math.random().toString(36).substring(7).split("").join("."),rP={INIT:`@@redux/INIT${em()}`,REPLACE:`@@redux/REPLACE${em()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${em()}`},_c=rP;function zt(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 tm(e,t,r){if(typeof e!="function")throw new Error(Ge(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ge(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ge(1));return r(tm)(e,t)}let n=e,o=t,a=new Map,l=a,d=0,p=!1;function m(){l===a&&(l=new Map,a.forEach((F,R)=>{l.set(R,F)}))}function S(){if(p)throw new Error(Ge(3));return o}function C(F){if(typeof F!="function")throw new Error(Ge(4));if(p)throw new Error(Ge(5));let R=!0;m();let A=d++;return l.set(A,F),function(){if(R){if(p)throw new Error(Ge(6));R=!1,m(),l.delete(A),a=null}}}function h(F){if(!zt(F))throw new Error(Ge(7));if(typeof F.type>"u")throw new Error(Ge(8));if(typeof F.type!="string")throw new Error(Ge(17));if(p)throw new Error(Ge(9));try{p=!0,o=n(o,F)}finally{p=!1}return(a=l).forEach(A=>{A()}),F}function y(F){if(typeof F!="function")throw new Error(Ge(10));n=F,h({type:_c.REPLACE})}function x(){let F=C;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ge(11));function A(){let I=R;I.next&&I.next(S())}return A(),{unsubscribe:F(A)}},[vS](){return this}}}return h({type:_c.INIT}),{dispatch:h,subscribe:C,getState:S,replaceReducer:y,[vS]:x}}function nP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:_c.INIT})>"u")throw new Error(Ge(12));if(typeof r(void 0,{type:_c.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ge(13))})}function _o(e){let t=Object.keys(e),r={};for(let l=0;l<t.length;l++){let d=t[l];typeof e[d]=="function"&&(r[d]=e[d])}let n=Object.keys(r),o,a;try{nP(r)}catch(l){a=l}return function(d={},p){if(a)throw a;let m=!1,S={};for(let C=0;C<n.length;C++){let h=n[C],y=r[h],x=d[h],b=y(x,p);if(typeof b>"u"){let F=p&&p.type;throw new Error(Ge(14))}S[h]=b,m=m||b!==x}return m=m||n.length!==Object.keys(d).length,m?S:d}}function jo(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function PS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Ge(15))},l={getState:o.getState,dispatch:(p,...m)=>a(p,...m)},d=e.map(p=>p(l));return a=jo(...d)(o.dispatch),{...o,dispatch:a}}}function jc(e){return zt(e)&&"type"in e&&typeof e.type=="string"}s();u();c();var dm=Symbol.for("immer-nothing"),us=Symbol.for("immer-draftable"),rt=Symbol.for("immer-state");function We(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oo=Object.getPrototypeOf;function dt(e){return!!e&&!!e[rt]}function nt(e){return e?OS(e)||Array.isArray(e)||!!e[us]||!!e.constructor?.[us]||fs(e)||gs(e):!1}var oP=Object.prototype.constructor.toString();function OS(e){if(!e||typeof e!="object")return!1;let t=oo(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)===oP}function pm(e){return dt(e)||We(15,e),e[rt].base_}function ls(e,t){ao(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function ao(e){let t=e[rt];return t?t.type_:Array.isArray(e)?1:fs(e)?2:gs(e)?3:0}function ds(e,t){return ao(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function rm(e,t){return ao(e)===2?e.get(t):e[t]}function kS(e,t,r){let n=ao(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function aP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function fs(e){return e instanceof Map}function gs(e){return e instanceof Set}function no(e){return e.copy_||e.base_}function am(e,t){if(fs(e))return new Map(e);if(gs(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=OS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[rt];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let l=o[a],d=n[l];d.writable===!1&&(d.writable=!0,d.configurable=!0),(d.get||d.set)&&(n[l]={configurable:!0,writable:!0,enumerable:d.enumerable,value:e[l]})}return Object.create(oo(e),n)}else{let n=oo(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Wc(e,t=!1){return Hc(e)||dt(e)||!nt(e)||(ao(e)>1&&(e.set=e.add=e.clear=e.delete=iP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Wc(n,!0))),e}function iP(){We(2)}function Hc(e){return Object.isFrozen(e)}var im={};function io(e){let t=im[e];return t||We(0,e),t}function sP(e,t){im[e]||(im[e]=t)}var ps;function qS(){return ps}function cP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wS(e,t){t&&(io("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sm(e){cm(e),e.drafts_.forEach(uP),e.drafts_=null}function cm(e){e===ps&&(ps=e.parent_)}function ES(e){return ps=cP(ps,e)}function uP(e){let t=e[rt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function IS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[rt].modified_&&(sm(t),We(4)),nt(e)&&(e=$c(t,e),t.parent_||Gc(t,e)),t.patches_&&io("Patches").generateReplacementPatches_(r[rt].base_,e,t.patches_,t.inversePatches_)):e=$c(t,r,[]),sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==dm?e:void 0}function $c(e,t,r){if(Hc(t))return t;let n=t[rt];if(!n)return ls(t,(o,a)=>TS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Gc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,l=!1;n.type_===3&&(a=new Set(o),o.clear(),l=!0),ls(a,(d,p)=>TS(e,n,o,d,p,r,l)),Gc(e,o,!1),r&&e.patches_&&io("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function TS(e,t,r,n,o,a,l){if(dt(o)){let d=a&&t&&t.type_!==3&&!ds(t.assigned_,n)?a.concat(n):void 0,p=$c(e,o,d);if(kS(r,n,p),dt(p))e.canAutoFreeze_=!1;else return}else l&&r.add(o);if(nt(o)&&!Hc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;$c(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Gc(e,o)}}function Gc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Wc(t,r)}function lP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:qS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=mm;r&&(o=[n],a=ms);let{revoke:l,proxy:d}=Proxy.revocable(o,a);return n.draft_=d,n.revoke_=l,d}var mm={get(e,t){if(t===rt)return e;let r=no(e);if(!ds(r,t))return dP(e,r,t);let n=r[t];return e.finalized_||!nt(n)?n:n===nm(e.base_,t)?(om(e),e.copy_[t]=lm(n,e)):n},has(e,t){return t in no(e)},ownKeys(e){return Reflect.ownKeys(no(e))},set(e,t,r){let n=DS(no(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=nm(no(e),t),a=o?.[rt];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(aP(r,o)&&(r!==void 0||ds(e.base_,t)))return!0;om(e),um(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 nm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,om(e),um(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=no(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){We(11)},getPrototypeOf(e){return oo(e.base_)},setPrototypeOf(){We(12)}},ms={};ls(mm,(e,t)=>{ms[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ms.deleteProperty=function(e,t){return ms.set.call(this,e,t,void 0)};ms.set=function(e,t,r){return mm.set.call(this,e[0],t,r,e[0])};function nm(e,t){let r=e[rt];return(r?no(r):e)[t]}function dP(e,t,r){let n=DS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function DS(e,t){if(!(t in e))return;let r=oo(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=oo(r)}}function um(e){e.modified_||(e.modified_=!0,e.parent_&&um(e.parent_))}function om(e){e.copy_||(e.copy_=am(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let l=this;return function(p=a,...m){return l.produce(p,S=>r.call(this,S,...m))}}typeof r!="function"&&We(6),n!==void 0&&typeof n!="function"&&We(7);let o;if(nt(t)){let a=ES(this),l=lm(t,void 0),d=!0;try{o=r(l),d=!1}finally{d?sm(a):cm(a)}return wS(a,n),IS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===dm&&(o=void 0),this.autoFreeze_&&Wc(o,!0),n){let a=[],l=[];io("Patches").generateReplacementPatches_(t,o,a,l),n(a,l)}return o}else We(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(l,...d)=>this.produceWithPatches(l,p=>t(p,...d));let n,o;return[this.produce(t,r,(l,d)=>{n=l,o=d}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){nt(e)||We(8),dt(e)&&(e=VS(e));let t=ES(this),r=lm(e,void 0);return r[rt].isManual_=!0,cm(t),r}finishDraft(e,t){let r=e&&e[rt];(!r||!r.isManual_)&&We(9);let{scope_:n}=r;return wS(n,t),IS(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=io("Patches").applyPatches_;return dt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function lm(e,t){let r=fs(e)?io("MapSet").proxyMap_(e,t):gs(e)?io("MapSet").proxySet_(e,t):lP(e,t);return(t?t.scope_:qS()).drafts_.push(r),r}function VS(e){return dt(e)||We(10,e),NS(e)}function NS(e){if(!nt(e)||Hc(e))return e;let t=e[rt],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=am(e,t.scope_.immer_.useStrictShallowCopy_)}else r=am(e,!0);return ls(r,(n,o)=>{kS(r,n,NS(o))}),t&&(t.finalized_=!1),r}function MS(){let t="replace",r="add",n="remove";function o(h,y,x,b){switch(h.type_){case 0:case 2:return l(h,y,x,b);case 1:return a(h,y,x,b);case 3:return d(h,y,x,b)}}function a(h,y,x,b){let{base_:F,assigned_:R}=h,A=h.copy_;A.length<F.length&&([F,A]=[A,F],[x,b]=[b,x]);for(let P=0;P<F.length;P++)if(R[P]&&A[P]!==F[P]){let I=y.concat([P]);x.push({op:t,path:I,value:C(A[P])}),b.push({op:t,path:I,value:C(F[P])})}for(let P=F.length;P<A.length;P++){let I=y.concat([P]);x.push({op:r,path:I,value:C(A[P])})}for(let P=A.length-1;F.length<=P;--P){let I=y.concat([P]);b.push({op:n,path:I})}}function l(h,y,x,b){let{base_:F,copy_:R}=h;ls(h.assigned_,(A,P)=>{let I=rm(F,A),N=rm(R,A),O=P?ds(F,A)?t:r:n;if(I===N&&O===t)return;let E=y.concat(A);x.push(O===n?{op:O,path:E}:{op:O,path:E,value:N}),b.push(O===r?{op:n,path:E}:O===n?{op:r,path:E,value:C(I)}:{op:t,path:E,value:C(I)})})}function d(h,y,x,b){let{base_:F,copy_:R}=h,A=0;F.forEach(P=>{if(!R.has(P)){let I=y.concat([A]);x.push({op:n,path:I,value:P}),b.unshift({op:r,path:I,value:P})}A++}),A=0,R.forEach(P=>{if(!F.has(P)){let I=y.concat([A]);x.push({op:r,path:I,value:P}),b.unshift({op:n,path:I,value:P})}A++})}function p(h,y,x,b){x.push({op:t,path:[],value:y===dm?void 0:y}),b.push({op:t,path:[],value:h})}function m(h,y){return y.forEach(x=>{let{path:b,op:F}=x,R=h;for(let N=0;N<b.length-1;N++){let O=ao(R),E=b[N];typeof E!="string"&&typeof E!="number"&&(E=""+E),(O===0||O===1)&&(E==="__proto__"||E==="constructor")&&We(19),typeof R=="function"&&E==="prototype"&&We(19),R=rm(R,E),typeof R!="object"&&We(18,b.join("/"))}let A=ao(R),P=S(x.value),I=b[b.length-1];switch(F){case t:switch(A){case 2:return R.set(I,P);case 3:We(16);default:return R[I]=P}case r:switch(A){case 1:return I==="-"?R.push(P):R.splice(I,0,P);case 2:return R.set(I,P);case 3:return R.add(P);default:return R[I]=P}case n:switch(A){case 1:return R.splice(I,1);case 2:return R.delete(I);case 3:return R.delete(x.value);default:return delete R[I]}default:We(17,F)}}),h}function S(h){if(!nt(h))return h;if(Array.isArray(h))return h.map(S);if(fs(h))return new Map(Array.from(h.entries()).map(([x,b])=>[x,S(b)]));if(gs(h))return new Set(Array.from(h).map(S));let y=Object.create(oo(h));for(let x in h)y[x]=S(h[x]);return ds(h,us)&&(y[us]=h[us]),y}function C(h){return dt(h)?S(h):h}sP("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:p})}var pt=new pP,Lr=pt.produce,zc=pt.produceWithPatches.bind(pt),_0=pt.setAutoFreeze.bind(pt),j0=pt.setUseStrictShallowCopy.bind(pt),fm=pt.applyPatches.bind(pt),$0=pt.createDraft.bind(pt),G0=pt.finishDraft.bind(pt);s();u();c();function mP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function fP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function gP(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 LS=e=>Array.isArray(e)?e:[e];function SP(e){let t=Array.isArray(e[0])?e[0]:e;return gP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function hP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var J0=Symbol();var X0=Object.getPrototypeOf({});var yP=class{constructor(e){this.value=e}deref(){return this.value}},CP=typeof WeakRef<"u"?WeakRef:yP,xP=0,QS=1;function Kc(){return{s:xP,v:void 0,o:null,p:null}}function $o(e,t={}){let r=Kc(),{resultEqualityCheck:n}=t,o,a=0;function l(){let d=r,{length:p}=arguments;for(let C=0,h=p;C<h;C++){let y=arguments[C];if(typeof y=="function"||typeof y=="object"&&y!==null){let x=d.o;x===null&&(d.o=x=new WeakMap);let b=x.get(y);b===void 0?(d=Kc(),x.set(y,d)):d=b}else{let x=d.p;x===null&&(d.p=x=new Map);let b=x.get(y);b===void 0?(d=Kc(),x.set(y,d)):d=b}}let m=d,S;if(d.s===QS)S=d.v;else if(S=e.apply(null,arguments),a++,n){let C=o?.deref?.()??o;C!=null&&n(C,S)&&(S=C,a!==0&&a--),o=typeof S=="object"&&S!==null||typeof S=="function"?new CP(S):S}return m.s=QS,m.v=S,S}return l.clearCache=()=>{r=Kc(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function BS(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,l=0,d,p={},m=o.pop();typeof m=="object"&&(p=m,m=o.pop()),mP(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let S={...r,...p},{memoize:C,memoizeOptions:h=[],argsMemoize:y=$o,argsMemoizeOptions:x=[],devModeChecks:b={}}=S,F=LS(h),R=LS(x),A=SP(o),P=C(function(){return a++,m.apply(null,arguments)},...F),I=!0,N=y(function(){l++;let E=hP(A,arguments);return d=P.apply(null,E),d},...R);return Object.assign(N,{resultFunc:m,memoizedResultFunc:P,dependencies:A,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>d,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:C,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var ue=BS($o),AP=Object.assign((e,t=ue)=>{fP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((l,d,p)=>(l[r[p]]=d,l),{}))},{withTypes:()=>AP});s();u();c();function US(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var _S=US(),jS=US;var FP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jo:jo.apply(null,arguments)},fB=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},RP=e=>e&&typeof e.match=="function";function v(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Mt(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=>jc(n)&&n.type===e,r}var zS=class Ss extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ss.prototype)}static get[Symbol.species](){return Ss}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ss(...t[0].concat(this)):new Ss(...t.concat(this))}};function $S(e){return nt(e)?Lr(e,()=>{}):e}function GS(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function bP(e){return typeof e=="boolean"}var vP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},l=new zS;return r&&(bP(r)?l.push(_S):l.push(jS(r.extraArgument))),l},sn="RTK_autoBatch",Wo=()=>e=>({payload:e,meta:{[sn]:!0}}),WS=e=>t=>{setTimeout(t,e)},PP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,l=!1,d=new Set,p=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:WS(10):e.type==="callback"?e.queueNotification:WS(e.timeout),m=()=>{l=!1,a&&(a=!1,d.forEach(S=>S()))};return Object.assign({},n,{subscribe(S){let C=()=>o&&S(),h=n.subscribe(C);return d.add(S),()=>{h(),d.delete(S)}},dispatch(S){try{return o=!S?.meta?.[sn],a=!o,a&&(l||(l=!0,p(m))),n.dispatch(S)}finally{o=!0}}})},wP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new zS(e);return n&&o.push(PP(typeof n=="object"?n:void 0)),o};function KS(e){let t=vP(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{},d;if(typeof r=="function")d=r;else if(zt(r))d=_o(r);else throw new Error(Mt(1));let p;typeof n=="function"?p=n(t):p=t();let m=jo;o&&(m=FP({trace:!1,...(typeof o=="object"&&o)}));let S=PS(...p),C=wP(S),h=typeof l=="function"?l(C):C(),y=m(...h);return tm(d,a,y)}function YS(e){let t={},r=[],n,o={addCase(a,l){let d=typeof a=="string"?a:a.type;if(!d)throw new Error(Mt(28));if(d in t)throw new Error(Mt(29));return t[d]=l,o},addMatcher(a,l){return r.push({matcher:a,reducer:l}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function EP(e){return typeof e=="function"}function J(e,t){let[r,n,o]=YS(t),a;if(EP(e))a=()=>$S(e());else{let d=$S(e);a=()=>d}function l(d=a(),p){let m=[r[p.type],...n.filter(({matcher:S})=>S(p)).map(({reducer:S})=>S)];return m.filter(S=>!!S).length===0&&(m=[o]),m.reduce((S,C)=>{if(C)if(dt(S)){let y=C(S,p);return y===void 0?S:y}else{if(nt(S))return Lr(S,h=>C(h,p));{let h=C(S,p);if(h===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return S},d)}return l.getInitialState=a,l}var JS=(e,t)=>RP(e)?e.match(t):e(t);function Kt(...e){return t=>e.some(r=>JS(r,t))}function Go(...e){return t=>e.every(r=>JS(r,t))}function Jc(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 hs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Xc(...e){return e.length===0?t=>Jc(t,["pending"]):hs(e)?Kt(...e.map(t=>t.pending)):Xc()(e[0])}function so(...e){return e.length===0?t=>Jc(t,["rejected"]):hs(e)?Kt(...e.map(t=>t.rejected)):so()(e[0])}function ys(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Go(so(...e),t):hs(e)?Go(so(...e),t):ys()(e[0])}function Qr(...e){return e.length===0?t=>Jc(t,["fulfilled"]):hs(e)?Kt(...e.map(t=>t.fulfilled)):Qr()(e[0])}function Zc(...e){return e.length===0?t=>Jc(t,["pending","fulfilled","rejected"]):hs(e)?Kt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Zc()(e[0])}var IP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",eu=(e=21)=>{let t="",r=e;for(;r--;)t+=IP[Math.random()*64|0];return t},TP=["name","message","stack","code"],gm=class{constructor(e,t){Se(this,"_type");this.payload=e,this.meta=t}},HS=class{constructor(e,t){Se(this,"_type");this.payload=e,this.meta=t}},OP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of TP)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ne=(()=>{function e(t,r,n){let o=v(t+"/fulfilled",(p,m,S,C)=>({payload:p,meta:{...(C||{}),arg:S,requestId:m,requestStatus:"fulfilled"}})),a=v(t+"/pending",(p,m,S)=>({payload:void 0,meta:{...(S||{}),arg:m,requestId:p,requestStatus:"pending"}})),l=v(t+"/rejected",(p,m,S,C,h)=>({payload:C,error:(n&&n.serializeError||OP)(p||"Rejected"),meta:{...(h||{}),arg:S,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:p?.name==="AbortError",condition:p?.name==="ConditionError"}}));function d(p){return(m,S,C)=>{let h=n?.idGenerator?n.idGenerator(p):eu(),y=new i.AbortController,x,b;function F(A){b=A,y.abort()}let R=_asyncToGenerator(function*(){let A;try{let I=n?.condition?.(p,{getState:S,extra:C});if(qP(I)&&(I=yield I),I===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((O,E)=>{x=()=>{E({name:"AbortError",message:b||"Aborted"})},y.signal.addEventListener("abort",x)});m(a(h,p,n?.getPendingMeta?.({requestId:h,arg:p},{getState:S,extra:C}))),A=yield Promise.race([N,Promise.resolve(r(p,{dispatch:m,getState:S,extra:C,requestId:h,signal:y.signal,abort:F,rejectWithValue:(O,E)=>new gm(O,E),fulfillWithValue:(O,E)=>new HS(O,E)})).then(O=>{if(O instanceof gm)throw O;return O instanceof HS?o(O.payload,h,p,O.meta):o(O,h,p)})])}catch(I){A=I instanceof gm?l(null,h,p,I.payload,I.meta):l(I,h,p)}finally{x&&y.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&l.match(A)&&A.meta.condition||m(A),A})();return Object.assign(R,{abort:F,requestId:h,arg:p,unwrap(){return R.then(kP)}})}}return Object.assign(d,{pending:a,rejected:l,fulfilled:o,settled:Kt(l,o),typePrefix:t})}return e.withTypes=()=>e,e})();function kP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function qP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var XS=Symbol.for("rtk-slice-createasyncthunk"),CB={[XS]:ne};function DP(e,t){return`${e}/${t}`}function VP({creators:e}={}){let t=e?.asyncThunk?.[XS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Mt(11));typeof process<"u";let l=(typeof n.reducers=="function"?n.reducers(MP()):n.reducers)||{},d=Object.keys(l),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(A,P){let I=typeof A=="string"?A:A.type;if(!I)throw new Error(Mt(12));if(I in p.sliceCaseReducersByType)throw new Error(Mt(13));return p.sliceCaseReducersByType[I]=P,m},addMatcher(A,P){return p.sliceMatchers.push({matcher:A,reducer:P}),m},exposeAction(A,P){return p.actionCreators[A]=P,m},exposeCaseReducer(A,P){return p.sliceCaseReducersByName[A]=P,m}};d.forEach(A=>{let P=l[A],I={reducerName:A,type:DP(o,A),createNotation:typeof n.reducers=="function"};QP(P)?UP(I,P,m,t):LP(I,P,m)});function S(){let[A={},P=[],I=void 0]=typeof n.extraReducers=="function"?YS(n.extraReducers):[n.extraReducers],N={...A,...p.sliceCaseReducersByType};return J(n.initialState,O=>{for(let E in N)O.addCase(E,N[E]);for(let E of p.sliceMatchers)O.addMatcher(E.matcher,E.reducer);for(let E of P)O.addMatcher(E.matcher,E.reducer);I&&O.addDefaultCase(I)})}let C=A=>A,h=new Map,y;function x(A,P){return y||(y=S()),y(A,P)}function b(){return y||(y=S()),y.getInitialState()}function F(A,P=!1){function I(O){let E=O[A];return typeof E>"u"&&P&&(E=b()),E}function N(O=C){let E=GS(h,P,()=>new WeakMap);return GS(E,O,()=>{let V={};for(let[k,$]of Object.entries(n.selectors??{}))V[k]=NP($,O,b,P);return V})}return{reducerPath:A,getSelectors:N,get selectors(){return N(I)},selectSlice:I}}let R={name:o,reducer:x,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:b,...F(a),injectInto(A,{reducerPath:P,...I}={}){let N=P??a;return A.inject({reducerPath:N,reducer:x},I),{...R,...F(N,!0)}}};return R}}function NP(e,t,r,n){function o(a,...l){let d=t(a);return typeof d>"u"&&n&&(d=r()),e(d,...l)}return o.unwrapped=e,o}var co=VP();function MP(){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 LP({type:e,reducerName:t,createNotation:r},n,o){let a,l;if("reducer"in n){if(r&&!BP(n))throw new Error(Mt(17));a=n.reducer,l=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?v(e,l):v(e))}function QP(e){return e._reducerDefinitionType==="asyncThunk"}function BP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function UP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Mt(18));let{payloadCreator:a,fulfilled:l,pending:d,rejected:p,settled:m,options:S}=r,C=o(e,a,S);n.exposeAction(t,C),l&&n.addCase(C.fulfilled,l),d&&n.addCase(C.pending,d),p&&n.addCase(C.rejected,p),m&&n.addMatcher(C.settled,m),n.exposeCaseReducer(t,{fulfilled:l||Yc,pending:d||Yc,rejected:p||Yc,settled:m||Yc})}function Yc(){}var ZS="listener",eh="completed",th="cancelled",xB=`task-${th}`,AB=`task-${eh}`,FB=`${ZS}-${th}`,RB=`${ZS}-${eh}`;var{assign:rh}=Object;var Sm="listenerMiddleware";var _P=rh(v(`${Sm}/add`),{withTypes:()=>_P}),bB=v(`${Sm}/removeAll`),jP=rh(v(`${Sm}/remove`),{withTypes:()=>jP});var vB=Symbol.for("rtk-state-proxy-original");function Mt(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. `}s();u();c();s();u();c();function $P({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:l}=e;l!=="disabled"&&(n.call(r),t.send(o,a,r))}var GP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function WP(e){return typeof e=="string"&&GP.test(e)}var He=[];for(tu=0;tu<256;++tu)He.push((tu+256).toString(16).slice(1));var tu;function HP(e,t=0){return(He[e[t+0]]+He[e[t+1]]+He[e[t+2]]+He[e[t+3]]+"-"+He[e[t+4]]+He[e[t+5]]+"-"+He[e[t+6]]+He[e[t+7]]+"-"+He[e[t+8]]+He[e[t+9]]+"-"+He[e[t+10]]+He[e[t+11]]+He[e[t+12]]+He[e[t+13]]+He[e[t+14]]+He[e[t+15]]).toLowerCase()}var ru,zP=new Uint8Array(16);function KP(){if(!ru&&(ru=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ru))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ru(zP)}var YP=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nh={randomUUID:YP};function JP(e,t,r){if(nh.randomUUID&&!t&&!e)return nh.randomUUID();e=e||{};var n=e.random||(e.rng||KP)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return HP(n)}function XP(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&WP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var ah="0.8.1";function ZP(e){let{trackingId:t}=e;return{trackingId:t}}function ew(e){return(e.source||[]).concat([`relay@${ah}`])}function ih(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:l}=r,d=ZP(t),p=n.getClientId();return Object.freeze({type:e,config:d,ts:Date.now(),source:ew(t),clientId:p,userAgent:l(),referrer:o(),location:a()})}function tw(e,t,r,n,o){return{...t,meta:ih(e,r,n,o)}}var rw="*";function nw(){let e=[];function t({type:p,callback:m}){return e.findIndex(S=>S.type===p&&S.callback===m)}function r(p,m){return p.type==="*"||m===p.type}function n(p){return t(p)<0&&e.push(p),()=>d(p.type,p.callback)}function o(p){e.forEach(m=>{if(r(m,p.meta.type))try{m.callback(p)}catch(S){console.error(S)}})}function a(p){if(p===rw)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===p&&e.splice(m,1)}function l(p){let m=t(p);m>=0&&e.splice(m,1)}function d(p,m){m?l({type:p,callback:m}):a(p)}return{add:n,call:o,remove:d}}function oh({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source})})}function ow(e){let t=oh(e);return{get:()=>t,update:r=>{t=oh({...t,...r})}}}function aw(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var hm=iw();function iw(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let l=a.replace(/^\s+/,"");if(l.lastIndexOf(n,0)===0)return l.substring(n.length,l.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),l=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,d=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${l}${d};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function sw(){return{getItem(e){return hm.getItem(e)||localStorage.getItem(e)},removeItem(e){hm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),hm.setItem(e,t,31556952e3)}}}function cw(){let e=document.referrer;return e===""?null:e}function uw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(aw().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>cw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>JP(),storage:sw()}}function lw(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function dw(){return{getItem(){return null},removeItem(){},setItem(){}}}function pw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:dw()}}function mw(e){return e.get().mode!=="disabled"&&fw()&&lw()?uw():pw()}function fw(){try{return typeof window=="object"}catch{return!1}}function gw(e){return{get:()=>Object.freeze(mw(e))}}function sh(e){let t=ow(e),r=nw(),n=gw(t),o=XP(n);return{emit:(a,l)=>{let d=t.get(),p=n.get(),m=tw(a,l,d,p,o);return $P({config:d,environment:p,event:m,listenerManager:r})},getMeta:a=>ih(a,t.get(),n.get(),o),on:(a,l)=>r.add({type:a,callback:l}),off:(a,l)=>r.remove(a,l),updateConfig:a=>t.update(a),version:ah}}s();u();c();s();u();c();var cn="3.13.2",ch=["@coveo/atomic","@coveo/quantic"];var Yt=ue(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${cn}`));var Ho=ue(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Yt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},l)=>sh({mode:a?"emit":"disabled",url:o??Mc(e,t),token:r,trackingId:n,source:l}));s();u();c();s();u();c();function Br(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 q(e,t,r,n){function o(a){return a instanceof r?a:new r(function(l){l(a)})}return new(r||(r=Promise))(function(a,l){function d(S){try{m(n.next(S))}catch(C){l(C)}}function p(S){try{m(n.throw(S))}catch(C){l(C)}}function m(S){S.done?a(S.value):o(S.value).then(d,p)}m((n=n.apply(e,t||[])).next())})}var de;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(de||(de={}));function xm(){return typeof window<"u"}function qm(){return typeof navigator<"u"}function zo(){return typeof document<"u"}function Am(){try{return typeof localStorage<"u"}catch{return!1}}function Sw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Fh(){return qm()&&navigator.cookieEnabled}var hw=[de.click,de.custom,de.search,de.view],yw=(e,t)=>hw.indexOf(e)!==-1?Object.assign({language:zo()?document.documentElement.lang:"unknown",userAgent:qm()?navigator.userAgent:"unknown"},t):t,As=class e{static set(t,r,n){var o,a,l,d;n&&(a=new Date,a.setTime(a.getTime()+n)),d=window.location.hostname,d.indexOf(".")===-1?uh(t,r,a):(l=d.split("."),o=l[l.length-2]+"."+l[l.length-1],uh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function uh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Cw(){return Am()?localStorage:Fh()?new Fs:Sw()?sessionStorage:new Yo}var Fs=class e{getItem(t){return As.get(`${e.prefix}${t}`)}removeItem(t){As.erase(`${e.prefix}${t}`)}setItem(t,r,n){As.set(`${e.prefix}${t}`,r,n)}};Fs.prefix="coveo_";var Fm=class{constructor(){this.cookieStorage=new Fs}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Yo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Cs="__coveo.analytics.history",Rh=20,bh=1e3*60,vh=75,Jo=class{constructor(t){this.store=t||Cw()}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 q(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 q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Cs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Cs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Cs,JSON.stringify(t.slice(0,Rh)))}catch{}}clear(){try{this.store.removeItem(Cs)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,vh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>bh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},Ph=Object.freeze({__proto__:null,HistoryStore:Jo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Rh,MAX_VALUE_SIZE:vh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:bh,STORE_KEY:Cs,default:Jo}),xw=(e,t)=>q(void 0,void 0,void 0,function*(){return e===de.view?(yield Aw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Aw=e=>q(void 0,void 0,void 0,function*(){let t=new Jo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),nu,Fw=new Uint8Array(16);function Rw(){if(!nu&&(nu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!nu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return nu(Fw)}var bw=/^(?:[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 au(e){return typeof e=="string"&&bw.test(e)}var ze=[];for(let e=0;e<256;++e)ze.push((e+256).toString(16).slice(1));function wh(e,t=0){return(ze[e[t+0]]+ze[e[t+1]]+ze[e[t+2]]+ze[e[t+3]]+"-"+ze[e[t+4]]+ze[e[t+5]]+"-"+ze[e[t+6]]+ze[e[t+7]]+"-"+ze[e[t+8]]+ze[e[t+9]]+"-"+ze[e[t+10]]+ze[e[t+11]]+ze[e[t+12]]+ze[e[t+13]]+ze[e[t+14]]+ze[e[t+15]]).toLowerCase()}function vw(e){if(!au(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 Pw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ww="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ew="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Iw(e,t,r){function n(o,a,l,d){var p;if(typeof o=="string"&&(o=Pw(o)),typeof a=="string"&&(a=vw(a)),((p=a)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,l){d=d||0;for(let S=0;S<16;++S)l[d+S]=m[S];return l}return wh(m)}try{n.name=e}catch{}return n.DNS=ww,n.URL=Ew,n}var Tw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lh={randomUUID:Tw};function uo(e,t,r){if(lh.randomUUID&&!t&&!e)return lh.randomUUID();e=e||{};let n=e.random||(e.rng||Rw)();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 wh(n)}function Ow(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 ym(e,t){return e<<t|e>>>32-t}function kw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let l=unescape(encodeURIComponent(e));e=[];for(let d=0;d<l.length;++d)e.push(l.charCodeAt(d))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let l=0;l<o;++l){let d=new Uint32Array(16);for(let p=0;p<16;++p)d[p]=e[l*64+p*4]<<24|e[l*64+p*4+1]<<16|e[l*64+p*4+2]<<8|e[l*64+p*4+3];a[l]=d}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let l=0;l<o;++l){let d=new Uint32Array(80);for(let y=0;y<16;++y)d[y]=a[l][y];for(let y=16;y<80;++y)d[y]=ym(d[y-3]^d[y-8]^d[y-14]^d[y-16],1);let p=r[0],m=r[1],S=r[2],C=r[3],h=r[4];for(let y=0;y<80;++y){let x=Math.floor(y/20),b=ym(p,5)+Ow(x,m,S,C)+h+t[x]+d[y]>>>0;h=C,C=S,S=ym(m,30)>>>0,m=p,p=b}r[0]=r[0]+p>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+S>>>0,r[3]=r[3]+C>>>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 qw=Iw("v5",80,kw),dh=qw,Eh="2.30.42",ph=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,xs={pageview:"pageview",event:"event"},iu=class{constructor({client:t,uuidGenerator:r=uo}){this.client=t,this.uuidGenerator=r}},Rm=class extends iu{constructor({client:t,uuidGenerator:r=uo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ph(window.location),this.lastReferrer=zo()?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:zo()?document.title:"",encoding:zo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===xs.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===xs.pageview?this.nextPageViewId:this.pageViewId,referrer:t===xs.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===xs.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 ph(window.location)}},un=class e{constructor(t,r){if(!au(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return au(a)?new e(a,Number.parseInt(o)*1e3):null}};un.cvo_cid="cvo_cid";un.expirationTime=120;var bm=class extends iu{constructor({client:t,uuidGenerator:r=uo}){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 q(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(un.cvo_cid,new un(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};bm.Id="link";var At=Object.keys;function ou(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Cm=128,Ih=192,mh=224,fh=240;function Dw(e){return(e&248)===fh?4:(e&fh)===mh?3:(e&mh)===Ih?2:1}function Vw(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&Cm)!=Cm)break;if(r-=3,(n&Ih)!=Cm){t-r>=Dw(n)*3&&(r=t);break}}return e.substring(0,r)}var vm={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"},Nw=At(vm).map(e=>vm[e]),Mw=[...Nw].join("|"),Lw=new RegExp(`^(${Mw}$)`),Qw={svcAction:"svc_action",svcActionData:"svc_action_data"},Bw=e=>At(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=vm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Uw=e=>Lw.test(e),_w=[Uw],gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Sh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ke={action:"pa",list:"pal",listSource:"pls"},su={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},jw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Pm={id:"quoteId",affiliation:"quoteAffiliation"},wm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},$w={add:Ke,bookmark_add:Ke,bookmark_remove:Ke,click:Ke,checkout:Ke,checkout_option:Ke,detail:Ke,impression:Ke,remove:Ke,refund:Object.assign(Object.assign({},Ke),su),purchase:Object.assign(Object.assign({},Ke),su),quickview:Ke,quote:Object.assign(Object.assign({},Ke),Pm),review:Object.assign(Object.assign({},Ke),wm)},Gw=At(gh).map(e=>gh[e]),Ww=At(Sh).map(e=>Sh[e]),Hw=At(Ke).map(e=>Ke[e]),zw=At(su).map(e=>su[e]),Kw=At(wm).map(e=>wm[e]),Yw=At(Pm).map(e=>Pm[e]),Jw=[...Gw,"custom"].join("|"),Xw=[...Ww,"custom"].join("|"),Th="(pr[0-9]+)",Oh="(il[0-9]+pi[0-9]+)",Zw=new RegExp(`^${Th}(${Jw})$`),eE=new RegExp(`^(${Oh}(${Xw}))|(il[0-9]+nm)$`),tE=new RegExp(`^(${Hw.join("|")})$`),rE=new RegExp(`^(${zw.join("|")})$`),nE=new RegExp(`^${Th}custom$`),oE=new RegExp(`^${Oh}custom$`),aE=new RegExp(`^(${[...jw,...Kw,...Yw].join("|")})$`),iE=e=>Zw.test(e),sE=e=>eE.test(e),cE=e=>tE.test(e),uE=e=>rE.test(e),lE=e=>aE.test(e),dE=[sE,iE,cE,uE,lE],pE=[nE,oE],mE={anonymizeIp:"aip"},fE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},gE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},SE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],hE=Object.assign(Object.assign(Object.assign(Object.assign({},mE),fE),gE),SE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Em=Object.assign(Object.assign({},hE),Qw),yE=e=>{let t=!!e.action&&$w[e.action]||{};return At(e).reduce((r,n)=>{let o=t[n]||Em[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},CE=At(Em).map(e=>Em[e]),xE=e=>CE.indexOf(e)!==-1,AE=e=>e==="custom",FE=e=>[...dE,..._w,xE,AE].some(t=>t(e)),RE=e=>At(e).reduce((t,r)=>{let n=bE(r);return n?Object.assign(Object.assign({},t),vE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),bE=e=>{let t;return[...pE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},vE=(e,t)=>At(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Im=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:l,payload:d}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),p=this.encodeForEventType(t,d),m=new Blob([p],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(l,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(this,void 0,void 0,function*(){let o=t,a=r;if(n){let l=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:d,body:p}=l;o=d||t;try{a=JSON.parse(p)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[de.click,de.custom,de.search,de.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}},Tm=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},hh=f.fetch,cu=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,l=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",d={url:`${n}/analytics/${t}${l}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},p=Object.assign(Object.assign({},d),a?yield a(d,"analyticsFetch"):{}),{url:m}=p,S=Br(p,["url"]),C;try{C=yield hh(m,S)}catch(h){console.error("An error has occured when sending the event.",h);return}if(C.ok){let h=yield C.json();return h.visitorId&&o.setCurrentVisitorId(h.visitorId),h}else{try{C.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,C,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield hh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[de.click,de.custom,de.search,de.view].indexOf(t)!==-1}getVisitorIdParam(){return q(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"})}},Om=class{constructor(t,r){Am()&&Fh()?this.storage=new Fm:Am()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Yo),this.client=new cu(t),this.beaconClient=new Im(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},km=class{constructor(t,r){this.storage=r||new Yo,this.client=new cu(t)}getClientDependingOnEventType(t){return this.client}},uu=class{constructor(){this.storage=new Yo,this.client=new Tm}getClientDependingOnEventType(t){return this.client}},PE="xx",wE=e=>e?.startsWith(PE)||!1,EE=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
@@ -47,4 +47,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
47
47
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
48
48
|
* See the License for the specific language governing permissions and
|
|
49
49
|
* limitations under the License.
|
|
50
|
-
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
50
|
+
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
51
|
+
|
|
52
|
+
window.coveoQuanticVersion = '3.12.1';
|