@coveo/quantic 3.37.4 → 3.37.5

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.
@@ -24,7 +24,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24
24
 
25
25
  ${t}
26
26
  `;return new ko(r)}var ko=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw gk(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}},Ge=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ee(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 Li(e){return e===void 0}function hk(e){return e===null}function ee(e){return Li(e)||hk(e)}var de=class{constructor(e={}){De(this,"value");this.value=new Ge(e)}validate(e){let t=this.value.validate(e);return t||(yk(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function yk(e){return Li(e)||Fu(e)}function Fu(e){return typeof e=="boolean"}var oe=class{constructor(e={}){De(this,"value");this.config=e,this.value=new Ge(e)}validate(e){let t=this.value.validate(e);return t||(Sk(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 Sk(e){return Li(e)||Ov(e)}function Ov(e){return typeof e=="number"&&!Number.isNaN(e)}var vk=/^\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 Ge(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Li(e))return null;if(!Ui(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(vk.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 Ui(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(Li(e))return this.config.options.required?"value is required and is currently undefined":null;if(!_v(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ee(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function _v(e){return e!==void 0&&typeof e=="object"}var ne=class{constructor(e={}){De(this,"value");this.config=e,this.value=new Ge(this.config)}validate(e){if(!ee(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ee(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&&ee(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 Fu(e)||Ui(e)||Ov(e)||_v(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Qi(e){return Array.isArray(e)}var Hs=class{constructor(e){De(this,"value");this.config=e,this.value=new Ge(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Li(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 Tu=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Pu(e){return Array.isArray(e)}function ku(e){return e.trim()===""}function Nv(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function Ak(e){return btoa(encodeURI(e))}function Ou(e,t){let{[e]:r,...n}=t;return n}function Bi(e){return Ak(JSON.stringify(e))}var Ck=new Set(["1",1,"yes",!0]);function Dv(){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=>Ck.has(r))}function qv(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Mv(e,t,r){return clearTimeout(t),setTimeout(e,r)}function zs(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function _u(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function bk(e){if(ku(e.openingDelimiter)||ku(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ee(e.content)||ku(e.content))return e.content;if(e.highlights.length===0)return Gi(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,p=a+i.length;if(p>t)break;r+=Gi(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Gi(e.content.slice(a,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Gi(e.content.slice(n))),r}function xg(e,t){return e=Gi(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?bg(n,t.notMatchDelimiters):o?bg(o,t.exactMatchDelimiters):i?bg(i,t.correctionDelimiters):r)}function bg(e,t){return t?t.open+e+t.close:e}function Gi(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var Yv=Er($v(),1);d();c();l();u();var ie=new Error("Failed to load reducers."),$i=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."}},_o=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 Hv(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function zv(e){return typeof e!="object"||!e?!1:Object.values(e).every(Wk)}function Wk(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Wv(e){return e===429}var Vr=class e{static call(t){return _asyncToGenerator(function*(){let r=Yk(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(i,a);if(Wv(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Yv.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let h=m&&Wv(m.status);return h&&(n.info("Platform retrying request"),yield new Promise(C=>setTimeout(C,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new $i;case 404:throw new _o(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new _o(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:p,...f}=t,m=zs(f);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Ye(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Kt(e,t="prod"){return`${Ye(e,t)}/rest/search/v2`}function Du(e,t="prod"){return`${Ye(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Yk(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,p=e.method==="POST"||e.method==="PUT",f=Kk(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(p&&{body:f}),signal:a}}function Kk(e,t){return t==="application/x-www-form-urlencoded"?zv(e)?Hv(e):"":JSON.stringify(e)}d();c();l();u();var Ks=Er(qu(),1),tA=Er(Kv(),1);d();c();l();u();var Mu=Er(qu(),1),Jv=Er(Xv(),1);Mu.default.extend(Jv.default);var Zv="YYYY/MM/DD@HH:mm:ss",Xk="1401-01-01";function Hi(e,t){let r=(0,Mu.default)(e,t);return!r.isValid()&&!t?(0,Mu.default)(e,Zv):r}function Vu(e){return e.format(Zv)}function eA(e,t){let r=Hi(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}`)}jg(r)}function jg(e){if(e.isBefore(Xk))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Ks.default.extend(tA.default);var rA=["past","now","next"],nA=["minute","hour","day","week","month","quarter","year"],Jk=e=>{let t=e==="now";return{amount:new oe({required:!t,min:1}),unit:new $({required:!t,constrainTo:nA}),period:new $({required:!0,constrainTo:rA})}};function ju(e){if(typeof e=="string"&&!Un(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Lg(e):e;new Fe(Jk(t.period)).validate(t);let r=iA(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);jg(r)}function oA(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function iA(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Ks.default)().subtract(r,n);case"next":return(0,Ks.default)().add(r,n);case"now":return(0,Ks.default)()}}function Xs(e){return Vu(iA(Lg(e)))}function aA(e){return e.toLocaleLowerCase().split("-")}function Un(e){let[t,r,n]=aA(e);if(t==="now")return!0;if(!rA.includes(t)||!nA.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function sA(e){return!!e&&typeof e=="object"&&"period"in e}function Lg(e){let[t,r,n]=aA(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function cA(e){return ju(e),Lg(e)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function lA(_x3,_x4){return _lA.apply(this,arguments)}function _lA(){_lA=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _lA.apply(this,arguments)}function dA(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=eO(t,a);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function pA(e,t,r){let n=uA(),o=new TextDecoder;return function(a,p){if(a.length===0)r?.(n),n=uA();else if(p>0){let f=o.decode(a.subarray(0,p)),m=p+(a[p+1]===32?2:1),h=o.decode(a.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
27
- ${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":Zk(h,n,t);break}}}}function Zk(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function eO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function uA(){return{data:"",event:"",id:"",retry:void 0}}var Ug="text/event-stream",tO=1e3,fA="last-event-id";function mA(){return typeof window<"u"}function Lu(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:p,fetch:f,...m}){return new Promise((h,C)=>{let b={...r};b.accept||(b.accept=Ug);let g;function S(){g?.abort(),document.hidden||_()}!p&&mA()&&document.addEventListener("visibilitychange",S);let x=tO,w;function R(){mA()&&document.removeEventListener("visibilitychange",S),clearTimeout(w),g?.abort()}t?.addEventListener("abort",()=>{R(),h()});let P=f??v,E=n??rO;function _(){return _2.apply(this,arguments)}function _2(){_2=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let F=yield P(e,{...m,headers:b,signal:g?.signal});yield E(F),yield lA(F.body,dA(pA(q=>{q?b[fA]=q:delete b[fA]},q=>{x=q},o))),i?.(),R(),h()}catch(F){if(!g?.signal?.aborted)try{let q=a?.(F)??x;clearTimeout(w),w=setTimeout(_,q)}catch(q){R(),C(q)}}});return _2.apply(this,arguments)}_()})}function rO(e){let t=e.headers.get("content-type");if(!t?.startsWith(Ug))throw new Error(`Expected content-type to be ${Ug}, Actual: ${t}`)}d();c();l();u();var Qn=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 nO=(e,t,r)=>new Qn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,gA=3,oO=5e3,iO="text/event-stream",Gg=1,Qg=class extends Error{},Js=class extends Error{constructor(r){super(r.message);this.payload=r}},Bg=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)}},Uu=class{constructor(t){De(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:a}=t,{write:p,abort:f,close:m,resetAnswer:h}=r,C=new Bg;if(!i){this.logger.error("No stream ID found");return}let b=0,g,S=()=>{g&&!C.isActive(g)&&(w?.abort(),h(),R())},x=()=>{C.remove(g),g=Mv(S,g,oO),C.add(g)},w=new s.AbortController,R=()=>Lu(nO(n,o,i),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${a}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(P){return _asyncToGenerator(function*(){if(P.ok&&P.headers.get("content-type")===iO)return;throw P.status>=400&&P.status<500&&P.status!==429?new Js({message:"Error opening stream",code:P.status}):new Qg})()},onmessage:P=>{if(w?.signal.aborted)return;let E=JSON.parse(P.data);if(E.finishReason==="ERROR"){C.remove(g),w?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),b=0,E.finishReason==="COMPLETED"?(C.remove(g),m()):x()},onerror:P=>{if(!w?.signal.aborted){if(C.remove(g),P instanceof Js)throw w?.abort(),f(P),P;if(++b>gA){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:Gg};throw w?.abort(),f(E),new Js(E)}this.logger.info(`Retrying...(${b}/${gA})`),h()}}});return R(),w}};d();c();l();u();var Qu=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function Zs(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var $g=e=>{let{response:t}=e;return t.body?aO(e):sO(t)},aO=e=>uO(e)?lO(e):cO(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},sO=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function cO(e){return e.body.statusCode!==void 0}function uO(e){return e.body.exception!==void 0}var lO=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function hA(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Hg=(e,t,r,n)=>{let o=new Qn(`${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 yA=(e,t)=>{let r=new Qn(`${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},zg=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Vr.call({...Hg(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Zs(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=hA(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return dO(a)?{success:a}:{error:$g({response:r,body:a})}});return function zg(_x5,_x6){return _ref3.apply(this,arguments)}}();function dO(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function zi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function At(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:zi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:zi(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function pO(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function fO(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Wi(e,t){if(t&&e.name==="AbortError")return{error:fO(e)};if(e instanceof _o)return{error:pO(e)};throw e}var Bn=e=>e.success!==void 0,$e=e=>e.error!==void 0;function SA(e){return e.results!==void 0}function vA(e){let t=zi();return ee(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var Wg=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,mO=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,ec=(e,t,r,n)=>{gO(e);let o=Wg(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},AA=(e,t,r)=>{hO(e);let n=mO(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},Yg=e=>{let{insightId:t,...r}=Zs(e);return r},CA=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.")},gO=e=>{if(CA(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},hO=e=>{if(CA(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var bA=e=>({...ec(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var xA=e=>({...ec(e,"POST","application/json","/search"),requestParams:Yg(e)}),wA=e=>({...ec(e,"POST","application/json","/querysuggest"),requestParams:Yg(e)});d();c();l();u();var RA=e=>({...AA(e,"POST","application/json"),requestParams:{objectId:e.userId}});var Bu=class{constructor(t){this.options=t}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...bA(t),..._this.options});if(r instanceof Error)return Wi(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield Vr.call({...xA(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return Wi(n);let o=yield n.json();return SA(o)&&(o=vA(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...wA(t),..._this3.options});if(r instanceof Error)return Wi(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...RA(t),..._this4.options});if(r instanceof Error)return Wi(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return zg(t,{..._this5.options})})()}};d();c();l();u();d();c();l();u();var z=new $({required:!0,emptyAllowed:!1}),ze=new $({required:!1,emptyAllowed:!1}),Ke=new $({required:!0,emptyAllowed:!0}),N3=new $({required:!1,emptyAllowed:!0}),Gu=new ne({each:z,required:!0}),IA=new $({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),EA=new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),D3=new $({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Fr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),fr=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new Y({options:{required:!0},values:t}).validate(e);if(o)throw new ko(o);return{payload:e}},O=(e,t)=>{try{return fr(e,t)}catch(r){return{payload:e,error:Fr(r)}}},mr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return FA(e,t,r,o,"Controller initialization error")},ht=(e,t,r,n)=>{let o=`Check the options of ${n}`;return FA(e,t,r,o,"Controller initialization error")},FA=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(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 yO=typeof Symbol=="function"&&Symbol.observable||"@@observable",TA=yO,Kg=()=>Math.random().toString(36).substring(7).split("").join("."),SO={INIT:`@@redux/INIT${Kg()}`,REPLACE:`@@redux/REPLACE${Kg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Kg()}`},$u=SO;function jr(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 Xg(e,t,r){if(typeof e!="function")throw new Error(Et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Et(1));return r(Xg)(e,t)}let n=e,o=t,i=new Map,a=i,p=0,f=!1;function m(){a===i&&(a=new Map,i.forEach((w,R)=>{a.set(R,w)}))}function h(){if(f)throw new Error(Et(3));return o}function C(w){if(typeof w!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let R=!0;m();let P=p++;return a.set(P,w),function(){if(R){if(f)throw new Error(Et(6));R=!1,m(),a.delete(P),i=null}}}function b(w){if(!jr(w))throw new Error(Et(7));if(typeof w.type>"u")throw new Error(Et(8));if(typeof w.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,o=n(o,w)}finally{f=!1}return(i=a).forEach(P=>{P()}),w}function g(w){if(typeof w!="function")throw new Error(Et(10));n=w,b({type:$u.REPLACE})}function S(){let w=C;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Et(11));function P(){let _=R;_.next&&_.next(h())}return P(),{unsubscribe:w(P)}},[TA](){return this}}}return b({type:$u.INIT}),{dispatch:b,subscribe:C,getState:h,replaceReducer:g,[TA]:S}}function vO(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:$u.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:$u.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function Yi(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let p=t[a];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{vO(r)}catch(a){i=a}return function(p={},f){if(i)throw i;let m=!1,h={};for(let C=0;C<n.length;C++){let b=n[C],g=r[b],S=p[b],x=g(S,f);if(typeof x>"u"){let w=f&&f.type;throw new Error(Et(14))}h[b]=x,m=m||x!==S}return m=m||n.length!==Object.keys(p).length,m?h:p}}function tc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function PA(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Et(15))},a={getState:o.getState,dispatch:(f,...m)=>i(f,...m)},p=e.map(f=>f(a));return i=tc(...p)(o.dispatch),{...o,dispatch:i}}}function rc(e){return jr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var ah=Symbol.for("immer-nothing"),nc=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state");function Ft(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,Do=sr.getPrototypeOf,ic="constructor",lc="prototype",eh="configurable",Yu="enumerable",zu="writable",ac="value",Gt=e=>!!e&&!!e[Ct];function $t(e){return e?VA(e)||pc(e)||!!e[nc]||!!e[ic]?.[nc]||fc(e)||mc(e):!1}var AO=sr[lc][ic].toString(),kA=new WeakMap;function VA(e){if(!e||!Ki(e))return!1;let t=Do(e);if(t===null||t===sr[lc])return!0;let r=sr.hasOwnProperty.call(t,ic)&&t[ic];if(r===Object)return!0;if(!No(r))return!1;let n=kA.get(r);return n===void 0&&(n=Function.toString.call(r),kA.set(r,n)),n===AO}function jA(e){return Gt(e)||Ft(15,e),e[Ct].base_}function dc(e,t,r=!0){qo(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function qo(e){let t=e[Ct];return t?t.type_:pc(e)?1:fc(e)?2:mc(e)?3:0}var oc=(e,t,r=qo(e))=>r===2?e.has(t):sr[lc].hasOwnProperty.call(e,t),wn=(e,t,r=qo(e))=>r===2?e.get(t):e[t],Ku=(e,t,r,n=qo(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function CO(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var pc=Array.isArray,fc=e=>e instanceof Map,mc=e=>e instanceof Set,Ki=e=>typeof e=="object",No=e=>typeof e=="function",Jg=e=>typeof e=="boolean";function bO(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var xO=e=>Ki(e)?e?.[Ct]:null,Rn=e=>e.copy_||e.base_;var sh=e=>e.modified_?e.copy_:e.base_;function th(e,t){if(fc(e))return new Map(e);if(mc(e))return new Set(e);if(pc(e))return Array[lc].slice.call(e);let r=VA(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[Ct];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],p=n[a];p[zu]===!1&&(p[zu]=!0,p[eh]=!0),(p.get||p.set)&&(n[a]={[eh]:!0,[zu]:!0,[Yu]:p[Yu],[ac]:e[a]})}return sr.create(Do(e),n)}else{let n=Do(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function ch(e,t=!1){return rl(e)||Gt(e)||!$t(e)||(qo(e)>1&&sr.defineProperties(e,{set:Hu,add:Hu,clear:Hu,delete:Hu}),sr.freeze(e),t&&dc(e,(r,n)=>{ch(n,!0)},!1)),e}function wO(){Ft(2)}var Hu={[ac]:wO};function rl(e){return e===null||!Ki(e)?!0:sr.isFrozen(e)}var Xu="MapSet",Ju="Patches",OA="ArrayMethods",Zu={};function Mo(e){let t=Zu[e];return t||Ft(0,e),t}var _A=e=>!!Zu[e];function RO(e,t){Zu[e]||(Zu[e]=t)}var sc,LA=()=>sc,IO=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_A(Xu)?Mo(Xu):void 0,arrayMethodsPlugin_:_A(OA)?Mo(OA):void 0});function NA(e,t){t&&(e.patchPlugin_=Mo(Ju),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function rh(e){nh(e),e.drafts_.forEach(EO),e.drafts_=null}function nh(e){e===sc&&(sc=e.parent_)}var DA=e=>sc=IO(sc,e);function EO(e){let t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qA(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ct].modified_&&(rh(t),Ft(4)),$t(e)&&(e=MA(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[Ct].base_,e,t)}else e=MA(t,r);return FO(t,e,!0),rh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ah?e:void 0}function MA(e,t){if(rl(t))return t;let r=t[Ct];if(!r)return el(t,e.handledSet_,e);if(!nl(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);BA(r,e)}return r.copy_}function FO(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ch(t,r)}function UA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var nl=(e,t)=>e.scope_===t,TO=[];function QA(e,t,r,n){let o=Rn(e),i=e.type_;if(n!==void 0&&wn(o,n,i)===t){Ku(o,n,r,i);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;dc(o,(f,m)=>{if(Gt(m)){let h=p.get(m)||[];h.push(f),p.set(m,h)}})}let a=e.draftLocations_.get(t)??TO;for(let p of a)Ku(o,p,r,i)}function PO(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!nl(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=sh(i);QA(e,i.draft_??i,a,r),BA(i,o)})}function BA(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)}UA(e)}}function kO(e,t,r){let{scope_:n}=e;if(Gt(r)){let o=r[Ct];nl(o,n)&&o.callbacks_.push(function(){Wu(e);let a=sh(o);QA(e,r,a,t)})}else $t(r)&&e.callbacks_.push(function(){let i=Rn(e);e.type_===3?i.has(r)&&el(r,n.handledSet_,n):wn(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&el(wn(e.copy_,t,e.type_),n.handledSet_,n)})}function el(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Gt(e)||t.has(e)||!$t(e)||rl(e)||(t.add(e),dc(e,(n,o)=>{if(Gt(o)){let i=o[Ct];if(nl(i,r)){let a=sh(i);Ku(e,n,a,e.type_),UA(i)}}else $t(o)&&el(o,t,r)})),e}function OO(e,t){let r=pc(e),n={type_:r?1:0,scope_:t?t.scope_:LA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=tl;r&&(o=[n],i=cc);let{revoke:a,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=a,[p,n]}var tl={get(e,t){if(t===Ct)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=Rn(e);if(!oc(o,t,e.type_))return _O(e,o,t);let i=o[t];if(e.finalized_||!$t(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&bO(t))return i;if(i===Zg(e.base_,t)){Wu(e);let a=e.type_===1?+t:t,p=ih(e.scope_,i,e,a);return e.copy_[a]=p}return i},has(e,t){return t in Rn(e)},ownKeys(e){return Reflect.ownKeys(Rn(e))},set(e,t,r){let n=GA(Rn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zg(Rn(e),t),i=o?.[Ct];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(CO(r,o)&&(r!==void 0||oc(e.base_,t,e.type_)))return!0;Wu(e),oh(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),kO(e,t,r)),!0},deleteProperty(e,t){return Wu(e),Zg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),oh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Rn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[zu]:!0,[eh]:e.type_!==1||t!=="length",[Yu]:n[Yu],[ac]:r[t]}},defineProperty(){Ft(11)},getPrototypeOf(e){return Do(e.base_)},setPrototypeOf(){Ft(12)}},cc={};for(let e in tl){let t=tl[e];cc[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}cc.deleteProperty=function(e,t){return cc.set.call(this,e,t,void 0)};cc.set=function(e,t,r){return tl.set.call(this,e[0],t,r,e[0])};function Zg(e,t){let r=e[Ct];return(r?Rn(r):e)[t]}function _O(e,t,r){let n=GA(t,r);return n?ac in n?n[ac]:n.get?.call(e.draft_):void 0}function GA(e,t){if(!(t in e))return;let r=Do(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Do(r)}}function oh(e){e.modified_||(e.modified_=!0,e.parent_&&oh(e.parent_))}function Wu(e){e.copy_||(e.assigned_=new Map,e.copy_=th(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var NO=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(No(t)&&!No(r)){let i=r;r=t;let a=this;return function(f=i,...m){return a.produce(f,h=>r.call(this,h,...m))}}No(r)||Ft(6),n!==void 0&&!No(n)&&Ft(7);let o;if($t(t)){let i=DA(this),a=ih(i,t,void 0),p=!0;try{o=r(a),p=!1}finally{p?rh(i):nh(i)}return NA(i,n),qA(o,i)}else if(!t||!Ki(t)){if(o=r(t),o===void 0&&(o=t),o===ah&&(o=void 0),this.autoFreeze_&&ch(o,!0),n){let i=[],a=[];Mo(Ju).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else Ft(1,t)},this.produceWithPatches=(t,r)=>{if(No(t))return(a,...p)=>this.produceWithPatches(a,f=>t(f,...p));let n,o;return[this.produce(t,r,(a,p)=>{n=a,o=p}),n,o]},Jg(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Jg(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Jg(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){$t(e)||Ft(8),Gt(e)&&(e=ol(e));let t=DA(this),r=ih(t,e,void 0);return r[Ct].isManual_=!0,nh(t),r}finishDraft(e,t){let r=e&&e[Ct];(!r||!r.isManual_)&&Ft(9);let{scope_:n}=r;return NA(n,t),qA(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=Mo(Ju).applyPatches_;return Gt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function ih(e,t,r,n){let[o,i]=fc(t)?Mo(Xu).proxyMap_(t,r):mc(t)?Mo(Xu).proxySet_(t,r):OO(t,r);return(r?.scope_??LA()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?PO(r,i,n):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),o}function ol(e){return Gt(e)||Ft(10,e),$A(e)}function $A(e){if(!$t(e)||rl(e))return e;let t=e[Ct],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=th(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=th(e,!0);return dc(r,(o,i)=>{Ku(r,o,$A(i))},n),t&&(t.finalized_=!1),r}function HA(){function t(S,x=[]){if(S.key_!==void 0){let w=S.parent_.copy_??S.parent_.base_,R=xO(wn(w,S.key_)),P=wn(w,S.key_);if(P===void 0||P!==S.draft_&&P!==S.base_&&P!==S.copy_||R!=null&&R.base_!==S.base_)return null;let E=S.parent_.type_===3,_;if(E){let F=S.parent_;_=Array.from(F.drafts_.keys()).indexOf(S.key_)}else _=S.key_;if(!(E&&w.size>_||oc(w,_)))return null;x.push(_)}if(S.parent_)return t(S.parent_,x);x.reverse();try{r(S.copy_,x)}catch{return null}return x}function r(S,x){let w=S;for(let R=0;R<x.length-1;R++){let P=x[R];if(w=wn(w,P),!Ki(w)||w===null)throw new Error(`Cannot resolve path at '${x.join("/")}'`)}return w}let n="replace",o="add",i="remove";function a(S,x,w){if(S.scope_.processedForPatches_.has(S))return;S.scope_.processedForPatches_.add(S);let{patches_:R,inversePatches_:P}=w;switch(S.type_){case 0:case 2:return f(S,x,R,P);case 1:return p(S,x,R,P);case 3:return m(S,x,R,P)}}function p(S,x,w,R){let{base_:P,assigned_:E}=S,_=S.copy_;_.length<P.length&&([P,_]=[_,P],[w,R]=[R,w]);let F=S.allIndicesReassigned_===!0;for(let q=0;q<P.length;q++){let G=_[q],Q=P[q];if((F||E?.get(q.toString()))&&G!==Q){let B=G?.[Ct];if(B&&B.modified_)continue;let L=x.concat([q]);w.push({op:n,path:L,value:g(G)}),R.push({op:n,path:L,value:g(Q)})}}for(let q=P.length;q<_.length;q++){let G=x.concat([q]);w.push({op:o,path:G,value:g(_[q])})}for(let q=_.length-1;P.length<=q;--q){let G=x.concat([q]);R.push({op:i,path:G})}}function f(S,x,w,R){let{base_:P,copy_:E,type_:_}=S;dc(S.assigned_,(F,q)=>{let G=wn(P,F,_),Q=wn(E,F,_),j=q?oc(P,F)?n:o:i;if(G===Q&&j===n)return;let B=x.concat(F);w.push(j===i?{op:j,path:B}:{op:j,path:B,value:g(Q)}),R.push(j===o?{op:i,path:B}:j===i?{op:o,path:B,value:g(G)}:{op:n,path:B,value:g(G)})})}function m(S,x,w,R){let{base_:P,copy_:E}=S,_=0;P.forEach(F=>{if(!E.has(F)){let q=x.concat([_]);w.push({op:i,path:q,value:F}),R.unshift({op:o,path:q,value:F})}_++}),_=0,E.forEach(F=>{if(!P.has(F)){let q=x.concat([_]);w.push({op:o,path:q,value:F}),R.unshift({op:i,path:q,value:F})}_++})}function h(S,x,w){let{patches_:R,inversePatches_:P}=w;R.push({op:n,path:[],value:x===ah?void 0:x}),P.push({op:n,path:[],value:S})}function C(S,x){return x.forEach(w=>{let{path:R,op:P}=w,E=S;for(let G=0;G<R.length-1;G++){let Q=qo(E),j=R[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(Q===0||Q===1)&&(j==="__proto__"||j===ic)&&Ft(19),No(E)&&j===lc&&Ft(19),E=wn(E,j),Ki(E)||Ft(18,R.join("/"))}let _=qo(E),F=b(w.value),q=R[R.length-1];switch(P){case n:switch(_){case 2:return E.set(q,F);case 3:Ft(16);default:return E[q]=F}case o:switch(_){case 1:return q==="-"?E.push(F):E.splice(q,0,F);case 2:return E.set(q,F);case 3:return E.add(F);default:return E[q]=F}case i:switch(_){case 1:return E.splice(q,1);case 2:return E.delete(q);case 3:return E.delete(w.value);default:return delete E[q]}default:Ft(17,P)}}),S}function b(S){if(!$t(S))return S;if(pc(S))return S.map(b);if(fc(S))return new Map(Array.from(S.entries()).map(([w,R])=>[w,b(R)]));if(mc(S))return new Set(Array.from(S).map(b));let x=Object.create(Do(S));for(let w in S)x[w]=b(S[w]);return oc(S,nc)&&(x[nc]=S[nc]),x}function g(S){return Gt(S)?b(S):S}RO(Ju,{applyPatches_:C,generatePatches_:a,generateReplacementPatches_:h,getPath:t})}var uc=new NO,Vo=uc.produce,uh=uc.produceWithPatches.bind(uc);var lh=uc.applyPatches.bind(uc);d();c();l();u();function DO(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function qO(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function MO(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 zA=e=>Array.isArray(e)?e:[e];function VO(e){let t=Array.isArray(e[0])?e[0]:e;return MO(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jO(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var J3=Object.getPrototypeOf({});var LO=class{constructor(e){this.value=e}deref(){return this.value}},UO=typeof WeakRef<"u"?WeakRef:LO,QO=0,WA=1;function il(){return{s:QO,v:void 0,o:null,p:null}}function gc(e,t={}){let r=il(),{resultEqualityCheck:n}=t,o,i=0;function a(){let p=r,{length:f}=arguments;for(let C=0,b=f;C<b;C++){let g=arguments[C];if(typeof g=="function"||typeof g=="object"&&g!==null){let S=p.o;S===null&&(p.o=S=new WeakMap);let x=S.get(g);x===void 0?(p=il(),S.set(g,p)):p=x}else{let S=p.p;S===null&&(p.p=S=new Map);let x=S.get(g);x===void 0?(p=il(),S.set(g,p)):p=x}}let m=p,h;if(p.s===WA)h=p.v;else if(h=e.apply(null,arguments),i++,n){let C=o?.deref?.()??o;C!=null&&n(C,h)&&(h=C,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new UO(h):h}return m.s=WA,m.v=h,h}return a.clearCache=()=>{r=il(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function BO(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),DO(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let h={...r,...f},{memoize:C,memoizeOptions:b=[],argsMemoize:g=gc,argsMemoizeOptions:S=[],devModeChecks:x={}}=h,w=zA(b),R=zA(S),P=VO(o),E=C(function(){return i++,m.apply(null,arguments)},...w),_=!0,F=g(function(){a++;let G=jO(P,arguments);return p=E.apply(null,G),p},...R);return Object.assign(F,{resultFunc:m,memoizedResultFunc:E,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:C,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var it=BO(gc),GO=Object.assign((e,t=it)=>{qO(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,p,f)=>(a[r[f]]=p,a),{}))},{withTypes:()=>GO});d();c();l();u();function YA(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var KA=YA(),XA=YA;var $O=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?tc:tc.apply(null,arguments)},hz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},HO=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ht(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=>rc(n)&&n.type===e,r}var iC=class hc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,hc.prototype)}static get[Symbol.species](){return hc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new hc(...t[0].concat(this)):new hc(...t.concat(this))}};function JA(e){return $t(e)?Vo(e,()=>{}):e}function al(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function zO(e){return typeof e=="boolean"}var WO=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new iC;return r&&(zO(r)?a.push(KA):a.push(XA(r.extraArgument))),a},yc="RTK_autoBatch",Zi=()=>e=>({payload:e,meta:{[yc]:!0}}),ZA=e=>t=>{setTimeout(t,e)},YO=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ZA(10):e.type==="callback"?e.queueNotification:ZA(e.timeout),m=()=>{a=!1,i&&(i=!1,p.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let C=()=>o&&h(),b=n.subscribe(C);return p.add(h),()=>{b(),p.delete(h)}},dispatch(h){try{return o=!h?.meta?.[yc],i=!o,i&&(a||(a=!0,f(m))),n.dispatch(h)}finally{o=!0}}})},KO=e=>function(r){let{autoBatch:n=!0}=r??{},o=new iC(e);return n&&o.push(YO(typeof n=="object"?n:void 0)),o};function aC(e){let t=WO(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(jr(r))f=Yi(r);else throw new Error(Ht(1));let m;typeof n=="function"?m=n(t):m=t();let h=tc;o&&(h=$O({trace:!1,...(typeof o=="object"&&o)}));let C=PA(...m),b=KO(C),g=typeof p=="function"?p(b):b(),S=h(...g);return Xg(f,a,S)}function sC(e){let t={},r=[],n,o={addCase(i,a){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Ht(28));if(p in t)throw new Error(Ht(29));return t[p]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function XO(e){return typeof e=="function"}function le(e,t){let[r,n,o]=sC(t),i;if(XO(e))i=()=>JA(e());else{let p=JA(e);i=()=>p}function a(p=i(),f){let m=[r[f.type],...n.filter(({matcher:h})=>h(f)).map(({reducer:h})=>h)];return m.filter(h=>!!h).length===0&&(m=[o]),m.reduce((h,C)=>{if(C)if(Gt(h)){let g=C(h,f);return g===void 0?h:g}else{if($t(h))return Vo(h,b=>C(b,f));{let b=C(h,f);if(b===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return h},p)}return a.getInitialState=i,a}var cC=(e,t)=>HO(e)?e.match(t):e(t);function Lr(...e){return t=>e.some(r=>cC(r,t))}function Ji(...e){return t=>e.every(r=>cC(r,t))}function ll(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 Sc(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function dl(...e){return e.length===0?t=>ll(t,["pending"]):Sc(e)?Lr(...e.map(t=>t.pending)):dl()(e[0])}function Lo(...e){return e.length===0?t=>ll(t,["rejected"]):Sc(e)?Lr(...e.map(t=>t.rejected)):Lo()(e[0])}function vc(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Ji(Lo(...e),t):Sc(e)?Ji(Lo(...e),t):vc()(e[0])}function In(...e){return e.length===0?t=>ll(t,["fulfilled"]):Sc(e)?Lr(...e.map(t=>t.fulfilled)):In()(e[0])}function pl(...e){return e.length===0?t=>ll(t,["pending","fulfilled","rejected"]):Sc(e)?Lr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):pl()(e[0])}var JO="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ac=(e=21)=>{let t="",r=e;for(;r--;)t+=JO[Math.random()*64|0];return t},ZO=["name","message","stack","code"],dh=class{constructor(e,t){De(this,"_type");this.payload=e,this.meta=t}},eC=class{constructor(e,t){De(this,"_type");this.payload=e,this.meta=t}},e_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of ZO)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},tC="External signal was aborted",pe=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,m,h,C)=>({payload:f,meta:{...(C||{}),arg:h,requestId:m,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,m,h)=>({payload:void 0,meta:{...(h||{}),arg:m,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,m,h,C,b)=>({payload:C,error:(n&&n.serializeError||e_)(f||"Rejected"),meta:{...(b||{}),arg:h,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(h,C,b)=>{let g=n?.idGenerator?n.idGenerator(f):Ac(),S=new s.AbortController,x,w;function R(E){w=E,S.abort()}m&&(m.aborted?R(tC):m.addEventListener("abort",()=>R(tC),{once:!0}));let P=_asyncToGenerator(function*(){let E;try{let F=n?.condition?.(f,{getState:C,extra:b});if(r_(F)&&(F=yield F),F===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((G,Q)=>{x=()=>{Q({name:"AbortError",message:w||"Aborted"})},S.signal.addEventListener("abort",x,{once:!0})});h(i(g,f,n?.getPendingMeta?.({requestId:g,arg:f},{getState:C,extra:b}))),E=yield Promise.race([q,Promise.resolve(r(f,{dispatch:h,getState:C,extra:b,requestId:g,signal:S.signal,abort:R,rejectWithValue:(G,Q)=>new dh(G,Q),fulfillWithValue:(G,Q)=>new eC(G,Q)})).then(G=>{if(G instanceof dh)throw G;return G instanceof eC?o(G.payload,g,f,G.meta):o(G,g,f)})])}catch(F){E=F instanceof dh?a(null,g,f,F.payload,F.meta):a(F,g,f)}finally{x&&S.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&a.match(E)&&E.meta.condition||h(E),E})();return Object.assign(P,{abort:R,requestId:g,arg:f,unwrap(){return P.then(t_)}})}}return Object.assign(p,{pending:i,rejected:a,fulfilled:o,settled:Lr(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function t_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function r_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var uC=Symbol.for("rtk-slice-createasyncthunk"),Sz={[uC]:pe};function n_(e,t){return`${e}/${t}`}function o_({creators:e}={}){let t=e?.asyncThunk?.[uC];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ht(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(a_()):n.reducers)||{},p=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(E,_){let F=typeof E=="string"?E:E.type;if(!F)throw new Error(Ht(12));if(F in f.sliceCaseReducersByType)throw new Error(Ht(13));return f.sliceCaseReducersByType[F]=_,m},addMatcher(E,_){return f.sliceMatchers.push({matcher:E,reducer:_}),m},exposeAction(E,_){return f.actionCreators[E]=_,m},exposeCaseReducer(E,_){return f.sliceCaseReducersByName[E]=_,m}};p.forEach(E=>{let _=a[E],F={reducerName:E,type:n_(o,E),createNotation:typeof n.reducers=="function"};c_(_)?l_(F,_,m,t):s_(F,_,m)});function h(){let[E={},_=[],F=void 0]=typeof n.extraReducers=="function"?sC(n.extraReducers):[n.extraReducers],q={...E,...f.sliceCaseReducersByType};return le(n.initialState,G=>{for(let Q in q)G.addCase(Q,q[Q]);for(let Q of f.sliceMatchers)G.addMatcher(Q.matcher,Q.reducer);for(let Q of _)G.addMatcher(Q.matcher,Q.reducer);F&&G.addDefaultCase(F)})}let C=E=>E,b=new Map,g=new WeakMap,S;function x(E,_){return S||(S=h()),S(E,_)}function w(){return S||(S=h()),S.getInitialState()}function R(E,_=!1){function F(G){let Q=G[E];return typeof Q>"u"&&_&&(Q=al(g,F,w)),Q}function q(G=C){let Q=al(b,_,()=>new WeakMap);return al(Q,G,()=>{let j={};for(let[B,L]of Object.entries(n.selectors??{}))j[B]=i_(L,G,()=>al(g,G,w),_);return j})}return{reducerPath:E,getSelectors:q,get selectors(){return q(F)},selectSlice:F}}let P={name:o,reducer:x,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(i),injectInto(E,{reducerPath:_,...F}={}){let q=_??i;return E.inject({reducerPath:q,reducer:x},F),{...P,...R(q,!0)}}};return P}}function i_(e,t,r,n){function o(i,...a){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...a)}return o.unwrapped=e,o}var Uo=o_();function a_(){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 s_({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!u_(n))throw new Error(Ht(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function c_(e){return e._reducerDefinitionType==="asyncThunk"}function u_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function l_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ht(18));let{payloadCreator:i,fulfilled:a,pending:p,rejected:f,settled:m,options:h}=r,C=o(e,i,h);n.exposeAction(t,C),a&&n.addCase(C.fulfilled,a),p&&n.addCase(C.pending,p),f&&n.addCase(C.rejected,f),m&&n.addMatcher(C.settled,m),n.exposeCaseReducer(t,{fulfilled:a||sl,pending:p||sl,rejected:f||sl,settled:m||sl})}function sl(){}var d_="task",lC="listener",dC="completed",mh="cancelled",p_=`task-${mh}`,f_=`task-${dC}`,ph=`${lC}-${mh}`,m_=`${lC}-${dC}`,fl=class{constructor(e){De(this,"name","TaskAbortError");De(this,"message");this.code=e,this.message=`${d_} ${mh} (reason: ${e})`}},gh=(e,t)=>{if(typeof e!="function")throw new TypeError(Ht(32))},cl=()=>{},pC=(e,t=cl)=>(e.catch(t),e),fC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),jo=e=>{if(e.aborted)throw new fl(e.reason)};function mC(e,t){let r=cl;return new Promise((n,o)=>{let i=()=>o(new fl(e.reason));if(e.aborted){i();return}r=fC(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=cl})}var g_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof fl?"cancelled":"rejected",error:r}}finally{t?.()}});return function g_(_x7,_x8){return _ref5.apply(this,arguments)}}(),ul=e=>t=>pC(mC(e,t).then(r=>(jo(e),r))),gC=e=>{let t=ul(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Xi}=Object,rC={},ml="listenerMiddleware",h_=(e,t)=>{let r=n=>fC(e,()=>n.abort(e.reason));return(n,o)=>{gh(n,"taskExecutor");let i=new s.AbortController;r(i);let a=g_(/*#__PURE__*/_asyncToGenerator(function*(){jo(e),jo(i.signal);let p=yield n({pause:ul(i.signal),delay:gC(i.signal),signal:i.signal});return jo(i.signal),p}),()=>i.abort(f_));return o?.autoJoin&&t.push(a.catch(cl)),{result:ul(e)(a),cancel(){i.abort(p_)}}}},y_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){jo(t);let i=()=>{},p=[new Promise((f,m)=>{let h=e({predicate:n,effect:(C,b)=>{b.unsubscribe(),f([C,b.getState(),b.getOriginalState()])}});i=()=>{h(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield mC(t,Promise.race(p));return jo(t),f}finally{i()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>pC(r(n,o))},hC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=T(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Ht(21));return gh(i,"options.listener"),{predicate:o,type:t,effect:i}},yC=Xi(e=>{let{type:t,predicate:r,effect:n}=hC(e);return{id:Ac(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Ht(22))}}},{withTypes:()=>yC}),nC=(e,t)=>{let{type:r,effect:n,predicate:o}=hC(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},fh=e=>{e.pending.forEach(t=>{t.abort(ph)})},S_=(e,t)=>()=>{for(let r of t.keys())fh(r);e.clear()},oC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},SC=Xi(T(`${ml}/add`),{withTypes:()=>SC}),v_=T(`${ml}/removeAll`),vC=Xi(T(`${ml}/remove`),{withTypes:()=>vC}),A_=(...e)=>{console.error(`${ml}/error`,...e)},AC=(e={})=>{let t=new Map,r=new Map,n=g=>{let S=r.get(g)??0;r.set(g,S+1)},o=g=>{let S=r.get(g)??1;S===1?r.delete(g):r.set(g,S-1)},{extra:i,onError:a=A_}=e;gh(a,"onError");let p=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),S=>{g.unsubscribe(),S?.cancelActive&&fh(g)}),f=g=>{let S=nC(t,g)??yC(g);return p(S)};Xi(f,{withTypes:()=>f});let m=g=>{let S=nC(t,g);return S&&(S.unsubscribe(),g.cancelActive&&fh(S)),!!S};Xi(m,{withTypes:()=>m});let h=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,S,x,w){let R=new s.AbortController,P=y_(f,R.signal),E=[];try{g.pending.add(R),n(g),yield Promise.resolve(g.effect(S,Xi({},x,{getOriginalState:w,condition:(_,F)=>P(_,F).then(Boolean),take:P,delay:gC(R.signal),pause:ul(R.signal),extra:i,signal:R.signal,fork:h_(R.signal,E),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((_,F,q)=>{_!==R&&(_.abort(ph),q.delete(_))})},cancel:()=>{R.abort(ph),g.pending.delete(R)},throwIfCancelled:()=>{jo(R.signal)}})))}catch(_){_ instanceof fl||oC(a,_,{raisedBy:"effect"})}finally{yield Promise.all(E),R.abort(m_),o(g),g.pending.delete(R)}});return function h(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),C=S_(t,r);return{middleware:g=>S=>x=>{if(!rc(x))return S(x);if(SC.match(x))return f(x.payload);if(v_.match(x)){C();return}if(vC.match(x))return m(x.payload);let w=g.getState(),R=()=>{if(w===rC)throw new Error(Ht(23));return w},P;try{if(P=S(x),t.size>0){let E=g.getState(),_=Array.from(t.values());for(let F of _){let q=!1;try{q=F.predicate(x,E,w)}catch(G){q=!1,oC(a,G,{raisedBy:"predicate"})}q&&h(F,x,g,R)}}}finally{w=rC}return P},startListening:f,stopListening:m,clearListeners:C}};function Ht(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 CC(){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 bC=/^(?:[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 C_(e){return typeof e=="string"&&bC.test(e)}var hh=C_;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function xC(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var yh,b_=new Uint8Array(16);function Sh(){if(!yh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yh=crypto.getRandomValues.bind(crypto)}return yh(b_)}d();c();l();u();d();c();l();u();var x_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vh={randomUUID:x_};function w_(e,t,r){e=e||{};let n=e.random??e.rng?.()??Sh();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 xC(n)}function R_(e,t,r){return vh.randomUUID&&!t&&!e?vh.randomUUID():w_(e,t,r)}var Ah=R_;function I_(_x13){return _I_.apply(this,arguments)}function _I_(){_I_=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _I_.apply(this,arguments)}var TC="2.1.1",Ch=128,PC=192,wC=224,RC=240,E_=248;function F_(e){return(e&E_)===RC?4:(e&RC)===wC?3:(e&wC)===PC?2:1}function T_(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&Ch)!=Ch)break;if(r-=3,(n&PC)!=Ch){t-r>=F_(n)*3&&(r=t);break}}return e.substring(0,r)}function P_(e){let{trackingId:t}=e;return{trackingId:t}}function k_(e){return(e.source||[]).concat([`relay@${TC}`])}function kC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=P_(t),p=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:k_(t),clientId:p,userAgent:i(),referrer:IC(n()),location:IC(o())})}function IC(e){return e!==null?T_(e,1024):null}function O_(e,t,r,n){return{...t,meta:kC(e,r,n)}}var __="*";function N_(){let e=[];function t({type:f,callback:m}){return e.findIndex(h=>h.type===f&&h.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(h){console.error(h)}})}function i(f){if(f===__)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function a(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?a({type:f,callback:m}):i(f)}return{add:n,call:o,remove:p}}function EC({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 D_(e){let t=EC(e);return{get:()=>t,update:r=>{t=EC({...t,...r})}}}var bh=q_();function q_(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function M_(){return{getItem(e){return bh.getItem(e)||localStorage.getItem(e)},removeItem(e){bh.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),bh.setItem(e,t,31556952e3)}}}var FC="visitorId";function V_(){let e=document.referrer;return e===""?null:e}function xh(){let e=M_();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=v(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});CC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let p;try{p=yield a.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>V_(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(FC);if(t&&hh(t))return t;let r=Ah();return e.setItem(FC,r),r}}}function j_(){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 L_(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function U_(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=L_();return t&&r?{...r,runtime:"custom"}:t&&Q_()&&j_()?xh():n}function Q_(){try{return typeof window=="object"}catch{return!1}}function B_(e){return{get:()=>Object.freeze(U_(e))}}function OC(e){let t=D_(e),r=N_(),n=B_(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,i){let a=t.get(),p=n.get(),f=O_(o,i,a,p);return I_({config:a,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>kC(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:TC}}d();c();l();u();function _C(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Gn="3.49.1",NC=["@coveo/atomic","@coveo/quantic"];var ea=it(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Gn}`));var Cc=it(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ea(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,p)=>{let f=$_(p);return OC({mode:i?"emit":"disabled",url:o??Du(e,t),token:r,trackingId:n??null,source:a,environment:f})}),G_={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},$_=e=>{if(!e)return;let t=e();return{...(_C()?xh():G_),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Ur(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 U(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(h){try{m(n.next(h))}catch(C){a(C)}}function f(h){try{m(n.throw(h))}catch(C){a(C)}}function m(h){h.done?i(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Oe;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Oe||(Oe={}));function Ih(){return typeof window<"u"}function Lh(){return typeof navigator<"u"}function ta(){return typeof document<"u"}function Eh(){try{return typeof localStorage<"u"}catch{return!1}}function H_(){try{return typeof sessionStorage<"u"}catch{return!1}}function zC(){return Lh()&&navigator.cookieEnabled}var z_=[Oe.click,Oe.custom,Oe.search,Oe.view],W_=(e,t)=>z_.indexOf(e)!==-1?Object.assign({language:ta()?document.documentElement.lang:"unknown",userAgent:Lh()?navigator.userAgent:"unknown"},t):t,xc=class e{static set(t,r,n){var o,i,a,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?DC(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],DC(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function DC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Y_(){return Eh()?localStorage:zC()?new wc:H_()?sessionStorage:new na}var wc=class e{getItem(t){return xc.get(`${e.prefix}${t}`)}removeItem(t){xc.erase(`${e.prefix}${t}`)}setItem(t,r,n){xc.set(`${e.prefix}${t}`,r,n)}};wc.prefix="coveo_";var Fh=class{constructor(){this.cookieStorage=new wc}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)}},na=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},gl="__coveo.analytics.history",K_=20,X_=1e3*60,J_=75,Sl=class{constructor(t){this.store=t||Y_()}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 U(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 U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(gl);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(gl);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(gl,JSON.stringify(t.slice(0,K_)))}catch{}}clear(){try{this.store.removeItem(gl)}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,J_)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>X_:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Z_=(e,t)=>U(void 0,void 0,void 0,function*(){return e===Oe.view?(yield eN(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),eN=e=>U(void 0,void 0,void 0,function*(){let t=new Sl,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),hl,tN=new Uint8Array(16);function rN(){if(!hl&&(hl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hl(tN)}var nN=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function vl(e){return typeof e=="string"&&nN.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function WC(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]]}function oN(e){if(!vl(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function iN(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var aN="6ba7b810-9dad-11d1-80b4-00c04fd430c8",sN="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function cN(e,t,r){function n(o,i,a,p){var f;if(typeof o=="string"&&(o=iN(o)),typeof i=="string"&&(i=oN(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(i),m.set(o,i.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,a){p=p||0;for(let h=0;h<16;++h)a[p+h]=m[h];return a}return WC(m)}try{n.name=e}catch{}return n.DNS=aN,n.URL=sN,n}var uN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qC={randomUUID:uN};function Qo(e,t,r){if(qC.randomUUID&&!t&&!e)return qC.randomUUID();e=e||{};let n=e.random||(e.rng||rN)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return WC(n)}function lN(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 wh(e,t){return e<<t|e>>>32-t}function dN(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let p=0;p<a.length;++p)e.push(a.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=p}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let p=new Uint32Array(80);for(let g=0;g<16;++g)p[g]=i[a][g];for(let g=16;g<80;++g)p[g]=wh(p[g-3]^p[g-8]^p[g-14]^p[g-16],1);let f=r[0],m=r[1],h=r[2],C=r[3],b=r[4];for(let g=0;g<80;++g){let S=Math.floor(g/20),x=wh(f,5)+lN(S,m,h,C)+b+t[S]+p[g]>>>0;b=C,C=h,h=wh(m,30)>>>0,m=f,f=x}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var pN=cN("v5",80,dN),MC=pN,YC="2.30.54",VC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,bc={pageview:"pageview",event:"event"},Al=class{constructor({client:t,uuidGenerator:r=Qo}){this.client=t,this.uuidGenerator=r}},Th=class extends Al{constructor({client:t,uuidGenerator:r=Qo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=VC(window.location),this.lastReferrer=ta()?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:ta()?document.title:"",encoding:ta()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===bc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===bc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===bc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===bc.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 VC(window.location)}},$n=class e{constructor(t,r){if(!vl(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return vl(i)?new e(i,Number.parseInt(o)*1e3):null}};$n.cvo_cid="cvo_cid";$n.expirationTime=120;var Ph=class extends Al{constructor({client:t,uuidGenerator:r=Qo}){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 U(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($n.cvo_cid,new $n(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ph.Id="link";var hr=Object.keys;function yl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Rh=128,KC=192,jC=224,LC=240;function fN(e){return(e&248)===LC?4:(e&LC)===jC?3:(e&jC)===KC?2:1}function mN(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&Rh)!=Rh)break;if(r-=3,(n&KC)!=Rh){t-r>=fN(n)*3&&(r=t);break}}return e.substring(0,r)}var kh={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"},gN=hr(kh).map(e=>kh[e]),hN=[...gN].join("|"),yN=new RegExp(`^(${hN}$)`),SN={svcAction:"svc_action",svcActionData:"svc_action_data"},vN=e=>hr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=kh[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),AN=e=>yN.test(e),CN=[AN],UC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},QC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},Cl={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},bN=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Oh={id:"quoteId",affiliation:"quoteAffiliation"},_h={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},xN={add:Mt,bookmark_add:Mt,bookmark_remove:Mt,click:Mt,checkout:Mt,checkout_option:Mt,detail:Mt,impression:Mt,remove:Mt,refund:Object.assign(Object.assign({},Mt),Cl),purchase:Object.assign(Object.assign({},Mt),Cl),quickview:Mt,quote:Object.assign(Object.assign({},Mt),Oh),review:Object.assign(Object.assign({},Mt),_h)},wN=hr(UC).map(e=>UC[e]),RN=hr(QC).map(e=>QC[e]),IN=hr(Mt).map(e=>Mt[e]),EN=hr(Cl).map(e=>Cl[e]),FN=hr(_h).map(e=>_h[e]),TN=hr(Oh).map(e=>Oh[e]),PN=[...wN,"custom"].join("|"),kN=[...RN,"custom"].join("|"),XC="(pr[0-9]+)",JC="(il[0-9]+pi[0-9]+)",ON=new RegExp(`^${XC}(${PN})$`),_N=new RegExp(`^(${JC}(${kN}))|(il[0-9]+nm)$`),NN=new RegExp(`^(${IN.join("|")})$`),DN=new RegExp(`^(${EN.join("|")})$`),qN=new RegExp(`^${XC}custom$`),MN=new RegExp(`^${JC}custom$`),VN=new RegExp(`^(${[...bN,...FN,...TN].join("|")})$`),jN=e=>ON.test(e),LN=e=>_N.test(e),UN=e=>NN.test(e),QN=e=>DN.test(e),BN=e=>VN.test(e),GN=[LN,jN,UN,QN,BN],$N=[qN,MN],HN={anonymizeIp:"aip"},zN={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},WN={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},YN=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],KN=Object.assign(Object.assign(Object.assign(Object.assign({},HN),zN),WN),YN.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Nh=Object.assign(Object.assign({},KN),SN),XN=e=>{let t=!!e.action&&xN[e.action]||{};return hr(e).reduce((r,n)=>{let o=t[n]||Nh[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},JN=hr(Nh).map(e=>Nh[e]),ZN=e=>JN.indexOf(e)!==-1,e0=e=>e==="custom",t0=e=>[...GN,...CN,ZN,e0].some(t=>t(e)),r0=e=>hr(e).reduce((t,r)=>{let n=n0(r);return n?Object.assign(Object.assign({},t),o0(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),n0=e=>{let t;return[...$N].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},o0=(e,t)=>hr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Dh=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=a;o=p||t;try{i=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return U(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Oe.click,Oe.custom,Oe.search,Oe.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}},qh=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},BC=y.fetch,bl=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),i?yield i(p,"analyticsFetch"):{}),{url:m}=f,h=Ur(f,["url"]),C;try{C=yield BC(m,h)}catch(b){console.error("An error has occured when sending the event.",b);return}if(C.ok){let b=yield C.json();return b.visitorId&&o.setCurrentVisitorId(b.visitorId),b}else{try{C.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,C,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield BC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Oe.click,Oe.custom,Oe.search,Oe.view].indexOf(t)!==-1}getVisitorIdParam(){return U(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"})}},Mh=class{constructor(t,r){Eh()&&zC()?this.storage=new Fh:Eh()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new na),this.client=new bl(t),this.beaconClient=new Dh(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Vh=class{constructor(t,r){this.storage=r||new na,this.client=new bl(t)}getClientDependingOnEventType(t){return this.client}},xl=class{constructor(){this.storage=new na,this.client=new qh}getClientDependingOnEventType(t){return this.client}},i0="xx",a0=e=>e?.startsWith(i0)||!1,s0=`
27
+ ${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":Zk(h,n,t);break}}}}function Zk(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function eO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function uA(){return{data:"",event:"",id:"",retry:void 0}}var Ug="text/event-stream",tO=1e3,fA="last-event-id";function mA(){return typeof window<"u"}function Lu(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:p,fetch:f,...m}){return new Promise((h,C)=>{let b={...r};b.accept||(b.accept=Ug);let g;function S(){g?.abort(),document.hidden||_()}!p&&mA()&&document.addEventListener("visibilitychange",S);let x=tO,w;function R(){mA()&&document.removeEventListener("visibilitychange",S),clearTimeout(w),g?.abort()}t?.addEventListener("abort",()=>{R(),h()});let P=f??v,E=n??rO;function _(){return _2.apply(this,arguments)}function _2(){_2=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let F=yield P(e,{...m,headers:b,signal:g?.signal});yield E(F),yield lA(F.body,dA(pA(q=>{q?b[fA]=q:delete b[fA]},q=>{x=q},o))),i?.(),R(),h()}catch(F){if(!g?.signal?.aborted)try{let q=a?.(F)??x;clearTimeout(w),w=setTimeout(_,q)}catch(q){R(),C(q)}}});return _2.apply(this,arguments)}_()})}function rO(e){let t=e.headers.get("content-type");if(!t?.startsWith(Ug))throw new Error(`Expected content-type to be ${Ug}, Actual: ${t}`)}d();c();l();u();var Qn=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 nO=(e,t,r)=>new Qn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,gA=3,oO=5e3,iO="text/event-stream",Gg=1,Qg=class extends Error{},Js=class extends Error{constructor(r){super(r.message);this.payload=r}},Bg=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)}},Uu=class{constructor(t){De(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:a}=t,{write:p,abort:f,close:m,resetAnswer:h}=r,C=new Bg;if(!i){this.logger.error("No stream ID found");return}let b=0,g,S=()=>{g&&!C.isActive(g)&&(w?.abort(),h(),R())},x=()=>{C.remove(g),g=Mv(S,g,oO),C.add(g)},w=new s.AbortController,R=()=>Lu(nO(n,o,i),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${a}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(P){return _asyncToGenerator(function*(){if(P.ok&&P.headers.get("content-type")===iO)return;throw P.status>=400&&P.status<500&&P.status!==429?new Js({message:"Error opening stream",code:P.status}):new Qg})()},onmessage:P=>{if(w?.signal.aborted)return;let E=JSON.parse(P.data);if(E.finishReason==="ERROR"){C.remove(g),w?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),b=0,E.finishReason==="COMPLETED"?(C.remove(g),m()):x()},onerror:P=>{if(!w?.signal.aborted){if(C.remove(g),P instanceof Js)throw w?.abort(),f(P),P;if(++b>gA){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:Gg};throw w?.abort(),f(E),new Js(E)}this.logger.info(`Retrying...(${b}/${gA})`),h()}}});return R(),w}};d();c();l();u();var Qu=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function Zs(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var $g=e=>{let{response:t}=e;return t.body?aO(e):sO(t)},aO=e=>uO(e)?lO(e):cO(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},sO=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function cO(e){return e.body.statusCode!==void 0}function uO(e){return e.body.exception!==void 0}var lO=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function hA(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Hg=(e,t,r,n)=>{let o=new Qn(`${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 yA=(e,t)=>{let r=new Qn(`${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},zg=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Vr.call({...Hg(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Zs(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=hA(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return dO(a)?{success:a}:{error:$g({response:r,body:a})}});return function zg(_x5,_x6){return _ref3.apply(this,arguments)}}();function dO(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function zi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function At(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:zi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:zi(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function pO(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function fO(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Wi(e,t){if(t&&e.name==="AbortError")return{error:fO(e)};if(e instanceof _o)return{error:pO(e)};throw e}var Bn=e=>e.success!==void 0,$e=e=>e.error!==void 0;function SA(e){return e.results!==void 0}function vA(e){let t=zi();return ee(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var Wg=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,mO=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,ec=(e,t,r,n)=>{gO(e);let o=Wg(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},AA=(e,t,r)=>{hO(e);let n=mO(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},Yg=e=>{let{insightId:t,...r}=Zs(e);return r},CA=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.")},gO=e=>{if(CA(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},hO=e=>{if(CA(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var bA=e=>({...ec(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var xA=e=>({...ec(e,"POST","application/json","/search"),requestParams:Yg(e)}),wA=e=>({...ec(e,"POST","application/json","/querysuggest"),requestParams:Yg(e)});d();c();l();u();var RA=e=>({...AA(e,"POST","application/json"),requestParams:{objectId:e.userId}});var Bu=class{constructor(t){this.options=t}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...bA(t),..._this.options});if(r instanceof Error)return Wi(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield Vr.call({...xA(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return Wi(n);let o=yield n.json();return SA(o)&&(o=vA(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...wA(t),..._this3.options});if(r instanceof Error)return Wi(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...RA(t),..._this4.options});if(r instanceof Error)return Wi(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return zg(t,{..._this5.options})})()}};d();c();l();u();d();c();l();u();var z=new $({required:!0,emptyAllowed:!1}),ze=new $({required:!1,emptyAllowed:!1}),Ke=new $({required:!0,emptyAllowed:!0}),N3=new $({required:!1,emptyAllowed:!0}),Gu=new ne({each:z,required:!0}),IA=new $({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),EA=new $({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),D3=new $({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Fr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),fr=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new Y({options:{required:!0},values:t}).validate(e);if(o)throw new ko(o);return{payload:e}},O=(e,t)=>{try{return fr(e,t)}catch(r){return{payload:e,error:Fr(r)}}},mr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return FA(e,t,r,o,"Controller initialization error")},ht=(e,t,r,n)=>{let o=`Check the options of ${n}`;return FA(e,t,r,o,"Controller initialization error")},FA=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(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 yO=typeof Symbol=="function"&&Symbol.observable||"@@observable",TA=yO,Kg=()=>Math.random().toString(36).substring(7).split("").join("."),SO={INIT:`@@redux/INIT${Kg()}`,REPLACE:`@@redux/REPLACE${Kg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Kg()}`},$u=SO;function jr(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 Xg(e,t,r){if(typeof e!="function")throw new Error(Et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Et(1));return r(Xg)(e,t)}let n=e,o=t,i=new Map,a=i,p=0,f=!1;function m(){a===i&&(a=new Map,i.forEach((w,R)=>{a.set(R,w)}))}function h(){if(f)throw new Error(Et(3));return o}function C(w){if(typeof w!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let R=!0;m();let P=p++;return a.set(P,w),function(){if(R){if(f)throw new Error(Et(6));R=!1,m(),a.delete(P),i=null}}}function b(w){if(!jr(w))throw new Error(Et(7));if(typeof w.type>"u")throw new Error(Et(8));if(typeof w.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,o=n(o,w)}finally{f=!1}return(i=a).forEach(P=>{P()}),w}function g(w){if(typeof w!="function")throw new Error(Et(10));n=w,b({type:$u.REPLACE})}function S(){let w=C;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Et(11));function P(){let _=R;_.next&&_.next(h())}return P(),{unsubscribe:w(P)}},[TA](){return this}}}return b({type:$u.INIT}),{dispatch:b,subscribe:C,getState:h,replaceReducer:g,[TA]:S}}function vO(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:$u.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:$u.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function Yi(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let p=t[a];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{vO(r)}catch(a){i=a}return function(p={},f){if(i)throw i;let m=!1,h={};for(let C=0;C<n.length;C++){let b=n[C],g=r[b],S=p[b],x=g(S,f);if(typeof x>"u"){let w=f&&f.type;throw new Error(Et(14))}h[b]=x,m=m||x!==S}return m=m||n.length!==Object.keys(p).length,m?h:p}}function tc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function PA(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Et(15))},a={getState:o.getState,dispatch:(f,...m)=>i(f,...m)},p=e.map(f=>f(a));return i=tc(...p)(o.dispatch),{...o,dispatch:i}}}function rc(e){return jr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var ah=Symbol.for("immer-nothing"),nc=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state");function Ft(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,Do=sr.getPrototypeOf,ic="constructor",lc="prototype",eh="configurable",Yu="enumerable",zu="writable",ac="value",Gt=e=>!!e&&!!e[Ct];function $t(e){return e?VA(e)||pc(e)||!!e[nc]||!!e[ic]?.[nc]||fc(e)||mc(e):!1}var AO=sr[lc][ic].toString(),kA=new WeakMap;function VA(e){if(!e||!Ki(e))return!1;let t=Do(e);if(t===null||t===sr[lc])return!0;let r=sr.hasOwnProperty.call(t,ic)&&t[ic];if(r===Object)return!0;if(!No(r))return!1;let n=kA.get(r);return n===void 0&&(n=Function.toString.call(r),kA.set(r,n)),n===AO}function jA(e){return Gt(e)||Ft(15,e),e[Ct].base_}function dc(e,t,r=!0){qo(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function qo(e){let t=e[Ct];return t?t.type_:pc(e)?1:fc(e)?2:mc(e)?3:0}var oc=(e,t,r=qo(e))=>r===2?e.has(t):sr[lc].hasOwnProperty.call(e,t),wn=(e,t,r=qo(e))=>r===2?e.get(t):e[t],Ku=(e,t,r,n=qo(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function CO(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var pc=Array.isArray,fc=e=>e instanceof Map,mc=e=>e instanceof Set,Ki=e=>typeof e=="object",No=e=>typeof e=="function",Jg=e=>typeof e=="boolean";function bO(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var xO=e=>Ki(e)?e?.[Ct]:null,Rn=e=>e.copy_||e.base_;var sh=e=>e.modified_?e.copy_:e.base_;function th(e,t){if(fc(e))return new Map(e);if(mc(e))return new Set(e);if(pc(e))return Array[lc].slice.call(e);let r=VA(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[Ct];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],p=n[a];p[zu]===!1&&(p[zu]=!0,p[eh]=!0),(p.get||p.set)&&(n[a]={[eh]:!0,[zu]:!0,[Yu]:p[Yu],[ac]:e[a]})}return sr.create(Do(e),n)}else{let n=Do(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function ch(e,t=!1){return rl(e)||Gt(e)||!$t(e)||(qo(e)>1&&sr.defineProperties(e,{set:Hu,add:Hu,clear:Hu,delete:Hu}),sr.freeze(e),t&&dc(e,(r,n)=>{ch(n,!0)},!1)),e}function wO(){Ft(2)}var Hu={[ac]:wO};function rl(e){return e===null||!Ki(e)?!0:sr.isFrozen(e)}var Xu="MapSet",Ju="Patches",OA="ArrayMethods",Zu={};function Mo(e){let t=Zu[e];return t||Ft(0,e),t}var _A=e=>!!Zu[e];function RO(e,t){Zu[e]||(Zu[e]=t)}var sc,LA=()=>sc,IO=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_A(Xu)?Mo(Xu):void 0,arrayMethodsPlugin_:_A(OA)?Mo(OA):void 0});function NA(e,t){t&&(e.patchPlugin_=Mo(Ju),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function rh(e){nh(e),e.drafts_.forEach(EO),e.drafts_=null}function nh(e){e===sc&&(sc=e.parent_)}var DA=e=>sc=IO(sc,e);function EO(e){let t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qA(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ct].modified_&&(rh(t),Ft(4)),$t(e)&&(e=MA(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[Ct].base_,e,t)}else e=MA(t,r);return FO(t,e,!0),rh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ah?e:void 0}function MA(e,t){if(rl(t))return t;let r=t[Ct];if(!r)return el(t,e.handledSet_,e);if(!nl(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);BA(r,e)}return r.copy_}function FO(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ch(t,r)}function UA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var nl=(e,t)=>e.scope_===t,TO=[];function QA(e,t,r,n){let o=Rn(e),i=e.type_;if(n!==void 0&&wn(o,n,i)===t){Ku(o,n,r,i);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;dc(o,(f,m)=>{if(Gt(m)){let h=p.get(m)||[];h.push(f),p.set(m,h)}})}let a=e.draftLocations_.get(t)??TO;for(let p of a)Ku(o,p,r,i)}function PO(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!nl(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=sh(i);QA(e,i.draft_??i,a,r),BA(i,o)})}function BA(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)}UA(e)}}function kO(e,t,r){let{scope_:n}=e;if(Gt(r)){let o=r[Ct];nl(o,n)&&o.callbacks_.push(function(){Wu(e);let a=sh(o);QA(e,r,a,t)})}else $t(r)&&e.callbacks_.push(function(){let i=Rn(e);e.type_===3?i.has(r)&&el(r,n.handledSet_,n):wn(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&el(wn(e.copy_,t,e.type_),n.handledSet_,n)})}function el(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Gt(e)||t.has(e)||!$t(e)||rl(e)||(t.add(e),dc(e,(n,o)=>{if(Gt(o)){let i=o[Ct];if(nl(i,r)){let a=sh(i);Ku(e,n,a,e.type_),UA(i)}}else $t(o)&&el(o,t,r)})),e}function OO(e,t){let r=pc(e),n={type_:r?1:0,scope_:t?t.scope_:LA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=tl;r&&(o=[n],i=cc);let{revoke:a,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=a,[p,n]}var tl={get(e,t){if(t===Ct)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=Rn(e);if(!oc(o,t,e.type_))return _O(e,o,t);let i=o[t];if(e.finalized_||!$t(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&bO(t))return i;if(i===Zg(e.base_,t)){Wu(e);let a=e.type_===1?+t:t,p=ih(e.scope_,i,e,a);return e.copy_[a]=p}return i},has(e,t){return t in Rn(e)},ownKeys(e){return Reflect.ownKeys(Rn(e))},set(e,t,r){let n=GA(Rn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zg(Rn(e),t),i=o?.[Ct];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(CO(r,o)&&(r!==void 0||oc(e.base_,t,e.type_)))return!0;Wu(e),oh(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),kO(e,t,r)),!0},deleteProperty(e,t){return Wu(e),Zg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),oh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Rn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[zu]:!0,[eh]:e.type_!==1||t!=="length",[Yu]:n[Yu],[ac]:r[t]}},defineProperty(){Ft(11)},getPrototypeOf(e){return Do(e.base_)},setPrototypeOf(){Ft(12)}},cc={};for(let e in tl){let t=tl[e];cc[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}cc.deleteProperty=function(e,t){return cc.set.call(this,e,t,void 0)};cc.set=function(e,t,r){return tl.set.call(this,e[0],t,r,e[0])};function Zg(e,t){let r=e[Ct];return(r?Rn(r):e)[t]}function _O(e,t,r){let n=GA(t,r);return n?ac in n?n[ac]:n.get?.call(e.draft_):void 0}function GA(e,t){if(!(t in e))return;let r=Do(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Do(r)}}function oh(e){e.modified_||(e.modified_=!0,e.parent_&&oh(e.parent_))}function Wu(e){e.copy_||(e.assigned_=new Map,e.copy_=th(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var NO=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(No(t)&&!No(r)){let i=r;r=t;let a=this;return function(f=i,...m){return a.produce(f,h=>r.call(this,h,...m))}}No(r)||Ft(6),n!==void 0&&!No(n)&&Ft(7);let o;if($t(t)){let i=DA(this),a=ih(i,t,void 0),p=!0;try{o=r(a),p=!1}finally{p?rh(i):nh(i)}return NA(i,n),qA(o,i)}else if(!t||!Ki(t)){if(o=r(t),o===void 0&&(o=t),o===ah&&(o=void 0),this.autoFreeze_&&ch(o,!0),n){let i=[],a=[];Mo(Ju).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else Ft(1,t)},this.produceWithPatches=(t,r)=>{if(No(t))return(a,...p)=>this.produceWithPatches(a,f=>t(f,...p));let n,o;return[this.produce(t,r,(a,p)=>{n=a,o=p}),n,o]},Jg(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Jg(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Jg(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){$t(e)||Ft(8),Gt(e)&&(e=ol(e));let t=DA(this),r=ih(t,e,void 0);return r[Ct].isManual_=!0,nh(t),r}finishDraft(e,t){let r=e&&e[Ct];(!r||!r.isManual_)&&Ft(9);let{scope_:n}=r;return NA(n,t),qA(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=Mo(Ju).applyPatches_;return Gt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function ih(e,t,r,n){let[o,i]=fc(t)?Mo(Xu).proxyMap_(t,r):mc(t)?Mo(Xu).proxySet_(t,r):OO(t,r);return(r?.scope_??LA()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?PO(r,i,n):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),o}function ol(e){return Gt(e)||Ft(10,e),$A(e)}function $A(e){if(!$t(e)||rl(e))return e;let t=e[Ct],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=th(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=th(e,!0);return dc(r,(o,i)=>{Ku(r,o,$A(i))},n),t&&(t.finalized_=!1),r}function HA(){function t(S,x=[]){if(S.key_!==void 0){let w=S.parent_.copy_??S.parent_.base_,R=xO(wn(w,S.key_)),P=wn(w,S.key_);if(P===void 0||P!==S.draft_&&P!==S.base_&&P!==S.copy_||R!=null&&R.base_!==S.base_)return null;let E=S.parent_.type_===3,_;if(E){let F=S.parent_;_=Array.from(F.drafts_.keys()).indexOf(S.key_)}else _=S.key_;if(!(E&&w.size>_||oc(w,_)))return null;x.push(_)}if(S.parent_)return t(S.parent_,x);x.reverse();try{r(S.copy_,x)}catch{return null}return x}function r(S,x){let w=S;for(let R=0;R<x.length-1;R++){let P=x[R];if(w=wn(w,P),!Ki(w)||w===null)throw new Error(`Cannot resolve path at '${x.join("/")}'`)}return w}let n="replace",o="add",i="remove";function a(S,x,w){if(S.scope_.processedForPatches_.has(S))return;S.scope_.processedForPatches_.add(S);let{patches_:R,inversePatches_:P}=w;switch(S.type_){case 0:case 2:return f(S,x,R,P);case 1:return p(S,x,R,P);case 3:return m(S,x,R,P)}}function p(S,x,w,R){let{base_:P,assigned_:E}=S,_=S.copy_;_.length<P.length&&([P,_]=[_,P],[w,R]=[R,w]);let F=S.allIndicesReassigned_===!0;for(let q=0;q<P.length;q++){let G=_[q],Q=P[q];if((F||E?.get(q.toString()))&&G!==Q){let B=G?.[Ct];if(B&&B.modified_)continue;let L=x.concat([q]);w.push({op:n,path:L,value:g(G)}),R.push({op:n,path:L,value:g(Q)})}}for(let q=P.length;q<_.length;q++){let G=x.concat([q]);w.push({op:o,path:G,value:g(_[q])})}for(let q=_.length-1;P.length<=q;--q){let G=x.concat([q]);R.push({op:i,path:G})}}function f(S,x,w,R){let{base_:P,copy_:E,type_:_}=S;dc(S.assigned_,(F,q)=>{let G=wn(P,F,_),Q=wn(E,F,_),j=q?oc(P,F)?n:o:i;if(G===Q&&j===n)return;let B=x.concat(F);w.push(j===i?{op:j,path:B}:{op:j,path:B,value:g(Q)}),R.push(j===o?{op:i,path:B}:j===i?{op:o,path:B,value:g(G)}:{op:n,path:B,value:g(G)})})}function m(S,x,w,R){let{base_:P,copy_:E}=S,_=0;P.forEach(F=>{if(!E.has(F)){let q=x.concat([_]);w.push({op:i,path:q,value:F}),R.unshift({op:o,path:q,value:F})}_++}),_=0,E.forEach(F=>{if(!P.has(F)){let q=x.concat([_]);w.push({op:o,path:q,value:F}),R.unshift({op:i,path:q,value:F})}_++})}function h(S,x,w){let{patches_:R,inversePatches_:P}=w;R.push({op:n,path:[],value:x===ah?void 0:x}),P.push({op:n,path:[],value:S})}function C(S,x){return x.forEach(w=>{let{path:R,op:P}=w,E=S;for(let G=0;G<R.length-1;G++){let Q=qo(E),j=R[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(Q===0||Q===1)&&(j==="__proto__"||j===ic)&&Ft(19),No(E)&&j===lc&&Ft(19),E=wn(E,j),Ki(E)||Ft(18,R.join("/"))}let _=qo(E),F=b(w.value),q=R[R.length-1];switch(P){case n:switch(_){case 2:return E.set(q,F);case 3:Ft(16);default:return E[q]=F}case o:switch(_){case 1:return q==="-"?E.push(F):E.splice(q,0,F);case 2:return E.set(q,F);case 3:return E.add(F);default:return E[q]=F}case i:switch(_){case 1:return E.splice(q,1);case 2:return E.delete(q);case 3:return E.delete(w.value);default:return delete E[q]}default:Ft(17,P)}}),S}function b(S){if(!$t(S))return S;if(pc(S))return S.map(b);if(fc(S))return new Map(Array.from(S.entries()).map(([w,R])=>[w,b(R)]));if(mc(S))return new Set(Array.from(S).map(b));let x=Object.create(Do(S));for(let w in S)x[w]=b(S[w]);return oc(S,nc)&&(x[nc]=S[nc]),x}function g(S){return Gt(S)?b(S):S}RO(Ju,{applyPatches_:C,generatePatches_:a,generateReplacementPatches_:h,getPath:t})}var uc=new NO,Vo=uc.produce,uh=uc.produceWithPatches.bind(uc);var lh=uc.applyPatches.bind(uc);d();c();l();u();function DO(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function qO(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function MO(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 zA=e=>Array.isArray(e)?e:[e];function VO(e){let t=Array.isArray(e[0])?e[0]:e;return MO(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jO(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var J3=Object.getPrototypeOf({});var LO=class{constructor(e){this.value=e}deref(){return this.value}},UO=typeof WeakRef<"u"?WeakRef:LO,QO=0,WA=1;function il(){return{s:QO,v:void 0,o:null,p:null}}function gc(e,t={}){let r=il(),{resultEqualityCheck:n}=t,o,i=0;function a(){let p=r,{length:f}=arguments;for(let C=0,b=f;C<b;C++){let g=arguments[C];if(typeof g=="function"||typeof g=="object"&&g!==null){let S=p.o;S===null&&(p.o=S=new WeakMap);let x=S.get(g);x===void 0?(p=il(),S.set(g,p)):p=x}else{let S=p.p;S===null&&(p.p=S=new Map);let x=S.get(g);x===void 0?(p=il(),S.set(g,p)):p=x}}let m=p,h;if(p.s===WA)h=p.v;else if(h=e.apply(null,arguments),i++,n){let C=o?.deref?.()??o;C!=null&&n(C,h)&&(h=C,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new UO(h):h}return m.s=WA,m.v=h,h}return a.clearCache=()=>{r=il(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function BO(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),DO(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let h={...r,...f},{memoize:C,memoizeOptions:b=[],argsMemoize:g=gc,argsMemoizeOptions:S=[],devModeChecks:x={}}=h,w=zA(b),R=zA(S),P=VO(o),E=C(function(){return i++,m.apply(null,arguments)},...w),_=!0,F=g(function(){a++;let G=jO(P,arguments);return p=E.apply(null,G),p},...R);return Object.assign(F,{resultFunc:m,memoizedResultFunc:E,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:C,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var it=BO(gc),GO=Object.assign((e,t=it)=>{qO(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,p,f)=>(a[r[f]]=p,a),{}))},{withTypes:()=>GO});d();c();l();u();function YA(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var KA=YA(),XA=YA;var $O=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?tc:tc.apply(null,arguments)},hz=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},HO=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ht(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=>rc(n)&&n.type===e,r}var iC=class hc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,hc.prototype)}static get[Symbol.species](){return hc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new hc(...t[0].concat(this)):new hc(...t.concat(this))}};function JA(e){return $t(e)?Vo(e,()=>{}):e}function al(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function zO(e){return typeof e=="boolean"}var WO=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new iC;return r&&(zO(r)?a.push(KA):a.push(XA(r.extraArgument))),a},yc="RTK_autoBatch",Zi=()=>e=>({payload:e,meta:{[yc]:!0}}),ZA=e=>t=>{setTimeout(t,e)},YO=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ZA(10):e.type==="callback"?e.queueNotification:ZA(e.timeout),m=()=>{a=!1,i&&(i=!1,p.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let C=()=>o&&h(),b=n.subscribe(C);return p.add(h),()=>{b(),p.delete(h)}},dispatch(h){try{return o=!h?.meta?.[yc],i=!o,i&&(a||(a=!0,f(m))),n.dispatch(h)}finally{o=!0}}})},KO=e=>function(r){let{autoBatch:n=!0}=r??{},o=new iC(e);return n&&o.push(YO(typeof n=="object"?n:void 0)),o};function aC(e){let t=WO(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(jr(r))f=Yi(r);else throw new Error(Ht(1));let m;typeof n=="function"?m=n(t):m=t();let h=tc;o&&(h=$O({trace:!1,...(typeof o=="object"&&o)}));let C=PA(...m),b=KO(C),g=typeof p=="function"?p(b):b(),S=h(...g);return Xg(f,a,S)}function sC(e){let t={},r=[],n,o={addCase(i,a){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Ht(28));if(p in t)throw new Error(Ht(29));return t[p]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function XO(e){return typeof e=="function"}function le(e,t){let[r,n,o]=sC(t),i;if(XO(e))i=()=>JA(e());else{let p=JA(e);i=()=>p}function a(p=i(),f){let m=[r[f.type],...n.filter(({matcher:h})=>h(f)).map(({reducer:h})=>h)];return m.filter(h=>!!h).length===0&&(m=[o]),m.reduce((h,C)=>{if(C)if(Gt(h)){let g=C(h,f);return g===void 0?h:g}else{if($t(h))return Vo(h,b=>C(b,f));{let b=C(h,f);if(b===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return h},p)}return a.getInitialState=i,a}var cC=(e,t)=>HO(e)?e.match(t):e(t);function Lr(...e){return t=>e.some(r=>cC(r,t))}function Ji(...e){return t=>e.every(r=>cC(r,t))}function ll(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 Sc(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function dl(...e){return e.length===0?t=>ll(t,["pending"]):Sc(e)?Lr(...e.map(t=>t.pending)):dl()(e[0])}function Lo(...e){return e.length===0?t=>ll(t,["rejected"]):Sc(e)?Lr(...e.map(t=>t.rejected)):Lo()(e[0])}function vc(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Ji(Lo(...e),t):Sc(e)?Ji(Lo(...e),t):vc()(e[0])}function In(...e){return e.length===0?t=>ll(t,["fulfilled"]):Sc(e)?Lr(...e.map(t=>t.fulfilled)):In()(e[0])}function pl(...e){return e.length===0?t=>ll(t,["pending","fulfilled","rejected"]):Sc(e)?Lr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):pl()(e[0])}var JO="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ac=(e=21)=>{let t="",r=e;for(;r--;)t+=JO[Math.random()*64|0];return t},ZO=["name","message","stack","code"],dh=class{constructor(e,t){De(this,"_type");this.payload=e,this.meta=t}},eC=class{constructor(e,t){De(this,"_type");this.payload=e,this.meta=t}},e_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of ZO)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},tC="External signal was aborted",pe=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,m,h,C)=>({payload:f,meta:{...(C||{}),arg:h,requestId:m,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,m,h)=>({payload:void 0,meta:{...(h||{}),arg:m,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,m,h,C,b)=>({payload:C,error:(n&&n.serializeError||e_)(f||"Rejected"),meta:{...(b||{}),arg:h,requestId:m,rejectedWithValue:!!C,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(h,C,b)=>{let g=n?.idGenerator?n.idGenerator(f):Ac(),S=new s.AbortController,x,w;function R(E){w=E,S.abort()}m&&(m.aborted?R(tC):m.addEventListener("abort",()=>R(tC),{once:!0}));let P=_asyncToGenerator(function*(){let E;try{let F=n?.condition?.(f,{getState:C,extra:b});if(r_(F)&&(F=yield F),F===!1||S.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let q=new Promise((G,Q)=>{x=()=>{Q({name:"AbortError",message:w||"Aborted"})},S.signal.addEventListener("abort",x,{once:!0})});h(i(g,f,n?.getPendingMeta?.({requestId:g,arg:f},{getState:C,extra:b}))),E=yield Promise.race([q,Promise.resolve(r(f,{dispatch:h,getState:C,extra:b,requestId:g,signal:S.signal,abort:R,rejectWithValue:(G,Q)=>new dh(G,Q),fulfillWithValue:(G,Q)=>new eC(G,Q)})).then(G=>{if(G instanceof dh)throw G;return G instanceof eC?o(G.payload,g,f,G.meta):o(G,g,f)})])}catch(F){E=F instanceof dh?a(null,g,f,F.payload,F.meta):a(F,g,f)}finally{x&&S.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&a.match(E)&&E.meta.condition||h(E),E})();return Object.assign(P,{abort:R,requestId:g,arg:f,unwrap(){return P.then(t_)}})}}return Object.assign(p,{pending:i,rejected:a,fulfilled:o,settled:Lr(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function t_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function r_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var uC=Symbol.for("rtk-slice-createasyncthunk"),Sz={[uC]:pe};function n_(e,t){return`${e}/${t}`}function o_({creators:e}={}){let t=e?.asyncThunk?.[uC];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ht(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(a_()):n.reducers)||{},p=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(E,_){let F=typeof E=="string"?E:E.type;if(!F)throw new Error(Ht(12));if(F in f.sliceCaseReducersByType)throw new Error(Ht(13));return f.sliceCaseReducersByType[F]=_,m},addMatcher(E,_){return f.sliceMatchers.push({matcher:E,reducer:_}),m},exposeAction(E,_){return f.actionCreators[E]=_,m},exposeCaseReducer(E,_){return f.sliceCaseReducersByName[E]=_,m}};p.forEach(E=>{let _=a[E],F={reducerName:E,type:n_(o,E),createNotation:typeof n.reducers=="function"};c_(_)?l_(F,_,m,t):s_(F,_,m)});function h(){let[E={},_=[],F=void 0]=typeof n.extraReducers=="function"?sC(n.extraReducers):[n.extraReducers],q={...E,...f.sliceCaseReducersByType};return le(n.initialState,G=>{for(let Q in q)G.addCase(Q,q[Q]);for(let Q of f.sliceMatchers)G.addMatcher(Q.matcher,Q.reducer);for(let Q of _)G.addMatcher(Q.matcher,Q.reducer);F&&G.addDefaultCase(F)})}let C=E=>E,b=new Map,g=new WeakMap,S;function x(E,_){return S||(S=h()),S(E,_)}function w(){return S||(S=h()),S.getInitialState()}function R(E,_=!1){function F(G){let Q=G[E];return typeof Q>"u"&&_&&(Q=al(g,F,w)),Q}function q(G=C){let Q=al(b,_,()=>new WeakMap);return al(Q,G,()=>{let j={};for(let[B,L]of Object.entries(n.selectors??{}))j[B]=i_(L,G,()=>al(g,G,w),_);return j})}return{reducerPath:E,getSelectors:q,get selectors(){return q(F)},selectSlice:F}}let P={name:o,reducer:x,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(i),injectInto(E,{reducerPath:_,...F}={}){let q=_??i;return E.inject({reducerPath:q,reducer:x},F),{...P,...R(q,!0)}}};return P}}function i_(e,t,r,n){function o(i,...a){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...a)}return o.unwrapped=e,o}var Uo=o_();function a_(){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 s_({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!u_(n))throw new Error(Ht(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function c_(e){return e._reducerDefinitionType==="asyncThunk"}function u_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function l_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ht(18));let{payloadCreator:i,fulfilled:a,pending:p,rejected:f,settled:m,options:h}=r,C=o(e,i,h);n.exposeAction(t,C),a&&n.addCase(C.fulfilled,a),p&&n.addCase(C.pending,p),f&&n.addCase(C.rejected,f),m&&n.addMatcher(C.settled,m),n.exposeCaseReducer(t,{fulfilled:a||sl,pending:p||sl,rejected:f||sl,settled:m||sl})}function sl(){}var d_="task",lC="listener",dC="completed",mh="cancelled",p_=`task-${mh}`,f_=`task-${dC}`,ph=`${lC}-${mh}`,m_=`${lC}-${dC}`,fl=class{constructor(e){De(this,"name","TaskAbortError");De(this,"message");this.code=e,this.message=`${d_} ${mh} (reason: ${e})`}},gh=(e,t)=>{if(typeof e!="function")throw new TypeError(Ht(32))},cl=()=>{},pC=(e,t=cl)=>(e.catch(t),e),fC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),jo=e=>{if(e.aborted)throw new fl(e.reason)};function mC(e,t){let r=cl;return new Promise((n,o)=>{let i=()=>o(new fl(e.reason));if(e.aborted){i();return}r=fC(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=cl})}var g_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof fl?"cancelled":"rejected",error:r}}finally{t?.()}});return function g_(_x7,_x8){return _ref5.apply(this,arguments)}}(),ul=e=>t=>pC(mC(e,t).then(r=>(jo(e),r))),gC=e=>{let t=ul(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Xi}=Object,rC={},ml="listenerMiddleware",h_=(e,t)=>{let r=n=>fC(e,()=>n.abort(e.reason));return(n,o)=>{gh(n,"taskExecutor");let i=new s.AbortController;r(i);let a=g_(/*#__PURE__*/_asyncToGenerator(function*(){jo(e),jo(i.signal);let p=yield n({pause:ul(i.signal),delay:gC(i.signal),signal:i.signal});return jo(i.signal),p}),()=>i.abort(f_));return o?.autoJoin&&t.push(a.catch(cl)),{result:ul(e)(a),cancel(){i.abort(p_)}}}},y_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){jo(t);let i=()=>{},p=[new Promise((f,m)=>{let h=e({predicate:n,effect:(C,b)=>{b.unsubscribe(),f([C,b.getState(),b.getOriginalState()])}});i=()=>{h(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield mC(t,Promise.race(p));return jo(t),f}finally{i()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>pC(r(n,o))},hC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=T(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Ht(21));return gh(i,"options.listener"),{predicate:o,type:t,effect:i}},yC=Xi(e=>{let{type:t,predicate:r,effect:n}=hC(e);return{id:Ac(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Ht(22))}}},{withTypes:()=>yC}),nC=(e,t)=>{let{type:r,effect:n,predicate:o}=hC(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},fh=e=>{e.pending.forEach(t=>{t.abort(ph)})},S_=(e,t)=>()=>{for(let r of t.keys())fh(r);e.clear()},oC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},SC=Xi(T(`${ml}/add`),{withTypes:()=>SC}),v_=T(`${ml}/removeAll`),vC=Xi(T(`${ml}/remove`),{withTypes:()=>vC}),A_=(...e)=>{console.error(`${ml}/error`,...e)},AC=(e={})=>{let t=new Map,r=new Map,n=g=>{let S=r.get(g)??0;r.set(g,S+1)},o=g=>{let S=r.get(g)??1;S===1?r.delete(g):r.set(g,S-1)},{extra:i,onError:a=A_}=e;gh(a,"onError");let p=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),S=>{g.unsubscribe(),S?.cancelActive&&fh(g)}),f=g=>{let S=nC(t,g)??yC(g);return p(S)};Xi(f,{withTypes:()=>f});let m=g=>{let S=nC(t,g);return S&&(S.unsubscribe(),g.cancelActive&&fh(S)),!!S};Xi(m,{withTypes:()=>m});let h=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,S,x,w){let R=new s.AbortController,P=y_(f,R.signal),E=[];try{g.pending.add(R),n(g),yield Promise.resolve(g.effect(S,Xi({},x,{getOriginalState:w,condition:(_,F)=>P(_,F).then(Boolean),take:P,delay:gC(R.signal),pause:ul(R.signal),extra:i,signal:R.signal,fork:h_(R.signal,E),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((_,F,q)=>{_!==R&&(_.abort(ph),q.delete(_))})},cancel:()=>{R.abort(ph),g.pending.delete(R)},throwIfCancelled:()=>{jo(R.signal)}})))}catch(_){_ instanceof fl||oC(a,_,{raisedBy:"effect"})}finally{yield Promise.all(E),R.abort(m_),o(g),g.pending.delete(R)}});return function h(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),C=S_(t,r);return{middleware:g=>S=>x=>{if(!rc(x))return S(x);if(SC.match(x))return f(x.payload);if(v_.match(x)){C();return}if(vC.match(x))return m(x.payload);let w=g.getState(),R=()=>{if(w===rC)throw new Error(Ht(23));return w},P;try{if(P=S(x),t.size>0){let E=g.getState(),_=Array.from(t.values());for(let F of _){let q=!1;try{q=F.predicate(x,E,w)}catch(G){q=!1,oC(a,G,{raisedBy:"predicate"})}q&&h(F,x,g,R)}}}finally{w=rC}return P},startListening:f,stopListening:m,clearListeners:C}};function Ht(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 CC(){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 bC=/^(?:[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 C_(e){return typeof e=="string"&&bC.test(e)}var hh=C_;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function xC(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var yh,b_=new Uint8Array(16);function Sh(){if(!yh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yh=crypto.getRandomValues.bind(crypto)}return yh(b_)}d();c();l();u();d();c();l();u();var x_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vh={randomUUID:x_};function w_(e,t,r){e=e||{};let n=e.random??e.rng?.()??Sh();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 xC(n)}function R_(e,t,r){return vh.randomUUID&&!t&&!e?vh.randomUUID():w_(e,t,r)}var Ah=R_;function I_(_x13){return _I_.apply(this,arguments)}function _I_(){_I_=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _I_.apply(this,arguments)}var TC="2.1.1",Ch=128,PC=192,wC=224,RC=240,E_=248;function F_(e){return(e&E_)===RC?4:(e&RC)===wC?3:(e&wC)===PC?2:1}function T_(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&Ch)!=Ch)break;if(r-=3,(n&PC)!=Ch){t-r>=F_(n)*3&&(r=t);break}}return e.substring(0,r)}function P_(e){let{trackingId:t}=e;return{trackingId:t}}function k_(e){return(e.source||[]).concat([`relay@${TC}`])}function kC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=P_(t),p=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:k_(t),clientId:p,userAgent:i(),referrer:IC(n()),location:IC(o())})}function IC(e){return e!==null?T_(e,1024):null}function O_(e,t,r,n){return{...t,meta:kC(e,r,n)}}var __="*";function N_(){let e=[];function t({type:f,callback:m}){return e.findIndex(h=>h.type===f&&h.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(h){console.error(h)}})}function i(f){if(f===__)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function a(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?a({type:f,callback:m}):i(f)}return{add:n,call:o,remove:p}}function EC({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 D_(e){let t=EC(e);return{get:()=>t,update:r=>{t=EC({...t,...r})}}}var bh=q_();function q_(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function M_(){return{getItem(e){return bh.getItem(e)||localStorage.getItem(e)},removeItem(e){bh.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),bh.setItem(e,t,31556952e3)}}}var FC="visitorId";function V_(){let e=document.referrer;return e===""?null:e}function xh(){let e=M_();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=v(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});CC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let p;try{p=yield a.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>V_(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(FC);if(t&&hh(t))return t;let r=Ah();return e.setItem(FC,r),r}}}function j_(){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 L_(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function U_(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=L_();return t&&r?{...r,runtime:"custom"}:t&&Q_()&&j_()?xh():n}function Q_(){try{return typeof window=="object"}catch{return!1}}function B_(e){return{get:()=>Object.freeze(U_(e))}}function OC(e){let t=D_(e),r=N_(),n=B_(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,i){let a=t.get(),p=n.get(),f=O_(o,i,a,p);return I_({config:a,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>kC(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:TC}}d();c();l();u();function _C(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Gn="3.49.2",NC=["@coveo/atomic","@coveo/quantic"];var ea=it(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Gn}`));var Cc=it(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ea(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,p)=>{let f=$_(p);return OC({mode:i?"emit":"disabled",url:o??Du(e,t),token:r,trackingId:n??null,source:a,environment:f})}),G_={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},$_=e=>{if(!e)return;let t=e();return{...(_C()?xh():G_),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Ur(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 U(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(h){try{m(n.next(h))}catch(C){a(C)}}function f(h){try{m(n.throw(h))}catch(C){a(C)}}function m(h){h.done?i(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Oe;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Oe||(Oe={}));function Ih(){return typeof window<"u"}function Lh(){return typeof navigator<"u"}function ta(){return typeof document<"u"}function Eh(){try{return typeof localStorage<"u"}catch{return!1}}function H_(){try{return typeof sessionStorage<"u"}catch{return!1}}function zC(){return Lh()&&navigator.cookieEnabled}var z_=[Oe.click,Oe.custom,Oe.search,Oe.view],W_=(e,t)=>z_.indexOf(e)!==-1?Object.assign({language:ta()?document.documentElement.lang:"unknown",userAgent:Lh()?navigator.userAgent:"unknown"},t):t,xc=class e{static set(t,r,n){var o,i,a,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?DC(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],DC(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function DC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Y_(){return Eh()?localStorage:zC()?new wc:H_()?sessionStorage:new na}var wc=class e{getItem(t){return xc.get(`${e.prefix}${t}`)}removeItem(t){xc.erase(`${e.prefix}${t}`)}setItem(t,r,n){xc.set(`${e.prefix}${t}`,r,n)}};wc.prefix="coveo_";var Fh=class{constructor(){this.cookieStorage=new wc}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)}},na=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},gl="__coveo.analytics.history",K_=20,X_=1e3*60,J_=75,Sl=class{constructor(t){this.store=t||Y_()}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 U(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 U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(gl);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(gl);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(gl,JSON.stringify(t.slice(0,K_)))}catch{}}clear(){try{this.store.removeItem(gl)}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,J_)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>X_:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Z_=(e,t)=>U(void 0,void 0,void 0,function*(){return e===Oe.view?(yield eN(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),eN=e=>U(void 0,void 0,void 0,function*(){let t=new Sl,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),hl,tN=new Uint8Array(16);function rN(){if(!hl&&(hl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hl(tN)}var nN=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function vl(e){return typeof e=="string"&&nN.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function WC(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]]}function oN(e){if(!vl(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function iN(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var aN="6ba7b810-9dad-11d1-80b4-00c04fd430c8",sN="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function cN(e,t,r){function n(o,i,a,p){var f;if(typeof o=="string"&&(o=iN(o)),typeof i=="string"&&(i=oN(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(i),m.set(o,i.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,a){p=p||0;for(let h=0;h<16;++h)a[p+h]=m[h];return a}return WC(m)}try{n.name=e}catch{}return n.DNS=aN,n.URL=sN,n}var uN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qC={randomUUID:uN};function Qo(e,t,r){if(qC.randomUUID&&!t&&!e)return qC.randomUUID();e=e||{};let n=e.random||(e.rng||rN)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return WC(n)}function lN(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 wh(e,t){return e<<t|e>>>32-t}function dN(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let p=0;p<a.length;++p)e.push(a.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=p}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let p=new Uint32Array(80);for(let g=0;g<16;++g)p[g]=i[a][g];for(let g=16;g<80;++g)p[g]=wh(p[g-3]^p[g-8]^p[g-14]^p[g-16],1);let f=r[0],m=r[1],h=r[2],C=r[3],b=r[4];for(let g=0;g<80;++g){let S=Math.floor(g/20),x=wh(f,5)+lN(S,m,h,C)+b+t[S]+p[g]>>>0;b=C,C=h,h=wh(m,30)>>>0,m=f,f=x}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var pN=cN("v5",80,dN),MC=pN,YC="2.30.54",VC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,bc={pageview:"pageview",event:"event"},Al=class{constructor({client:t,uuidGenerator:r=Qo}){this.client=t,this.uuidGenerator=r}},Th=class extends Al{constructor({client:t,uuidGenerator:r=Qo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=VC(window.location),this.lastReferrer=ta()?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:ta()?document.title:"",encoding:ta()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===bc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===bc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===bc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===bc.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 VC(window.location)}},$n=class e{constructor(t,r){if(!vl(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return vl(i)?new e(i,Number.parseInt(o)*1e3):null}};$n.cvo_cid="cvo_cid";$n.expirationTime=120;var Ph=class extends Al{constructor({client:t,uuidGenerator:r=Qo}){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 U(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($n.cvo_cid,new $n(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ph.Id="link";var hr=Object.keys;function yl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Rh=128,KC=192,jC=224,LC=240;function fN(e){return(e&248)===LC?4:(e&LC)===jC?3:(e&jC)===KC?2:1}function mN(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&Rh)!=Rh)break;if(r-=3,(n&KC)!=Rh){t-r>=fN(n)*3&&(r=t);break}}return e.substring(0,r)}var kh={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"},gN=hr(kh).map(e=>kh[e]),hN=[...gN].join("|"),yN=new RegExp(`^(${hN}$)`),SN={svcAction:"svc_action",svcActionData:"svc_action_data"},vN=e=>hr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=kh[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),AN=e=>yN.test(e),CN=[AN],UC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},QC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},Cl={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},bN=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Oh={id:"quoteId",affiliation:"quoteAffiliation"},_h={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},xN={add:Mt,bookmark_add:Mt,bookmark_remove:Mt,click:Mt,checkout:Mt,checkout_option:Mt,detail:Mt,impression:Mt,remove:Mt,refund:Object.assign(Object.assign({},Mt),Cl),purchase:Object.assign(Object.assign({},Mt),Cl),quickview:Mt,quote:Object.assign(Object.assign({},Mt),Oh),review:Object.assign(Object.assign({},Mt),_h)},wN=hr(UC).map(e=>UC[e]),RN=hr(QC).map(e=>QC[e]),IN=hr(Mt).map(e=>Mt[e]),EN=hr(Cl).map(e=>Cl[e]),FN=hr(_h).map(e=>_h[e]),TN=hr(Oh).map(e=>Oh[e]),PN=[...wN,"custom"].join("|"),kN=[...RN,"custom"].join("|"),XC="(pr[0-9]+)",JC="(il[0-9]+pi[0-9]+)",ON=new RegExp(`^${XC}(${PN})$`),_N=new RegExp(`^(${JC}(${kN}))|(il[0-9]+nm)$`),NN=new RegExp(`^(${IN.join("|")})$`),DN=new RegExp(`^(${EN.join("|")})$`),qN=new RegExp(`^${XC}custom$`),MN=new RegExp(`^${JC}custom$`),VN=new RegExp(`^(${[...bN,...FN,...TN].join("|")})$`),jN=e=>ON.test(e),LN=e=>_N.test(e),UN=e=>NN.test(e),QN=e=>DN.test(e),BN=e=>VN.test(e),GN=[LN,jN,UN,QN,BN],$N=[qN,MN],HN={anonymizeIp:"aip"},zN={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},WN={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},YN=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],KN=Object.assign(Object.assign(Object.assign(Object.assign({},HN),zN),WN),YN.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Nh=Object.assign(Object.assign({},KN),SN),XN=e=>{let t=!!e.action&&xN[e.action]||{};return hr(e).reduce((r,n)=>{let o=t[n]||Nh[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},JN=hr(Nh).map(e=>Nh[e]),ZN=e=>JN.indexOf(e)!==-1,e0=e=>e==="custom",t0=e=>[...GN,...CN,ZN,e0].some(t=>t(e)),r0=e=>hr(e).reduce((t,r)=>{let n=n0(r);return n?Object.assign(Object.assign({},t),o0(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),n0=e=>{let t;return[...$N].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},o0=(e,t)=>hr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Dh=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=a;o=p||t;try{i=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return U(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Oe.click,Oe.custom,Oe.search,Oe.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}},qh=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},BC=y.fetch,bl=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),i?yield i(p,"analyticsFetch"):{}),{url:m}=f,h=Ur(f,["url"]),C;try{C=yield BC(m,h)}catch(b){console.error("An error has occured when sending the event.",b);return}if(C.ok){let b=yield C.json();return b.visitorId&&o.setCurrentVisitorId(b.visitorId),b}else{try{C.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,C,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield BC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Oe.click,Oe.custom,Oe.search,Oe.view].indexOf(t)!==-1}getVisitorIdParam(){return U(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"})}},Mh=class{constructor(t,r){Eh()&&zC()?this.storage=new Fh:Eh()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new na),this.client=new bl(t),this.beaconClient=new Dh(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Vh=class{constructor(t,r){this.storage=r||new na,this.client=new bl(t)}getClientDependingOnEventType(t){return this.client}},xl=class{constructor(){this.storage=new na,this.client=new qh}getClientDependingOnEventType(t){return this.client}},i0="xx",a0=e=>e?.startsWith(i0)||!1,s0=`
28
28
  We've detected you're using React Native but have not provided the corresponding runtime,
29
29
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
30
30
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
@@ -75,4 +75,4 @@ fast-json-patch/module/duplex.mjs:
75
75
  *)
76
76
  */if(__exports!=exports)module.exports=exports;return module.exports});
77
77
 
78
- window.coveoQuanticVersion = '3.37.4';
78
+ window.coveoQuanticVersion = '3.37.5';