@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.
@@ -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 Rn(r)}var Rn=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},de=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw yF(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Se=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&z(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 zn(e){return e===void 0}function SF(e){return e===null}function z(e){return zn(e)||SF(e)}var W=class{constructor(e={}){Fe(this,"value");this.config=e,this.value=new Se(e)}validate(e){let t=this.value.validate(e);return t||(CF(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 CF(e){return zn(e)||lf(e)}function lf(e){return typeof e=="number"&&!isNaN(e)}var te=class{constructor(e={}){Fe(this,"value");this.value=new Se(e)}validate(e){let t=this.value.validate(e);return t||(AF(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function AF(e){return zn(e)||df(e)}function df(e){return typeof e=="boolean"}var xF=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,O=class{constructor(e={}){Fe(this,"value");Fe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Se(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,l=this.value.validate(e);if(l)return l;if(zn(e))return null;if(!Wn(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(xF.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 Wn(e){return Object.prototype.toString.call(e)==="[object String]"}var M=class{constructor(e={}){Fe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(zn(e))return this.config.options.required?"value is required and is currently undefined":null;if(!pf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&z(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=" "+i)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function pf(e){return e!==void 0&&typeof e=="object"}var K=class{constructor(e={}){Fe(this,"value");this.config=e,this.value=new Se(this.config)}validate(e){if(!z(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(z(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&&z(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 df(e)||Wn(e)||lf(e)||pf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Yn(e){return Array.isArray(e)}var Et=class{constructor(e){Fe(this,"value");this.config=e,this.value=new Se(e)}validate(e){let t=this.value.validate(e);return t!==null?t:zn(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 ja=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function $a(e){return Array.isArray(e)}function Ga(e){return e.trim()===""}function mf(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function RF(e){return btoa(encodeURI(e))}function Ha(e,t){let{[e]:r,...n}=t;return n}function Kn(e){return RF(JSON.stringify(e))}var FF=new Set(["1",1,"yes",!0]);function ff(){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=>FF.has(r))}function gf(e){let t={};for(let[r,n]of e)t[r]=n;return t}function hf(e,t,r){return clearTimeout(t),setTimeout(e,r)}function xi(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function bF(e){if(Ga(e.openingDelimiter)||Ga(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(z(e.content)||Ga(e.content))return e.content;if(e.highlights.length===0)return Jn(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],l=i.offset,d=l+i.length;if(d>t)break;r+=Jn(e.content.slice(n,l)),r+=e.openingDelimiter,r+=Jn(e.content.slice(l,d)),r+=e.closingDelimiter,n=d}return n!==t&&(r+=Jn(e.content.slice(n))),r}function ud(e,t){return e=Jn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?cd(n,t.notMatchDelimiters):o?cd(o,t.exactMatchDelimiters):i?cd(i,t.correctionDelimiters):r)}function cd(e,t){return t?t.open+e+t.close:e}function Jn(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}s();u();c();s();u();c();s();u();c();s();u();c();s();u();c();function Sf(_x2,_x3){return _Sf.apply(this,arguments)}function _Sf(){_Sf=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Sf.apply(this,arguments)}function Cf(e){let t,r,n,o=!1;return function(l){t===void 0?(t=l,r=0,n=-1):t=vF(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 Af(e,t,r){let n=yf(),o=new TextDecoder;return function(l,d){if(l.length===0)r?.(n),n=yf();else if(d>0){let p=o.decode(l.subarray(0,d)),m=d+(l[d+1]===32?2:1),f=o.decode(l.subarray(m));switch(p){case"data":n.data=n.data?n.data+`
26
- `+f:f;break;case"event":n.event=f;break;case"id":e(n.id=f);break;case"retry":let C=parseInt(f,10);isNaN(C)||t(n.retry=C);break}}}}function vF(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function yf(){return{data:"",event:"",id:"",retry:void 0}}var IF=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},za="text/event-stream",wF=1e3,xf="last-event-id";function Rf(){typeof window<"u"}function Ri(e,t){var{signal:r,headers:n,onopen:o,onmessage:i,onclose:l,onerror:d,openWhenHidden:p,fetch:m}=t,f=IF(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((C,S)=>{let y=Object.assign({},n);y.accept||(y.accept=za);let A;function x(){A?.abort(),document.hidden||N()}!p&&Rf()&&document.addEventListener("visibilitychange",x);let F=wF,v=0;function R(){Rf()&&document.removeEventListener("visibilitychange",x),clearTimeout(v),A?.abort()}r?.addEventListener("abort",()=>{R(),C()});let I=m??I,T=o??PF;function N(){return _N.apply(this,arguments)}function _N(){_N=_asyncToGenerator(function*(){var k;A=typeof a.AbortController>"u"?null:new a.AbortController;try{let E=yield I(e,Object.assign(Object.assign({},f),{headers:y,signal:A?.signal}));yield T(E),yield Sf(E.body,Cf(Af(V=>{V?y[xf]=V:delete y[xf]},V=>{F=V},i))),l?.(),R(),C()}catch(E){if(!A?.signal.aborted)try{let V=(k=d?.(E))!==null&&k!==void 0?k:F;clearTimeout(v),v=setTimeout(N,V)}catch(V){R(),S(V)}}});return _N.apply(this,arguments)}N()})}function PF(e){let t=e.headers.get("content-type");if(!t?.startsWith(za))throw new Error(`Expected content-type to be ${za}, Actual: ${t}`)}s();u();c();var Tr=class{constructor(t){Fe(this,"_basePath");Fe(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 EF=(e,t,r)=>new Tr(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Ff=3,TF=5e3,kF="text/event-stream",md=1,dd=class extends Error{},Fi=class extends Error{constructor(r){super(r.message);this.payload=r}},pd=class{constructor(){Fe(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)}},Wa=class{constructor(t){Fe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:l}=t,{write:d,abort:p,close:m,resetAnswer:f}=r,C=new pd;if(!i){this.logger.error("No stream ID found");return}let S=0,y,A=()=>{y&&!C.isActive(y)&&(F?.abort(),f(),v())},x=()=>{C.remove(y),y=hf(A,y,TF),C.add(y)},F=new a.AbortController,v=()=>Ri(EF(n,o,i),{method:"GET",fetch:h,headers:{Authorization:`Bearer ${l}`,accept:"*/*"},openWhenHidden:!0,signal:F?.signal,onopen(R){return _asyncToGenerator(function*(){if(R.ok&&R.headers.get("content-type")===kF)return;throw R.status>=400&&R.status<500&&R.status!==429?new Fi({message:"Error opening stream",code:R.status}):new dd})()},onmessage:R=>{if(F?.signal.aborted)return;let I=JSON.parse(R.data);if(I.finishReason==="ERROR"){C.remove(y),F?.abort(),p({message:I.errorMessage,code:I.statusCode});return}d(I),S=0,I.finishReason==="COMPLETED"?(C.remove(y),m()):x()},onerror:R=>{if(!F?.signal.aborted){if(C.remove(y),R instanceof Fi)throw F?.abort(),p(R),R;if(++S>Ff){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:md};throw F?.abort(),p(I),new Fi(I)}this.logger.info(`Retrying...(${S}/${Ff})`),f()}}});return v(),F}};s();u();c();var Ya=e=>e;s();u();c();s();u();c();var Vf=Ct(kf(),1);s();u();c();s();u();c();var nb="recommendation-internal-options",LV=Symbol.for(nb);var X=new Error("Failed to load reducers."),Xn=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var bn=class extends Error{constructor(r,n){super();Fe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};s();u();c();function qf(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Of(e){return typeof e!="object"||!e?!1:Object.values(e).every(ob)}function ob(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Df(e){return e===429}var Tt=class e{static call(t){return _asyncToGenerator(function*(){let r=ib(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...l}=o,d=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let p=yield h(i,l);if(Df(p.status))throw p;return p});return function d(){return _ref.apply(this,arguments)}}();try{let p=yield(0,Vf.backOff)(d,{retry:m=>{let f=m&&Df(m.status);return f&&n.info("Platform retrying request"),f}});switch(p.status){case 419:case 401:throw n.info("Platform renewing token"),new Xn;case 404:throw new bn(i,p.status);default:return n.info({response:p,requestInfo:o},"Platform response"),p}}catch(p){return p.message==="Failed to fetch"?new bn(i):p}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:l}=r,{signal:d,...p}=t,m=xi(p);try{let f=yield o(t,n,l);return{...t,...f}}catch(f){i.error(f,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Ie(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function nt(e,t="prod"){return`${Ie(e,t)}/rest/search/v2`}function Ja(e,t="prod"){return`${Ie(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function ib(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:l}=e,d=e.method==="POST"||e.method==="PUT",p=ab(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(d&&{body:p}),signal:l}}function ab(e,t){return t==="application/x-www-form-urlencoded"?Of(e)?qf(e):"":JSON.stringify(e)}s();u();c();s();u();c();function Ii(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Rd=e=>{let{response:t}=e;return t.body?sb(e):cb(t)},sb=e=>lb(e)?db(e):ub(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},cb=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function ub(e){return e.body.statusCode!==void 0}function lb(e){return e.body.exception!==void 0}var db=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});s();u();c();function Nf(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}s();u();c();var Fd=(e,t,r,n)=>{let o=new Tr(`${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 Mf=(e,t)=>{let r=new Tr(`${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},bd=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Tt.call({...Fd(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ii(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Nf(r),o=yield r.arrayBuffer(),l=new TextDecoder(n).decode(o);return pb(l)?{success:l}:{error:Rd({response:r,body:l})}});return function bd(_x4,_x5){return _ref2.apply(this,arguments)}}();function pb(e){return typeof e=="string"}s();u();c();s();u();c();function Zn(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Me(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Zn(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Zn(),extendedResults:{}}}s();u();c();s();u();c();function mb(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function fb(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function vn(e,t){if(t&&e.name==="AbortError")return{error:fb(e)};if(e instanceof bn)return{error:mb(e)};throw e}var kr=e=>e.success!==void 0,Ce=e=>e.error!==void 0;function Lf(e){return e.results!==void 0}function Qf(e){let t=Zn();return z(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}s();u();c();s();u();c();var vd=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,gb=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,wi=(e,t,r,n)=>{hb(e);let o=vd(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},Uf=(e,t,r)=>{yb(e);let n=gb(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},Id=e=>{let{insightId:t,...r}=Ii(e);return r},_f=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},hb=e=>{if(_f(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},yb=e=>{if(_f(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var Bf=e=>({...wi(e,"GET","application/json","/interface"),requestParams:{}});s();u();c();var jf=e=>({...wi(e,"POST","application/json","/search"),requestParams:Id(e)}),$f=e=>({...wi(e,"POST","application/json","/querysuggest"),requestParams:Id(e)});s();u();c();var Gf=e=>({...Uf(e,"POST","application/json"),requestParams:{objectId:e.userId}});var Xa=class{constructor(t){this.options=t}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield Tt.call({...Bf(t),..._this.options});if(r instanceof Error)return vn(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield Tt.call({...jf(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return vn(n);let o=yield n.json();return Lf(o)&&(o=Qf(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Tt.call({...$f(t),..._this3.options});if(r instanceof Error)return vn(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield Tt.call({...Gf(t),..._this4.options});if(r instanceof Error)return vn(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return bd(t,{..._this5.options})})()}};s();u();c();s();u();c();var U=new O({required:!0,emptyAllowed:!1}),fe=new O({required:!1,emptyAllowed:!1}),Ae=new O({required:!0,emptyAllowed:!0}),Hf=new O({required:!1,emptyAllowed:!0}),Za=new K({each:U,required:!0}),zf=new O({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),kt=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),At=(e,t)=>{if("required"in t)return{payload:new de({value:t}).validate({value:e}).value};let o=new M({options:{required:!0},values:t}).validate(e);if(o)throw new Rn(o);return{payload:e}},w=(e,t)=>{try{return At(e,t)}catch(r){return{payload:e,error:kt(r)}}},Bt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Wf(e,t,r,o,"Controller initialization error")},Le=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Wf(e,t,r,o,"Controller initialization error")},Wf=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};s();u();c();s();u();c();s();u();c();function je(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 Sb=typeof Symbol=="function"&&Symbol.observable||"@@observable",Yf=Sb,wd=()=>Math.random().toString(36).substring(7).split("").join("."),Cb={INIT:`@@redux/INIT${wd()}`,REPLACE:`@@redux/REPLACE${wd()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${wd()}`},es=Cb;function jt(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 Pd(e,t,r){if(typeof e!="function")throw new Error(je(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(je(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(je(1));return r(Pd)(e,t)}let n=e,o=t,i=new Map,l=i,d=0,p=!1;function m(){l===i&&(l=new Map,i.forEach((F,v)=>{l.set(v,F)}))}function f(){if(p)throw new Error(je(3));return o}function C(F){if(typeof F!="function")throw new Error(je(4));if(p)throw new Error(je(5));let v=!0;m();let R=d++;return l.set(R,F),function(){if(v){if(p)throw new Error(je(6));v=!1,m(),l.delete(R),i=null}}}function S(F){if(!jt(F))throw new Error(je(7));if(typeof F.type>"u")throw new Error(je(8));if(typeof F.type!="string")throw new Error(je(17));if(p)throw new Error(je(9));try{p=!0,o=n(o,F)}finally{p=!1}return(i=l).forEach(R=>{R()}),F}function y(F){if(typeof F!="function")throw new Error(je(10));n=F,S({type:es.REPLACE})}function A(){let F=C;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(je(11));function R(){let T=v;T.next&&T.next(f())}return R(),{unsubscribe:F(R)}},[Yf](){return this}}}return S({type:es.INIT}),{dispatch:S,subscribe:C,getState:f,replaceReducer:y,[Yf]:A}}function Ab(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:es.INIT})>"u")throw new Error(je(12));if(typeof r(void 0,{type:es.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(je(13))})}function eo(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,i;try{Ab(r)}catch(l){i=l}return function(d={},p){if(i)throw i;let m=!1,f={};for(let C=0;C<n.length;C++){let S=n[C],y=r[S],A=d[S],x=y(A,p);if(typeof x>"u"){let F=p&&p.type;throw new Error(je(14))}f[S]=x,m=m||x!==A}return m=m||n.length!==Object.keys(d).length,m?f:d}}function to(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Kf(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(je(15))},l={getState:o.getState,dispatch:(p,...m)=>i(p,...m)},d=e.map(p=>p(l));return i=to(...d)(o.dispatch),{...o,dispatch:i}}}function ts(e){return jt(e)&&"type"in e&&typeof e.type=="string"}s();u();c();var Ld=Symbol.for("immer-nothing"),Pi=Symbol.for("immer-draftable"),ot=Symbol.for("immer-state");function $e(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wn=Object.getPrototypeOf;function pt(e){return!!e&&!!e[ot]}function it(e){return e?tg(e)||Array.isArray(e)||!!e[Pi]||!!e.constructor?.[Pi]||Oi(e)||Di(e):!1}var xb=Object.prototype.constructor.toString();function tg(e){if(!e||typeof e!="object")return!1;let t=wn(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)===xb}function Qd(e){return pt(e)||$e(15,e),e[ot].base_}function Ei(e,t){Pn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Pn(e){let t=e[ot];return t?t.type_:Array.isArray(e)?1:Oi(e)?2:Di(e)?3:0}function Ti(e,t){return Pn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ed(e,t){return Pn(e)===2?e.get(t):e[t]}function rg(e,t,r){let n=Pn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Rb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Oi(e){return e instanceof Map}function Di(e){return e instanceof Set}function In(e){return e.copy_||e.base_}function qd(e,t){if(Oi(e))return new Map(e);if(Di(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=tg(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ot];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let l=o[i],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(wn(e),n)}else{let n=wn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function os(e,t=!1){return is(e)||pt(e)||!it(e)||(Pn(e)>1&&(e.set=e.add=e.clear=e.delete=Fb),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>os(n,!0))),e}function Fb(){$e(2)}function is(e){return Object.isFrozen(e)}var Od={};function En(e){let t=Od[e];return t||$e(0,e),t}function bb(e,t){Od[e]||(Od[e]=t)}var ki;function ng(){return ki}function vb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jf(e,t){t&&(En("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dd(e){Vd(e),e.drafts_.forEach(Ib),e.drafts_=null}function Vd(e){e===ki&&(ki=e.parent_)}function Xf(e){return ki=vb(ki,e)}function Ib(e){let t=e[ot];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Zf(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ot].modified_&&(Dd(t),$e(4)),it(e)&&(e=rs(t,e),t.parent_||ns(t,e)),t.patches_&&En("Patches").generateReplacementPatches_(r[ot].base_,e,t.patches_,t.inversePatches_)):e=rs(t,r,[]),Dd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ld?e:void 0}function rs(e,t,r){if(is(t))return t;let n=t[ot];if(!n)return Ei(t,(o,i)=>eg(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return ns(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,l=!1;n.type_===3&&(i=new Set(o),o.clear(),l=!0),Ei(i,(d,p)=>eg(e,n,o,d,p,r,l)),ns(e,o,!1),r&&e.patches_&&En("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function eg(e,t,r,n,o,i,l){if(pt(o)){let d=i&&t&&t.type_!==3&&!Ti(t.assigned_,n)?i.concat(n):void 0,p=rs(e,o,d);if(rg(r,n,p),pt(p))e.canAutoFreeze_=!1;else return}else l&&r.add(o);if(it(o)&&!is(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;rs(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&ns(e,o)}}function ns(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&os(t,r)}function wb(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ng(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=Ud;r&&(o=[n],i=qi);let{revoke:l,proxy:d}=Proxy.revocable(o,i);return n.draft_=d,n.revoke_=l,d}var Ud={get(e,t){if(t===ot)return e;let r=In(e);if(!Ti(r,t))return Pb(e,r,t);let n=r[t];return e.finalized_||!it(n)?n:n===Td(e.base_,t)?(kd(e),e.copy_[t]=Md(n,e)):n},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,r){let n=og(In(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Td(In(e),t),i=o?.[ot];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Rb(r,o)&&(r!==void 0||Ti(e.base_,t)))return!0;kd(e),Nd(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 Td(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,kd(e),Nd(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=In(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){$e(11)},getPrototypeOf(e){return wn(e.base_)},setPrototypeOf(){$e(12)}},qi={};Ei(Ud,(e,t)=>{qi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qi.deleteProperty=function(e,t){return qi.set.call(this,e,t,void 0)};qi.set=function(e,t,r){return Ud.set.call(this,e[0],t,r,e[0])};function Td(e,t){let r=e[ot];return(r?In(r):e)[t]}function Pb(e,t,r){let n=og(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function og(e,t){if(!(t in e))return;let r=wn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=wn(r)}}function Nd(e){e.modified_||(e.modified_=!0,e.parent_&&Nd(e.parent_))}function kd(e){e.copy_||(e.copy_=qd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Eb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let l=this;return function(p=i,...m){return l.produce(p,f=>r.call(this,f,...m))}}typeof r!="function"&&$e(6),n!==void 0&&typeof n!="function"&&$e(7);let o;if(it(t)){let i=Xf(this),l=Md(t,void 0),d=!0;try{o=r(l),d=!1}finally{d?Dd(i):Vd(i)}return Jf(i,n),Zf(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Ld&&(o=void 0),this.autoFreeze_&&os(o,!0),n){let i=[],l=[];En("Patches").generateReplacementPatches_(t,o,i,l),n(i,l)}return o}else $e(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){it(e)||$e(8),pt(e)&&(e=ig(e));let t=Xf(this),r=Md(e,void 0);return r[ot].isManual_=!0,Vd(t),r}finishDraft(e,t){let r=e&&e[ot];(!r||!r.isManual_)&&$e(9);let{scope_:n}=r;return Jf(n,t),Zf(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=En("Patches").applyPatches_;return pt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Md(e,t){let r=Oi(e)?En("MapSet").proxyMap_(e,t):Di(e)?En("MapSet").proxySet_(e,t):wb(e,t);return(t?t.scope_:ng()).drafts_.push(r),r}function ig(e){return pt(e)||$e(10,e),ag(e)}function ag(e){if(!it(e)||is(e))return e;let t=e[ot],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=qd(e,t.scope_.immer_.useStrictShallowCopy_)}else r=qd(e,!0);return Ei(r,(n,o)=>{rg(r,n,ag(o))}),t&&(t.finalized_=!1),r}function sg(){let t="replace",r="add",n="remove";function o(S,y,A,x){switch(S.type_){case 0:case 2:return l(S,y,A,x);case 1:return i(S,y,A,x);case 3:return d(S,y,A,x)}}function i(S,y,A,x){let{base_:F,assigned_:v}=S,R=S.copy_;R.length<F.length&&([F,R]=[R,F],[A,x]=[x,A]);for(let I=0;I<F.length;I++)if(v[I]&&R[I]!==F[I]){let T=y.concat([I]);A.push({op:t,path:T,value:C(R[I])}),x.push({op:t,path:T,value:C(F[I])})}for(let I=F.length;I<R.length;I++){let T=y.concat([I]);A.push({op:r,path:T,value:C(R[I])})}for(let I=R.length-1;F.length<=I;--I){let T=y.concat([I]);x.push({op:n,path:T})}}function l(S,y,A,x){let{base_:F,copy_:v}=S;Ei(S.assigned_,(R,I)=>{let T=Ed(F,R),N=Ed(v,R),k=I?Ti(F,R)?t:r:n;if(T===N&&k===t)return;let E=y.concat(R);A.push(k===n?{op:k,path:E}:{op:k,path:E,value:N}),x.push(k===r?{op:n,path:E}:k===n?{op:r,path:E,value:C(T)}:{op:t,path:E,value:C(T)})})}function d(S,y,A,x){let{base_:F,copy_:v}=S,R=0;F.forEach(I=>{if(!v.has(I)){let T=y.concat([R]);A.push({op:n,path:T,value:I}),x.unshift({op:r,path:T,value:I})}R++}),R=0,v.forEach(I=>{if(!F.has(I)){let T=y.concat([R]);A.push({op:r,path:T,value:I}),x.unshift({op:n,path:T,value:I})}R++})}function p(S,y,A,x){A.push({op:t,path:[],value:y===Ld?void 0:y}),x.push({op:t,path:[],value:S})}function m(S,y){return y.forEach(A=>{let{path:x,op:F}=A,v=S;for(let N=0;N<x.length-1;N++){let k=Pn(v),E=x[N];typeof E!="string"&&typeof E!="number"&&(E=""+E),(k===0||k===1)&&(E==="__proto__"||E==="constructor")&&$e(19),typeof v=="function"&&E==="prototype"&&$e(19),v=Ed(v,E),typeof v!="object"&&$e(18,x.join("/"))}let R=Pn(v),I=f(A.value),T=x[x.length-1];switch(F){case t:switch(R){case 2:return v.set(T,I);case 3:$e(16);default:return v[T]=I}case r:switch(R){case 1:return T==="-"?v.push(I):v.splice(T,0,I);case 2:return v.set(T,I);case 3:return v.add(I);default:return v[T]=I}case n:switch(R){case 1:return v.splice(T,1);case 2:return v.delete(T);case 3:return v.delete(A.value);default:return delete v[T]}default:$e(17,F)}}),S}function f(S){if(!it(S))return S;if(Array.isArray(S))return S.map(f);if(Oi(S))return new Map(Array.from(S.entries()).map(([A,x])=>[A,f(x)]));if(Di(S))return new Set(Array.from(S).map(f));let y=Object.create(wn(S));for(let A in S)y[A]=f(S[A]);return Ti(S,Pi)&&(y[Pi]=S[Pi]),y}function C(S){return pt(S)?f(S):S}bb("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:p})}var mt=new Eb,Cr=mt.produce,as=mt.produceWithPatches.bind(mt),eL=mt.setAutoFreeze.bind(mt),tL=mt.setUseStrictShallowCopy.bind(mt),_d=mt.applyPatches.bind(mt),rL=mt.createDraft.bind(mt),nL=mt.finishDraft.bind(mt);s();u();c();function Tb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function kb(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function qb(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 cg=e=>Array.isArray(e)?e:[e];function Ob(e){let t=Array.isArray(e[0])?e[0]:e;return qb(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Db(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var uL=Symbol();var lL=Object.getPrototypeOf({});var Vb=class{constructor(e){this.value=e}deref(){return this.value}},Nb=typeof WeakRef<"u"?WeakRef:Vb,Mb=0,ug=1;function ss(){return{s:Mb,v:void 0,o:null,p:null}}function ro(e,t={}){let r=ss(),{resultEqualityCheck:n}=t,o,i=0;function l(){let d=r,{length:p}=arguments;for(let C=0,S=p;C<S;C++){let y=arguments[C];if(typeof y=="function"||typeof y=="object"&&y!==null){let A=d.o;A===null&&(d.o=A=new WeakMap);let x=A.get(y);x===void 0?(d=ss(),A.set(y,d)):d=x}else{let A=d.p;A===null&&(d.p=A=new Map);let x=A.get(y);x===void 0?(d=ss(),A.set(y,d)):d=x}}let m=d,f;if(d.s===ug)f=d.v;else if(f=e.apply(null,arguments),i++,n){let C=o?.deref?.()??o;C!=null&&n(C,f)&&(f=C,i!==0&&i--),o=typeof f=="object"&&f!==null||typeof f=="function"?new Nb(f):f}return m.s=ug,m.v=f,f}return l.clearCache=()=>{r=ss(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function lg(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,l=0,d,p={},m=o.pop();typeof m=="object"&&(p=m,m=o.pop()),Tb(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let f={...r,...p},{memoize:C,memoizeOptions:S=[],argsMemoize:y=ro,argsMemoizeOptions:A=[],devModeChecks:x={}}=f,F=cg(S),v=cg(A),R=Ob(o),I=C(function(){return i++,m.apply(null,arguments)},...F),T=!0,N=y(function(){l++;let E=Db(R,arguments);return d=I.apply(null,E),d},...v);return Object.assign(N,{resultFunc:m,memoizedResultFunc:I,dependencies:R,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>d,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:C,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var se=lg(ro),Lb=Object.assign((e,t=se)=>{kb(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((l,d,p)=>(l[r[p]]=d,l),{}))},{withTypes:()=>Lb});s();u();c();function dg(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var pg=dg(),mg=dg;var Qb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?to:to.apply(null,arguments)},IL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Ub=e=>e&&typeof e.match=="function";function b(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(qt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ts(n)&&n.type===e,r}var Sg=class Vi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Vi.prototype)}static get[Symbol.species](){return Vi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Vi(...t[0].concat(this)):new Vi(...t.concat(this))}};function fg(e){return it(e)?Cr(e,()=>{}):e}function gg(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function _b(e){return typeof e=="boolean"}var Bb=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},l=new Sg;return r&&(_b(r)?l.push(pg):l.push(mg(r.extraArgument))),l},qr="RTK_autoBatch",oo=()=>e=>({payload:e,meta:{[qr]:!0}}),hg=e=>t=>{setTimeout(t,e)},jb=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,l=!1,d=new Set,p=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:hg(10):e.type==="callback"?e.queueNotification:hg(e.timeout),m=()=>{l=!1,i&&(i=!1,d.forEach(f=>f()))};return Object.assign({},n,{subscribe(f){let C=()=>o&&f(),S=n.subscribe(C);return d.add(f),()=>{S(),d.delete(f)}},dispatch(f){try{return o=!f?.meta?.[qr],i=!o,i&&(l||(l=!0,p(m))),n.dispatch(f)}finally{o=!0}}})},$b=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Sg(e);return n&&o.push(jb(typeof n=="object"?n:void 0)),o};function Cg(e){let t=Bb(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:l=void 0}=e||{},d;if(typeof r=="function")d=r;else if(jt(r))d=eo(r);else throw new Error(qt(1));let p;typeof n=="function"?p=n(t):p=t();let m=to;o&&(m=Qb({trace:!1,...(typeof o=="object"&&o)}));let f=Kf(...p),C=$b(f),S=typeof l=="function"?l(C):C(),y=m(...S);return Pd(d,i,y)}function Ag(e){let t={},r=[],n,o={addCase(i,l){let d=typeof i=="string"?i:i.type;if(!d)throw new Error(qt(28));if(d in t)throw new Error(qt(29));return t[d]=l,o},addMatcher(i,l){return r.push({matcher:i,reducer:l}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function Gb(e){return typeof e=="function"}function re(e,t){let[r,n,o]=Ag(t),i;if(Gb(e))i=()=>fg(e());else{let d=fg(e);i=()=>d}function l(d=i(),p){let m=[r[p.type],...n.filter(({matcher:f})=>f(p)).map(({reducer:f})=>f)];return m.filter(f=>!!f).length===0&&(m=[o]),m.reduce((f,C)=>{if(C)if(pt(f)){let y=C(f,p);return y===void 0?f:y}else{if(it(f))return Cr(f,S=>C(S,p));{let S=C(f,p);if(S===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return f},d)}return l.getInitialState=i,l}var xg=(e,t)=>Ub(e)?e.match(t):e(t);function $t(...e){return t=>e.some(r=>xg(r,t))}function no(...e){return t=>e.every(r=>xg(r,t))}function us(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 Ni(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ls(...e){return e.length===0?t=>us(t,["pending"]):Ni(e)?$t(...e.map(t=>t.pending)):ls()(e[0])}function Tn(...e){return e.length===0?t=>us(t,["rejected"]):Ni(e)?$t(...e.map(t=>t.rejected)):Tn()(e[0])}function Mi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?no(Tn(...e),t):Ni(e)?no(Tn(...e),t):Mi()(e[0])}function Ar(...e){return e.length===0?t=>us(t,["fulfilled"]):Ni(e)?$t(...e.map(t=>t.fulfilled)):Ar()(e[0])}function ds(...e){return e.length===0?t=>us(t,["pending","fulfilled","rejected"]):Ni(e)?$t(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ds()(e[0])}var Hb="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ps=(e=21)=>{let t="",r=e;for(;r--;)t+=Hb[Math.random()*64|0];return t},zb=["name","message","stack","code"],Bd=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},yg=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},Wb=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of zb)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},J=(()=>{function e(t,r,n){let o=b(t+"/fulfilled",(p,m,f,C)=>({payload:p,meta:{...(C||{}),arg:f,requestId:m,requestStatus:"fulfilled"}})),i=b(t+"/pending",(p,m,f)=>({payload:void 0,meta:{...(f||{}),arg:m,requestId:p,requestStatus:"pending"}})),l=b(t+"/rejected",(p,m,f,C,S)=>({payload:C,error:(n&&n.serializeError||Wb)(p||"Rejected"),meta:{...(S||{}),arg:f,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:p?.name==="AbortError",condition:p?.name==="ConditionError"}}));function d(p){return(m,f,C)=>{let S=n?.idGenerator?n.idGenerator(p):ps(),y=new a.AbortController,A,x;function F(R){x=R,y.abort()}let v=_asyncToGenerator(function*(){let R;try{let T=n?.condition?.(p,{getState:f,extra:C});if(Kb(T)&&(T=yield T),T===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((k,E)=>{A=()=>{E({name:"AbortError",message:x||"Aborted"})},y.signal.addEventListener("abort",A)});m(i(S,p,n?.getPendingMeta?.({requestId:S,arg:p},{getState:f,extra:C}))),R=yield Promise.race([N,Promise.resolve(r(p,{dispatch:m,getState:f,extra:C,requestId:S,signal:y.signal,abort:F,rejectWithValue:(k,E)=>new Bd(k,E),fulfillWithValue:(k,E)=>new yg(k,E)})).then(k=>{if(k instanceof Bd)throw k;return k instanceof yg?o(k.payload,S,p,k.meta):o(k,S,p)})])}catch(T){R=T instanceof Bd?l(null,S,p,T.payload,T.meta):l(T,S,p)}finally{A&&y.signal.removeEventListener("abort",A)}return n&&!n.dispatchConditionRejection&&l.match(R)&&R.meta.condition||m(R),R})();return Object.assign(v,{abort:F,requestId:S,arg:p,unwrap(){return v.then(Yb)}})}}return Object.assign(d,{pending:i,rejected:l,fulfilled:o,settled:$t(l,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Yb(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Kb(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Rg=Symbol.for("rtk-slice-createasyncthunk"),kL={[Rg]:J};function Jb(e,t){return`${e}/${t}`}function Xb({creators:e}={}){let t=e?.asyncThunk?.[Rg];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(qt(11));typeof process<"u";let l=(typeof n.reducers=="function"?n.reducers(ev()):n.reducers)||{},d=Object.keys(l),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(R,I){let T=typeof R=="string"?R:R.type;if(!T)throw new Error(qt(12));if(T in p.sliceCaseReducersByType)throw new Error(qt(13));return p.sliceCaseReducersByType[T]=I,m},addMatcher(R,I){return p.sliceMatchers.push({matcher:R,reducer:I}),m},exposeAction(R,I){return p.actionCreators[R]=I,m},exposeCaseReducer(R,I){return p.sliceCaseReducersByName[R]=I,m}};d.forEach(R=>{let I=l[R],T={reducerName:R,type:Jb(o,R),createNotation:typeof n.reducers=="function"};rv(I)?ov(T,I,m,t):tv(T,I,m)});function f(){let[R={},I=[],T=void 0]=typeof n.extraReducers=="function"?Ag(n.extraReducers):[n.extraReducers],N={...R,...p.sliceCaseReducersByType};return re(n.initialState,k=>{for(let E in N)k.addCase(E,N[E]);for(let E of p.sliceMatchers)k.addMatcher(E.matcher,E.reducer);for(let E of I)k.addMatcher(E.matcher,E.reducer);T&&k.addDefaultCase(T)})}let C=R=>R,S=new Map,y;function A(R,I){return y||(y=f()),y(R,I)}function x(){return y||(y=f()),y.getInitialState()}function F(R,I=!1){function T(k){let E=k[R];return typeof E>"u"&&I&&(E=x()),E}function N(k=C){let E=gg(S,I,()=>new WeakMap);return gg(E,k,()=>{let V={};for(let[D,B]of Object.entries(n.selectors??{}))V[D]=Zb(B,k,x,I);return V})}return{reducerPath:R,getSelectors:N,get selectors(){return N(T)},selectSlice:T}}let v={name:o,reducer:A,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:x,...F(i),injectInto(R,{reducerPath:I,...T}={}){let N=I??i;return R.inject({reducerPath:N,reducer:A},T),{...v,...F(N,!0)}}};return v}}function Zb(e,t,r,n){function o(i,...l){let d=t(i);return typeof d>"u"&&n&&(d=r()),e(d,...l)}return o.unwrapped=e,o}var kn=Xb();function ev(){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 tv({type:e,reducerName:t,createNotation:r},n,o){let i,l;if("reducer"in n){if(r&&!nv(n))throw new Error(qt(17));i=n.reducer,l=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,l?b(e,l):b(e))}function rv(e){return e._reducerDefinitionType==="asyncThunk"}function nv(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ov({type:e,reducerName:t},r,n,o){if(!o)throw new Error(qt(18));let{payloadCreator:i,fulfilled:l,pending:d,rejected:p,settled:m,options:f}=r,C=o(e,i,f);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||cs,pending:d||cs,rejected:p||cs,settled:m||cs})}function cs(){}var Fg="listener",bg="completed",vg="cancelled",qL=`task-${vg}`,OL=`task-${bg}`,DL=`${Fg}-${vg}`,VL=`${Fg}-${bg}`;var{assign:Ig}=Object;var jd="listenerMiddleware";var iv=Ig(b(`${jd}/add`),{withTypes:()=>iv}),NL=b(`${jd}/removeAll`),av=Ig(b(`${jd}/remove`),{withTypes:()=>av});var ML=Symbol.for("rtk-state-proxy-original");function qt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}s();u();c();s();u();c();function sv({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:l}=e;l!=="disabled"&&(n.call(r),t.send(o,i,r))}var cv=/^(?:[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 uv(e){return typeof e=="string"&&cv.test(e)}var Ge=[];for(ms=0;ms<256;++ms)Ge.push((ms+256).toString(16).slice(1));var ms;function lv(e,t=0){return(Ge[e[t+0]]+Ge[e[t+1]]+Ge[e[t+2]]+Ge[e[t+3]]+"-"+Ge[e[t+4]]+Ge[e[t+5]]+"-"+Ge[e[t+6]]+Ge[e[t+7]]+"-"+Ge[e[t+8]]+Ge[e[t+9]]+"-"+Ge[e[t+10]]+Ge[e[t+11]]+Ge[e[t+12]]+Ge[e[t+13]]+Ge[e[t+14]]+Ge[e[t+15]]).toLowerCase()}var fs,dv=new Uint8Array(16);function pv(){if(!fs&&(fs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fs(dv)}var mv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wg={randomUUID:mv};function fv(e,t,r){if(wg.randomUUID&&!t&&!e)return wg.randomUUID();e=e||{};var n=e.random||(e.rng||pv)();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 lv(n)}function gv(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),i=o&&uv(o)?o:r.generateUUID();return n.setItem(t,i),i}}}var Eg="0.8.1";function hv(e){let{trackingId:t}=e;return{trackingId:t}}function yv(e){return(e.source||[]).concat([`relay@${Eg}`])}function Tg(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:l}=r,d=hv(t),p=n.getClientId();return Object.freeze({type:e,config:d,ts:Date.now(),source:yv(t),clientId:p,userAgent:l(),referrer:o(),location:i()})}function Sv(e,t,r,n,o){return{...t,meta:Tg(e,r,n,o)}}var Cv="*";function Av(){let e=[];function t({type:p,callback:m}){return e.findIndex(f=>f.type===p&&f.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(f){console.error(f)}})}function i(p){if(p===Cv)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}):i(p)}return{add:n,call:o,remove:d}}function Pg({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 xv(e){let t=Pg(e);return{get:()=>t,update:r=>{t=Pg({...t,...r})}}}function Rv(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var $d=Fv();function Fv(){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 i of o){let l=i.replace(/^\s+/,"");if(l.lastIndexOf(n,0)===0)return l.substring(n.length,l.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),l=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,d=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${l}${d};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function bv(){return{getItem(e){return $d.getItem(e)||localStorage.getItem(e)},removeItem(e){$d.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),$d.setItem(e,t,31556952e3)}}}function vv(){let e=document.referrer;return e===""?null:e}function Iv(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Rv().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:()=>vv(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>fv(),storage:bv()}}function wv(){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 Pv(){return{getItem(){return null},removeItem(){},setItem(){}}}function Ev(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Pv()}}function Tv(e){return e.get().mode!=="disabled"&&kv()&&wv()?Iv():Ev()}function kv(){try{return typeof window=="object"}catch{return!1}}function qv(e){return{get:()=>Object.freeze(Tv(e))}}function kg(e){let t=xv(e),r=Av(),n=qv(t),o=gv(n);return{emit:(i,l)=>{let d=t.get(),p=n.get(),m=Sv(i,l,d,p,o);return sv({config:d,environment:p,event:m,listenerManager:r})},getMeta:i=>Tg(i,t.get(),n.get(),o),on:(i,l)=>r.add({type:i,callback:l}),off:(i,l)=>r.remove(i,l),updateConfig:i=>t.update(i),version:Eg}}s();u();c();s();u();c();var io="3.13.1",qg=["@coveo/atomic","@coveo/quantic"];var Gt=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${io}`));var ao=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Gt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},l)=>kg({mode:i?"emit":"disabled",url:o??Ja(e,t),token:r,trackingId:n,source:l}));s();u();c();s();u();c();function Ht(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(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function d(f){try{m(n.next(f))}catch(C){l(C)}}function p(f){try{m(n.throw(f))}catch(C){l(C)}}function m(f){f.done?i(f.value):o(f.value).then(d,p)}m((n=n.apply(e,t||[])).next())})}var pe;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(pe||(pe={}));function zd(){return typeof window<"u"}function sp(){return typeof navigator<"u"}function so(){return typeof document<"u"}function Wd(){try{return typeof localStorage<"u"}catch{return!1}}function Ov(){try{return typeof sessionStorage<"u"}catch{return!1}}function Gg(){return sp()&&navigator.cookieEnabled}var Dv=[pe.click,pe.custom,pe.search,pe.view],Vv=(e,t)=>Dv.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:sp()?navigator.userAgent:"unknown"},t):t,Ui=class e{static set(t,r,n){var o,i,l,d;n&&(i=new Date,i.setTime(i.getTime()+n)),d=window.location.hostname,d.indexOf(".")===-1?Og(t,r,i):(l=d.split("."),o=l[l.length-2]+"."+l[l.length-1],Og(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Og(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Nv(){return Wd()?localStorage:Gg()?new _i:Ov()?sessionStorage:new uo}var _i=class e{getItem(t){return Ui.get(`${e.prefix}${t}`)}removeItem(t){Ui.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ui.set(`${e.prefix}${t}`,r,n)}};_i.prefix="coveo_";var Yd=class{constructor(){this.cookieStorage=new _i}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Li="__coveo.analytics.history",Hg=20,zg=1e3*60,Wg=75,lo=class{constructor(t){this.store=t||Nv()}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(Li);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(Li);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Li,JSON.stringify(t.slice(0,Hg)))}catch{}}clear(){try{this.store.removeItem(Li)}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,Wg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>zg:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},Yg=Object.freeze({__proto__:null,HistoryStore:lo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Hg,MAX_VALUE_SIZE:Wg,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:zg,STORE_KEY:Li,default:lo}),Mv=(e,t)=>q(void 0,void 0,void 0,function*(){return e===pe.view?(yield Lv(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Lv=e=>q(void 0,void 0,void 0,function*(){let t=new lo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),gs,Qv=new Uint8Array(16);function Uv(){if(!gs&&(gs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gs(Qv)}var _v=/^(?:[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 ys(e){return typeof e=="string"&&_v.test(e)}var He=[];for(let e=0;e<256;++e)He.push((e+256).toString(16).slice(1));function Kg(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()}function Bv(e){if(!ys(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 jv(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var $v="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Gv="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Hv(e,t,r){function n(o,i,l,d){var p;if(typeof o=="string"&&(o=jv(o)),typeof i=="string"&&(i=Bv(i)),((p=i)===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(i),m.set(o,i.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,l){d=d||0;for(let f=0;f<16;++f)l[d+f]=m[f];return l}return Kg(m)}try{n.name=e}catch{}return n.DNS=$v,n.URL=Gv,n}var zv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Dg={randomUUID:zv};function qn(e,t,r){if(Dg.randomUUID&&!t&&!e)return Dg.randomUUID();e=e||{};let n=e.random||(e.rng||Uv)();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 Kg(n)}function Wv(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 Gd(e,t){return e<<t|e>>>32-t}function Yv(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),i=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];i[l]=d}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let l=0;l<o;++l){let d=new Uint32Array(80);for(let y=0;y<16;++y)d[y]=i[l][y];for(let y=16;y<80;++y)d[y]=Gd(d[y-3]^d[y-8]^d[y-14]^d[y-16],1);let p=r[0],m=r[1],f=r[2],C=r[3],S=r[4];for(let y=0;y<80;++y){let A=Math.floor(y/20),x=Gd(p,5)+Wv(A,m,f,C)+S+t[A]+d[y]>>>0;S=C,C=f,f=Gd(m,30)>>>0,m=p,p=x}r[0]=r[0]+p>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Kv=Hv("v5",80,Yv),Vg=Kv,Jg="2.30.42",Ng=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Qi={pageview:"pageview",event:"event"},Ss=class{constructor({client:t,uuidGenerator:r=qn}){this.client=t,this.uuidGenerator=r}},Kd=class extends Ss{constructor({client:t,uuidGenerator:r=qn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Ng(window.location),this.lastReferrer=so()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Qi.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Qi.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Qi.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Qi.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 Ng(window.location)}},Or=class e{constructor(t,r){if(!ys(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return ys(i)?new e(i,Number.parseInt(o)*1e3):null}};Or.cvo_cid="cvo_cid";Or.expirationTime=120;var Jd=class extends Ss{constructor({client:t,uuidGenerator:r=qn}){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(Or.cvo_cid,new Or(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Jd.Id="link";var Rt=Object.keys;function hs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Hd=128,Xg=192,Mg=224,Lg=240;function Jv(e){return(e&248)===Lg?4:(e&Lg)===Mg?3:(e&Mg)===Xg?2:1}function Xv(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&Hd)!=Hd)break;if(r-=3,(n&Xg)!=Hd){t-r>=Jv(n)*3&&(r=t);break}}return e.substring(0,r)}var Xd={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"},Zv=Rt(Xd).map(e=>Xd[e]),eI=[...Zv].join("|"),tI=new RegExp(`^(${eI}$)`),rI={svcAction:"svc_action",svcActionData:"svc_action_data"},nI=e=>Rt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Xd[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),oI=e=>tI.test(e),iI=[oI],Qg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Ug={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ye={action:"pa",list:"pal",listSource:"pls"},Cs={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},aI=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Zd={id:"quoteId",affiliation:"quoteAffiliation"},ep={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},sI={add:Ye,bookmark_add:Ye,bookmark_remove:Ye,click:Ye,checkout:Ye,checkout_option:Ye,detail:Ye,impression:Ye,remove:Ye,refund:Object.assign(Object.assign({},Ye),Cs),purchase:Object.assign(Object.assign({},Ye),Cs),quickview:Ye,quote:Object.assign(Object.assign({},Ye),Zd),review:Object.assign(Object.assign({},Ye),ep)},cI=Rt(Qg).map(e=>Qg[e]),uI=Rt(Ug).map(e=>Ug[e]),lI=Rt(Ye).map(e=>Ye[e]),dI=Rt(Cs).map(e=>Cs[e]),pI=Rt(ep).map(e=>ep[e]),mI=Rt(Zd).map(e=>Zd[e]),fI=[...cI,"custom"].join("|"),gI=[...uI,"custom"].join("|"),Zg="(pr[0-9]+)",eh="(il[0-9]+pi[0-9]+)",hI=new RegExp(`^${Zg}(${fI})$`),yI=new RegExp(`^(${eh}(${gI}))|(il[0-9]+nm)$`),SI=new RegExp(`^(${lI.join("|")})$`),CI=new RegExp(`^(${dI.join("|")})$`),AI=new RegExp(`^${Zg}custom$`),xI=new RegExp(`^${eh}custom$`),RI=new RegExp(`^(${[...aI,...pI,...mI].join("|")})$`),FI=e=>hI.test(e),bI=e=>yI.test(e),vI=e=>SI.test(e),II=e=>CI.test(e),wI=e=>RI.test(e),PI=[bI,FI,vI,II,wI],EI=[AI,xI],TI={anonymizeIp:"aip"},kI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},qI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},OI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],DI=Object.assign(Object.assign(Object.assign(Object.assign({},TI),kI),qI),OI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),tp=Object.assign(Object.assign({},DI),rI),VI=e=>{let t=!!e.action&&sI[e.action]||{};return Rt(e).reduce((r,n)=>{let o=t[n]||tp[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},NI=Rt(tp).map(e=>tp[e]),MI=e=>NI.indexOf(e)!==-1,LI=e=>e==="custom",QI=e=>[...PI,...iI,MI,LI].some(t=>t(e)),UI=e=>Rt(e).reduce((t,r)=>{let n=_I(r);return n?Object.assign(Object.assign({},t),BI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),_I=e=>{let t;return[...EI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},BI=(e,t)=>Rt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),rp=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,i=yield this.getQueryParamsForEventType(t),{url:l,payload:d}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,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,i=r;if(n){let l=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:d,body:p}=l;o=d||t;try{i=JSON.parse(p)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return 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(i=>!!i).join("&")})}isEventTypeLegacy(t){return[pe.click,pe.custom,pe.search,pe.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}},np=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()})}},_g=g.fetch,As=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=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),i?yield i(d,"analyticsFetch"):{}),{url:m}=p,f=Ht(p,["url"]),C;try{C=yield _g(m,f)}catch(S){console.error("An error has occured when sending the event.",S);return}if(C.ok){let S=yield C.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}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 _g(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[pe.click,pe.custom,pe.search,pe.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"})}},op=class{constructor(t,r){Wd()&&Gg()?this.storage=new Yd:Wd()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new As(t),this.beaconClient=new rp(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},ip=class{constructor(t,r){this.storage=r||new uo,this.client=new As(t)}getClientDependingOnEventType(t){return this.client}},xs=class{constructor(){this.storage=new uo,this.client=new np}getClientDependingOnEventType(t){return this.client}},jI="xx",$I=e=>e?.startsWith(jI)||!1,GI=`
26
+ `+f:f;break;case"event":n.event=f;break;case"id":e(n.id=f);break;case"retry":let C=parseInt(f,10);isNaN(C)||t(n.retry=C);break}}}}function vF(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function yf(){return{data:"",event:"",id:"",retry:void 0}}var IF=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},za="text/event-stream",wF=1e3,xf="last-event-id";function Rf(){typeof window<"u"}function Ri(e,t){var{signal:r,headers:n,onopen:o,onmessage:i,onclose:l,onerror:d,openWhenHidden:p,fetch:m}=t,f=IF(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((C,S)=>{let y=Object.assign({},n);y.accept||(y.accept=za);let A;function x(){A?.abort(),document.hidden||N()}!p&&Rf()&&document.addEventListener("visibilitychange",x);let F=wF,v=0;function R(){Rf()&&document.removeEventListener("visibilitychange",x),clearTimeout(v),A?.abort()}r?.addEventListener("abort",()=>{R(),C()});let I=m??I,T=o??PF;function N(){return _N.apply(this,arguments)}function _N(){_N=_asyncToGenerator(function*(){var k;A=typeof a.AbortController>"u"?null:new a.AbortController;try{let E=yield I(e,Object.assign(Object.assign({},f),{headers:y,signal:A?.signal}));yield T(E),yield Sf(E.body,Cf(Af(V=>{V?y[xf]=V:delete y[xf]},V=>{F=V},i))),l?.(),R(),C()}catch(E){if(!A?.signal.aborted)try{let V=(k=d?.(E))!==null&&k!==void 0?k:F;clearTimeout(v),v=setTimeout(N,V)}catch(V){R(),S(V)}}});return _N.apply(this,arguments)}N()})}function PF(e){let t=e.headers.get("content-type");if(!t?.startsWith(za))throw new Error(`Expected content-type to be ${za}, Actual: ${t}`)}s();u();c();var Tr=class{constructor(t){Fe(this,"_basePath");Fe(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 EF=(e,t,r)=>new Tr(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Ff=3,TF=5e3,kF="text/event-stream",md=1,dd=class extends Error{},Fi=class extends Error{constructor(r){super(r.message);this.payload=r}},pd=class{constructor(){Fe(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)}},Wa=class{constructor(t){Fe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:l}=t,{write:d,abort:p,close:m,resetAnswer:f}=r,C=new pd;if(!i){this.logger.error("No stream ID found");return}let S=0,y,A=()=>{y&&!C.isActive(y)&&(F?.abort(),f(),v())},x=()=>{C.remove(y),y=hf(A,y,TF),C.add(y)},F=new a.AbortController,v=()=>Ri(EF(n,o,i),{method:"GET",fetch:h,headers:{Authorization:`Bearer ${l}`,accept:"*/*"},openWhenHidden:!0,signal:F?.signal,onopen(R){return _asyncToGenerator(function*(){if(R.ok&&R.headers.get("content-type")===kF)return;throw R.status>=400&&R.status<500&&R.status!==429?new Fi({message:"Error opening stream",code:R.status}):new dd})()},onmessage:R=>{if(F?.signal.aborted)return;let I=JSON.parse(R.data);if(I.finishReason==="ERROR"){C.remove(y),F?.abort(),p({message:I.errorMessage,code:I.statusCode});return}d(I),S=0,I.finishReason==="COMPLETED"?(C.remove(y),m()):x()},onerror:R=>{if(!F?.signal.aborted){if(C.remove(y),R instanceof Fi)throw F?.abort(),p(R),R;if(++S>Ff){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:md};throw F?.abort(),p(I),new Fi(I)}this.logger.info(`Retrying...(${S}/${Ff})`),f()}}});return v(),F}};s();u();c();var Ya=e=>e;s();u();c();s();u();c();var Vf=Ct(kf(),1);s();u();c();s();u();c();var nb="recommendation-internal-options",LV=Symbol.for(nb);var X=new Error("Failed to load reducers."),Xn=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var bn=class extends Error{constructor(r,n){super();Fe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};s();u();c();function qf(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Of(e){return typeof e!="object"||!e?!1:Object.values(e).every(ob)}function ob(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Df(e){return e===429}var Tt=class e{static call(t){return _asyncToGenerator(function*(){let r=ib(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...l}=o,d=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let p=yield h(i,l);if(Df(p.status))throw p;return p});return function d(){return _ref.apply(this,arguments)}}();try{let p=yield(0,Vf.backOff)(d,{retry:m=>{let f=m&&Df(m.status);return f&&n.info("Platform retrying request"),f}});switch(p.status){case 419:case 401:throw n.info("Platform renewing token"),new Xn;case 404:throw new bn(i,p.status);default:return n.info({response:p,requestInfo:o},"Platform response"),p}}catch(p){return p.message==="Failed to fetch"?new bn(i):p}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:l}=r,{signal:d,...p}=t,m=xi(p);try{let f=yield o(t,n,l);return{...t,...f}}catch(f){i.error(f,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Ie(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function nt(e,t="prod"){return`${Ie(e,t)}/rest/search/v2`}function Ja(e,t="prod"){return`${Ie(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function ib(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:l}=e,d=e.method==="POST"||e.method==="PUT",p=ab(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(d&&{body:p}),signal:l}}function ab(e,t){return t==="application/x-www-form-urlencoded"?Of(e)?qf(e):"":JSON.stringify(e)}s();u();c();s();u();c();function Ii(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Rd=e=>{let{response:t}=e;return t.body?sb(e):cb(t)},sb=e=>lb(e)?db(e):ub(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},cb=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function ub(e){return e.body.statusCode!==void 0}function lb(e){return e.body.exception!==void 0}var db=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});s();u();c();function Nf(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}s();u();c();var Fd=(e,t,r,n)=>{let o=new Tr(`${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 Mf=(e,t)=>{let r=new Tr(`${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},bd=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Tt.call({...Fd(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ii(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Nf(r),o=yield r.arrayBuffer(),l=new TextDecoder(n).decode(o);return pb(l)?{success:l}:{error:Rd({response:r,body:l})}});return function bd(_x4,_x5){return _ref2.apply(this,arguments)}}();function pb(e){return typeof e=="string"}s();u();c();s();u();c();function Zn(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Me(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Zn(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Zn(),extendedResults:{}}}s();u();c();s();u();c();function mb(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function fb(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function vn(e,t){if(t&&e.name==="AbortError")return{error:fb(e)};if(e instanceof bn)return{error:mb(e)};throw e}var kr=e=>e.success!==void 0,Ce=e=>e.error!==void 0;function Lf(e){return e.results!==void 0}function Qf(e){let t=Zn();return z(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}s();u();c();s();u();c();var vd=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,gb=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,wi=(e,t,r,n)=>{hb(e);let o=vd(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},Uf=(e,t,r)=>{yb(e);let n=gb(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},Id=e=>{let{insightId:t,...r}=Ii(e);return r},_f=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},hb=e=>{if(_f(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},yb=e=>{if(_f(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var Bf=e=>({...wi(e,"GET","application/json","/interface"),requestParams:{}});s();u();c();var jf=e=>({...wi(e,"POST","application/json","/search"),requestParams:Id(e)}),$f=e=>({...wi(e,"POST","application/json","/querysuggest"),requestParams:Id(e)});s();u();c();var Gf=e=>({...Uf(e,"POST","application/json"),requestParams:{objectId:e.userId}});var Xa=class{constructor(t){this.options=t}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield Tt.call({...Bf(t),..._this.options});if(r instanceof Error)return vn(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield Tt.call({...jf(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return vn(n);let o=yield n.json();return Lf(o)&&(o=Qf(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Tt.call({...$f(t),..._this3.options});if(r instanceof Error)return vn(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield Tt.call({...Gf(t),..._this4.options});if(r instanceof Error)return vn(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return bd(t,{..._this5.options})})()}};s();u();c();s();u();c();var U=new O({required:!0,emptyAllowed:!1}),fe=new O({required:!1,emptyAllowed:!1}),Ae=new O({required:!0,emptyAllowed:!0}),Hf=new O({required:!1,emptyAllowed:!0}),Za=new K({each:U,required:!0}),zf=new O({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),kt=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),At=(e,t)=>{if("required"in t)return{payload:new de({value:t}).validate({value:e}).value};let o=new M({options:{required:!0},values:t}).validate(e);if(o)throw new Rn(o);return{payload:e}},w=(e,t)=>{try{return At(e,t)}catch(r){return{payload:e,error:kt(r)}}},Bt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Wf(e,t,r,o,"Controller initialization error")},Le=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Wf(e,t,r,o,"Controller initialization error")},Wf=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};s();u();c();s();u();c();s();u();c();function je(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 Sb=typeof Symbol=="function"&&Symbol.observable||"@@observable",Yf=Sb,wd=()=>Math.random().toString(36).substring(7).split("").join("."),Cb={INIT:`@@redux/INIT${wd()}`,REPLACE:`@@redux/REPLACE${wd()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${wd()}`},es=Cb;function jt(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 Pd(e,t,r){if(typeof e!="function")throw new Error(je(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(je(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(je(1));return r(Pd)(e,t)}let n=e,o=t,i=new Map,l=i,d=0,p=!1;function m(){l===i&&(l=new Map,i.forEach((F,v)=>{l.set(v,F)}))}function f(){if(p)throw new Error(je(3));return o}function C(F){if(typeof F!="function")throw new Error(je(4));if(p)throw new Error(je(5));let v=!0;m();let R=d++;return l.set(R,F),function(){if(v){if(p)throw new Error(je(6));v=!1,m(),l.delete(R),i=null}}}function S(F){if(!jt(F))throw new Error(je(7));if(typeof F.type>"u")throw new Error(je(8));if(typeof F.type!="string")throw new Error(je(17));if(p)throw new Error(je(9));try{p=!0,o=n(o,F)}finally{p=!1}return(i=l).forEach(R=>{R()}),F}function y(F){if(typeof F!="function")throw new Error(je(10));n=F,S({type:es.REPLACE})}function A(){let F=C;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(je(11));function R(){let T=v;T.next&&T.next(f())}return R(),{unsubscribe:F(R)}},[Yf](){return this}}}return S({type:es.INIT}),{dispatch:S,subscribe:C,getState:f,replaceReducer:y,[Yf]:A}}function Ab(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:es.INIT})>"u")throw new Error(je(12));if(typeof r(void 0,{type:es.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(je(13))})}function eo(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,i;try{Ab(r)}catch(l){i=l}return function(d={},p){if(i)throw i;let m=!1,f={};for(let C=0;C<n.length;C++){let S=n[C],y=r[S],A=d[S],x=y(A,p);if(typeof x>"u"){let F=p&&p.type;throw new Error(je(14))}f[S]=x,m=m||x!==A}return m=m||n.length!==Object.keys(d).length,m?f:d}}function to(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Kf(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(je(15))},l={getState:o.getState,dispatch:(p,...m)=>i(p,...m)},d=e.map(p=>p(l));return i=to(...d)(o.dispatch),{...o,dispatch:i}}}function ts(e){return jt(e)&&"type"in e&&typeof e.type=="string"}s();u();c();var Ld=Symbol.for("immer-nothing"),Pi=Symbol.for("immer-draftable"),ot=Symbol.for("immer-state");function $e(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wn=Object.getPrototypeOf;function pt(e){return!!e&&!!e[ot]}function it(e){return e?tg(e)||Array.isArray(e)||!!e[Pi]||!!e.constructor?.[Pi]||Oi(e)||Di(e):!1}var xb=Object.prototype.constructor.toString();function tg(e){if(!e||typeof e!="object")return!1;let t=wn(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)===xb}function Qd(e){return pt(e)||$e(15,e),e[ot].base_}function Ei(e,t){Pn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Pn(e){let t=e[ot];return t?t.type_:Array.isArray(e)?1:Oi(e)?2:Di(e)?3:0}function Ti(e,t){return Pn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ed(e,t){return Pn(e)===2?e.get(t):e[t]}function rg(e,t,r){let n=Pn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Rb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Oi(e){return e instanceof Map}function Di(e){return e instanceof Set}function In(e){return e.copy_||e.base_}function qd(e,t){if(Oi(e))return new Map(e);if(Di(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=tg(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ot];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let l=o[i],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(wn(e),n)}else{let n=wn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function os(e,t=!1){return is(e)||pt(e)||!it(e)||(Pn(e)>1&&(e.set=e.add=e.clear=e.delete=Fb),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>os(n,!0))),e}function Fb(){$e(2)}function is(e){return Object.isFrozen(e)}var Od={};function En(e){let t=Od[e];return t||$e(0,e),t}function bb(e,t){Od[e]||(Od[e]=t)}var ki;function ng(){return ki}function vb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jf(e,t){t&&(En("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dd(e){Vd(e),e.drafts_.forEach(Ib),e.drafts_=null}function Vd(e){e===ki&&(ki=e.parent_)}function Xf(e){return ki=vb(ki,e)}function Ib(e){let t=e[ot];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Zf(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ot].modified_&&(Dd(t),$e(4)),it(e)&&(e=rs(t,e),t.parent_||ns(t,e)),t.patches_&&En("Patches").generateReplacementPatches_(r[ot].base_,e,t.patches_,t.inversePatches_)):e=rs(t,r,[]),Dd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ld?e:void 0}function rs(e,t,r){if(is(t))return t;let n=t[ot];if(!n)return Ei(t,(o,i)=>eg(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return ns(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,l=!1;n.type_===3&&(i=new Set(o),o.clear(),l=!0),Ei(i,(d,p)=>eg(e,n,o,d,p,r,l)),ns(e,o,!1),r&&e.patches_&&En("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function eg(e,t,r,n,o,i,l){if(pt(o)){let d=i&&t&&t.type_!==3&&!Ti(t.assigned_,n)?i.concat(n):void 0,p=rs(e,o,d);if(rg(r,n,p),pt(p))e.canAutoFreeze_=!1;else return}else l&&r.add(o);if(it(o)&&!is(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;rs(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&ns(e,o)}}function ns(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&os(t,r)}function wb(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ng(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=Ud;r&&(o=[n],i=qi);let{revoke:l,proxy:d}=Proxy.revocable(o,i);return n.draft_=d,n.revoke_=l,d}var Ud={get(e,t){if(t===ot)return e;let r=In(e);if(!Ti(r,t))return Pb(e,r,t);let n=r[t];return e.finalized_||!it(n)?n:n===Td(e.base_,t)?(kd(e),e.copy_[t]=Md(n,e)):n},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,r){let n=og(In(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Td(In(e),t),i=o?.[ot];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Rb(r,o)&&(r!==void 0||Ti(e.base_,t)))return!0;kd(e),Nd(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 Td(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,kd(e),Nd(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=In(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){$e(11)},getPrototypeOf(e){return wn(e.base_)},setPrototypeOf(){$e(12)}},qi={};Ei(Ud,(e,t)=>{qi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qi.deleteProperty=function(e,t){return qi.set.call(this,e,t,void 0)};qi.set=function(e,t,r){return Ud.set.call(this,e[0],t,r,e[0])};function Td(e,t){let r=e[ot];return(r?In(r):e)[t]}function Pb(e,t,r){let n=og(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function og(e,t){if(!(t in e))return;let r=wn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=wn(r)}}function Nd(e){e.modified_||(e.modified_=!0,e.parent_&&Nd(e.parent_))}function kd(e){e.copy_||(e.copy_=qd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Eb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let l=this;return function(p=i,...m){return l.produce(p,f=>r.call(this,f,...m))}}typeof r!="function"&&$e(6),n!==void 0&&typeof n!="function"&&$e(7);let o;if(it(t)){let i=Xf(this),l=Md(t,void 0),d=!0;try{o=r(l),d=!1}finally{d?Dd(i):Vd(i)}return Jf(i,n),Zf(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Ld&&(o=void 0),this.autoFreeze_&&os(o,!0),n){let i=[],l=[];En("Patches").generateReplacementPatches_(t,o,i,l),n(i,l)}return o}else $e(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){it(e)||$e(8),pt(e)&&(e=ig(e));let t=Xf(this),r=Md(e,void 0);return r[ot].isManual_=!0,Vd(t),r}finishDraft(e,t){let r=e&&e[ot];(!r||!r.isManual_)&&$e(9);let{scope_:n}=r;return Jf(n,t),Zf(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=En("Patches").applyPatches_;return pt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Md(e,t){let r=Oi(e)?En("MapSet").proxyMap_(e,t):Di(e)?En("MapSet").proxySet_(e,t):wb(e,t);return(t?t.scope_:ng()).drafts_.push(r),r}function ig(e){return pt(e)||$e(10,e),ag(e)}function ag(e){if(!it(e)||is(e))return e;let t=e[ot],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=qd(e,t.scope_.immer_.useStrictShallowCopy_)}else r=qd(e,!0);return Ei(r,(n,o)=>{rg(r,n,ag(o))}),t&&(t.finalized_=!1),r}function sg(){let t="replace",r="add",n="remove";function o(S,y,A,x){switch(S.type_){case 0:case 2:return l(S,y,A,x);case 1:return i(S,y,A,x);case 3:return d(S,y,A,x)}}function i(S,y,A,x){let{base_:F,assigned_:v}=S,R=S.copy_;R.length<F.length&&([F,R]=[R,F],[A,x]=[x,A]);for(let I=0;I<F.length;I++)if(v[I]&&R[I]!==F[I]){let T=y.concat([I]);A.push({op:t,path:T,value:C(R[I])}),x.push({op:t,path:T,value:C(F[I])})}for(let I=F.length;I<R.length;I++){let T=y.concat([I]);A.push({op:r,path:T,value:C(R[I])})}for(let I=R.length-1;F.length<=I;--I){let T=y.concat([I]);x.push({op:n,path:T})}}function l(S,y,A,x){let{base_:F,copy_:v}=S;Ei(S.assigned_,(R,I)=>{let T=Ed(F,R),N=Ed(v,R),k=I?Ti(F,R)?t:r:n;if(T===N&&k===t)return;let E=y.concat(R);A.push(k===n?{op:k,path:E}:{op:k,path:E,value:N}),x.push(k===r?{op:n,path:E}:k===n?{op:r,path:E,value:C(T)}:{op:t,path:E,value:C(T)})})}function d(S,y,A,x){let{base_:F,copy_:v}=S,R=0;F.forEach(I=>{if(!v.has(I)){let T=y.concat([R]);A.push({op:n,path:T,value:I}),x.unshift({op:r,path:T,value:I})}R++}),R=0,v.forEach(I=>{if(!F.has(I)){let T=y.concat([R]);A.push({op:r,path:T,value:I}),x.unshift({op:n,path:T,value:I})}R++})}function p(S,y,A,x){A.push({op:t,path:[],value:y===Ld?void 0:y}),x.push({op:t,path:[],value:S})}function m(S,y){return y.forEach(A=>{let{path:x,op:F}=A,v=S;for(let N=0;N<x.length-1;N++){let k=Pn(v),E=x[N];typeof E!="string"&&typeof E!="number"&&(E=""+E),(k===0||k===1)&&(E==="__proto__"||E==="constructor")&&$e(19),typeof v=="function"&&E==="prototype"&&$e(19),v=Ed(v,E),typeof v!="object"&&$e(18,x.join("/"))}let R=Pn(v),I=f(A.value),T=x[x.length-1];switch(F){case t:switch(R){case 2:return v.set(T,I);case 3:$e(16);default:return v[T]=I}case r:switch(R){case 1:return T==="-"?v.push(I):v.splice(T,0,I);case 2:return v.set(T,I);case 3:return v.add(I);default:return v[T]=I}case n:switch(R){case 1:return v.splice(T,1);case 2:return v.delete(T);case 3:return v.delete(A.value);default:return delete v[T]}default:$e(17,F)}}),S}function f(S){if(!it(S))return S;if(Array.isArray(S))return S.map(f);if(Oi(S))return new Map(Array.from(S.entries()).map(([A,x])=>[A,f(x)]));if(Di(S))return new Set(Array.from(S).map(f));let y=Object.create(wn(S));for(let A in S)y[A]=f(S[A]);return Ti(S,Pi)&&(y[Pi]=S[Pi]),y}function C(S){return pt(S)?f(S):S}bb("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:p})}var mt=new Eb,Cr=mt.produce,as=mt.produceWithPatches.bind(mt),eL=mt.setAutoFreeze.bind(mt),tL=mt.setUseStrictShallowCopy.bind(mt),_d=mt.applyPatches.bind(mt),rL=mt.createDraft.bind(mt),nL=mt.finishDraft.bind(mt);s();u();c();function Tb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function kb(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function qb(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 cg=e=>Array.isArray(e)?e:[e];function Ob(e){let t=Array.isArray(e[0])?e[0]:e;return qb(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Db(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var uL=Symbol();var lL=Object.getPrototypeOf({});var Vb=class{constructor(e){this.value=e}deref(){return this.value}},Nb=typeof WeakRef<"u"?WeakRef:Vb,Mb=0,ug=1;function ss(){return{s:Mb,v:void 0,o:null,p:null}}function ro(e,t={}){let r=ss(),{resultEqualityCheck:n}=t,o,i=0;function l(){let d=r,{length:p}=arguments;for(let C=0,S=p;C<S;C++){let y=arguments[C];if(typeof y=="function"||typeof y=="object"&&y!==null){let A=d.o;A===null&&(d.o=A=new WeakMap);let x=A.get(y);x===void 0?(d=ss(),A.set(y,d)):d=x}else{let A=d.p;A===null&&(d.p=A=new Map);let x=A.get(y);x===void 0?(d=ss(),A.set(y,d)):d=x}}let m=d,f;if(d.s===ug)f=d.v;else if(f=e.apply(null,arguments),i++,n){let C=o?.deref?.()??o;C!=null&&n(C,f)&&(f=C,i!==0&&i--),o=typeof f=="object"&&f!==null||typeof f=="function"?new Nb(f):f}return m.s=ug,m.v=f,f}return l.clearCache=()=>{r=ss(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function lg(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,l=0,d,p={},m=o.pop();typeof m=="object"&&(p=m,m=o.pop()),Tb(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let f={...r,...p},{memoize:C,memoizeOptions:S=[],argsMemoize:y=ro,argsMemoizeOptions:A=[],devModeChecks:x={}}=f,F=cg(S),v=cg(A),R=Ob(o),I=C(function(){return i++,m.apply(null,arguments)},...F),T=!0,N=y(function(){l++;let E=Db(R,arguments);return d=I.apply(null,E),d},...v);return Object.assign(N,{resultFunc:m,memoizedResultFunc:I,dependencies:R,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>d,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:C,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var se=lg(ro),Lb=Object.assign((e,t=se)=>{kb(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((l,d,p)=>(l[r[p]]=d,l),{}))},{withTypes:()=>Lb});s();u();c();function dg(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var pg=dg(),mg=dg;var Qb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?to:to.apply(null,arguments)},IL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Ub=e=>e&&typeof e.match=="function";function b(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(qt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ts(n)&&n.type===e,r}var Sg=class Vi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Vi.prototype)}static get[Symbol.species](){return Vi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Vi(...t[0].concat(this)):new Vi(...t.concat(this))}};function fg(e){return it(e)?Cr(e,()=>{}):e}function gg(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function _b(e){return typeof e=="boolean"}var Bb=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},l=new Sg;return r&&(_b(r)?l.push(pg):l.push(mg(r.extraArgument))),l},qr="RTK_autoBatch",oo=()=>e=>({payload:e,meta:{[qr]:!0}}),hg=e=>t=>{setTimeout(t,e)},jb=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,l=!1,d=new Set,p=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:hg(10):e.type==="callback"?e.queueNotification:hg(e.timeout),m=()=>{l=!1,i&&(i=!1,d.forEach(f=>f()))};return Object.assign({},n,{subscribe(f){let C=()=>o&&f(),S=n.subscribe(C);return d.add(f),()=>{S(),d.delete(f)}},dispatch(f){try{return o=!f?.meta?.[qr],i=!o,i&&(l||(l=!0,p(m))),n.dispatch(f)}finally{o=!0}}})},$b=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Sg(e);return n&&o.push(jb(typeof n=="object"?n:void 0)),o};function Cg(e){let t=Bb(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:l=void 0}=e||{},d;if(typeof r=="function")d=r;else if(jt(r))d=eo(r);else throw new Error(qt(1));let p;typeof n=="function"?p=n(t):p=t();let m=to;o&&(m=Qb({trace:!1,...(typeof o=="object"&&o)}));let f=Kf(...p),C=$b(f),S=typeof l=="function"?l(C):C(),y=m(...S);return Pd(d,i,y)}function Ag(e){let t={},r=[],n,o={addCase(i,l){let d=typeof i=="string"?i:i.type;if(!d)throw new Error(qt(28));if(d in t)throw new Error(qt(29));return t[d]=l,o},addMatcher(i,l){return r.push({matcher:i,reducer:l}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function Gb(e){return typeof e=="function"}function re(e,t){let[r,n,o]=Ag(t),i;if(Gb(e))i=()=>fg(e());else{let d=fg(e);i=()=>d}function l(d=i(),p){let m=[r[p.type],...n.filter(({matcher:f})=>f(p)).map(({reducer:f})=>f)];return m.filter(f=>!!f).length===0&&(m=[o]),m.reduce((f,C)=>{if(C)if(pt(f)){let y=C(f,p);return y===void 0?f:y}else{if(it(f))return Cr(f,S=>C(S,p));{let S=C(f,p);if(S===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return f},d)}return l.getInitialState=i,l}var xg=(e,t)=>Ub(e)?e.match(t):e(t);function $t(...e){return t=>e.some(r=>xg(r,t))}function no(...e){return t=>e.every(r=>xg(r,t))}function us(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 Ni(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ls(...e){return e.length===0?t=>us(t,["pending"]):Ni(e)?$t(...e.map(t=>t.pending)):ls()(e[0])}function Tn(...e){return e.length===0?t=>us(t,["rejected"]):Ni(e)?$t(...e.map(t=>t.rejected)):Tn()(e[0])}function Mi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?no(Tn(...e),t):Ni(e)?no(Tn(...e),t):Mi()(e[0])}function Ar(...e){return e.length===0?t=>us(t,["fulfilled"]):Ni(e)?$t(...e.map(t=>t.fulfilled)):Ar()(e[0])}function ds(...e){return e.length===0?t=>us(t,["pending","fulfilled","rejected"]):Ni(e)?$t(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ds()(e[0])}var Hb="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ps=(e=21)=>{let t="",r=e;for(;r--;)t+=Hb[Math.random()*64|0];return t},zb=["name","message","stack","code"],Bd=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},yg=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},Wb=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of zb)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},J=(()=>{function e(t,r,n){let o=b(t+"/fulfilled",(p,m,f,C)=>({payload:p,meta:{...(C||{}),arg:f,requestId:m,requestStatus:"fulfilled"}})),i=b(t+"/pending",(p,m,f)=>({payload:void 0,meta:{...(f||{}),arg:m,requestId:p,requestStatus:"pending"}})),l=b(t+"/rejected",(p,m,f,C,S)=>({payload:C,error:(n&&n.serializeError||Wb)(p||"Rejected"),meta:{...(S||{}),arg:f,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:p?.name==="AbortError",condition:p?.name==="ConditionError"}}));function d(p){return(m,f,C)=>{let S=n?.idGenerator?n.idGenerator(p):ps(),y=new a.AbortController,A,x;function F(R){x=R,y.abort()}let v=_asyncToGenerator(function*(){let R;try{let T=n?.condition?.(p,{getState:f,extra:C});if(Kb(T)&&(T=yield T),T===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((k,E)=>{A=()=>{E({name:"AbortError",message:x||"Aborted"})},y.signal.addEventListener("abort",A)});m(i(S,p,n?.getPendingMeta?.({requestId:S,arg:p},{getState:f,extra:C}))),R=yield Promise.race([N,Promise.resolve(r(p,{dispatch:m,getState:f,extra:C,requestId:S,signal:y.signal,abort:F,rejectWithValue:(k,E)=>new Bd(k,E),fulfillWithValue:(k,E)=>new yg(k,E)})).then(k=>{if(k instanceof Bd)throw k;return k instanceof yg?o(k.payload,S,p,k.meta):o(k,S,p)})])}catch(T){R=T instanceof Bd?l(null,S,p,T.payload,T.meta):l(T,S,p)}finally{A&&y.signal.removeEventListener("abort",A)}return n&&!n.dispatchConditionRejection&&l.match(R)&&R.meta.condition||m(R),R})();return Object.assign(v,{abort:F,requestId:S,arg:p,unwrap(){return v.then(Yb)}})}}return Object.assign(d,{pending:i,rejected:l,fulfilled:o,settled:$t(l,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Yb(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Kb(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Rg=Symbol.for("rtk-slice-createasyncthunk"),kL={[Rg]:J};function Jb(e,t){return`${e}/${t}`}function Xb({creators:e}={}){let t=e?.asyncThunk?.[Rg];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(qt(11));typeof process<"u";let l=(typeof n.reducers=="function"?n.reducers(ev()):n.reducers)||{},d=Object.keys(l),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(R,I){let T=typeof R=="string"?R:R.type;if(!T)throw new Error(qt(12));if(T in p.sliceCaseReducersByType)throw new Error(qt(13));return p.sliceCaseReducersByType[T]=I,m},addMatcher(R,I){return p.sliceMatchers.push({matcher:R,reducer:I}),m},exposeAction(R,I){return p.actionCreators[R]=I,m},exposeCaseReducer(R,I){return p.sliceCaseReducersByName[R]=I,m}};d.forEach(R=>{let I=l[R],T={reducerName:R,type:Jb(o,R),createNotation:typeof n.reducers=="function"};rv(I)?ov(T,I,m,t):tv(T,I,m)});function f(){let[R={},I=[],T=void 0]=typeof n.extraReducers=="function"?Ag(n.extraReducers):[n.extraReducers],N={...R,...p.sliceCaseReducersByType};return re(n.initialState,k=>{for(let E in N)k.addCase(E,N[E]);for(let E of p.sliceMatchers)k.addMatcher(E.matcher,E.reducer);for(let E of I)k.addMatcher(E.matcher,E.reducer);T&&k.addDefaultCase(T)})}let C=R=>R,S=new Map,y;function A(R,I){return y||(y=f()),y(R,I)}function x(){return y||(y=f()),y.getInitialState()}function F(R,I=!1){function T(k){let E=k[R];return typeof E>"u"&&I&&(E=x()),E}function N(k=C){let E=gg(S,I,()=>new WeakMap);return gg(E,k,()=>{let V={};for(let[D,B]of Object.entries(n.selectors??{}))V[D]=Zb(B,k,x,I);return V})}return{reducerPath:R,getSelectors:N,get selectors(){return N(T)},selectSlice:T}}let v={name:o,reducer:A,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:x,...F(i),injectInto(R,{reducerPath:I,...T}={}){let N=I??i;return R.inject({reducerPath:N,reducer:A},T),{...v,...F(N,!0)}}};return v}}function Zb(e,t,r,n){function o(i,...l){let d=t(i);return typeof d>"u"&&n&&(d=r()),e(d,...l)}return o.unwrapped=e,o}var kn=Xb();function ev(){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 tv({type:e,reducerName:t,createNotation:r},n,o){let i,l;if("reducer"in n){if(r&&!nv(n))throw new Error(qt(17));i=n.reducer,l=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,l?b(e,l):b(e))}function rv(e){return e._reducerDefinitionType==="asyncThunk"}function nv(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ov({type:e,reducerName:t},r,n,o){if(!o)throw new Error(qt(18));let{payloadCreator:i,fulfilled:l,pending:d,rejected:p,settled:m,options:f}=r,C=o(e,i,f);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||cs,pending:d||cs,rejected:p||cs,settled:m||cs})}function cs(){}var Fg="listener",bg="completed",vg="cancelled",qL=`task-${vg}`,OL=`task-${bg}`,DL=`${Fg}-${vg}`,VL=`${Fg}-${bg}`;var{assign:Ig}=Object;var jd="listenerMiddleware";var iv=Ig(b(`${jd}/add`),{withTypes:()=>iv}),NL=b(`${jd}/removeAll`),av=Ig(b(`${jd}/remove`),{withTypes:()=>av});var ML=Symbol.for("rtk-state-proxy-original");function qt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}s();u();c();s();u();c();function sv({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:l}=e;l!=="disabled"&&(n.call(r),t.send(o,i,r))}var cv=/^(?:[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 uv(e){return typeof e=="string"&&cv.test(e)}var Ge=[];for(ms=0;ms<256;++ms)Ge.push((ms+256).toString(16).slice(1));var ms;function lv(e,t=0){return(Ge[e[t+0]]+Ge[e[t+1]]+Ge[e[t+2]]+Ge[e[t+3]]+"-"+Ge[e[t+4]]+Ge[e[t+5]]+"-"+Ge[e[t+6]]+Ge[e[t+7]]+"-"+Ge[e[t+8]]+Ge[e[t+9]]+"-"+Ge[e[t+10]]+Ge[e[t+11]]+Ge[e[t+12]]+Ge[e[t+13]]+Ge[e[t+14]]+Ge[e[t+15]]).toLowerCase()}var fs,dv=new Uint8Array(16);function pv(){if(!fs&&(fs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fs(dv)}var mv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wg={randomUUID:mv};function fv(e,t,r){if(wg.randomUUID&&!t&&!e)return wg.randomUUID();e=e||{};var n=e.random||(e.rng||pv)();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 lv(n)}function gv(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),i=o&&uv(o)?o:r.generateUUID();return n.setItem(t,i),i}}}var Eg="0.8.1";function hv(e){let{trackingId:t}=e;return{trackingId:t}}function yv(e){return(e.source||[]).concat([`relay@${Eg}`])}function Tg(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:l}=r,d=hv(t),p=n.getClientId();return Object.freeze({type:e,config:d,ts:Date.now(),source:yv(t),clientId:p,userAgent:l(),referrer:o(),location:i()})}function Sv(e,t,r,n,o){return{...t,meta:Tg(e,r,n,o)}}var Cv="*";function Av(){let e=[];function t({type:p,callback:m}){return e.findIndex(f=>f.type===p&&f.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(f){console.error(f)}})}function i(p){if(p===Cv)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}):i(p)}return{add:n,call:o,remove:d}}function Pg({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 xv(e){let t=Pg(e);return{get:()=>t,update:r=>{t=Pg({...t,...r})}}}function Rv(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var $d=Fv();function Fv(){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 i of o){let l=i.replace(/^\s+/,"");if(l.lastIndexOf(n,0)===0)return l.substring(n.length,l.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),l=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,d=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${l}${d};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function bv(){return{getItem(e){return $d.getItem(e)||localStorage.getItem(e)},removeItem(e){$d.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),$d.setItem(e,t,31556952e3)}}}function vv(){let e=document.referrer;return e===""?null:e}function Iv(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Rv().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:()=>vv(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>fv(),storage:bv()}}function wv(){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 Pv(){return{getItem(){return null},removeItem(){},setItem(){}}}function Ev(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Pv()}}function Tv(e){return e.get().mode!=="disabled"&&kv()&&wv()?Iv():Ev()}function kv(){try{return typeof window=="object"}catch{return!1}}function qv(e){return{get:()=>Object.freeze(Tv(e))}}function kg(e){let t=xv(e),r=Av(),n=qv(t),o=gv(n);return{emit:(i,l)=>{let d=t.get(),p=n.get(),m=Sv(i,l,d,p,o);return sv({config:d,environment:p,event:m,listenerManager:r})},getMeta:i=>Tg(i,t.get(),n.get(),o),on:(i,l)=>r.add({type:i,callback:l}),off:(i,l)=>r.remove(i,l),updateConfig:i=>t.update(i),version:Eg}}s();u();c();s();u();c();var io="3.13.2",qg=["@coveo/atomic","@coveo/quantic"];var Gt=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${io}`));var ao=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Gt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},l)=>kg({mode:i?"emit":"disabled",url:o??Ja(e,t),token:r,trackingId:n,source:l}));s();u();c();s();u();c();function Ht(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(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function d(f){try{m(n.next(f))}catch(C){l(C)}}function p(f){try{m(n.throw(f))}catch(C){l(C)}}function m(f){f.done?i(f.value):o(f.value).then(d,p)}m((n=n.apply(e,t||[])).next())})}var pe;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(pe||(pe={}));function zd(){return typeof window<"u"}function sp(){return typeof navigator<"u"}function so(){return typeof document<"u"}function Wd(){try{return typeof localStorage<"u"}catch{return!1}}function Ov(){try{return typeof sessionStorage<"u"}catch{return!1}}function Gg(){return sp()&&navigator.cookieEnabled}var Dv=[pe.click,pe.custom,pe.search,pe.view],Vv=(e,t)=>Dv.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:sp()?navigator.userAgent:"unknown"},t):t,Ui=class e{static set(t,r,n){var o,i,l,d;n&&(i=new Date,i.setTime(i.getTime()+n)),d=window.location.hostname,d.indexOf(".")===-1?Og(t,r,i):(l=d.split("."),o=l[l.length-2]+"."+l[l.length-1],Og(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Og(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Nv(){return Wd()?localStorage:Gg()?new _i:Ov()?sessionStorage:new uo}var _i=class e{getItem(t){return Ui.get(`${e.prefix}${t}`)}removeItem(t){Ui.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ui.set(`${e.prefix}${t}`,r,n)}};_i.prefix="coveo_";var Yd=class{constructor(){this.cookieStorage=new _i}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Li="__coveo.analytics.history",Hg=20,zg=1e3*60,Wg=75,lo=class{constructor(t){this.store=t||Nv()}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(Li);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(Li);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Li,JSON.stringify(t.slice(0,Hg)))}catch{}}clear(){try{this.store.removeItem(Li)}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,Wg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>zg:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},Yg=Object.freeze({__proto__:null,HistoryStore:lo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Hg,MAX_VALUE_SIZE:Wg,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:zg,STORE_KEY:Li,default:lo}),Mv=(e,t)=>q(void 0,void 0,void 0,function*(){return e===pe.view?(yield Lv(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Lv=e=>q(void 0,void 0,void 0,function*(){let t=new lo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),gs,Qv=new Uint8Array(16);function Uv(){if(!gs&&(gs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gs(Qv)}var _v=/^(?:[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 ys(e){return typeof e=="string"&&_v.test(e)}var He=[];for(let e=0;e<256;++e)He.push((e+256).toString(16).slice(1));function Kg(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()}function Bv(e){if(!ys(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 jv(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var $v="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Gv="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Hv(e,t,r){function n(o,i,l,d){var p;if(typeof o=="string"&&(o=jv(o)),typeof i=="string"&&(i=Bv(i)),((p=i)===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(i),m.set(o,i.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,l){d=d||0;for(let f=0;f<16;++f)l[d+f]=m[f];return l}return Kg(m)}try{n.name=e}catch{}return n.DNS=$v,n.URL=Gv,n}var zv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Dg={randomUUID:zv};function qn(e,t,r){if(Dg.randomUUID&&!t&&!e)return Dg.randomUUID();e=e||{};let n=e.random||(e.rng||Uv)();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 Kg(n)}function Wv(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 Gd(e,t){return e<<t|e>>>32-t}function Yv(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),i=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];i[l]=d}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let l=0;l<o;++l){let d=new Uint32Array(80);for(let y=0;y<16;++y)d[y]=i[l][y];for(let y=16;y<80;++y)d[y]=Gd(d[y-3]^d[y-8]^d[y-14]^d[y-16],1);let p=r[0],m=r[1],f=r[2],C=r[3],S=r[4];for(let y=0;y<80;++y){let A=Math.floor(y/20),x=Gd(p,5)+Wv(A,m,f,C)+S+t[A]+d[y]>>>0;S=C,C=f,f=Gd(m,30)>>>0,m=p,p=x}r[0]=r[0]+p>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Kv=Hv("v5",80,Yv),Vg=Kv,Jg="2.30.42",Ng=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Qi={pageview:"pageview",event:"event"},Ss=class{constructor({client:t,uuidGenerator:r=qn}){this.client=t,this.uuidGenerator=r}},Kd=class extends Ss{constructor({client:t,uuidGenerator:r=qn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Ng(window.location),this.lastReferrer=so()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Qi.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Qi.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Qi.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Qi.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 Ng(window.location)}},Or=class e{constructor(t,r){if(!ys(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return ys(i)?new e(i,Number.parseInt(o)*1e3):null}};Or.cvo_cid="cvo_cid";Or.expirationTime=120;var Jd=class extends Ss{constructor({client:t,uuidGenerator:r=qn}){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(Or.cvo_cid,new Or(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Jd.Id="link";var Rt=Object.keys;function hs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Hd=128,Xg=192,Mg=224,Lg=240;function Jv(e){return(e&248)===Lg?4:(e&Lg)===Mg?3:(e&Mg)===Xg?2:1}function Xv(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&Hd)!=Hd)break;if(r-=3,(n&Xg)!=Hd){t-r>=Jv(n)*3&&(r=t);break}}return e.substring(0,r)}var Xd={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"},Zv=Rt(Xd).map(e=>Xd[e]),eI=[...Zv].join("|"),tI=new RegExp(`^(${eI}$)`),rI={svcAction:"svc_action",svcActionData:"svc_action_data"},nI=e=>Rt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Xd[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),oI=e=>tI.test(e),iI=[oI],Qg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Ug={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ye={action:"pa",list:"pal",listSource:"pls"},Cs={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},aI=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Zd={id:"quoteId",affiliation:"quoteAffiliation"},ep={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},sI={add:Ye,bookmark_add:Ye,bookmark_remove:Ye,click:Ye,checkout:Ye,checkout_option:Ye,detail:Ye,impression:Ye,remove:Ye,refund:Object.assign(Object.assign({},Ye),Cs),purchase:Object.assign(Object.assign({},Ye),Cs),quickview:Ye,quote:Object.assign(Object.assign({},Ye),Zd),review:Object.assign(Object.assign({},Ye),ep)},cI=Rt(Qg).map(e=>Qg[e]),uI=Rt(Ug).map(e=>Ug[e]),lI=Rt(Ye).map(e=>Ye[e]),dI=Rt(Cs).map(e=>Cs[e]),pI=Rt(ep).map(e=>ep[e]),mI=Rt(Zd).map(e=>Zd[e]),fI=[...cI,"custom"].join("|"),gI=[...uI,"custom"].join("|"),Zg="(pr[0-9]+)",eh="(il[0-9]+pi[0-9]+)",hI=new RegExp(`^${Zg}(${fI})$`),yI=new RegExp(`^(${eh}(${gI}))|(il[0-9]+nm)$`),SI=new RegExp(`^(${lI.join("|")})$`),CI=new RegExp(`^(${dI.join("|")})$`),AI=new RegExp(`^${Zg}custom$`),xI=new RegExp(`^${eh}custom$`),RI=new RegExp(`^(${[...aI,...pI,...mI].join("|")})$`),FI=e=>hI.test(e),bI=e=>yI.test(e),vI=e=>SI.test(e),II=e=>CI.test(e),wI=e=>RI.test(e),PI=[bI,FI,vI,II,wI],EI=[AI,xI],TI={anonymizeIp:"aip"},kI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},qI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},OI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],DI=Object.assign(Object.assign(Object.assign(Object.assign({},TI),kI),qI),OI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),tp=Object.assign(Object.assign({},DI),rI),VI=e=>{let t=!!e.action&&sI[e.action]||{};return Rt(e).reduce((r,n)=>{let o=t[n]||tp[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},NI=Rt(tp).map(e=>tp[e]),MI=e=>NI.indexOf(e)!==-1,LI=e=>e==="custom",QI=e=>[...PI,...iI,MI,LI].some(t=>t(e)),UI=e=>Rt(e).reduce((t,r)=>{let n=_I(r);return n?Object.assign(Object.assign({},t),BI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),_I=e=>{let t;return[...EI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},BI=(e,t)=>Rt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),rp=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,i=yield this.getQueryParamsForEventType(t),{url:l,payload:d}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,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,i=r;if(n){let l=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:d,body:p}=l;o=d||t;try{i=JSON.parse(p)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return 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(i=>!!i).join("&")})}isEventTypeLegacy(t){return[pe.click,pe.custom,pe.search,pe.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}},np=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()})}},_g=g.fetch,As=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=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),i?yield i(d,"analyticsFetch"):{}),{url:m}=p,f=Ht(p,["url"]),C;try{C=yield _g(m,f)}catch(S){console.error("An error has occured when sending the event.",S);return}if(C.ok){let S=yield C.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}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 _g(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[pe.click,pe.custom,pe.search,pe.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"})}},op=class{constructor(t,r){Wd()&&Gg()?this.storage=new Yd:Wd()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new As(t),this.beaconClient=new rp(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},ip=class{constructor(t,r){this.storage=r||new uo,this.client=new As(t)}getClientDependingOnEventType(t){return this.client}},xs=class{constructor(){this.storage=new uo,this.client=new np}getClientDependingOnEventType(t){return this.client}},jI="xx",$I=e=>e?.startsWith(jI)||!1,GI=`
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
@@ -44,4 +44,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
44
44
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
45
  * See the License for the specific language governing permissions and
46
46
  * limitations under the License.
47
- */if(__exports!=exports)module.exports=exports;return module.exports});
47
+ */if(__exports!=exports)module.exports=exports;return module.exports});
48
+
49
+ window.coveoQuanticVersion = '3.12.1';