@coveo/headless 3.57.0 → 3.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/case-assist/headless.cjs +1 -1
- package/dist/cjs/commerce/headless.cjs +5 -1
- package/dist/cjs/commerce/node.cjs.stats.json +1 -1
- package/dist/cjs/headless.cjs +1 -1
- package/dist/cjs/insight/headless.cjs +1 -1
- package/dist/cjs/recommendation/headless.cjs +1 -1
- package/dist/cjs/ssr/headless.cjs +1 -1
- package/dist/cjs/ssr-commerce/headless.cjs +5 -1
- package/dist/cjs/ssr-commerce/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-commerce-next/headless.cjs +5 -1
- package/dist/cjs/ssr-commerce-next/node.cjs.stats.json +1 -1
- package/dist/cjs/ssr-next/headless.cjs +1 -1
- package/dist/definitions/ssr/commerce/types/engine.d.ts +4 -1
- package/dist/definitions/ssr/common/types/engine.d.ts +4 -1
- package/dist/esm/features/commerce/facets/numeric-facet/manual-numeric-facet-slice.js +6 -1
- package/dist/esm/utils/version.js +1 -1
- package/dist/quantic/case-assist/headless.js +1 -1
- package/dist/quantic/commerce/browser.cjs.stats.json +1 -1
- package/dist/quantic/commerce/headless.js +15 -15
- package/dist/quantic/commerce/headless.js.map +3 -3
- package/dist/quantic/headless.js +1 -1
- package/dist/quantic/insight/headless.js +1 -1
- package/dist/quantic/recommendation/headless.js +1 -1
- package/package.json +3 -3
|
@@ -26,7 +26,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
26
26
|
|
|
27
27
|
${t}
|
|
28
28
|
`;return new Vo(r)}var Vo=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},De=class{constructor(e){de(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw OO(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}},Ke=class{constructor(e={}){de(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&J(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 Wa(e){return e===void 0}function _O(e){return e===null}function J(e){return Wa(e)||_O(e)}var pe=class{constructor(e={}){de(this,"value");this.value=new Ke(e)}validate(e){let t=this.value.validate(e);return t||(NO(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function NO(e){return Wa(e)||$u(e)}function $u(e){return typeof e=="boolean"}var oe=class{constructor(e={}){de(this,"config");de(this,"value");this.config=e,this.value=new Ke(e)}validate(e){let t=this.value.validate(e);return t||(DO(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 DO(e){return Wa(e)||SA(e)}function SA(e){return typeof e=="number"&&!Number.isNaN(e)}var qO=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,$=class{constructor(e={}){de(this,"value");de(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Ke(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,i=this.value.validate(e);if(i)return i;if(Wa(e))return null;if(!Ya(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(qO.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 Ya(e){return Object.prototype.toString.call(e)==="[object String]"}var Y=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Wa(e))return this.config.options.required?"value is required and is currently undefined":null;if(!vA(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&J(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function vA(e){return e!==void 0&&typeof e=="object"}var ae=class{constructor(e={}){de(this,"config");de(this,"value");this.config=e,this.value=new Ke(this.config)}validate(e){if(!J(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(J(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&&J(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 $u(e)||Ya(e)||SA(e)||vA(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ka(e){return Array.isArray(e)}var cc=class{constructor(e){de(this,"config");de(this,"value");this.config=e,this.value=new Ke(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Wa(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}};d();c();l();u();var Hu=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function zu(e){return Array.isArray(e)}function Wu(e){return e.trim()===""}function AA(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function MO(e){return btoa(encodeURI(e))}function Yu(e,t){let{[e]:r,...n}=t;return n}function Xa(e){return MO(JSON.stringify(e))}var VO=new Set(["1",1,"yes",!0]);function ah(){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=>VO.has(r))}function bA(e){let t={};for(let[r,n]of e)t[r]=n;return t}function CA(e,t,r){return clearTimeout(t),setTimeout(e,r)}function uc(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ku(e,t,r={}){let n;return((...o)=>{let a=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),a)return e.apply(void 0,o)})}function jO(e){if(Wu(e.openingDelimiter)||Wu(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(J(e.content)||Wu(e.content))return e.content;if(e.highlights.length===0)return Za(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,p=i+a.length;if(p>t)break;r+=Za(e.content.slice(n,i)),r+=e.openingDelimiter,r+=Za(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Za(e.content.slice(n))),r}function sh(e,t){return e=Za(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?ih(n,t.notMatchDelimiters):o?ih(o,t.exactMatchDelimiters):a?ih(a,t.correctionDelimiters):r)}function ih(e,t){return t?t.open+e+t.close:e}function Za(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();var NA=Pr(PA(),1);d();c();l();u();var ie=new Error("Failed to load reducers."),Ja=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},Lo=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function kA(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function OA(e){return typeof e!="object"||!e?!1:Object.values(e).every(d0)}function d0(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function _A(e){return e===429}var Qr=class e{static async call(t){let r=p0(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=async()=>{let m=await A(a,i);if(_A(m.status))throw m;return m};try{let m=await(0,NA.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:async f=>{let g=f&&_A(f.status);return g&&(n.info("Platform retrying request"),await new Promise(S=>setTimeout(S,1e3))),g}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new Ja;case 404:throw new Lo(a,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new Lo(a):m}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...m}=t,f=uc(m);try{let g=await o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return f}};function gt(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Hn(e,t,r="prod"){return e??gt(t,r)}function Xt(e,t="prod"){return`${gt(e,t)}/rest/search/v2`}function Zu(e,t="prod"){return`${gt(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function p0(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",m=f0(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...p&&{body:m},signal:i}}function f0(e,t){return t==="application/x-www-form-urlencoded"?OA(e)?kA(e):"":JSON.stringify(e)}d();c();l();u();var pc=Pr(Ju(),1),LA=Pr(DA(),1);d();c();l();u();var el=Pr(Ju(),1),MA=Pr(qA(),1);el.default.extend(MA.default);var VA="YYYY/MM/DD@HH:mm:ss",m0="1401-01-01";function ei(e,t){let r=(0,el.default)(e,t);return!r.isValid()&&!t?(0,el.default)(e,VA):r}function tl(e){return e.format(VA)}function jA(e,t){let r=ei(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}xh(r)}function xh(e){if(e.isBefore(m0))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}pc.default.extend(LA.default);var UA=["past","now","next"],QA=["minute","hour","day","week","month","quarter","year"],g0=e=>{let t=e==="now";return{amount:new oe({required:!t,min:1}),unit:new $({required:!t,constrainTo:QA}),period:new $({required:!0,constrainTo:UA})}};function rl(e){if(typeof e=="string"&&!zn(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Rh(e):e;new De(g0(t.period)).validate(t);let r=GA(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);xh(r)}function BA(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function GA(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,pc.default)().subtract(r,n);case"next":return(0,pc.default)().add(r,n);case"now":return(0,pc.default)()}}function fc(e){return tl(GA(Rh(e)))}function $A(e){return e.toLocaleLowerCase().split("-")}function zn(e){let[t,r,n]=$A(e);if(t==="now")return!0;if(!UA.includes(t)||!QA.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function HA(e){return!!e&&typeof e=="object"&&"period"in e}function Rh(e){let[t,r,n]=$A(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function zA(e){return rl(e),Rh(e)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();async function YA(e,t){let r=e.getReader(),n;for(;!(n=await r.read()).done;)t(n.value)}function KA(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=y0(t,i);let p=t.length,m=0;for(;r<p;){o&&(t[r]===10&&(m=++r),o=!1);let f=-1;for(;r<p&&f===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0,f=r;break;case 10:f=r;break}if(f===-1)break;e(t.subarray(m,f),n),m=r,n=-1}m===p?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function XA(e,t,r){let n=WA(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=WA();else if(p>0){let m=o.decode(i.subarray(0,p)),f=p+(i[p+1]===32?2:1),g=o.decode(i.subarray(f));switch(m){case"data":n.data=n.data?`${n.data}
|
|
29
|
-
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":h0(g,n,t);break}}}}function h0(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function y0(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function WA(){return{data:"",event:"",id:"",retry:void 0}}var wh="text/event-stream",S0=1e3,ZA="last-event-id";function JA(){return typeof window<"u"}function nl(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:m,...f}){return new Promise((g,S)=>{let C={...r};C.accept||(C.accept=wh);let h;function y(){h?.abort(),document.hidden||O()}!p&&JA()&&document.addEventListener("visibilitychange",y);let x=S0,w;function E(){JA()&&document.removeEventListener("visibilitychange",y),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{E(),g()});let T=m??A,F=n??v0;async function O(){h=s.AbortController?new s.AbortController:null;try{let I=await T(e,{...f,headers:C,signal:h?.signal});await F(I),await YA(I.body,KA(XA(k=>{k?C[ZA]=k:delete C[ZA]},k=>{x=k},o))),a?.(),E(),g()}catch(I){if(!h?.signal?.aborted)try{let k=i?.(I)??x;clearTimeout(w),w=setTimeout(O,k)}catch(k){E(),S(k)}}}O()})}function v0(e){let t=e.headers.get("content-type");if(!t?.startsWith(wh))throw new Error(`Expected content-type to be ${wh}, Actual: ${t}`)}d();c();l();u();var Wn=class{constructor(t){de(this,"_basePath");de(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 A0=(e,t,r)=>new Wn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,eb=3,b0=5e3,C0="text/event-stream",Fh=1,Ih=class extends Error{},mc=class extends Error{constructor(r){super(r.message);de(this,"payload",r)}},Eh=class{constructor(){de(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)}},ol=class{constructor(t){de(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:m,close:f,resetAnswer:g}=r,S=new Eh;if(!a){this.logger.error("No stream ID found");return}let C=0,h,y=()=>{h&&!S.isActive(h)&&(w?.abort(),g(),E())},x=()=>{S.remove(h),h=CA(y,h,b0),S.add(h)},w=new s.AbortController,E=()=>nl(A0(n,o,a),{method:"GET",fetch:A,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,async onopen(T){if(T.ok&&T.headers.get("content-type")===C0)return;throw T.status>=400&&T.status<500&&T.status!==429?new mc({message:"Error opening stream",code:T.status}):new Ih},onmessage:T=>{if(w?.signal.aborted)return;let F=JSON.parse(T.data);if(F.finishReason==="ERROR"){S.remove(h),w?.abort(),m({message:F.errorMessage,code:F.statusCode});return}p(F),C=0,F.finishReason==="COMPLETED"?(S.remove(h),f()):x()},onerror:T=>{if(!w?.signal.aborted){if(S.remove(h),T instanceof mc)throw w?.abort(),m(T),T;if(++C>eb){this.logger.info("Maximum retry exceeded.");let F={message:"Failed to complete stream.",code:Fh};throw w?.abort(),m(F),new mc(F)}this.logger.info(`Retrying...(${C}/${eb})`),g()}}});return E(),w}};d();c();l();u();var al=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function gc(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var Th=e=>{let{response:t}=e;return t.body?x0(e):R0(t)},x0=e=>I0(e)?E0(e):w0(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},R0=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function w0(e){return e.body.statusCode!==void 0}function I0(e){return e.body.exception!==void 0}var E0=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function tb(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Ph=(e,t,r,n)=>{let o=new Wn(`${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 rb=(e,t)=>{let r=new Wn(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},kh=async(e,t)=>{let r=await Qr.call({...Ph(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:gc(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=tb(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return F0(i)?{success:i}:{error:Th({response:r,body:i})}};function F0(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function ti(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function xt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:ti(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:ti(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function T0(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function P0(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ri(e,t){if(t&&e.name==="AbortError")return{error:P0(e)};if(e instanceof Lo)return{error:T0(e)};throw e}var Yn=e=>e.success!==void 0,Xe=e=>e.error!==void 0;function nb(e){return e.results!==void 0}function ob(e){let t=ti();return J(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var Oh=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,k0=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,hc=(e,t,r,n)=>{O0(e);let o=Oh(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},ab=(e,t,r)=>{_0(e);let n=k0(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},_h=e=>{let{insightId:t,...r}=gc(e);return r},ib=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.")},O0=e=>{if(ib(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},_0=e=>{if(ib(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var sb=e=>({...hc(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var cb=e=>({...hc(e,"POST","application/json","/search"),requestParams:_h(e)}),ub=e=>({...hc(e,"POST","application/json","/querysuggest"),requestParams:_h(e)});d();c();l();u();var lb=e=>({...ab(e,"POST","application/json"),requestParams:{objectId:e.userId}});var il=class{constructor(t){de(this,"options",t)}async getInterface(t){let r=await Qr.call({...sb(t),...this.options});if(r instanceof Error)return ri(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async query(t,r){let n=await Qr.call({...cb(t),requestMetadata:{method:"search",origin:r?.origin},...this.options});if(n instanceof Error)return ri(n);let o=await n.json();return nb(o)&&(o=ob(o)),n.ok?{success:o}:{error:o}}async querySuggest(t){let r=await Qr.call({...ub(t),...this.options});if(r instanceof Error)return ri(r);let n=await r.json();return n.completions?{success:n}:{error:n}}async userActions(t){let r=await Qr.call({...lb(t),...this.options});if(r instanceof Error)return ri(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return kh(t,{...this.options})}};d();c();l();u();d();c();l();u();var H=new $({required:!0,emptyAllowed:!1}),Ze=new $({required:!1,emptyAllowed:!1}),Je=new $({required:!0,emptyAllowed:!0}),nW=new $({required:!1,emptyAllowed:!0}),sl=new ae({each:H,required:!0}),db=new $({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),pb=new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),oW=new $({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),kr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),hr=(e,t)=>{if("required"in t)return{payload:new De({value:t}).validate({value:e}).value};let o=new Y({options:{required:!0},values:t}).validate(e);if(o)throw new Vo(o);return{payload:e}},q=(e,t)=>{try{return hr(e,t)}catch(r){return{payload:e,error:kr(r)}}},yr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return fb(e,t,r,o,"Controller initialization error")},yt=(e,t,r,n)=>{let o=`Check the options of ${n}`;return fb(e,t,r,o,"Controller initialization error")},fb=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Ft(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 N0=typeof Symbol=="function"&&Symbol.observable||"@@observable",mb=N0,Nh=()=>Math.random().toString(36).substring(7).split("").join("."),D0={INIT:`@@redux/INIT${Nh()}`,REPLACE:`@@redux/REPLACE${Nh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Nh()}`},cl=D0;function Br(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 Dh(e,t,r){if(typeof e!="function")throw new Error(Ft(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ft(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ft(1));return r(Dh)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,m=!1;function f(){i===a&&(i=new Map,a.forEach((w,E)=>{i.set(E,w)}))}function g(){if(m)throw new Error(Ft(3));return o}function S(w){if(typeof w!="function")throw new Error(Ft(4));if(m)throw new Error(Ft(5));let E=!0;f();let T=p++;return i.set(T,w),function(){if(E){if(m)throw new Error(Ft(6));E=!1,f(),i.delete(T),a=null}}}function C(w){if(!Br(w))throw new Error(Ft(7));if(typeof w.type>"u")throw new Error(Ft(8));if(typeof w.type!="string")throw new Error(Ft(17));if(m)throw new Error(Ft(9));try{m=!0,o=n(o,w)}finally{m=!1}return(a=i).forEach(T=>{T()}),w}function h(w){if(typeof w!="function")throw new Error(Ft(10));n=w,C({type:cl.REPLACE})}function y(){let w=S;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Ft(11));function T(){let O=E;O.next&&O.next(g())}return T(),{unsubscribe:w(T)}},[mb](){return this}}}return C({type:cl.INIT}),{dispatch:C,subscribe:S,getState:g,replaceReducer:h,[mb]:y}}function q0(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:cl.INIT})>"u")throw new Error(Ft(12));if(typeof r(void 0,{type:cl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ft(13))})}function ni(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{q0(r)}catch(i){a=i}return function(p={},m){if(a)throw a;let f=!1,g={};for(let S=0;S<n.length;S++){let C=n[S],h=r[C],y=p[C],x=h(y,m);if(typeof x>"u"){let w=m&&m.type;throw new Error(Ft(14))}g[C]=x,f=f||x!==y}return f=f||n.length!==Object.keys(p).length,f?g:p}}function yc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function gb(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Ft(15))},i={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(i));return a=yc(...p)(o.dispatch),{...o,dispatch:a}}}function Sc(e){return Br(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var Gh=Symbol.for("immer-nothing"),vc=Symbol.for("immer-draftable"),vt=Symbol.for("immer-state");function Tt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var cr=Object,Qo=cr.getPrototypeOf,Ac="constructor",wc="prototype",Vh="configurable",pl="enumerable",ll="writable",bc="value",zt=e=>!!e&&!!e[vt];function jt(e){return e?xb(e)||Ec(e)||!!e[vc]||!!e[Ac]?.[vc]||Fc(e)||Tc(e):!1}var M0=cr[wc][Ac].toString(),hb=new WeakMap;function xb(e){if(!e||!ai(e))return!1;let t=Qo(e);if(t===null||t===cr[wc])return!0;let r=cr.hasOwnProperty.call(t,Ac)&&t[Ac];if(r===Object)return!0;if(!Uo(r))return!1;let n=hb.get(r);return n===void 0&&(n=Function.toString.call(r),hb.set(r,n)),n===M0}function Rb(e){return zt(e)||Tt(15,e),e[vt].base_}function Ic(e,t,r=!0){Bo(e)===0?(r?Reflect.ownKeys(e):cr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Bo(e){let t=e[vt];return t?t.type_:Ec(e)?1:Fc(e)?2:Tc(e)?3:0}var oi=(e,t,r=Bo(e))=>r===2?e.has(t):cr[wc].hasOwnProperty.call(e,t),Fn=(e,t,r=Bo(e))=>r===2?e.get(t):e[t],fl=(e,t,r,n=Bo(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function V0(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ec=Array.isArray,Fc=e=>e instanceof Map,Tc=e=>e instanceof Set,ai=e=>typeof e=="object",Uo=e=>typeof e=="function",qh=e=>typeof e=="boolean";function j0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var L0=e=>ai(e)?e?.[vt]:null,Tn=e=>e.copy_||e.base_;var $h=e=>e.modified_?e.copy_:e.base_;function jh(e,t){if(Fc(e))return new Map(e);if(Tc(e))return new Set(e);if(Ec(e))return Array[wc].slice.call(e);let r=xb(e);if(t===!0||t==="class_only"&&!r){let n=cr.getOwnPropertyDescriptors(e);delete n[vt];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[ll]===!1&&(p[ll]=!0,p[Vh]=!0),(p.get||p.set)&&(n[i]={[Vh]:!0,[ll]:!0,[pl]:p[pl],[bc]:e[i]})}return cr.create(Qo(e),n)}else{let n=Qo(e);if(n!==null&&r)return{...e};let o=cr.create(n);return cr.assign(o,e)}}function Hh(e,t=!1){return vl(e)||zt(e)||!jt(e)||(Bo(e)>1&&cr.defineProperties(e,{set:ul,add:ul,clear:ul,delete:ul}),cr.freeze(e),t&&Ic(e,(r,n)=>{Hh(n,!0)},!1)),e}function U0(){Tt(2)}var ul={[bc]:U0};function vl(e){return e===null||!ai(e)?!0:cr.isFrozen(e)}var ml="MapSet",gl="Patches",yb="ArrayMethods",hl={};function Go(e){let t=hl[e];return t||Tt(0,e),t}var Sb=e=>!!hl[e];function Q0(e,t){hl[e]||(hl[e]=t)}var Cc,wb=()=>Cc,B0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Sb(ml)?Go(ml):void 0,arrayMethodsPlugin_:Sb(yb)?Go(yb):void 0});function vb(e,t){t&&(e.patchPlugin_=Go(gl),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Lh(e){Uh(e),e.drafts_.forEach(G0),e.drafts_=null}function Uh(e){e===Cc&&(Cc=e.parent_)}var Ab=e=>Cc=B0(Cc,e);function G0(e){let t=e[vt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bb(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[vt].modified_&&(Lh(t),Tt(4)),jt(e)&&(e=Cb(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[vt].base_,e,t)}else e=Cb(t,r);return $0(t,e,!0),Lh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Gh?e:void 0}function Cb(e,t){if(vl(t))return t;let r=t[vt];if(!r)return yl(t,e.handledSet_,e);if(!Al(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Fb(r,e)}return r.copy_}function $0(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hh(t,r)}function Ib(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Al=(e,t)=>e.scope_===t,H0=[];function Eb(e,t,r,n){let o=Tn(e),a=e.type_;if(n!==void 0&&Fn(o,n,a)===t){fl(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Ic(o,(m,f)=>{if(zt(f)){let g=p.get(f)||[];g.push(m),p.set(f,g)}})}let i=e.draftLocations_.get(t)??H0;for(let p of i)fl(o,p,r,a)}function z0(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Al(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=$h(a);Eb(e,a.draft_??a,i,r),Fb(a,o)})}function Fb(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}Ib(e)}}function W0(e,t,r){let{scope_:n}=e;if(zt(r)){let o=r[vt];Al(o,n)&&o.callbacks_.push(function(){dl(e);let i=$h(o);Eb(e,r,i,t)})}else jt(r)&&e.callbacks_.push(function(){let a=Tn(e);e.type_===3?a.has(r)&&yl(r,n.handledSet_,n):Fn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&yl(Fn(e.copy_,t,e.type_),n.handledSet_,n)})}function yl(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||zt(e)||t.has(e)||!jt(e)||vl(e)||(t.add(e),Ic(e,(n,o)=>{if(zt(o)){let a=o[vt];if(Al(a,r)){let i=$h(a);fl(e,n,i,e.type_),Ib(a)}}else jt(o)&&yl(o,t,r)})),e}function Y0(e,t){let r=Ec(e),n={type_:r?1:0,scope_:t?t.scope_:wb(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=Sl;r&&(o=[n],a=xc);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var Sl={get(e,t){if(t===vt)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=Tn(e);if(!oi(o,t,e.type_))return X0(e,o,t);let a=o[t];if(e.finalized_||!jt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&j0(t))return a;if(a===Mh(e.base_,t)||K0(e,t,a)){dl(e);let i=e.type_===1?+t:t,p=Bh(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in Tn(e)},ownKeys(e){return Reflect.ownKeys(Tn(e))},set(e,t,r){let n=Tb(Tn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Mh(Tn(e),t),a=o?.[vt];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(V0(r,o)&&(r!==void 0||oi(e.base_,t,e.type_)))return!0;dl(e),Qh(e)}return e.copy_[t]===r&&(r!==void 0||oi(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),W0(e,t,r)),!0},deleteProperty(e,t){return dl(e),Mh(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Tn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[ll]:!0,[Vh]:e.type_!==1||t!=="length",[pl]:n[pl],[bc]:r[t]}},defineProperty(){Tt(11)},getPrototypeOf(e){return Qo(e.base_)},setPrototypeOf(){Tt(12)}},xc={};for(let e in Sl){let t=Sl[e];xc[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}xc.deleteProperty=function(e,t){return xc.set.call(this,e,t,void 0)};xc.set=function(e,t,r){return Sl.set.call(this,e[0],t,r,e[0])};function Mh(e,t){let r=e[vt];return(r?Tn(r):e)[t]}function K0(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!jt(r)||r[vt]?!1:e.baseRefs_.has(r)}function X0(e,t,r){let n=Tb(t,r);return n?bc in n?n[bc]:n.get?.call(e.draft_):void 0}function Tb(e,t){if(!(t in e))return;let r=Qo(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Qo(r)}}function Qh(e){e.modified_||(e.modified_=!0,e.parent_&&Qh(e.parent_))}function dl(e){e.copy_||(e.assigned_=new Map,e.copy_=jh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Z0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Uo(t)&&!Uo(r)){let a=r;r=t;let i=this;return function(m=a,...f){return i.produce(m,g=>r.call(this,g,...f))}}Uo(r)||Tt(6),n!==void 0&&!Uo(n)&&Tt(7);let o;if(jt(t)){let a=Ab(this),i=Bh(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?Lh(a):Uh(a)}return vb(a,n),bb(o,a)}else if(!t||!ai(t)){if(o=r(t),o===void 0&&(o=t),o===Gh&&(o=void 0),this.autoFreeze_&&Hh(o,!0),n){let a=[],i=[];Go(gl).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else Tt(1,t)},this.produceWithPatches=(t,r)=>{if(Uo(t))return(i,...p)=>this.produceWithPatches(i,m=>t(m,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},qh(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),qh(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),qh(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){jt(e)||Tt(8),zt(e)&&(e=bl(e));let t=Ab(this),r=Bh(t,e,void 0);return r[vt].isManual_=!0,Uh(t),r}finishDraft(e,t){let r=e&&e[vt];(!r||!r.isManual_)&&Tt(9);let{scope_:n}=r;return vb(n,t),bb(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Go(gl).applyPatches_;return zt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Bh(e,t,r,n){let[o,a]=Fc(t)?Go(ml).proxyMap_(t,r):Tc(t)?Go(ml).proxySet_(t,r):Y0(t,r);return(r?.scope_??wb()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?z0(r,a,n):a.callbacks_.push(function(m){m.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:f}=m;a.modified_&&f&&f.generatePatches_(a,[],m)}),o}function bl(e){return zt(e)||Tt(10,e),Pb(e)}function Pb(e){if(!jt(e)||vl(e))return e;let t=e[vt],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=jh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=jh(e,!0);return Ic(r,(o,a)=>{fl(r,o,Pb(a))},n),t&&(t.finalized_=!1),r}function kb(){function t(y,x=[]){if(y.key_!==void 0){let w=y.parent_.copy_??y.parent_.base_,E=L0(Fn(w,y.key_)),T=Fn(w,y.key_);if(T===void 0||T!==y.draft_&&T!==y.base_&&T!==y.copy_||E!=null&&E.base_!==y.base_)return null;let F=y.parent_.type_===3,O;if(F){let I=y.parent_;O=Array.from(I.drafts_.keys()).indexOf(y.key_)}else O=y.key_;if(!(F&&w.size>O||oi(w,O)))return null;x.push(O)}if(y.parent_)return t(y.parent_,x);x.reverse();try{r(y.copy_,x)}catch{return null}return x}function r(y,x){let w=y;for(let E=0;E<x.length-1;E++){let T=x[E];if(w=Fn(w,T),!ai(w)||w===null)throw new Error(`Cannot resolve path at '${x.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(y,x,w){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:E,inversePatches_:T}=w;switch(y.type_){case 0:case 2:return m(y,x,E,T);case 1:return p(y,x,E,T);case 3:return f(y,x,E,T)}}function p(y,x,w,E){let{base_:T,assigned_:F}=y,O=y.copy_;O.length<T.length&&([T,O]=[O,T],[w,E]=[E,w]);let I=y.allIndicesReassigned_===!0;for(let k=0;k<T.length;k++){let P=O[k],_=T[k];if((I||F?.get(k.toString()))&&P!==_){let B=P?.[vt];if(B&&B.modified_)continue;let U=x.concat([k]);w.push({op:n,path:U,value:h(P)}),E.push({op:n,path:U,value:h(_)})}}for(let k=T.length;k<O.length;k++){let P=x.concat([k]);w.push({op:o,path:P,value:h(O[k])})}for(let k=O.length-1;T.length<=k;--k){let P=x.concat([k]);E.push({op:a,path:P})}}function m(y,x,w,E){let{base_:T,copy_:F,type_:O}=y;Ic(y.assigned_,(I,k)=>{let P=Fn(T,I,O),_=Fn(F,I,O),j=k?oi(T,I)?n:o:a;if(P===_&&j===n)return;let B=x.concat(I);w.push(j===a?{op:j,path:B}:{op:j,path:B,value:h(_)}),E.push(j===o?{op:a,path:B}:j===a?{op:o,path:B,value:h(P)}:{op:n,path:B,value:h(P)})})}function f(y,x,w,E){let{base_:T,copy_:F}=y,O=0;T.forEach(I=>{if(!F.has(I)){let k=x.concat([O]);w.push({op:a,path:k,value:I}),E.unshift({op:o,path:k,value:I})}O++}),O=0,F.forEach(I=>{if(!T.has(I)){let k=x.concat([O]);w.push({op:o,path:k,value:I}),E.unshift({op:a,path:k,value:I})}O++})}function g(y,x,w){let{patches_:E,inversePatches_:T}=w;E.push({op:n,path:[],value:x===Gh?void 0:x}),T.push({op:n,path:[],value:y})}function S(y,x){return x.forEach(w=>{let{path:E,op:T}=w,F=y;for(let P=0;P<E.length-1;P++){let _=Bo(F),j=E[P];typeof j!="string"&&typeof j!="number"&&(j=""+j),(_===0||_===1)&&(j==="__proto__"||j===Ac)&&Tt(19),Uo(F)&&j===wc&&Tt(19),F=Fn(F,j),(F===null||!ai(F))&&Tt(18,E.join("/"))}let O=Bo(F),I=C(w.value),k=E[E.length-1];switch(T){case n:switch(O){case 2:return F.set(k,I);case 3:Tt(16);default:return F[k]=I}case o:switch(O){case 1:return k==="-"?F.push(I):F.splice(k,0,I);case 2:return F.set(k,I);case 3:return F.add(I);default:return F[k]=I}case a:switch(O){case 1:return F.splice(k,1);case 2:return F.delete(k);case 3:return F.delete(w.value);default:return delete F[k]}default:Tt(17,T)}}),y}function C(y){if(!jt(y))return y;if(Ec(y))return y.map(C);if(Fc(y))return new Map(Array.from(y.entries()).map(([w,E])=>[w,C(E)]));if(Tc(y))return new Set(Array.from(y).map(C));let x=Object.create(Qo(y));for(let w in y)x[w]=C(y[w]);return oi(y,vc)&&(x[vc]=y[vc]),x}function h(y){return zt(y)?C(y):y}Q0(gl,{applyPatches_:S,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var J0=v.Iterator,gW=typeof J0?.from=="function";var Rc=new Z0,$o=Rc.produce,zh=Rc.produceWithPatches.bind(Rc);var Wh=Rc.applyPatches.bind(Rc);d();c();l();u();var e_=class{constructor(e){this.value=e}deref(){return this.value}},t_=()=>typeof WeakRef>"u"?e_:WeakRef,_b=t_(),r_=0,Cl=1;function Pc(){return{s:r_,v:void 0,o:null,p:null}}function n_(e){return e instanceof _b?e.deref():e}function ii(e,t={}){let r=Pc(),{resultEqualityCheck:n,maxSize:o}=t,a=o!==void 0;if(a&&(!Number.isInteger(o)||o<1))throw new TypeError(`maxSize must be a positive integer, received: ${o}`);let i=null,p=0,m,f=0,g=!1;function S(){p>=o&&(i=r,r=Pc(),p=0)}function C(){let h=r,{length:y}=arguments;for(let E=0,T=y;E<T;E++){let F=arguments[E];if(typeof F=="function"||typeof F=="object"&&F!==null){let O=h.o;O===null&&(h.o=O=new WeakMap);let I=O.get(F);I===void 0?(h=Pc(),O.set(F,h)):h=I}else{let O=h.p;O===null&&(h.p=O=new Map);let I=O.get(F);I===void 0?(h=Pc(),O.set(F,h),p++):h=I}}if(h.s===Cl)return h.v;if(i!==null){let E=i;for(let T=0,F=y;T<F;T++){let O=arguments[T],I;if(typeof O=="function"||typeof O=="object"&&O!==null){let k=E.o;I=k!==null?k.get(O):void 0}else{let k=E.p;I=k!==null?k.get(O):void 0}if(I===void 0){E=null;break}E=I}if(E!==null&&E.s===Cl){let T=h;return T.s=Cl,T.v=E.v,S(),E.v}}let x=h,w=e.apply(null,arguments);if(f++,n){let E=n_(m);E!=null&&n(E,w)&&(w=E,f!==0&&f--),m=typeof w=="object"&&w!==null||typeof w=="function"?new _b(w):w}return x.s=Cl,x.v=w,a&&S(),w}return C.clearCache=()=>{r=Pc(),i=null,p=0,C.resetResultsCount()},C.resultsCount=()=>f,C.resetResultsCount=()=>{f=0},C}var Yh=Symbol("NOT_FOUND");function o_(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function a_(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 Ob=e=>Array.isArray(e)?e:[e];function i_(e){let t=Array.isArray(e[0])?e[0]:e;return a_(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function xl(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),o_(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let g={...r,...m},{memoize:S,memoizeOptions:C=[],argsMemoize:h=ii,argsMemoizeOptions:y=[]}=g,x=Ob(C),w=Ob(y),E=i_(o),T=S(function(){return a++,f.apply(null,arguments)},...x),F=!0,O=h(function(){i++;let{length:k}=E,P=new Array(k);for(let _=0;_<k;_++)P[_]=E[_].apply(null,arguments);return p=T.apply(null,P),p},...w);return Object.assign(O,{resultFunc:f,memoizedResultFunc:T,dependencies:E,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:S,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var lt=xl(ii);function s_(e){let t;return{get(r){return t&&e(t.key,r)?t.value:Yh},put(r,n){t={key:r,value:n}},findMatchingEntry(r,n){let o=t;return o!==void 0&&n(o.value,r)?o:void 0},clear(){t=void 0}}}function c_(e,t){let r=[];function n(p){let m=r.findIndex(f=>t(f.key,p));if(m>-1){let f=r[m];return m>0&&(r.splice(m,1),r.unshift(f)),f.value}return Yh}function o(p,m){r.unshift({key:p,value:m}),r.length>e&&r.pop()}function a(p,m){let f=r,{length:g}=f;for(let S=0;S<g;S++){let C=f[S];if(m(C.value,p))return C}}function i(){r=[]}return{get:n,put:o,findMatchingEntry:a,clear:i}}var u_=(e,t)=>e===t;function l_(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;let{length:o}=r;for(let a=0;a<o;a++)if(!e(r[a],n[a]))return!1;return!0}}function Kh(e,t){let r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=u_,maxSize:o=1,resultEqualityCheck:a}=r,i=l_(n),p=0,m=o<=1?s_(i):c_(o,i);function f(){let g=m.get(arguments);if(g===Yh){if(g=e.apply(null,arguments),p++,a){let S=m.findMatchingEntry(g,a);S&&(g=S.value,p!==0&&p--)}m.put(arguments,g)}return g}return f.clearCache=()=>{m.clear(),f.resetResultsCount()},f.resultsCount=()=>p,f.resetResultsCount=()=>{p=0},f}d();c();l();u();function Nb(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var Db=Nb(),qb=Nb;var d_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?yc:yc.apply(null,arguments)},VW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},p_=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Wt(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=>Sc(n)&&n.type===e,r}var Gb=class kc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,kc.prototype)}static get[Symbol.species](){return kc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new kc(...t[0].concat(this)):new kc(...t.concat(this))}};function Mb(e){return jt(e)?$o(e,()=>{}):e}function Rl(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function f_(e){return typeof e=="boolean"}var m_=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new Gb;return r&&(f_(r)?i.push(Db):i.push(qb(r.extraArgument))),i},Oc="RTK_autoBatch",ui=()=>e=>({payload:e,meta:{[Oc]:!0}}),Vb=e=>t=>{setTimeout(t,e)},g_=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},h_=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?g_(window.requestAnimationFrame,100):Vb(10):e.type==="callback"?e.queueNotification:Vb(e.timeout),f=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let S=()=>o&&g(),C=n.subscribe(S);return p.add(g),()=>{C(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Oc],a=!o,a&&(i||(i=!0,m(f))),n.dispatch(g)}finally{o=!0}}})},y_=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Gb(e);return n&&o.push(h_(typeof n=="object"?n:void 0)),o};function $b(e){let t=m_(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},m;if(typeof r=="function")m=r;else if(Br(r))m=ni(r);else throw new Error(Wt(1));let f;typeof n=="function"?f=n(t):f=t();let g=yc;o&&(g=d_({trace:!1,...typeof o=="object"&&o}));let S=gb(...f),C=y_(S),h=typeof p=="function"?p(C):C(),y=g(...h);return Dh(m,i,y)}function Hb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Wt(28));if(p in t)throw new Error(Wt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function S_(e){return typeof e=="function"}function fe(e,t){let[r,n,o]=Hb(t),a;if(S_(e))a=()=>Mb(e());else{let p=Mb(e);a=()=>p}function i(p=a(),m){let f=[r[m.type],...n.filter(({matcher:g})=>g(m)).map(({reducer:g})=>g)];return f.filter(g=>!!g).length===0&&(f=[o]),f.reduce((g,S)=>{if(S)if(zt(g)){let h=S(g,m);return h===void 0?g:h}else{if(jt(g))return $o(g,C=>S(C,m));{let C=S(g,m);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return g},p)}return i.getInitialState=a,i}var zb=(e,t)=>p_(e)?e.match(t):e(t);function Gr(...e){return t=>e.some(r=>zb(r,t))}function ci(...e){return t=>e.every(r=>zb(r,t))}function Fl(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 _c(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Tl(...e){return e.length===0?t=>Fl(t,["pending"]):_c(e)?Gr(...e.map(t=>t.pending)):Tl()(e[0])}function zo(...e){return e.length===0?t=>Fl(t,["rejected"]):_c(e)?Gr(...e.map(t=>t.rejected)):zo()(e[0])}function Nc(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ci(zo(...e),t):_c(e)?ci(zo(...e),t):Nc()(e[0])}function Pn(...e){return e.length===0?t=>Fl(t,["fulfilled"]):_c(e)?Gr(...e.map(t=>t.fulfilled)):Pn()(e[0])}function Pl(...e){return e.length===0?t=>Fl(t,["pending","fulfilled","rejected"]):_c(e)?Gr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Pl()(e[0])}var v_="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Dc=(e=21)=>{let t="",r=e;for(;r--;)t+=v_[Math.random()*64|0];return t},A_=["name","message","stack","code"],Xh=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},jb=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},b_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of A_)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Lb="External signal was aborted",me=(()=>{function e(t,r,n){let o=N(t+"/fulfilled",(m,f,g,S)=>({payload:m,meta:{...S||{},arg:g,requestId:f,requestStatus:"fulfilled"}})),a=N(t+"/pending",(m,f,g)=>({payload:void 0,meta:{...g||{},arg:f,requestId:m,requestStatus:"pending"}})),i=N(t+"/rejected",(m,f,g,S,C)=>({payload:S,error:(n&&n.serializeError||b_)(m||"Rejected"),meta:{...C||{},arg:g,requestId:f,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m,{signal:f}={}){return(g,S,C)=>{let h=n?.idGenerator?n.idGenerator(m):Dc(),y=new s.AbortController,x,w;function E(F){w=F,y.abort()}f&&(f.aborted?E(Lb):f.addEventListener("abort",()=>E(Lb),{once:!0}));let T=(async function(){let F;try{let I=n?.condition?.(m,{getState:S,extra:C});if(x_(I)&&(I=await I),I===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let k=new Promise((P,_)=>{x=()=>{_({name:"AbortError",message:w||"Aborted"})},y.signal.addEventListener("abort",x,{once:!0})});g(a(h,m,n?.getPendingMeta?.({requestId:h,arg:m},{getState:S,extra:C}))),F=await Promise.race([k,Promise.resolve(r(m,{dispatch:g,getState:S,extra:C,requestId:h,signal:y.signal,abort:E,rejectWithValue:((P,_)=>new Xh(P,_)),fulfillWithValue:((P,_)=>new jb(P,_))})).then(P=>{if(P instanceof Xh)throw P;return P instanceof jb?o(P.payload,h,m,P.meta):o(P,h,m)})])}catch(I){F=I instanceof Xh?i(null,h,m,I.payload,I.meta):i(I,h,m)}finally{x&&y.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||g(F),F})();return Object.assign(T,{abort:E,requestId:h,arg:m,unwrap(){return T.then(C_)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Gr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function C_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function x_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Wb=Symbol.for("rtk-slice-createasyncthunk"),LW={[Wb]:me};function R_(e,t){return`${e}/${t}`}function w_({creators:e}={}){let t=e?.asyncThunk?.[Wb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Wt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(E_()):n.reducers)||{},p=Object.keys(i),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(F,O){let I=typeof F=="string"?F:F.type;if(!I)throw new Error(Wt(12));if(I in m.sliceCaseReducersByType)throw new Error(Wt(13));return m.sliceCaseReducersByType[I]=O,f},addMatcher(F,O){return m.sliceMatchers.push({matcher:F,reducer:O}),f},exposeAction(F,O){return m.actionCreators[F]=O,f},exposeCaseReducer(F,O){return m.sliceCaseReducersByName[F]=O,f}};p.forEach(F=>{let O=i[F],I={reducerName:F,type:R_(o,F),createNotation:typeof n.reducers=="function"};T_(O)?k_(I,O,f,t):F_(I,O,f)});function g(){let[F={},O=[],I=void 0]=typeof n.extraReducers=="function"?Hb(n.extraReducers):[n.extraReducers],k={...F,...m.sliceCaseReducersByType};return fe(n.initialState,P=>{for(let _ in k)P.addCase(_,k[_]);for(let _ of m.sliceMatchers)P.addMatcher(_.matcher,_.reducer);for(let _ of O)P.addMatcher(_.matcher,_.reducer);I&&P.addDefaultCase(I)})}let S=F=>F,C=new Map,h=new WeakMap,y;function x(F,O){return y||(y=g()),y(F,O)}function w(){return y||(y=g()),y.getInitialState()}function E(F,O=!1){function I(P){let _=P[F];return typeof _>"u"&&O&&(_=Rl(h,I,w)),_}function k(P=S){let _=Rl(C,O,()=>new WeakMap);return Rl(_,P,()=>{let j={};for(let[B,U]of Object.entries(n.selectors??{}))j[B]=I_(U,P,()=>Rl(h,P,w),O);return j})}return{reducerPath:F,getSelectors:k,get selectors(){return k(I)},selectSlice:I}}let T={name:o,reducer:x,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:w,...E(a),injectInto(F,{reducerPath:O,...I}={}){let k=O??a;return F.inject({reducerPath:k,reducer:x},I),{...T,...E(k,!0)}}};return T}}function I_(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var Wo=w_();function E_(){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 F_({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!P_(n))throw new Error(Wt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?N(e,i):N(e))}function T_(e){return e._reducerDefinitionType==="asyncThunk"}function P_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function k_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Wt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:m,settled:f,options:g}=r,S=o(e,a,g);n.exposeAction(t,S),i&&n.addCase(S.fulfilled,i),p&&n.addCase(S.pending,p),m&&n.addCase(S.rejected,m),f&&n.addMatcher(S.settled,f),n.exposeCaseReducer(t,{fulfilled:i||wl,pending:p||wl,rejected:m||wl,settled:f||wl})}function wl(){}var O_="task",Yb="listener",Kb="completed",ey="cancelled",__=`task-${ey}`,N_=`task-${Kb}`,Zh=`${Yb}-${ey}`,D_=`${Yb}-${Kb}`,kl=class{constructor(e){de(this,"code");de(this,"name","TaskAbortError");de(this,"message");this.code=e,this.message=`${O_} ${ey} (reason: ${e})`}},ty=(e,t)=>{if(typeof e!="function")throw new TypeError(Wt(32))},Il=()=>{},Xb=(e,t=Il)=>(e.catch(t),e),Zb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ho=e=>{if(e.aborted)throw new kl(e.reason)};function Jb(e,t){let r=Il;return new Promise((n,o)=>{let a=()=>o(new kl(e.reason));if(e.aborted){a();return}r=Zb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Il})}var q_=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof kl?"cancelled":"rejected",error:r}}finally{t?.()}},El=e=>t=>Xb(Jb(e,t).then(r=>(Ho(e),r))),eC=e=>{let t=El(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:si}=Object,Ub={},Ol="listenerMiddleware",M_=(e,t)=>{let r=n=>Zb(e,()=>n.abort(e.reason));return(n,o)=>{ty(n,"taskExecutor");let a=new s.AbortController;r(a);let i=q_(async()=>{Ho(e),Ho(a.signal);let p=await n({pause:El(a.signal),delay:eC(a.signal),signal:a.signal});return Ho(a.signal),p},()=>a.abort(N_));return o?.autoJoin&&t.push(i.catch(Il)),{result:El(e)(i),cancel(){a.abort(__)}}}},V_=(e,t)=>{let r=async(n,o)=>{Ho(t);let a=()=>{},p=[new Promise((m,f)=>{let g=e({predicate:n,effect:(S,C)=>{C.unsubscribe(),m([S,C.getState(),C.getOriginalState()])}});a=()=>{g(),f()}})];o!=null&&p.push(new Promise(m=>setTimeout(m,o,null)));try{let m=await Jb(t,Promise.race(p));return Ho(t),m}finally{a()}};return((n,o)=>Xb(r(n,o)))},tC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=N(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Wt(21));return ty(a,"options.listener"),{predicate:o,type:t,effect:a}},rC=si(e=>{let{type:t,predicate:r,effect:n}=tC(e);return{id:Dc(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Wt(22))}}},{withTypes:()=>rC}),Qb=(e,t)=>{let{type:r,effect:n,predicate:o}=tC(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},Jh=e=>{e.pending.forEach(t=>{t.abort(Zh)})},j_=(e,t)=>()=>{for(let r of t.keys())Jh(r);e.clear()},Bb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},nC=si(N(`${Ol}/add`),{withTypes:()=>nC}),L_=N(`${Ol}/removeAll`),oC=si(N(`${Ol}/remove`),{withTypes:()=>oC}),U_=(...e)=>{console.error(`${Ol}/error`,...e)},aC=(e={})=>{let t=new Map,r=new Map,n=h=>{let y=r.get(h)??0;r.set(h,y+1)},o=h=>{let y=r.get(h)??1;y===1?r.delete(h):r.set(h,y-1)},{extra:a,onError:i=U_}=e;ty(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&Jh(h)}),m=(h=>{let y=Qb(t,h)??rC(h);return p(y)});si(m,{withTypes:()=>m});let f=h=>{let y=Qb(t,h);return y&&(y.unsubscribe(),h.cancelActive&&Jh(y)),!!y};si(f,{withTypes:()=>f});let g=async(h,y,x,w)=>{let E=new s.AbortController,T=V_(m,E.signal),F=[];try{h.pending.add(E),n(h),await Promise.resolve(h.effect(y,si({},x,{getOriginalState:w,condition:(O,I)=>T(O,I).then(Boolean),take:T,delay:eC(E.signal),pause:El(E.signal),extra:a,signal:E.signal,fork:M_(E.signal,F),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((O,I,k)=>{O!==E&&(O.abort(Zh),k.delete(O))})},cancel:()=>{E.abort(Zh),h.pending.delete(E)},throwIfCancelled:()=>{Ho(E.signal)}})))}catch(O){O instanceof kl||Bb(i,O,{raisedBy:"effect"})}finally{await Promise.all(F),E.abort(D_),o(h),h.pending.delete(E)}},S=j_(t,r);return{middleware:h=>y=>x=>{if(!Sc(x))return y(x);if(nC.match(x))return m(x.payload);if(L_.match(x)){S();return}if(oC.match(x))return f(x.payload);let w=h.getState(),E=()=>{if(w===Ub)throw new Error(Wt(23));return w},T;try{if(T=y(x),t.size>0){let F=h.getState(),O=Array.from(t.values());for(let I of O){let k=!1;try{k=I.predicate(x,F,w)}catch(P){k=!1,Bb(i,P,{raisedBy:"predicate"})}k&&g(I,x,h,E)}}}finally{w=Ub}return T},startListening:m,stopListening:f,clearListeners:S}};function Wt(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. `}d();c();l();u();d();c();l();u();d();c();l();u();function iC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var sC=/^(?:[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 Q_(e){return typeof e=="string"&&sC.test(e)}var ry=Q_;d();c();l();u();var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function cC(e,t=0){return(Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]).toLowerCase()}d();c();l();u();var B_=new Uint8Array(16);function ny(){return crypto.getRandomValues(B_)}d();c();l();u();function G_(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():$_(e,t,r)}function $_(e,t,r){e=e||{};let n=e.random??e.rng?.()??ny();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return cC(n)}var oy=G_;async function H_({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)}var mC="2.1.3",ay=128,gC=192,uC=224,lC=240,z_=248;function W_(e){return(e&z_)===lC?4:(e&lC)===uC?3:(e&uC)===gC?2:1}function Y_(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&ay)!=ay)break;if(r-=3,(n&gC)!=ay){t-r>=W_(n)*3&&(r=t);break}}return e.substring(0,r)}function K_(e){let{trackingId:t}=e;return{trackingId:t}}function X_(e){return(e.source||[]).concat([`relay@${mC}`])}function hC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=K_(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:X_(t),clientId:p,userAgent:a(),referrer:dC(n()),location:dC(o())})}function dC(e){return e!==null?Y_(e,1024):null}function Z_(e,t,r,n){return{...t,meta:hC(e,r,n)}}var J_="*";function eN(){let e=[];function t({type:m,callback:f}){return e.findIndex(g=>g.type===m&&g.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(g){console.error(g)}})}function a(m){if(m===J_)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function i(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?i({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function pC({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},...!!n.environment&&{environment:n.environment}})}function tN(e){let t=pC(e);return{get:()=>t,update:r=>{t=pC({...t,...r})}}}var iy=rN();function rN(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function nN(){return{getItem(e){return iy.getItem(e)||localStorage.getItem(e)},removeItem(e){iy.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),iy.setItem(e,t,31556952e3)}}}var fC="visitorId";function oN(){let e=document.referrer;return e===""?null:e}function sy(){let e=nN();return{runtime:"browser",send:async(t,r,n)=>{let o=A(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});iC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=await o;if(i?.ok){let p;try{p=await i.json()}catch{return}for(let m of p.events)if(!m.accepted)throw new Error(`Received event was rejected for processing: ${m.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)},getReferrer:()=>oN(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(fC);if(t&&ry(t))return t;let r=oy();return e.setItem(fC,r),r}}}function aN(){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 iN(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function sN(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=iN();return t&&r?{...r,runtime:"custom"}:t&&cN()&&aN()?sy():n}function cN(){try{return typeof window=="object"}catch{return!1}}function uN(e){return{get:()=>Object.freeze(sN(e))}}function yC(e){let t=tN(e),r=eN(),n=uN(t);return{emit:async(o,a)=>{let i=t.get(),p=n.get(),m=Z_(o,a,i,p);return H_({config:i,environment:p,event:m,listenerManager:r})},getMeta:o=>hC(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:mC}}d();c();l();u();function SC(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Kn="3.57.0",vC=["@coveo/atomic","@coveo/quantic"];var li=lt(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Kn}`));var lN=50,dN=xl({memoize:Kh,memoizeOptions:{maxSize:lN}}),qc=dN(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>li(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let m=fN(p);return yC({mode:a?"emit":"disabled",url:o??Zu(e,t),token:r,trackingId:n??null,source:i,environment:m})}),pN={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:async()=>{}},fN=e=>{if(!e)return;let t=e();return{...SC()?sy():pN,getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function $r(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function G(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{f(n.next(g))}catch(S){i(S)}}function m(g){try{f(n.throw(g))}catch(S){i(S)}}function f(g){g.done?a(g.value):o(g.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var je;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(je||(je={}));function ly(){return typeof window<"u"}function Ry(){return typeof navigator<"u"}function di(){return typeof document<"u"}function dy(){try{return typeof localStorage<"u"}catch{return!1}}function mN(){try{return typeof sessionStorage<"u"}catch{return!1}}function kC(){return Ry()&&navigator.cookieEnabled}var gN=[je.click,je.custom,je.search,je.view],hN=(e,t)=>gN.indexOf(e)!==-1?Object.assign({language:di()?document.documentElement.lang:"unknown",userAgent:Ry()?navigator.userAgent:"unknown"},t):t,Vc=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?AC(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],AC(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function AC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function yN(){return dy()?localStorage:kC()?new jc:mN()?sessionStorage:new fi}var jc=class e{getItem(t){return Vc.get(`${e.prefix}${t}`)}removeItem(t){Vc.erase(`${e.prefix}${t}`)}setItem(t,r,n){Vc.set(`${e.prefix}${t}`,r,n)}};jc.prefix="coveo_";var py=class{constructor(){this.cookieStorage=new jc}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)}},fi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},_l="__coveo.analytics.history",SN=20,vN=1e3*60,AN=75,Dl=class{constructor(t){this.store=t||yN()}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 G(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 G(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(_l);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return G(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(_l);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(_l,JSON.stringify(t.slice(0,SN)))}catch{}}clear(){try{this.store.removeItem(_l)}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,AN)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>vN:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var bN=(e,t)=>G(void 0,void 0,void 0,function*(){return e===je.view?(yield CN(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),CN=e=>G(void 0,void 0,void 0,function*(){let t=new Dl,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),xN=/^(?:[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 ql(e){return typeof e=="string"&&xN.test(e)}function bC(e){if(!ql(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function OC(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}var RN=new Uint8Array(16);function wN(){return crypto.getRandomValues(RN)}function IN(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}var EN="6ba7b810-9dad-11d1-80b4-00c04fd430c8",FN="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function TN(e,t,r,n,o,a){let i=typeof r=="string"?IN(r):r,p=typeof n=="string"?bC(n):n;if(typeof n=="string"&&(n=bC(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+i.length);return m.set(p),m.set(i,p.length),m=t(m),m[6]=m[6]&15|e,m[8]=m[8]&63|128,OC(m)}function Yo(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():PN(e,t,r)}function PN(e,t,r){e=e||{};let n=e.random??e.rng?.()??wN();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return OC(n)}function kN(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 cy(e,t){return e<<t|e>>>32-t}function ON(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(e.length+1);n.set(e),n[e.length]=128,e=n;let o=e.length/4+2,a=Math.ceil(o/16),i=new Array(a);for(let p=0;p<a;++p){let m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[p*64+f*4]<<24|e[p*64+f*4+1]<<16|e[p*64+f*4+2]<<8|e[p*64+f*4+3];i[p]=m}i[a-1][14]=(e.length-1)*8/2**32,i[a-1][14]=Math.floor(i[a-1][14]),i[a-1][15]=(e.length-1)*8&4294967295;for(let p=0;p<a;++p){let m=new Uint32Array(80);for(let y=0;y<16;++y)m[y]=i[p][y];for(let y=16;y<80;++y)m[y]=cy(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);let f=r[0],g=r[1],S=r[2],C=r[3],h=r[4];for(let y=0;y<80;++y){let x=Math.floor(y/20),w=cy(f,5)+kN(x,g,S,C)+h+t[x]+m[y]>>>0;h=C,C=S,S=cy(g,30)>>>0,g=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+S>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+h>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}function Ml(e,t,r,n){return TN(80,ON,e,t)}Ml.DNS=EN;Ml.URL=FN;var _C="2.33.0",CC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Mc={pageview:"pageview",event:"event"},Vl=class{constructor({client:t,uuidGenerator:r=Yo}){this.client=t,this.uuidGenerator=r}},fy=class extends Vl{constructor({client:t,uuidGenerator:r=Yo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=CC(window.location),this.lastReferrer=di()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:di()?document.title:"",encoding:di()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Mc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Mc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Mc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Mc.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 CC(window.location)}},Xn=class e{constructor(t,r){if(!ql(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return ql(a)?new e(a,Number.parseInt(o)*1e3):null}};Xn.cvo_cid="cvo_cid";Xn.expirationTime=120;var my=class extends Vl{constructor({client:t,uuidGenerator:r=Yo}){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 G(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(Xn.cvo_cid,new Xn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};my.Id="link";var vr=Object.keys;function Nl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var uy=128,NC=192,xC=224,RC=240;function _N(e){return(e&248)===RC?4:(e&RC)===xC?3:(e&xC)===NC?2:1}function NN(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&uy)!=uy)break;if(r-=3,(n&NC)!=uy){t-r>=_N(n)*3&&(r=t);break}}return e.substring(0,r)}var gy={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"},DN=vr(gy).map(e=>gy[e]),qN=[...DN].join("|"),MN=new RegExp(`^(${qN}$)`),VN={svcAction:"svc_action",svcActionData:"svc_action_data"},jN=e=>vr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=gy[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),LN=e=>MN.test(e),UN=[LN],wC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},IC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Lt={action:"pa",list:"pal",listSource:"pls"},jl={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},QN=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],hy={id:"quoteId",affiliation:"quoteAffiliation"},yy={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},BN={add:Lt,bookmark_add:Lt,bookmark_remove:Lt,click:Lt,checkout:Lt,checkout_option:Lt,detail:Lt,impression:Lt,remove:Lt,refund:Object.assign(Object.assign({},Lt),jl),purchase:Object.assign(Object.assign({},Lt),jl),quickview:Lt,quote:Object.assign(Object.assign({},Lt),hy),review:Object.assign(Object.assign({},Lt),yy)},GN=vr(wC).map(e=>wC[e]),$N=vr(IC).map(e=>IC[e]),HN=vr(Lt).map(e=>Lt[e]),zN=vr(jl).map(e=>jl[e]),WN=vr(yy).map(e=>yy[e]),YN=vr(hy).map(e=>hy[e]),KN=[...GN,"custom"].join("|"),XN=[...$N,"custom"].join("|"),DC="(pr[0-9]+)",qC="(il[0-9]+pi[0-9]+)",ZN=new RegExp(`^${DC}(${KN})$`),JN=new RegExp(`^(${qC}(${XN}))|(il[0-9]+nm)$`),eD=new RegExp(`^(${HN.join("|")})$`),tD=new RegExp(`^(${zN.join("|")})$`),rD=new RegExp(`^${DC}custom$`),nD=new RegExp(`^${qC}custom$`),oD=new RegExp(`^(${[...QN,...WN,...YN].join("|")})$`),aD=e=>ZN.test(e),iD=e=>JN.test(e),sD=e=>eD.test(e),cD=e=>tD.test(e),uD=e=>oD.test(e),lD=[iD,aD,sD,cD,uD],dD=[rD,nD],pD={anonymizeIp:"aip"},fD={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},mD={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},gD=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],hD=Object.assign(Object.assign(Object.assign(Object.assign({},pD),fD),mD),gD.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Sy=Object.assign(Object.assign({},hD),VN),yD=e=>{let t=!!e.action&&BN[e.action]||{};return vr(e).reduce((r,n)=>{let o=t[n]||Sy[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},SD=vr(Sy).map(e=>Sy[e]),vD=e=>SD.indexOf(e)!==-1,AD=e=>e==="custom",bD=e=>[...lD,...UN,vD,AD].some(t=>t(e)),CD=e=>vr(e).reduce((t,r)=>{let n=xD(r);return n?Object.assign(Object.assign({},t),RD(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),xD=e=>{let t;return[...dD].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},RD=(e,t)=>vr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),vy=class{constructor(t){this.opts=t}sendEvent(t,r){return G(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return G(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=i;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return G(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[je.click,je.custom,je.search,je.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}},Ay=class{sendEvent(t,r){return G(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){return Promise.resolve()})}},EC=v.fetch,Ll=class{constructor(t){this.opts=t}sendEvent(t,r){return G(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,g=$r(m,["url"]),S;try{S=yield EC(f,g)}catch(C){console.error("An error has occurred when sending the event.",C);return}if(S.ok){let C=yield S.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{S.json()}catch{}throw console.error(`An error has occurred when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield EC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[je.click,je.custom,je.search,je.view].indexOf(t)!==-1}getVisitorIdParam(){return G(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"})}},by=class{constructor(t,r){dy()&&kC()?this.storage=new py:dy()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new fi),this.client=new Ll(t),this.beaconClient=new vy(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Cy=class{constructor(t,r){this.storage=r||new fi,this.client=new Ll(t)}getClientDependingOnEventType(t){return this.client}},Ul=class{constructor(){this.storage=new fi,this.client=new Ay}getClientDependingOnEventType(t){return this.client}},wD="xx",ID=e=>e?.startsWith(wD)||!1,ED=`
|
|
29
|
+
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":h0(g,n,t);break}}}}function h0(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function y0(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function WA(){return{data:"",event:"",id:"",retry:void 0}}var wh="text/event-stream",S0=1e3,ZA="last-event-id";function JA(){return typeof window<"u"}function nl(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:m,...f}){return new Promise((g,S)=>{let C={...r};C.accept||(C.accept=wh);let h;function y(){h?.abort(),document.hidden||O()}!p&&JA()&&document.addEventListener("visibilitychange",y);let x=S0,w;function E(){JA()&&document.removeEventListener("visibilitychange",y),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{E(),g()});let T=m??A,F=n??v0;async function O(){h=s.AbortController?new s.AbortController:null;try{let I=await T(e,{...f,headers:C,signal:h?.signal});await F(I),await YA(I.body,KA(XA(k=>{k?C[ZA]=k:delete C[ZA]},k=>{x=k},o))),a?.(),E(),g()}catch(I){if(!h?.signal?.aborted)try{let k=i?.(I)??x;clearTimeout(w),w=setTimeout(O,k)}catch(k){E(),S(k)}}}O()})}function v0(e){let t=e.headers.get("content-type");if(!t?.startsWith(wh))throw new Error(`Expected content-type to be ${wh}, Actual: ${t}`)}d();c();l();u();var Wn=class{constructor(t){de(this,"_basePath");de(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 A0=(e,t,r)=>new Wn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,eb=3,b0=5e3,C0="text/event-stream",Fh=1,Ih=class extends Error{},mc=class extends Error{constructor(r){super(r.message);de(this,"payload",r)}},Eh=class{constructor(){de(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)}},ol=class{constructor(t){de(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:m,close:f,resetAnswer:g}=r,S=new Eh;if(!a){this.logger.error("No stream ID found");return}let C=0,h,y=()=>{h&&!S.isActive(h)&&(w?.abort(),g(),E())},x=()=>{S.remove(h),h=CA(y,h,b0),S.add(h)},w=new s.AbortController,E=()=>nl(A0(n,o,a),{method:"GET",fetch:A,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,async onopen(T){if(T.ok&&T.headers.get("content-type")===C0)return;throw T.status>=400&&T.status<500&&T.status!==429?new mc({message:"Error opening stream",code:T.status}):new Ih},onmessage:T=>{if(w?.signal.aborted)return;let F=JSON.parse(T.data);if(F.finishReason==="ERROR"){S.remove(h),w?.abort(),m({message:F.errorMessage,code:F.statusCode});return}p(F),C=0,F.finishReason==="COMPLETED"?(S.remove(h),f()):x()},onerror:T=>{if(!w?.signal.aborted){if(S.remove(h),T instanceof mc)throw w?.abort(),m(T),T;if(++C>eb){this.logger.info("Maximum retry exceeded.");let F={message:"Failed to complete stream.",code:Fh};throw w?.abort(),m(F),new mc(F)}this.logger.info(`Retrying...(${C}/${eb})`),g()}}});return E(),w}};d();c();l();u();var al=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function gc(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var Th=e=>{let{response:t}=e;return t.body?x0(e):R0(t)},x0=e=>I0(e)?E0(e):w0(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},R0=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function w0(e){return e.body.statusCode!==void 0}function I0(e){return e.body.exception!==void 0}var E0=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function tb(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Ph=(e,t,r,n)=>{let o=new Wn(`${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 rb=(e,t)=>{let r=new Wn(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},kh=async(e,t)=>{let r=await Qr.call({...Ph(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:gc(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=tb(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return F0(i)?{success:i}:{error:Th({response:r,body:i})}};function F0(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function ti(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function xt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:ti(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:ti(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function T0(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function P0(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ri(e,t){if(t&&e.name==="AbortError")return{error:P0(e)};if(e instanceof Lo)return{error:T0(e)};throw e}var Yn=e=>e.success!==void 0,Xe=e=>e.error!==void 0;function nb(e){return e.results!==void 0}function ob(e){let t=ti();return J(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var Oh=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,k0=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,hc=(e,t,r,n)=>{O0(e);let o=Oh(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},ab=(e,t,r)=>{_0(e);let n=k0(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},_h=e=>{let{insightId:t,...r}=gc(e);return r},ib=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.")},O0=e=>{if(ib(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},_0=e=>{if(ib(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var sb=e=>({...hc(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var cb=e=>({...hc(e,"POST","application/json","/search"),requestParams:_h(e)}),ub=e=>({...hc(e,"POST","application/json","/querysuggest"),requestParams:_h(e)});d();c();l();u();var lb=e=>({...ab(e,"POST","application/json"),requestParams:{objectId:e.userId}});var il=class{constructor(t){de(this,"options",t)}async getInterface(t){let r=await Qr.call({...sb(t),...this.options});if(r instanceof Error)return ri(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async query(t,r){let n=await Qr.call({...cb(t),requestMetadata:{method:"search",origin:r?.origin},...this.options});if(n instanceof Error)return ri(n);let o=await n.json();return nb(o)&&(o=ob(o)),n.ok?{success:o}:{error:o}}async querySuggest(t){let r=await Qr.call({...ub(t),...this.options});if(r instanceof Error)return ri(r);let n=await r.json();return n.completions?{success:n}:{error:n}}async userActions(t){let r=await Qr.call({...lb(t),...this.options});if(r instanceof Error)return ri(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return kh(t,{...this.options})}};d();c();l();u();d();c();l();u();var H=new $({required:!0,emptyAllowed:!1}),Ze=new $({required:!1,emptyAllowed:!1}),Je=new $({required:!0,emptyAllowed:!0}),nW=new $({required:!1,emptyAllowed:!0}),sl=new ae({each:H,required:!0}),db=new $({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),pb=new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),oW=new $({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),kr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),hr=(e,t)=>{if("required"in t)return{payload:new De({value:t}).validate({value:e}).value};let o=new Y({options:{required:!0},values:t}).validate(e);if(o)throw new Vo(o);return{payload:e}},q=(e,t)=>{try{return hr(e,t)}catch(r){return{payload:e,error:kr(r)}}},yr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return fb(e,t,r,o,"Controller initialization error")},yt=(e,t,r,n)=>{let o=`Check the options of ${n}`;return fb(e,t,r,o,"Controller initialization error")},fb=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Ft(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 N0=typeof Symbol=="function"&&Symbol.observable||"@@observable",mb=N0,Nh=()=>Math.random().toString(36).substring(7).split("").join("."),D0={INIT:`@@redux/INIT${Nh()}`,REPLACE:`@@redux/REPLACE${Nh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Nh()}`},cl=D0;function Br(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 Dh(e,t,r){if(typeof e!="function")throw new Error(Ft(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ft(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ft(1));return r(Dh)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,m=!1;function f(){i===a&&(i=new Map,a.forEach((w,E)=>{i.set(E,w)}))}function g(){if(m)throw new Error(Ft(3));return o}function S(w){if(typeof w!="function")throw new Error(Ft(4));if(m)throw new Error(Ft(5));let E=!0;f();let T=p++;return i.set(T,w),function(){if(E){if(m)throw new Error(Ft(6));E=!1,f(),i.delete(T),a=null}}}function C(w){if(!Br(w))throw new Error(Ft(7));if(typeof w.type>"u")throw new Error(Ft(8));if(typeof w.type!="string")throw new Error(Ft(17));if(m)throw new Error(Ft(9));try{m=!0,o=n(o,w)}finally{m=!1}return(a=i).forEach(T=>{T()}),w}function h(w){if(typeof w!="function")throw new Error(Ft(10));n=w,C({type:cl.REPLACE})}function y(){let w=S;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Ft(11));function T(){let O=E;O.next&&O.next(g())}return T(),{unsubscribe:w(T)}},[mb](){return this}}}return C({type:cl.INIT}),{dispatch:C,subscribe:S,getState:g,replaceReducer:h,[mb]:y}}function q0(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:cl.INIT})>"u")throw new Error(Ft(12));if(typeof r(void 0,{type:cl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ft(13))})}function ni(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{q0(r)}catch(i){a=i}return function(p={},m){if(a)throw a;let f=!1,g={};for(let S=0;S<n.length;S++){let C=n[S],h=r[C],y=p[C],x=h(y,m);if(typeof x>"u"){let w=m&&m.type;throw new Error(Ft(14))}g[C]=x,f=f||x!==y}return f=f||n.length!==Object.keys(p).length,f?g:p}}function yc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function gb(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Ft(15))},i={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(i));return a=yc(...p)(o.dispatch),{...o,dispatch:a}}}function Sc(e){return Br(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var Gh=Symbol.for("immer-nothing"),vc=Symbol.for("immer-draftable"),vt=Symbol.for("immer-state");function Tt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var cr=Object,Qo=cr.getPrototypeOf,Ac="constructor",wc="prototype",Vh="configurable",pl="enumerable",ll="writable",bc="value",zt=e=>!!e&&!!e[vt];function jt(e){return e?xb(e)||Ec(e)||!!e[vc]||!!e[Ac]?.[vc]||Fc(e)||Tc(e):!1}var M0=cr[wc][Ac].toString(),hb=new WeakMap;function xb(e){if(!e||!ai(e))return!1;let t=Qo(e);if(t===null||t===cr[wc])return!0;let r=cr.hasOwnProperty.call(t,Ac)&&t[Ac];if(r===Object)return!0;if(!Uo(r))return!1;let n=hb.get(r);return n===void 0&&(n=Function.toString.call(r),hb.set(r,n)),n===M0}function Rb(e){return zt(e)||Tt(15,e),e[vt].base_}function Ic(e,t,r=!0){Bo(e)===0?(r?Reflect.ownKeys(e):cr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Bo(e){let t=e[vt];return t?t.type_:Ec(e)?1:Fc(e)?2:Tc(e)?3:0}var oi=(e,t,r=Bo(e))=>r===2?e.has(t):cr[wc].hasOwnProperty.call(e,t),Fn=(e,t,r=Bo(e))=>r===2?e.get(t):e[t],fl=(e,t,r,n=Bo(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function V0(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ec=Array.isArray,Fc=e=>e instanceof Map,Tc=e=>e instanceof Set,ai=e=>typeof e=="object",Uo=e=>typeof e=="function",qh=e=>typeof e=="boolean";function j0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var L0=e=>ai(e)?e?.[vt]:null,Tn=e=>e.copy_||e.base_;var $h=e=>e.modified_?e.copy_:e.base_;function jh(e,t){if(Fc(e))return new Map(e);if(Tc(e))return new Set(e);if(Ec(e))return Array[wc].slice.call(e);let r=xb(e);if(t===!0||t==="class_only"&&!r){let n=cr.getOwnPropertyDescriptors(e);delete n[vt];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[ll]===!1&&(p[ll]=!0,p[Vh]=!0),(p.get||p.set)&&(n[i]={[Vh]:!0,[ll]:!0,[pl]:p[pl],[bc]:e[i]})}return cr.create(Qo(e),n)}else{let n=Qo(e);if(n!==null&&r)return{...e};let o=cr.create(n);return cr.assign(o,e)}}function Hh(e,t=!1){return vl(e)||zt(e)||!jt(e)||(Bo(e)>1&&cr.defineProperties(e,{set:ul,add:ul,clear:ul,delete:ul}),cr.freeze(e),t&&Ic(e,(r,n)=>{Hh(n,!0)},!1)),e}function U0(){Tt(2)}var ul={[bc]:U0};function vl(e){return e===null||!ai(e)?!0:cr.isFrozen(e)}var ml="MapSet",gl="Patches",yb="ArrayMethods",hl={};function Go(e){let t=hl[e];return t||Tt(0,e),t}var Sb=e=>!!hl[e];function Q0(e,t){hl[e]||(hl[e]=t)}var Cc,wb=()=>Cc,B0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Sb(ml)?Go(ml):void 0,arrayMethodsPlugin_:Sb(yb)?Go(yb):void 0});function vb(e,t){t&&(e.patchPlugin_=Go(gl),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Lh(e){Uh(e),e.drafts_.forEach(G0),e.drafts_=null}function Uh(e){e===Cc&&(Cc=e.parent_)}var Ab=e=>Cc=B0(Cc,e);function G0(e){let t=e[vt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bb(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[vt].modified_&&(Lh(t),Tt(4)),jt(e)&&(e=Cb(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[vt].base_,e,t)}else e=Cb(t,r);return $0(t,e,!0),Lh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Gh?e:void 0}function Cb(e,t){if(vl(t))return t;let r=t[vt];if(!r)return yl(t,e.handledSet_,e);if(!Al(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Fb(r,e)}return r.copy_}function $0(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hh(t,r)}function Ib(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Al=(e,t)=>e.scope_===t,H0=[];function Eb(e,t,r,n){let o=Tn(e),a=e.type_;if(n!==void 0&&Fn(o,n,a)===t){fl(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Ic(o,(m,f)=>{if(zt(f)){let g=p.get(f)||[];g.push(m),p.set(f,g)}})}let i=e.draftLocations_.get(t)??H0;for(let p of i)fl(o,p,r,a)}function z0(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Al(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=$h(a);Eb(e,a.draft_??a,i,r),Fb(a,o)})}function Fb(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}Ib(e)}}function W0(e,t,r){let{scope_:n}=e;if(zt(r)){let o=r[vt];Al(o,n)&&o.callbacks_.push(function(){dl(e);let i=$h(o);Eb(e,r,i,t)})}else jt(r)&&e.callbacks_.push(function(){let a=Tn(e);e.type_===3?a.has(r)&&yl(r,n.handledSet_,n):Fn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&yl(Fn(e.copy_,t,e.type_),n.handledSet_,n)})}function yl(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||zt(e)||t.has(e)||!jt(e)||vl(e)||(t.add(e),Ic(e,(n,o)=>{if(zt(o)){let a=o[vt];if(Al(a,r)){let i=$h(a);fl(e,n,i,e.type_),Ib(a)}}else jt(o)&&yl(o,t,r)})),e}function Y0(e,t){let r=Ec(e),n={type_:r?1:0,scope_:t?t.scope_:wb(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=Sl;r&&(o=[n],a=xc);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var Sl={get(e,t){if(t===vt)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=Tn(e);if(!oi(o,t,e.type_))return X0(e,o,t);let a=o[t];if(e.finalized_||!jt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&j0(t))return a;if(a===Mh(e.base_,t)||K0(e,t,a)){dl(e);let i=e.type_===1?+t:t,p=Bh(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in Tn(e)},ownKeys(e){return Reflect.ownKeys(Tn(e))},set(e,t,r){let n=Tb(Tn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Mh(Tn(e),t),a=o?.[vt];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(V0(r,o)&&(r!==void 0||oi(e.base_,t,e.type_)))return!0;dl(e),Qh(e)}return e.copy_[t]===r&&(r!==void 0||oi(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),W0(e,t,r)),!0},deleteProperty(e,t){return dl(e),Mh(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Tn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[ll]:!0,[Vh]:e.type_!==1||t!=="length",[pl]:n[pl],[bc]:r[t]}},defineProperty(){Tt(11)},getPrototypeOf(e){return Qo(e.base_)},setPrototypeOf(){Tt(12)}},xc={};for(let e in Sl){let t=Sl[e];xc[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}xc.deleteProperty=function(e,t){return xc.set.call(this,e,t,void 0)};xc.set=function(e,t,r){return Sl.set.call(this,e[0],t,r,e[0])};function Mh(e,t){let r=e[vt];return(r?Tn(r):e)[t]}function K0(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!jt(r)||r[vt]?!1:e.baseRefs_.has(r)}function X0(e,t,r){let n=Tb(t,r);return n?bc in n?n[bc]:n.get?.call(e.draft_):void 0}function Tb(e,t){if(!(t in e))return;let r=Qo(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Qo(r)}}function Qh(e){e.modified_||(e.modified_=!0,e.parent_&&Qh(e.parent_))}function dl(e){e.copy_||(e.assigned_=new Map,e.copy_=jh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Z0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Uo(t)&&!Uo(r)){let a=r;r=t;let i=this;return function(m=a,...f){return i.produce(m,g=>r.call(this,g,...f))}}Uo(r)||Tt(6),n!==void 0&&!Uo(n)&&Tt(7);let o;if(jt(t)){let a=Ab(this),i=Bh(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?Lh(a):Uh(a)}return vb(a,n),bb(o,a)}else if(!t||!ai(t)){if(o=r(t),o===void 0&&(o=t),o===Gh&&(o=void 0),this.autoFreeze_&&Hh(o,!0),n){let a=[],i=[];Go(gl).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else Tt(1,t)},this.produceWithPatches=(t,r)=>{if(Uo(t))return(i,...p)=>this.produceWithPatches(i,m=>t(m,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},qh(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),qh(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),qh(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){jt(e)||Tt(8),zt(e)&&(e=bl(e));let t=Ab(this),r=Bh(t,e,void 0);return r[vt].isManual_=!0,Uh(t),r}finishDraft(e,t){let r=e&&e[vt];(!r||!r.isManual_)&&Tt(9);let{scope_:n}=r;return vb(n,t),bb(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Go(gl).applyPatches_;return zt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Bh(e,t,r,n){let[o,a]=Fc(t)?Go(ml).proxyMap_(t,r):Tc(t)?Go(ml).proxySet_(t,r):Y0(t,r);return(r?.scope_??wb()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?z0(r,a,n):a.callbacks_.push(function(m){m.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:f}=m;a.modified_&&f&&f.generatePatches_(a,[],m)}),o}function bl(e){return zt(e)||Tt(10,e),Pb(e)}function Pb(e){if(!jt(e)||vl(e))return e;let t=e[vt],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=jh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=jh(e,!0);return Ic(r,(o,a)=>{fl(r,o,Pb(a))},n),t&&(t.finalized_=!1),r}function kb(){function t(y,x=[]){if(y.key_!==void 0){let w=y.parent_.copy_??y.parent_.base_,E=L0(Fn(w,y.key_)),T=Fn(w,y.key_);if(T===void 0||T!==y.draft_&&T!==y.base_&&T!==y.copy_||E!=null&&E.base_!==y.base_)return null;let F=y.parent_.type_===3,O;if(F){let I=y.parent_;O=Array.from(I.drafts_.keys()).indexOf(y.key_)}else O=y.key_;if(!(F&&w.size>O||oi(w,O)))return null;x.push(O)}if(y.parent_)return t(y.parent_,x);x.reverse();try{r(y.copy_,x)}catch{return null}return x}function r(y,x){let w=y;for(let E=0;E<x.length-1;E++){let T=x[E];if(w=Fn(w,T),!ai(w)||w===null)throw new Error(`Cannot resolve path at '${x.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(y,x,w){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:E,inversePatches_:T}=w;switch(y.type_){case 0:case 2:return m(y,x,E,T);case 1:return p(y,x,E,T);case 3:return f(y,x,E,T)}}function p(y,x,w,E){let{base_:T,assigned_:F}=y,O=y.copy_;O.length<T.length&&([T,O]=[O,T],[w,E]=[E,w]);let I=y.allIndicesReassigned_===!0;for(let k=0;k<T.length;k++){let P=O[k],_=T[k];if((I||F?.get(k.toString()))&&P!==_){let B=P?.[vt];if(B&&B.modified_)continue;let U=x.concat([k]);w.push({op:n,path:U,value:h(P)}),E.push({op:n,path:U,value:h(_)})}}for(let k=T.length;k<O.length;k++){let P=x.concat([k]);w.push({op:o,path:P,value:h(O[k])})}for(let k=O.length-1;T.length<=k;--k){let P=x.concat([k]);E.push({op:a,path:P})}}function m(y,x,w,E){let{base_:T,copy_:F,type_:O}=y;Ic(y.assigned_,(I,k)=>{let P=Fn(T,I,O),_=Fn(F,I,O),j=k?oi(T,I)?n:o:a;if(P===_&&j===n)return;let B=x.concat(I);w.push(j===a?{op:j,path:B}:{op:j,path:B,value:h(_)}),E.push(j===o?{op:a,path:B}:j===a?{op:o,path:B,value:h(P)}:{op:n,path:B,value:h(P)})})}function f(y,x,w,E){let{base_:T,copy_:F}=y,O=0;T.forEach(I=>{if(!F.has(I)){let k=x.concat([O]);w.push({op:a,path:k,value:I}),E.unshift({op:o,path:k,value:I})}O++}),O=0,F.forEach(I=>{if(!T.has(I)){let k=x.concat([O]);w.push({op:o,path:k,value:I}),E.unshift({op:a,path:k,value:I})}O++})}function g(y,x,w){let{patches_:E,inversePatches_:T}=w;E.push({op:n,path:[],value:x===Gh?void 0:x}),T.push({op:n,path:[],value:y})}function S(y,x){return x.forEach(w=>{let{path:E,op:T}=w,F=y;for(let P=0;P<E.length-1;P++){let _=Bo(F),j=E[P];typeof j!="string"&&typeof j!="number"&&(j=""+j),(_===0||_===1)&&(j==="__proto__"||j===Ac)&&Tt(19),Uo(F)&&j===wc&&Tt(19),F=Fn(F,j),(F===null||!ai(F))&&Tt(18,E.join("/"))}let O=Bo(F),I=C(w.value),k=E[E.length-1];switch(T){case n:switch(O){case 2:return F.set(k,I);case 3:Tt(16);default:return F[k]=I}case o:switch(O){case 1:return k==="-"?F.push(I):F.splice(k,0,I);case 2:return F.set(k,I);case 3:return F.add(I);default:return F[k]=I}case a:switch(O){case 1:return F.splice(k,1);case 2:return F.delete(k);case 3:return F.delete(w.value);default:return delete F[k]}default:Tt(17,T)}}),y}function C(y){if(!jt(y))return y;if(Ec(y))return y.map(C);if(Fc(y))return new Map(Array.from(y.entries()).map(([w,E])=>[w,C(E)]));if(Tc(y))return new Set(Array.from(y).map(C));let x=Object.create(Qo(y));for(let w in y)x[w]=C(y[w]);return oi(y,vc)&&(x[vc]=y[vc]),x}function h(y){return zt(y)?C(y):y}Q0(gl,{applyPatches_:S,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var J0=v.Iterator,gW=typeof J0?.from=="function";var Rc=new Z0,$o=Rc.produce,zh=Rc.produceWithPatches.bind(Rc);var Wh=Rc.applyPatches.bind(Rc);d();c();l();u();var e_=class{constructor(e){this.value=e}deref(){return this.value}},t_=()=>typeof WeakRef>"u"?e_:WeakRef,_b=t_(),r_=0,Cl=1;function Pc(){return{s:r_,v:void 0,o:null,p:null}}function n_(e){return e instanceof _b?e.deref():e}function ii(e,t={}){let r=Pc(),{resultEqualityCheck:n,maxSize:o}=t,a=o!==void 0;if(a&&(!Number.isInteger(o)||o<1))throw new TypeError(`maxSize must be a positive integer, received: ${o}`);let i=null,p=0,m,f=0,g=!1;function S(){p>=o&&(i=r,r=Pc(),p=0)}function C(){let h=r,{length:y}=arguments;for(let E=0,T=y;E<T;E++){let F=arguments[E];if(typeof F=="function"||typeof F=="object"&&F!==null){let O=h.o;O===null&&(h.o=O=new WeakMap);let I=O.get(F);I===void 0?(h=Pc(),O.set(F,h)):h=I}else{let O=h.p;O===null&&(h.p=O=new Map);let I=O.get(F);I===void 0?(h=Pc(),O.set(F,h),p++):h=I}}if(h.s===Cl)return h.v;if(i!==null){let E=i;for(let T=0,F=y;T<F;T++){let O=arguments[T],I;if(typeof O=="function"||typeof O=="object"&&O!==null){let k=E.o;I=k!==null?k.get(O):void 0}else{let k=E.p;I=k!==null?k.get(O):void 0}if(I===void 0){E=null;break}E=I}if(E!==null&&E.s===Cl){let T=h;return T.s=Cl,T.v=E.v,S(),E.v}}let x=h,w=e.apply(null,arguments);if(f++,n){let E=n_(m);E!=null&&n(E,w)&&(w=E,f!==0&&f--),m=typeof w=="object"&&w!==null||typeof w=="function"?new _b(w):w}return x.s=Cl,x.v=w,a&&S(),w}return C.clearCache=()=>{r=Pc(),i=null,p=0,C.resetResultsCount()},C.resultsCount=()=>f,C.resetResultsCount=()=>{f=0},C}var Yh=Symbol("NOT_FOUND");function o_(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function a_(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 Ob=e=>Array.isArray(e)?e:[e];function i_(e){let t=Array.isArray(e[0])?e[0]:e;return a_(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function xl(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),o_(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let g={...r,...m},{memoize:S,memoizeOptions:C=[],argsMemoize:h=ii,argsMemoizeOptions:y=[]}=g,x=Ob(C),w=Ob(y),E=i_(o),T=S(function(){return a++,f.apply(null,arguments)},...x),F=!0,O=h(function(){i++;let{length:k}=E,P=new Array(k);for(let _=0;_<k;_++)P[_]=E[_].apply(null,arguments);return p=T.apply(null,P),p},...w);return Object.assign(O,{resultFunc:f,memoizedResultFunc:T,dependencies:E,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:S,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var lt=xl(ii);function s_(e){let t;return{get(r){return t&&e(t.key,r)?t.value:Yh},put(r,n){t={key:r,value:n}},findMatchingEntry(r,n){let o=t;return o!==void 0&&n(o.value,r)?o:void 0},clear(){t=void 0}}}function c_(e,t){let r=[];function n(p){let m=r.findIndex(f=>t(f.key,p));if(m>-1){let f=r[m];return m>0&&(r.splice(m,1),r.unshift(f)),f.value}return Yh}function o(p,m){r.unshift({key:p,value:m}),r.length>e&&r.pop()}function a(p,m){let f=r,{length:g}=f;for(let S=0;S<g;S++){let C=f[S];if(m(C.value,p))return C}}function i(){r=[]}return{get:n,put:o,findMatchingEntry:a,clear:i}}var u_=(e,t)=>e===t;function l_(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;let{length:o}=r;for(let a=0;a<o;a++)if(!e(r[a],n[a]))return!1;return!0}}function Kh(e,t){let r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=u_,maxSize:o=1,resultEqualityCheck:a}=r,i=l_(n),p=0,m=o<=1?s_(i):c_(o,i);function f(){let g=m.get(arguments);if(g===Yh){if(g=e.apply(null,arguments),p++,a){let S=m.findMatchingEntry(g,a);S&&(g=S.value,p!==0&&p--)}m.put(arguments,g)}return g}return f.clearCache=()=>{m.clear(),f.resetResultsCount()},f.resultsCount=()=>p,f.resetResultsCount=()=>{p=0},f}d();c();l();u();function Nb(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var Db=Nb(),qb=Nb;var d_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?yc:yc.apply(null,arguments)},VW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},p_=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Wt(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=>Sc(n)&&n.type===e,r}var Gb=class kc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,kc.prototype)}static get[Symbol.species](){return kc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new kc(...t[0].concat(this)):new kc(...t.concat(this))}};function Mb(e){return jt(e)?$o(e,()=>{}):e}function Rl(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function f_(e){return typeof e=="boolean"}var m_=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new Gb;return r&&(f_(r)?i.push(Db):i.push(qb(r.extraArgument))),i},Oc="RTK_autoBatch",ui=()=>e=>({payload:e,meta:{[Oc]:!0}}),Vb=e=>t=>{setTimeout(t,e)},g_=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},h_=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?g_(window.requestAnimationFrame,100):Vb(10):e.type==="callback"?e.queueNotification:Vb(e.timeout),f=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let S=()=>o&&g(),C=n.subscribe(S);return p.add(g),()=>{C(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Oc],a=!o,a&&(i||(i=!0,m(f))),n.dispatch(g)}finally{o=!0}}})},y_=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Gb(e);return n&&o.push(h_(typeof n=="object"?n:void 0)),o};function $b(e){let t=m_(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},m;if(typeof r=="function")m=r;else if(Br(r))m=ni(r);else throw new Error(Wt(1));let f;typeof n=="function"?f=n(t):f=t();let g=yc;o&&(g=d_({trace:!1,...typeof o=="object"&&o}));let S=gb(...f),C=y_(S),h=typeof p=="function"?p(C):C(),y=g(...h);return Dh(m,i,y)}function Hb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Wt(28));if(p in t)throw new Error(Wt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function S_(e){return typeof e=="function"}function fe(e,t){let[r,n,o]=Hb(t),a;if(S_(e))a=()=>Mb(e());else{let p=Mb(e);a=()=>p}function i(p=a(),m){let f=[r[m.type],...n.filter(({matcher:g})=>g(m)).map(({reducer:g})=>g)];return f.filter(g=>!!g).length===0&&(f=[o]),f.reduce((g,S)=>{if(S)if(zt(g)){let h=S(g,m);return h===void 0?g:h}else{if(jt(g))return $o(g,C=>S(C,m));{let C=S(g,m);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return g},p)}return i.getInitialState=a,i}var zb=(e,t)=>p_(e)?e.match(t):e(t);function Gr(...e){return t=>e.some(r=>zb(r,t))}function ci(...e){return t=>e.every(r=>zb(r,t))}function Fl(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 _c(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Tl(...e){return e.length===0?t=>Fl(t,["pending"]):_c(e)?Gr(...e.map(t=>t.pending)):Tl()(e[0])}function zo(...e){return e.length===0?t=>Fl(t,["rejected"]):_c(e)?Gr(...e.map(t=>t.rejected)):zo()(e[0])}function Nc(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ci(zo(...e),t):_c(e)?ci(zo(...e),t):Nc()(e[0])}function Pn(...e){return e.length===0?t=>Fl(t,["fulfilled"]):_c(e)?Gr(...e.map(t=>t.fulfilled)):Pn()(e[0])}function Pl(...e){return e.length===0?t=>Fl(t,["pending","fulfilled","rejected"]):_c(e)?Gr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Pl()(e[0])}var v_="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Dc=(e=21)=>{let t="",r=e;for(;r--;)t+=v_[Math.random()*64|0];return t},A_=["name","message","stack","code"],Xh=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},jb=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},b_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of A_)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Lb="External signal was aborted",me=(()=>{function e(t,r,n){let o=N(t+"/fulfilled",(m,f,g,S)=>({payload:m,meta:{...S||{},arg:g,requestId:f,requestStatus:"fulfilled"}})),a=N(t+"/pending",(m,f,g)=>({payload:void 0,meta:{...g||{},arg:f,requestId:m,requestStatus:"pending"}})),i=N(t+"/rejected",(m,f,g,S,C)=>({payload:S,error:(n&&n.serializeError||b_)(m||"Rejected"),meta:{...C||{},arg:g,requestId:f,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m,{signal:f}={}){return(g,S,C)=>{let h=n?.idGenerator?n.idGenerator(m):Dc(),y=new s.AbortController,x,w;function E(F){w=F,y.abort()}f&&(f.aborted?E(Lb):f.addEventListener("abort",()=>E(Lb),{once:!0}));let T=(async function(){let F;try{let I=n?.condition?.(m,{getState:S,extra:C});if(x_(I)&&(I=await I),I===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let k=new Promise((P,_)=>{x=()=>{_({name:"AbortError",message:w||"Aborted"})},y.signal.addEventListener("abort",x,{once:!0})});g(a(h,m,n?.getPendingMeta?.({requestId:h,arg:m},{getState:S,extra:C}))),F=await Promise.race([k,Promise.resolve(r(m,{dispatch:g,getState:S,extra:C,requestId:h,signal:y.signal,abort:E,rejectWithValue:((P,_)=>new Xh(P,_)),fulfillWithValue:((P,_)=>new jb(P,_))})).then(P=>{if(P instanceof Xh)throw P;return P instanceof jb?o(P.payload,h,m,P.meta):o(P,h,m)})])}catch(I){F=I instanceof Xh?i(null,h,m,I.payload,I.meta):i(I,h,m)}finally{x&&y.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||g(F),F})();return Object.assign(T,{abort:E,requestId:h,arg:m,unwrap(){return T.then(C_)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Gr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function C_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function x_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Wb=Symbol.for("rtk-slice-createasyncthunk"),LW={[Wb]:me};function R_(e,t){return`${e}/${t}`}function w_({creators:e}={}){let t=e?.asyncThunk?.[Wb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Wt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(E_()):n.reducers)||{},p=Object.keys(i),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(F,O){let I=typeof F=="string"?F:F.type;if(!I)throw new Error(Wt(12));if(I in m.sliceCaseReducersByType)throw new Error(Wt(13));return m.sliceCaseReducersByType[I]=O,f},addMatcher(F,O){return m.sliceMatchers.push({matcher:F,reducer:O}),f},exposeAction(F,O){return m.actionCreators[F]=O,f},exposeCaseReducer(F,O){return m.sliceCaseReducersByName[F]=O,f}};p.forEach(F=>{let O=i[F],I={reducerName:F,type:R_(o,F),createNotation:typeof n.reducers=="function"};T_(O)?k_(I,O,f,t):F_(I,O,f)});function g(){let[F={},O=[],I=void 0]=typeof n.extraReducers=="function"?Hb(n.extraReducers):[n.extraReducers],k={...F,...m.sliceCaseReducersByType};return fe(n.initialState,P=>{for(let _ in k)P.addCase(_,k[_]);for(let _ of m.sliceMatchers)P.addMatcher(_.matcher,_.reducer);for(let _ of O)P.addMatcher(_.matcher,_.reducer);I&&P.addDefaultCase(I)})}let S=F=>F,C=new Map,h=new WeakMap,y;function x(F,O){return y||(y=g()),y(F,O)}function w(){return y||(y=g()),y.getInitialState()}function E(F,O=!1){function I(P){let _=P[F];return typeof _>"u"&&O&&(_=Rl(h,I,w)),_}function k(P=S){let _=Rl(C,O,()=>new WeakMap);return Rl(_,P,()=>{let j={};for(let[B,U]of Object.entries(n.selectors??{}))j[B]=I_(U,P,()=>Rl(h,P,w),O);return j})}return{reducerPath:F,getSelectors:k,get selectors(){return k(I)},selectSlice:I}}let T={name:o,reducer:x,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:w,...E(a),injectInto(F,{reducerPath:O,...I}={}){let k=O??a;return F.inject({reducerPath:k,reducer:x},I),{...T,...E(k,!0)}}};return T}}function I_(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var Wo=w_();function E_(){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 F_({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!P_(n))throw new Error(Wt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?N(e,i):N(e))}function T_(e){return e._reducerDefinitionType==="asyncThunk"}function P_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function k_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Wt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:m,settled:f,options:g}=r,S=o(e,a,g);n.exposeAction(t,S),i&&n.addCase(S.fulfilled,i),p&&n.addCase(S.pending,p),m&&n.addCase(S.rejected,m),f&&n.addMatcher(S.settled,f),n.exposeCaseReducer(t,{fulfilled:i||wl,pending:p||wl,rejected:m||wl,settled:f||wl})}function wl(){}var O_="task",Yb="listener",Kb="completed",ey="cancelled",__=`task-${ey}`,N_=`task-${Kb}`,Zh=`${Yb}-${ey}`,D_=`${Yb}-${Kb}`,kl=class{constructor(e){de(this,"code");de(this,"name","TaskAbortError");de(this,"message");this.code=e,this.message=`${O_} ${ey} (reason: ${e})`}},ty=(e,t)=>{if(typeof e!="function")throw new TypeError(Wt(32))},Il=()=>{},Xb=(e,t=Il)=>(e.catch(t),e),Zb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ho=e=>{if(e.aborted)throw new kl(e.reason)};function Jb(e,t){let r=Il;return new Promise((n,o)=>{let a=()=>o(new kl(e.reason));if(e.aborted){a();return}r=Zb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Il})}var q_=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof kl?"cancelled":"rejected",error:r}}finally{t?.()}},El=e=>t=>Xb(Jb(e,t).then(r=>(Ho(e),r))),eC=e=>{let t=El(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:si}=Object,Ub={},Ol="listenerMiddleware",M_=(e,t)=>{let r=n=>Zb(e,()=>n.abort(e.reason));return(n,o)=>{ty(n,"taskExecutor");let a=new s.AbortController;r(a);let i=q_(async()=>{Ho(e),Ho(a.signal);let p=await n({pause:El(a.signal),delay:eC(a.signal),signal:a.signal});return Ho(a.signal),p},()=>a.abort(N_));return o?.autoJoin&&t.push(i.catch(Il)),{result:El(e)(i),cancel(){a.abort(__)}}}},V_=(e,t)=>{let r=async(n,o)=>{Ho(t);let a=()=>{},p=[new Promise((m,f)=>{let g=e({predicate:n,effect:(S,C)=>{C.unsubscribe(),m([S,C.getState(),C.getOriginalState()])}});a=()=>{g(),f()}})];o!=null&&p.push(new Promise(m=>setTimeout(m,o,null)));try{let m=await Jb(t,Promise.race(p));return Ho(t),m}finally{a()}};return((n,o)=>Xb(r(n,o)))},tC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=N(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Wt(21));return ty(a,"options.listener"),{predicate:o,type:t,effect:a}},rC=si(e=>{let{type:t,predicate:r,effect:n}=tC(e);return{id:Dc(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Wt(22))}}},{withTypes:()=>rC}),Qb=(e,t)=>{let{type:r,effect:n,predicate:o}=tC(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},Jh=e=>{e.pending.forEach(t=>{t.abort(Zh)})},j_=(e,t)=>()=>{for(let r of t.keys())Jh(r);e.clear()},Bb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},nC=si(N(`${Ol}/add`),{withTypes:()=>nC}),L_=N(`${Ol}/removeAll`),oC=si(N(`${Ol}/remove`),{withTypes:()=>oC}),U_=(...e)=>{console.error(`${Ol}/error`,...e)},aC=(e={})=>{let t=new Map,r=new Map,n=h=>{let y=r.get(h)??0;r.set(h,y+1)},o=h=>{let y=r.get(h)??1;y===1?r.delete(h):r.set(h,y-1)},{extra:a,onError:i=U_}=e;ty(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&Jh(h)}),m=(h=>{let y=Qb(t,h)??rC(h);return p(y)});si(m,{withTypes:()=>m});let f=h=>{let y=Qb(t,h);return y&&(y.unsubscribe(),h.cancelActive&&Jh(y)),!!y};si(f,{withTypes:()=>f});let g=async(h,y,x,w)=>{let E=new s.AbortController,T=V_(m,E.signal),F=[];try{h.pending.add(E),n(h),await Promise.resolve(h.effect(y,si({},x,{getOriginalState:w,condition:(O,I)=>T(O,I).then(Boolean),take:T,delay:eC(E.signal),pause:El(E.signal),extra:a,signal:E.signal,fork:M_(E.signal,F),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((O,I,k)=>{O!==E&&(O.abort(Zh),k.delete(O))})},cancel:()=>{E.abort(Zh),h.pending.delete(E)},throwIfCancelled:()=>{Ho(E.signal)}})))}catch(O){O instanceof kl||Bb(i,O,{raisedBy:"effect"})}finally{await Promise.all(F),E.abort(D_),o(h),h.pending.delete(E)}},S=j_(t,r);return{middleware:h=>y=>x=>{if(!Sc(x))return y(x);if(nC.match(x))return m(x.payload);if(L_.match(x)){S();return}if(oC.match(x))return f(x.payload);let w=h.getState(),E=()=>{if(w===Ub)throw new Error(Wt(23));return w},T;try{if(T=y(x),t.size>0){let F=h.getState(),O=Array.from(t.values());for(let I of O){let k=!1;try{k=I.predicate(x,F,w)}catch(P){k=!1,Bb(i,P,{raisedBy:"predicate"})}k&&g(I,x,h,E)}}}finally{w=Ub}return T},startListening:m,stopListening:f,clearListeners:S}};function Wt(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. `}d();c();l();u();d();c();l();u();d();c();l();u();function iC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var sC=/^(?:[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 Q_(e){return typeof e=="string"&&sC.test(e)}var ry=Q_;d();c();l();u();var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function cC(e,t=0){return(Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]).toLowerCase()}d();c();l();u();var B_=new Uint8Array(16);function ny(){return crypto.getRandomValues(B_)}d();c();l();u();function G_(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():$_(e,t,r)}function $_(e,t,r){e=e||{};let n=e.random??e.rng?.()??ny();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return cC(n)}var oy=G_;async function H_({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)}var mC="2.1.3",ay=128,gC=192,uC=224,lC=240,z_=248;function W_(e){return(e&z_)===lC?4:(e&lC)===uC?3:(e&uC)===gC?2:1}function Y_(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&ay)!=ay)break;if(r-=3,(n&gC)!=ay){t-r>=W_(n)*3&&(r=t);break}}return e.substring(0,r)}function K_(e){let{trackingId:t}=e;return{trackingId:t}}function X_(e){return(e.source||[]).concat([`relay@${mC}`])}function hC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=K_(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:X_(t),clientId:p,userAgent:a(),referrer:dC(n()),location:dC(o())})}function dC(e){return e!==null?Y_(e,1024):null}function Z_(e,t,r,n){return{...t,meta:hC(e,r,n)}}var J_="*";function eN(){let e=[];function t({type:m,callback:f}){return e.findIndex(g=>g.type===m&&g.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(g){console.error(g)}})}function a(m){if(m===J_)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function i(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?i({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function pC({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},...!!n.environment&&{environment:n.environment}})}function tN(e){let t=pC(e);return{get:()=>t,update:r=>{t=pC({...t,...r})}}}var iy=rN();function rN(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function nN(){return{getItem(e){return iy.getItem(e)||localStorage.getItem(e)},removeItem(e){iy.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),iy.setItem(e,t,31556952e3)}}}var fC="visitorId";function oN(){let e=document.referrer;return e===""?null:e}function sy(){let e=nN();return{runtime:"browser",send:async(t,r,n)=>{let o=A(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});iC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=await o;if(i?.ok){let p;try{p=await i.json()}catch{return}for(let m of p.events)if(!m.accepted)throw new Error(`Received event was rejected for processing: ${m.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)},getReferrer:()=>oN(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(fC);if(t&&ry(t))return t;let r=oy();return e.setItem(fC,r),r}}}function aN(){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 iN(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function sN(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=iN();return t&&r?{...r,runtime:"custom"}:t&&cN()&&aN()?sy():n}function cN(){try{return typeof window=="object"}catch{return!1}}function uN(e){return{get:()=>Object.freeze(sN(e))}}function yC(e){let t=tN(e),r=eN(),n=uN(t);return{emit:async(o,a)=>{let i=t.get(),p=n.get(),m=Z_(o,a,i,p);return H_({config:i,environment:p,event:m,listenerManager:r})},getMeta:o=>hC(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:mC}}d();c();l();u();function SC(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Kn="3.57.1",vC=["@coveo/atomic","@coveo/quantic"];var li=lt(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Kn}`));var lN=50,dN=xl({memoize:Kh,memoizeOptions:{maxSize:lN}}),qc=dN(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>li(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let m=fN(p);return yC({mode:a?"emit":"disabled",url:o??Zu(e,t),token:r,trackingId:n??null,source:i,environment:m})}),pN={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:async()=>{}},fN=e=>{if(!e)return;let t=e();return{...SC()?sy():pN,getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function $r(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function G(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{f(n.next(g))}catch(S){i(S)}}function m(g){try{f(n.throw(g))}catch(S){i(S)}}function f(g){g.done?a(g.value):o(g.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var je;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(je||(je={}));function ly(){return typeof window<"u"}function Ry(){return typeof navigator<"u"}function di(){return typeof document<"u"}function dy(){try{return typeof localStorage<"u"}catch{return!1}}function mN(){try{return typeof sessionStorage<"u"}catch{return!1}}function kC(){return Ry()&&navigator.cookieEnabled}var gN=[je.click,je.custom,je.search,je.view],hN=(e,t)=>gN.indexOf(e)!==-1?Object.assign({language:di()?document.documentElement.lang:"unknown",userAgent:Ry()?navigator.userAgent:"unknown"},t):t,Vc=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?AC(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],AC(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function AC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function yN(){return dy()?localStorage:kC()?new jc:mN()?sessionStorage:new fi}var jc=class e{getItem(t){return Vc.get(`${e.prefix}${t}`)}removeItem(t){Vc.erase(`${e.prefix}${t}`)}setItem(t,r,n){Vc.set(`${e.prefix}${t}`,r,n)}};jc.prefix="coveo_";var py=class{constructor(){this.cookieStorage=new jc}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)}},fi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},_l="__coveo.analytics.history",SN=20,vN=1e3*60,AN=75,Dl=class{constructor(t){this.store=t||yN()}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 G(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 G(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(_l);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return G(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(_l);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(_l,JSON.stringify(t.slice(0,SN)))}catch{}}clear(){try{this.store.removeItem(_l)}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,AN)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>vN:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var bN=(e,t)=>G(void 0,void 0,void 0,function*(){return e===je.view?(yield CN(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),CN=e=>G(void 0,void 0,void 0,function*(){let t=new Dl,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),xN=/^(?:[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 ql(e){return typeof e=="string"&&xN.test(e)}function bC(e){if(!ql(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function OC(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}var RN=new Uint8Array(16);function wN(){return crypto.getRandomValues(RN)}function IN(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}var EN="6ba7b810-9dad-11d1-80b4-00c04fd430c8",FN="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function TN(e,t,r,n,o,a){let i=typeof r=="string"?IN(r):r,p=typeof n=="string"?bC(n):n;if(typeof n=="string"&&(n=bC(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+i.length);return m.set(p),m.set(i,p.length),m=t(m),m[6]=m[6]&15|e,m[8]=m[8]&63|128,OC(m)}function Yo(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():PN(e,t,r)}function PN(e,t,r){e=e||{};let n=e.random??e.rng?.()??wN();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return OC(n)}function kN(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 cy(e,t){return e<<t|e>>>32-t}function ON(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(e.length+1);n.set(e),n[e.length]=128,e=n;let o=e.length/4+2,a=Math.ceil(o/16),i=new Array(a);for(let p=0;p<a;++p){let m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[p*64+f*4]<<24|e[p*64+f*4+1]<<16|e[p*64+f*4+2]<<8|e[p*64+f*4+3];i[p]=m}i[a-1][14]=(e.length-1)*8/2**32,i[a-1][14]=Math.floor(i[a-1][14]),i[a-1][15]=(e.length-1)*8&4294967295;for(let p=0;p<a;++p){let m=new Uint32Array(80);for(let y=0;y<16;++y)m[y]=i[p][y];for(let y=16;y<80;++y)m[y]=cy(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);let f=r[0],g=r[1],S=r[2],C=r[3],h=r[4];for(let y=0;y<80;++y){let x=Math.floor(y/20),w=cy(f,5)+kN(x,g,S,C)+h+t[x]+m[y]>>>0;h=C,C=S,S=cy(g,30)>>>0,g=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+S>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+h>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}function Ml(e,t,r,n){return TN(80,ON,e,t)}Ml.DNS=EN;Ml.URL=FN;var _C="2.33.0",CC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Mc={pageview:"pageview",event:"event"},Vl=class{constructor({client:t,uuidGenerator:r=Yo}){this.client=t,this.uuidGenerator=r}},fy=class extends Vl{constructor({client:t,uuidGenerator:r=Yo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=CC(window.location),this.lastReferrer=di()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:di()?document.title:"",encoding:di()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Mc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Mc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Mc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Mc.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 CC(window.location)}},Xn=class e{constructor(t,r){if(!ql(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return ql(a)?new e(a,Number.parseInt(o)*1e3):null}};Xn.cvo_cid="cvo_cid";Xn.expirationTime=120;var my=class extends Vl{constructor({client:t,uuidGenerator:r=Yo}){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 G(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(Xn.cvo_cid,new Xn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};my.Id="link";var vr=Object.keys;function Nl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var uy=128,NC=192,xC=224,RC=240;function _N(e){return(e&248)===RC?4:(e&RC)===xC?3:(e&xC)===NC?2:1}function NN(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&uy)!=uy)break;if(r-=3,(n&NC)!=uy){t-r>=_N(n)*3&&(r=t);break}}return e.substring(0,r)}var gy={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"},DN=vr(gy).map(e=>gy[e]),qN=[...DN].join("|"),MN=new RegExp(`^(${qN}$)`),VN={svcAction:"svc_action",svcActionData:"svc_action_data"},jN=e=>vr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=gy[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),LN=e=>MN.test(e),UN=[LN],wC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},IC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Lt={action:"pa",list:"pal",listSource:"pls"},jl={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},QN=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],hy={id:"quoteId",affiliation:"quoteAffiliation"},yy={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},BN={add:Lt,bookmark_add:Lt,bookmark_remove:Lt,click:Lt,checkout:Lt,checkout_option:Lt,detail:Lt,impression:Lt,remove:Lt,refund:Object.assign(Object.assign({},Lt),jl),purchase:Object.assign(Object.assign({},Lt),jl),quickview:Lt,quote:Object.assign(Object.assign({},Lt),hy),review:Object.assign(Object.assign({},Lt),yy)},GN=vr(wC).map(e=>wC[e]),$N=vr(IC).map(e=>IC[e]),HN=vr(Lt).map(e=>Lt[e]),zN=vr(jl).map(e=>jl[e]),WN=vr(yy).map(e=>yy[e]),YN=vr(hy).map(e=>hy[e]),KN=[...GN,"custom"].join("|"),XN=[...$N,"custom"].join("|"),DC="(pr[0-9]+)",qC="(il[0-9]+pi[0-9]+)",ZN=new RegExp(`^${DC}(${KN})$`),JN=new RegExp(`^(${qC}(${XN}))|(il[0-9]+nm)$`),eD=new RegExp(`^(${HN.join("|")})$`),tD=new RegExp(`^(${zN.join("|")})$`),rD=new RegExp(`^${DC}custom$`),nD=new RegExp(`^${qC}custom$`),oD=new RegExp(`^(${[...QN,...WN,...YN].join("|")})$`),aD=e=>ZN.test(e),iD=e=>JN.test(e),sD=e=>eD.test(e),cD=e=>tD.test(e),uD=e=>oD.test(e),lD=[iD,aD,sD,cD,uD],dD=[rD,nD],pD={anonymizeIp:"aip"},fD={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},mD={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},gD=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],hD=Object.assign(Object.assign(Object.assign(Object.assign({},pD),fD),mD),gD.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Sy=Object.assign(Object.assign({},hD),VN),yD=e=>{let t=!!e.action&&BN[e.action]||{};return vr(e).reduce((r,n)=>{let o=t[n]||Sy[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},SD=vr(Sy).map(e=>Sy[e]),vD=e=>SD.indexOf(e)!==-1,AD=e=>e==="custom",bD=e=>[...lD,...UN,vD,AD].some(t=>t(e)),CD=e=>vr(e).reduce((t,r)=>{let n=xD(r);return n?Object.assign(Object.assign({},t),RD(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),xD=e=>{let t;return[...dD].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},RD=(e,t)=>vr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),vy=class{constructor(t){this.opts=t}sendEvent(t,r){return G(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return G(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=i;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return G(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[je.click,je.custom,je.search,je.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}},Ay=class{sendEvent(t,r){return G(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){return Promise.resolve()})}},EC=v.fetch,Ll=class{constructor(t){this.opts=t}sendEvent(t,r){return G(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,g=$r(m,["url"]),S;try{S=yield EC(f,g)}catch(C){console.error("An error has occurred when sending the event.",C);return}if(S.ok){let C=yield S.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{S.json()}catch{}throw console.error(`An error has occurred when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield EC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[je.click,je.custom,je.search,je.view].indexOf(t)!==-1}getVisitorIdParam(){return G(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"})}},by=class{constructor(t,r){dy()&&kC()?this.storage=new py:dy()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new fi),this.client=new Ll(t),this.beaconClient=new vy(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Cy=class{constructor(t,r){this.storage=r||new fi,this.client=new Ll(t)}getClientDependingOnEventType(t){return this.client}},Ul=class{constructor(){this.storage=new fi,this.client=new Ay}getClientDependingOnEventType(t){return this.client}},wD="xx",ID=e=>e?.startsWith(wD)||!1,ED=`
|
|
30
30
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
31
31
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
32
32
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|