@coveo/quantic 3.39.0 → 3.40.0

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.
Files changed (24) hide show
  1. package/force-app/main/default/classes/HeadlessControllerTest.cls +1 -0
  2. package/force-app/main/default/classes/InsightControllerTest.cls +1 -0
  3. package/force-app/main/default/classes/RecommendationsControllerTest.cls +1 -1
  4. package/force-app/main/default/classes/SampleTokenProvider.cls +1 -0
  5. package/force-app/main/default/classes/SampleTokenProviderTest.cls +1 -0
  6. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +54 -0
  7. package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.js +26 -3
  8. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.css +5 -0
  9. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +3 -1
  10. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +269 -0
  11. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/quanticGeneratedAnswerContent.js +136 -0
  12. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/templates/generatedMarkdownContent.css +10 -0
  13. package/force-app/main/default/lwc/quanticUtils/__tests__/accessibilityUtils.test.js +214 -0
  14. package/force-app/main/default/lwc/quanticUtils/__tests__/facetStoreUtils.test.js +86 -0
  15. package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +38 -0
  16. package/force-app/main/default/lwc/quanticUtils/accessibilityUtils.js +225 -0
  17. package/force-app/main/default/lwc/quanticUtils/facetStoreUtils.js +65 -0
  18. package/force-app/main/default/lwc/quanticUtils/markdownUtils.js +18 -0
  19. package/force-app/main/default/lwc/quanticUtils/quanticUtils.js +2 -291
  20. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +3 -3
  21. package/force-app/main/default/staticresources/coveoheadless/headless.js +3 -3
  22. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +3 -3
  23. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +3 -3
  24. package/package.json +2 -2
@@ -25,11 +25,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25
25
 
26
26
  ${t}
27
27
  `;return new wu(r)}var wu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Se=class{constructor(e){de(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw K_(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}},Qe=class{constructor(e={}){de(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&fe(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 Tt(e){return e===void 0}function Y_(e){return e===null}function fe(e){return Tt(e)||Y_(e)}var pe=class{constructor(e={}){de(this,"value");this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t||(X_(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function X_(e){return Tt(e)||dd(e)}function dd(e){return typeof e=="boolean"}var re=class{constructor(e={}){de(this,"config");de(this,"value");this.config=e,this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t||(J_(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 J_(e){return Tt(e)||eC(e)}function eC(e){return typeof e=="number"&&!Number.isNaN(e)}var Z_=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,U=class{constructor(e={}){de(this,"value");de(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Qe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,i=this.value.validate(e);if(i)return i;if(Tt(e))return null;if(!_i(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(Z_.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 _i(e){return Object.prototype.toString.call(e)==="[object String]"}var J=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Tt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!tC(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&fe(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function tC(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"config");de(this,"value");this.config=e,this.value=new Qe(this.config)}validate(e){if(!fe(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(fe(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&&fe(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 dd(e)||_i(e)||eC(e)||tC(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ni(e){return Array.isArray(e)}var Ru=class{constructor(e){de(this,"config");de(this,"value");this.config=e,this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Tt(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 go=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function pd(e){return Array.isArray(e)}function fd(e){return e.trim()===""}function rC(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function eN(e){return btoa(encodeURI(e))}function md(e,t){let{[e]:r,...n}=t;return n}function Di(e){return eN(JSON.stringify(e))}var tN=new Set(["1",1,"yes",!0]);function nC(){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=>tN.has(r))}function oC(e){let t={};for(let[r,n]of e)t[r]=n;return t}function aC(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Fu(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function gd(e,t,r={}){let n;return(...o)=>{let a=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),a)return e.apply(void 0,o)}}function rN(e){if(fd(e.openingDelimiter)||fd(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(fe(e.content)||fd(e.content))return e.content;if(e.highlights.length===0)return qi(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,p=i+a.length;if(p>t)break;r+=qi(e.content.slice(n,i)),r+=e.openingDelimiter,r+=qi(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=qi(e.content.slice(n))),r}function qy(e,t){return e=qi(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Dy(n,t.notMatchDelimiters):o?Dy(o,t.exactMatchDelimiters):a?Dy(a,t.correctionDelimiters):r)}function Dy(e,t){return t?t.open+e+t.close:e}function qi(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,a=>t[a]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function sC(_x2,_x3){return _sC.apply(this,arguments)}function _sC(){_sC=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _sC.apply(this,arguments)}function cC(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=oN(t,i);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 uC(e,t,r){let n=iC(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=iC();else if(p>0){let f=o.decode(i.subarray(0,p)),m=p+(i[p+1]===32?2:1),g=o.decode(i.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
28
- ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":nN(g,n,t);break}}}}function nN(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function oN(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function iC(){return{data:"",event:"",id:"",retry:void 0}}var Vy="text/event-stream",aN=1e3,lC="last-event-id";function dC(){return typeof window<"u"}function hd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,v)=>{let C={...r};C.accept||(C.accept=Vy);let h;function x(){h?.abort(),document.hidden||k()}!p&&dC()&&document.addEventListener("visibilitychange",x);let b=aN,w;function R(){dC()&&document.removeEventListener("visibilitychange",x),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{R(),g()});let E=f??S,I=n??iN;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let T=yield E(e,{...m,headers:C,signal:h?.signal});yield I(T),yield sC(T.body,cC(uC(D=>{D?C[lC]=D:delete C[lC]},D=>{b=D},o))),a?.(),R(),g()}catch(T){if(!h?.signal?.aborted)try{let D=i?.(T)??b;clearTimeout(w),w=setTimeout(k,D)}catch(D){R(),v(D)}}});return _k2.apply(this,arguments)}k()})}function iN(e){let t=e.headers.get("content-type");if(!t?.startsWith(Vy))throw new Error(`Expected content-type to be ${Vy}, Actual: ${t}`)}d();c();l();u();var ho=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 sN=(e,t,r)=>new ho(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,pC=3,cN=5e3,uN="text/event-stream",Uy=1,jy=class extends Error{},Eu=class extends Error{constructor(r){super(r.message);de(this,"payload",r)}},Ly=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)}},yd=class{constructor(t){de(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,v=new Ly;if(!a){this.logger.error("No stream ID found");return}let C=0,h,x=()=>{h&&!v.isActive(h)&&(w?.abort(),g(),R())},b=()=>{v.remove(h),h=aC(x,h,cN),v.add(h)},w=new s.AbortController,R=()=>hd(sN(n,o,a),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===uN)return;throw E.status>=400&&E.status<500&&E.status!==429?new Eu({message:"Error opening stream",code:E.status}):new jy})()},onmessage:E=>{if(w?.signal.aborted)return;let I=JSON.parse(E.data);if(I.finishReason==="ERROR"){v.remove(h),w?.abort(),f({message:I.errorMessage,code:I.statusCode});return}p(I),C=0,I.finishReason==="COMPLETED"?(v.remove(h),m()):b()},onerror:E=>{if(!w?.signal.aborted){if(v.remove(h),E instanceof Eu)throw w?.abort(),f(E),E;if(++C>pC){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Uy};throw w?.abort(),f(I),new Eu(I)}this.logger.info(`Retrying...(${C}/${pC})`),g()}}});return R(),w}};d();c();l();u();var Sd=e=>e;d();c();l();u();d();c();l();u();function Mi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ar(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Mi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Mi(),extendedResults:{},searchAction:void 0}}d();c();l();u();function yo(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var So=e=>{let{response:t}=e;return t.body?lN(e):dN(t)},lN=e=>fN(e)?mN(e):pN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},dN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function pN(e){return e.body.statusCode!==void 0}function fN(e){return e.body.exception!==void 0}var mN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var wC=Vr(AC(),1);d();c();l();u();var K=new Error("Failed to load reducers."),Vi=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."}},da=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 xC(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function CC(e){return typeof e!="object"||!e?!1:Object.values(e).every(LN)}function LN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function bC(e){return e===429}var jr=class e{static call(t){return _asyncToGenerator(function*(){let r=UN(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield S(a,i);if(bC(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,wC.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&bC(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Vi;case 404:throw new da(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new da(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Fu(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function mr(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ji(e,t,r="prod"){return e??mr(t,r)}function St(e,t="prod"){return`${mr(e,t)}/rest/search/v2`}function Ad(e,t="prod"){return`${mr(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function UN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=QN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function QN(e,t){return t==="application/x-www-form-urlencoded"?CC(e)?xC(e):"":JSON.stringify(e)}d();c();l();u();var vo=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function RC(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Qn=(e,t,r,n)=>{let o=new ho(`${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 FC=(e,t)=>{let r=new ho(`${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},EC=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jr.call({...Qn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:yo(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=RC(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return BN(i)?{success:i}:{error:So({response:r,body:i})}});return function EC(_x5,_x6){return _ref3.apply(this,arguments)}}();function BN(e){return typeof e=="string"}d();c();l();u();function GN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function $N(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function xd(e,t){if(t&&e.name==="AbortError")return{error:$N(e)};if(e instanceof da)return{error:GN(e)};throw e}var Cd=class{constructor(t){de(this,"options",t);de(this,"apiCallsQueues",{unknown:new vo,mainSearch:new vo,facetValues:new vo,foldingCollection:new vo,instantResults:new vo})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/plan"),requestParams:yo(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return xd(r);let n=yield r.json();return zN(n)?{success:n}:{error:So({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:yo(t),..._this3.options});if(r instanceof Error)return xd(r);let n=yield r.json(),o={response:r,body:n};return HN(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:So(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>jr.call({...Qn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return xd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return IC(a)?(i.body=TC(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:So(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/facet"),requestParams:yo(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(IC(n)){let o={response:r,body:n};return o.body=TC(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:So({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return EC(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return WN(n)?{success:n}:{error:So({response:r,body:n})}})()}},bd=e=>e.success!==void 0,vt=e=>e.error!==void 0;function IC(e){return e.results!==void 0}function TC(e){let t=Mi();return fe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function HN(e){return e.completions!==void 0}function zN(e){return e.preprocessingOutput!==void 0}function WN(e){return e.fields!==void 0}d();c();l();u();var PC=e=>e,kC=e=>e,OC=e=>e;d();c();l();u();d();c();l();u();var W=new U({required:!0,emptyAllowed:!1}),st=new U({required:!1,emptyAllowed:!1}),Be=new U({required:!0,emptyAllowed:!0}),lK=new U({required:!1,emptyAllowed:!0}),wd=new ie({each:W,required:!0}),_C=new U({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),NC=new U({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),dK=new U({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Bn=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),gr=(e,t)=>{if("required"in t)return{payload:new Se({value:t}).validate({value:e}).value};let o=new J({options:{required:!0},values:t}).validate(e);if(o)throw new wu(o);return{payload:e}},O=(e,t)=>{try{return gr(e,t)}catch(r){return{payload:e,error:Bn(r)}}},lt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return DC(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return DC(e,t,r,o,"Controller initialization error")},DC=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Pt(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 KN=typeof Symbol=="function"&&Symbol.observable||"@@observable",qC=KN,Yy=()=>Math.random().toString(36).substring(7).split("").join("."),YN={INIT:`@@redux/INIT${Yy()}`,REPLACE:`@@redux/REPLACE${Yy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yy()}`},Rd=YN;function Xr(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 Xy(e,t,r){if(typeof e!="function")throw new Error(Pt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Pt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Pt(1));return r(Xy)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((w,R)=>{i.set(R,w)}))}function g(){if(f)throw new Error(Pt(3));return o}function v(w){if(typeof w!="function")throw new Error(Pt(4));if(f)throw new Error(Pt(5));let R=!0;m();let E=p++;return i.set(E,w),function(){if(R){if(f)throw new Error(Pt(6));R=!1,m(),i.delete(E),a=null}}}function C(w){if(!Xr(w))throw new Error(Pt(7));if(typeof w.type>"u")throw new Error(Pt(8));if(typeof w.type!="string")throw new Error(Pt(17));if(f)throw new Error(Pt(9));try{f=!0,o=n(o,w)}finally{f=!1}return(a=i).forEach(E=>{E()}),w}function h(w){if(typeof w!="function")throw new Error(Pt(10));n=w,C({type:Rd.REPLACE})}function x(){let w=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Pt(11));function E(){let k=R;k.next&&k.next(g())}return E(),{unsubscribe:w(E)}},[qC](){return this}}}return C({type:Rd.INIT}),{dispatch:C,subscribe:v,getState:g,replaceReducer:h,[qC]:x}}function XN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Rd.INIT})>"u")throw new Error(Pt(12));if(typeof r(void 0,{type:Rd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pt(13))})}function Li(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{XN(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let v=0;v<n.length;v++){let C=n[v],h=r[C],x=p[C],b=h(x,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Pt(14))}g[C]=b,m=m||b!==x}return m=m||n.length!==Object.keys(p).length,m?g:p}}function Pu(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function MC(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Pt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=Pu(...p)(o.dispatch),{...o,dispatch:a}}}function ku(e){return Xr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var iS=Symbol.for("immer-nothing"),Ou=Symbol.for("immer-draftable"),At=Symbol.for("immer-state");function kt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ir=Object,fa=ir.getPrototypeOf,Nu="constructor",ju="prototype",eS="configurable",Td="enumerable",Ed="writable",Du="value",Wt=e=>!!e&&!!e[At];function Kt(e){return e?$C(e)||Uu(e)||!!e[Ou]||!!e[Nu]?.[Ou]||Qu(e)||Bu(e):!1}var JN=ir[ju][Nu].toString(),VC=new WeakMap;function $C(e){if(!e||!Ui(e))return!1;let t=fa(e);if(t===null||t===ir[ju])return!0;let r=ir.hasOwnProperty.call(t,Nu)&&t[Nu];if(r===Object)return!0;if(!pa(r))return!1;let n=VC.get(r);return n===void 0&&(n=Function.toString.call(r),VC.set(r,n)),n===JN}function HC(e){return Wt(e)||kt(15,e),e[At].base_}function Lu(e,t,r=!0){ma(e)===0?(r?Reflect.ownKeys(e):ir.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ma(e){let t=e[At];return t?t.type_:Uu(e)?1:Qu(e)?2:Bu(e)?3:0}var _u=(e,t,r=ma(e))=>r===2?e.has(t):ir[ju].hasOwnProperty.call(e,t),Gn=(e,t,r=ma(e))=>r===2?e.get(t):e[t],Pd=(e,t,r,n=ma(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function ZN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Uu=Array.isArray,Qu=e=>e instanceof Map,Bu=e=>e instanceof Set,Ui=e=>typeof e=="object",pa=e=>typeof e=="function",Jy=e=>typeof e=="boolean";function e0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var t0=e=>Ui(e)?e?.[At]:null,$n=e=>e.copy_||e.base_;var sS=e=>e.modified_?e.copy_:e.base_;function tS(e,t){if(Qu(e))return new Map(e);if(Bu(e))return new Set(e);if(Uu(e))return Array[ju].slice.call(e);let r=$C(e);if(t===!0||t==="class_only"&&!r){let n=ir.getOwnPropertyDescriptors(e);delete n[At];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Ed]===!1&&(p[Ed]=!0,p[eS]=!0),(p.get||p.set)&&(n[i]={[eS]:!0,[Ed]:!0,[Td]:p[Td],[Du]:e[i]})}return ir.create(fa(e),n)}else{let n=fa(e);if(n!==null&&r)return{...e};let o=ir.create(n);return ir.assign(o,e)}}function cS(e,t=!1){return qd(e)||Wt(e)||!Kt(e)||(ma(e)>1&&ir.defineProperties(e,{set:Fd,add:Fd,clear:Fd,delete:Fd}),ir.freeze(e),t&&Lu(e,(r,n)=>{cS(n,!0)},!1)),e}function r0(){kt(2)}var Fd={[Du]:r0};function qd(e){return e===null||!Ui(e)?!0:ir.isFrozen(e)}var kd="MapSet",Od="Patches",jC="ArrayMethods",_d={};function ga(e){let t=_d[e];return t||kt(0,e),t}var LC=e=>!!_d[e];function n0(e,t){_d[e]||(_d[e]=t)}var qu,zC=()=>qu,o0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:LC(kd)?ga(kd):void 0,arrayMethodsPlugin_:LC(jC)?ga(jC):void 0});function UC(e,t){t&&(e.patchPlugin_=ga(Od),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function rS(e){nS(e),e.drafts_.forEach(a0),e.drafts_=null}function nS(e){e===qu&&(qu=e.parent_)}var QC=e=>qu=o0(qu,e);function a0(e){let t=e[At];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function BC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[At].modified_&&(rS(t),kt(4)),Kt(e)&&(e=GC(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[At].base_,e,t)}else e=GC(t,r);return i0(t,e,!0),rS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==iS?e:void 0}function GC(e,t){if(qd(t))return t;let r=t[At];if(!r)return Nd(t,e.handledSet_,e);if(!Md(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);YC(r,e)}return r.copy_}function i0(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cS(t,r)}function WC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Md=(e,t)=>e.scope_===t,s0=[];function KC(e,t,r,n){let o=$n(e),a=e.type_;if(n!==void 0&&Gn(o,n,a)===t){Pd(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Lu(o,(f,m)=>{if(Wt(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??s0;for(let p of i)Pd(o,p,r,a)}function c0(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Md(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=sS(a);KC(e,a.draft_??a,i,r),YC(a,o)})}function YC(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)}WC(e)}}function u0(e,t,r){let{scope_:n}=e;if(Wt(r)){let o=r[At];Md(o,n)&&o.callbacks_.push(function(){Id(e);let i=sS(o);KC(e,r,i,t)})}else Kt(r)&&e.callbacks_.push(function(){let a=$n(e);e.type_===3?a.has(r)&&Nd(r,n.handledSet_,n):Gn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Nd(Gn(e.copy_,t,e.type_),n.handledSet_,n)})}function Nd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Wt(e)||t.has(e)||!Kt(e)||qd(e)||(t.add(e),Lu(e,(n,o)=>{if(Wt(o)){let a=o[At];if(Md(a,r)){let i=sS(a);Pd(e,n,i,e.type_),WC(a)}}else Kt(o)&&Nd(o,t,r)})),e}function l0(e,t){let r=Uu(e),n={type_:r?1:0,scope_:t?t.scope_:zC(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=Dd;r&&(o=[n],a=Mu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var Dd={get(e,t){if(t===At)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=$n(e);if(!_u(o,t,e.type_))return d0(e,o,t);let a=o[t];if(e.finalized_||!Kt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&e0(t))return a;if(a===Zy(e.base_,t)){Id(e);let i=e.type_===1?+t:t,p=aS(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in $n(e)},ownKeys(e){return Reflect.ownKeys($n(e))},set(e,t,r){let n=XC($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zy($n(e),t),a=o?.[At];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(ZN(r,o)&&(r!==void 0||_u(e.base_,t,e.type_)))return!0;Id(e),oS(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),u0(e,t,r)),!0},deleteProperty(e,t){return Id(e),Zy(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),oS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$n(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ed]:!0,[eS]:e.type_!==1||t!=="length",[Td]:n[Td],[Du]:r[t]}},defineProperty(){kt(11)},getPrototypeOf(e){return fa(e.base_)},setPrototypeOf(){kt(12)}},Mu={};for(let e in Dd){let t=Dd[e];Mu[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Mu.deleteProperty=function(e,t){return Mu.set.call(this,e,t,void 0)};Mu.set=function(e,t,r){return Dd.set.call(this,e[0],t,r,e[0])};function Zy(e,t){let r=e[At];return(r?$n(r):e)[t]}function d0(e,t,r){let n=XC(t,r);return n?Du in n?n[Du]:n.get?.call(e.draft_):void 0}function XC(e,t){if(!(t in e))return;let r=fa(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fa(r)}}function oS(e){e.modified_||(e.modified_=!0,e.parent_&&oS(e.parent_))}function Id(e){e.copy_||(e.assigned_=new Map,e.copy_=tS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var p0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(pa(t)&&!pa(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}pa(r)||kt(6),n!==void 0&&!pa(n)&&kt(7);let o;if(Kt(t)){let a=QC(this),i=aS(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?rS(a):nS(a)}return UC(a,n),BC(o,a)}else if(!t||!Ui(t)){if(o=r(t),o===void 0&&(o=t),o===iS&&(o=void 0),this.autoFreeze_&&cS(o,!0),n){let a=[],i=[];ga(Od).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else kt(1,t)},this.produceWithPatches=(t,r)=>{if(pa(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},Jy(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Jy(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Jy(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Kt(e)||kt(8),Wt(e)&&(e=Vd(e));let t=QC(this),r=aS(t,e,void 0);return r[At].isManual_=!0,nS(t),r}finishDraft(e,t){let r=e&&e[At];(!r||!r.isManual_)&&kt(9);let{scope_:n}=r;return UC(n,t),BC(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=ga(Od).applyPatches_;return Wt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aS(e,t,r,n){let[o,a]=Qu(t)?ga(kd).proxyMap_(t,r):Bu(t)?ga(kd).proxySet_(t,r):l0(t,r);return(r?.scope_??zC()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?c0(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function Vd(e){return Wt(e)||kt(10,e),JC(e)}function JC(e){if(!Kt(e)||qd(e))return e;let t=e[At],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=tS(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=tS(e,!0);return Lu(r,(o,a)=>{Pd(r,o,JC(a))},n),t&&(t.finalized_=!1),r}function ZC(){function t(x,b=[]){if(x.key_!==void 0){let w=x.parent_.copy_??x.parent_.base_,R=t0(Gn(w,x.key_)),E=Gn(w,x.key_);if(E===void 0||E!==x.draft_&&E!==x.base_&&E!==x.copy_||R!=null&&R.base_!==x.base_)return null;let I=x.parent_.type_===3,k;if(I){let T=x.parent_;k=Array.from(T.drafts_.keys()).indexOf(x.key_)}else k=x.key_;if(!(I&&w.size>k||_u(w,k)))return null;b.push(k)}if(x.parent_)return t(x.parent_,b);b.reverse();try{r(x.copy_,b)}catch{return null}return b}function r(x,b){let w=x;for(let R=0;R<b.length-1;R++){let E=b[R];if(w=Gn(w,E),!Ui(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(x,b,w){if(x.scope_.processedForPatches_.has(x))return;x.scope_.processedForPatches_.add(x);let{patches_:R,inversePatches_:E}=w;switch(x.type_){case 0:case 2:return f(x,b,R,E);case 1:return p(x,b,R,E);case 3:return m(x,b,R,E)}}function p(x,b,w,R){let{base_:E,assigned_:I}=x,k=x.copy_;k.length<E.length&&([E,k]=[k,E],[w,R]=[R,w]);let T=x.allIndicesReassigned_===!0;for(let D=0;D<E.length;D++){let G=k[D],L=E[D];if((T||I?.get(D.toString()))&&G!==L){let B=G?.[At];if(B&&B.modified_)continue;let j=b.concat([D]);w.push({op:n,path:j,value:h(G)}),R.push({op:n,path:j,value:h(L)})}}for(let D=E.length;D<k.length;D++){let G=b.concat([D]);w.push({op:o,path:G,value:h(k[D])})}for(let D=k.length-1;E.length<=D;--D){let G=b.concat([D]);R.push({op:a,path:G})}}function f(x,b,w,R){let{base_:E,copy_:I,type_:k}=x;Lu(x.assigned_,(T,D)=>{let G=Gn(E,T,k),L=Gn(I,T,k),V=D?_u(E,T)?n:o:a;if(G===L&&V===n)return;let B=b.concat(T);w.push(V===a?{op:V,path:B}:{op:V,path:B,value:h(L)}),R.push(V===o?{op:a,path:B}:V===a?{op:o,path:B,value:h(G)}:{op:n,path:B,value:h(G)})})}function m(x,b,w,R){let{base_:E,copy_:I}=x,k=0;E.forEach(T=>{if(!I.has(T)){let D=b.concat([k]);w.push({op:a,path:D,value:T}),R.unshift({op:o,path:D,value:T})}k++}),k=0,I.forEach(T=>{if(!E.has(T)){let D=b.concat([k]);w.push({op:o,path:D,value:T}),R.unshift({op:a,path:D,value:T})}k++})}function g(x,b,w){let{patches_:R,inversePatches_:E}=w;R.push({op:n,path:[],value:b===iS?void 0:b}),E.push({op:n,path:[],value:x})}function v(x,b){return b.forEach(w=>{let{path:R,op:E}=w,I=x;for(let G=0;G<R.length-1;G++){let L=ma(I),V=R[G];typeof V!="string"&&typeof V!="number"&&(V=""+V),(L===0||L===1)&&(V==="__proto__"||V===Nu)&&kt(19),pa(I)&&V===ju&&kt(19),I=Gn(I,V),Ui(I)||kt(18,R.join("/"))}let k=ma(I),T=C(w.value),D=R[R.length-1];switch(E){case n:switch(k){case 2:return I.set(D,T);case 3:kt(16);default:return I[D]=T}case o:switch(k){case 1:return D==="-"?I.push(T):I.splice(D,0,T);case 2:return I.set(D,T);case 3:return I.add(T);default:return I[D]=T}case a:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(w.value);default:return delete I[D]}default:kt(17,E)}}),x}function C(x){if(!Kt(x))return x;if(Uu(x))return x.map(C);if(Qu(x))return new Map(Array.from(x.entries()).map(([w,R])=>[w,C(R)]));if(Bu(x))return new Set(Array.from(x).map(C));let b=Object.create(fa(x));for(let w in x)b[w]=C(x[w]);return _u(x,Ou)&&(b[Ou]=x[Ou]),b}function h(x){return Wt(x)?C(x):x}n0(Od,{applyPatches_:v,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var Vu=new p0,ha=Vu.produce,uS=Vu.produceWithPatches.bind(Vu);var lS=Vu.applyPatches.bind(Vu);d();c();l();u();function f0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function m0(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 eb=e=>Array.isArray(e)?e:[e];function g0(e){let t=Array.isArray(e[0])?e[0]:e;return m0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function h0(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var y0=class{constructor(e){this.value=e}deref(){return this.value}},S0=()=>typeof WeakRef>"u"?y0:WeakRef,rb=S0(),v0=0,tb=1;function jd(){return{s:v0,v:void 0,o:null,p:null}}function A0(e){return e instanceof rb?e.deref():e}function Gu(e,t={}){let r=jd(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let v=0,C=f;v<C;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let x=p.o;x===null&&(p.o=x=new WeakMap);let b=x.get(h);b===void 0?(p=jd(),x.set(h,p)):p=b}else{let x=p.p;x===null&&(p.p=x=new Map);let b=x.get(h);b===void 0?(p=jd(),x.set(h,p)):p=b}}let m=p,g;if(p.s===tb)g=p.v;else if(g=e.apply(null,arguments),a++,n){let v=A0(o);v!=null&&n(v,g)&&(g=v,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new rb(g):g}return m.s=tb,m.v=g,g}return i.clearCache=()=>{r=jd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function x0(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),f0(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:v,memoizeOptions:C=[],argsMemoize:h=Gu,argsMemoizeOptions:x=[]}=g,b=eb(C),w=eb(x),R=g0(o),E=v(function(){return a++,m.apply(null,arguments)},...b),I=!0,k=h(function(){i++;let D=h0(R,arguments);return p=E.apply(null,D),p},...w);return Object.assign(k,{resultFunc:m,memoizedResultFunc:E,dependencies:R,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var et=x0(Gu);d();c();l();u();function nb(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var ob=nb(),ab=nb;var C0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pu:Pu.apply(null,arguments)},$K=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},b0=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Yt(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=>ku(n)&&n.type===e,r}var fb=class $u extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,$u.prototype)}static get[Symbol.species](){return $u}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new $u(...t[0].concat(this)):new $u(...t.concat(this))}};function ib(e){return Kt(e)?ha(e,()=>{}):e}function Ld(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function w0(e){return typeof e=="boolean"}var R0=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new fb;return r&&(w0(r)?i.push(ob):i.push(ab(r.extraArgument))),i},Hu="RTK_autoBatch",Gi=()=>e=>({payload:e,meta:{[Hu]:!0}}),sb=e=>t=>{setTimeout(t,e)},F0=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},E0=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?F0(window.requestAnimationFrame,100):sb(10):e.type==="callback"?e.queueNotification:sb(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),C=n.subscribe(v);return p.add(g),()=>{C(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Hu],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},I0=e=>function(r){let{autoBatch:n=!0}=r??{},o=new fb(e);return n&&o.push(E0(typeof n=="object"?n:void 0)),o};function mb(e){let t=R0(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Xr(r))f=Li(r);else throw new Error(Yt(1));let m;typeof n=="function"?m=n(t):m=t();let g=Pu;o&&(g=C0({trace:!1,...(typeof o=="object"&&o)}));let v=MC(...m),C=I0(v),h=typeof p=="function"?p(C):C(),x=g(...h);return Xy(f,i,x)}function gb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Yt(28));if(p in t)throw new Error(Yt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function T0(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=gb(t),a;if(T0(e))a=()=>ib(e());else{let p=ib(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,v)=>{if(v)if(Wt(g)){let h=v(g,f);return h===void 0?g:h}else{if(Kt(g))return ha(g,C=>v(C,f));{let C=v(g,f);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return g},p)}return i.getInitialState=a,i}var hb=(e,t)=>b0(e)?e.match(t):e(t);function Jr(...e){return t=>e.some(r=>hb(r,t))}function Bi(...e){return t=>e.every(r=>hb(r,t))}function Gd(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 zu(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function $d(...e){return e.length===0?t=>Gd(t,["pending"]):zu(e)?Jr(...e.map(t=>t.pending)):$d()(e[0])}function Sa(...e){return e.length===0?t=>Gd(t,["rejected"]):zu(e)?Jr(...e.map(t=>t.rejected)):Sa()(e[0])}function Wu(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Bi(Sa(...e),t):zu(e)?Bi(Sa(...e),t):Wu()(e[0])}function Hn(...e){return e.length===0?t=>Gd(t,["fulfilled"]):zu(e)?Jr(...e.map(t=>t.fulfilled)):Hn()(e[0])}function Hd(...e){return e.length===0?t=>Gd(t,["pending","fulfilled","rejected"]):zu(e)?Jr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Hd()(e[0])}var P0="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ku=(e=21)=>{let t="",r=e;for(;r--;)t+=P0[Math.random()*64|0];return t},k0=["name","message","stack","code"],dS=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},cb=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},O0=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of k0)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ub="External signal was aborted",xe=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,m,g,v)=>({payload:f,meta:{...(v||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=P(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=P(t+"/rejected",(f,m,g,v,C)=>({payload:v,error:(n&&n.serializeError||O0)(f||"Rejected"),meta:{...(C||{}),arg:g,requestId:m,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,v,C)=>{let h=n?.idGenerator?n.idGenerator(f):Ku(),x=new s.AbortController,b,w;function R(I){w=I,x.abort()}m&&(m.aborted?R(ub):m.addEventListener("abort",()=>R(ub),{once:!0}));let E=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(f,{getState:v,extra:C});if(N0(T)&&(T=yield T),T===!1||x.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,L)=>{b=()=>{L({name:"AbortError",message:w||"Aborted"})},x.signal.addEventListener("abort",b,{once:!0})});g(a(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:v,extra:C}))),I=yield Promise.race([D,Promise.resolve(r(f,{dispatch:g,getState:v,extra:C,requestId:h,signal:x.signal,abort:R,rejectWithValue:(G,L)=>new dS(G,L),fulfillWithValue:(G,L)=>new cb(G,L)})).then(G=>{if(G instanceof dS)throw G;return G instanceof cb?o(G.payload,h,f,G.meta):o(G,h,f)})])}catch(T){I=T instanceof dS?i(null,h,f,T.payload,T.meta):i(T,h,f)}finally{b&&x.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&i.match(I)&&I.meta.condition||g(I),I})();return Object.assign(E,{abort:R,requestId:h,arg:f,unwrap(){return E.then(_0)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Jr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function _0(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function N0(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var yb=Symbol.for("rtk-slice-createasyncthunk"),zK={[yb]:xe};function D0(e,t){return`${e}/${t}`}function q0({creators:e}={}){let t=e?.asyncThunk?.[yb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Yt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(V0()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(I,k){let T=typeof I=="string"?I:I.type;if(!T)throw new Error(Yt(12));if(T in f.sliceCaseReducersByType)throw new Error(Yt(13));return f.sliceCaseReducersByType[T]=k,m},addMatcher(I,k){return f.sliceMatchers.push({matcher:I,reducer:k}),m},exposeAction(I,k){return f.actionCreators[I]=k,m},exposeCaseReducer(I,k){return f.sliceCaseReducersByName[I]=k,m}};p.forEach(I=>{let k=i[I],T={reducerName:I,type:D0(o,I),createNotation:typeof n.reducers=="function"};L0(k)?Q0(T,k,m,t):j0(T,k,m)});function g(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?gb(n.extraReducers):[n.extraReducers],D={...I,...f.sliceCaseReducersByType};return ae(n.initialState,G=>{for(let L in D)G.addCase(L,D[L]);for(let L of f.sliceMatchers)G.addMatcher(L.matcher,L.reducer);for(let L of k)G.addMatcher(L.matcher,L.reducer);T&&G.addDefaultCase(T)})}let v=I=>I,C=new Map,h=new WeakMap,x;function b(I,k){return x||(x=g()),x(I,k)}function w(){return x||(x=g()),x.getInitialState()}function R(I,k=!1){function T(G){let L=G[I];return typeof L>"u"&&k&&(L=Ld(h,T,w)),L}function D(G=v){let L=Ld(C,k,()=>new WeakMap);return Ld(L,G,()=>{let V={};for(let[B,j]of Object.entries(n.selectors??{}))V[B]=M0(j,G,()=>Ld(h,G,w),k);return V})}return{reducerPath:I,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let E={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(a),injectInto(I,{reducerPath:k,...T}={}){let D=k??a;return I.inject({reducerPath:D,reducer:b},T),{...E,...R(D,!0)}}};return E}}function M0(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var va=q0();function V0(){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 j0({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!U0(n))throw new Error(Yt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?P(e,i):P(e))}function L0(e){return e._reducerDefinitionType==="asyncThunk"}function U0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Q0({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Yt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,v=o(e,a,g);n.exposeAction(t,v),i&&n.addCase(v.fulfilled,i),p&&n.addCase(v.pending,p),f&&n.addCase(v.rejected,f),m&&n.addMatcher(v.settled,m),n.exposeCaseReducer(t,{fulfilled:i||Ud,pending:p||Ud,rejected:f||Ud,settled:m||Ud})}function Ud(){}var B0="task",Sb="listener",vb="completed",mS="cancelled",G0=`task-${mS}`,$0=`task-${vb}`,pS=`${Sb}-${mS}`,H0=`${Sb}-${vb}`,zd=class{constructor(e){de(this,"code");de(this,"name","TaskAbortError");de(this,"message");this.code=e,this.message=`${B0} ${mS} (reason: ${e})`}},gS=(e,t)=>{if(typeof e!="function")throw new TypeError(Yt(32))},Qd=()=>{},Ab=(e,t=Qd)=>(e.catch(t),e),xb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ya=e=>{if(e.aborted)throw new zd(e.reason)};function Cb(e,t){let r=Qd;return new Promise((n,o)=>{let a=()=>o(new zd(e.reason));if(e.aborted){a();return}r=xb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Qd})}var z0=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof zd?"cancelled":"rejected",error:r}}finally{t?.()}});return function z0(_x7,_x8){return _ref5.apply(this,arguments)}}(),Bd=e=>t=>Ab(Cb(e,t).then(r=>(ya(e),r))),bb=e=>{let t=Bd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Qi}=Object,lb={},Wd="listenerMiddleware",W0=(e,t)=>{let r=n=>xb(e,()=>n.abort(e.reason));return(n,o)=>{gS(n,"taskExecutor");let a=new s.AbortController;r(a);let i=z0(/*#__PURE__*/_asyncToGenerator(function*(){ya(e),ya(a.signal);let p=yield n({pause:Bd(a.signal),delay:bb(a.signal),signal:a.signal});return ya(a.signal),p}),()=>a.abort($0));return o?.autoJoin&&t.push(i.catch(Qd)),{result:Bd(e)(i),cancel(){a.abort(G0)}}}},K0=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){ya(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(v,C)=>{C.unsubscribe(),f([v,C.getState(),C.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield Cb(t,Promise.race(p));return ya(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>Ab(r(n,o))},wb=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Yt(21));return gS(a,"options.listener"),{predicate:o,type:t,effect:a}},Rb=Qi(e=>{let{type:t,predicate:r,effect:n}=wb(e);return{id:Ku(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Yt(22))}}},{withTypes:()=>Rb}),db=(e,t)=>{let{type:r,effect:n,predicate:o}=wb(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},fS=e=>{e.pending.forEach(t=>{t.abort(pS)})},Y0=(e,t)=>()=>{for(let r of t.keys())fS(r);e.clear()},pb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Fb=Qi(P(`${Wd}/add`),{withTypes:()=>Fb}),X0=P(`${Wd}/removeAll`),Eb=Qi(P(`${Wd}/remove`),{withTypes:()=>Eb}),J0=(...e)=>{console.error(`${Wd}/error`,...e)},Ib=(e={})=>{let t=new Map,r=new Map,n=h=>{let x=r.get(h)??0;r.set(h,x+1)},o=h=>{let x=r.get(h)??1;x===1?r.delete(h):r.set(h,x-1)},{extra:a,onError:i=J0}=e;gS(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),x=>{h.unsubscribe(),x?.cancelActive&&fS(h)}),f=h=>{let x=db(t,h)??Rb(h);return p(x)};Qi(f,{withTypes:()=>f});let m=h=>{let x=db(t,h);return x&&(x.unsubscribe(),h.cancelActive&&fS(x)),!!x};Qi(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,x,b,w){let R=new s.AbortController,E=K0(f,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(x,Qi({},b,{getOriginalState:w,condition:(k,T)=>E(k,T).then(Boolean),take:E,delay:bb(R.signal),pause:Bd(R.signal),extra:a,signal:R.signal,fork:W0(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,T,D)=>{k!==R&&(k.abort(pS),D.delete(k))})},cancel:()=>{R.abort(pS),h.pending.delete(R)},throwIfCancelled:()=>{ya(R.signal)}})))}catch(k){k instanceof zd||pb(i,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(H0),o(h),h.pending.delete(R)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),v=Y0(t,r);return{middleware:h=>x=>b=>{if(!ku(b))return x(b);if(Fb.match(b))return f(b.payload);if(X0.match(b)){v();return}if(Eb.match(b))return m(b.payload);let w=h.getState(),R=()=>{if(w===lb)throw new Error(Yt(23));return w},E;try{if(E=x(b),t.size>0){let I=h.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(b,I,w)}catch(G){D=!1,pb(i,G,{raisedBy:"predicate"})}D&&g(T,b,h,R)}}}finally{w=lb}return E},startListening:f,stopListening:m,clearListeners:v}};function Yt(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 Tb(){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 Pb=/^(?:[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 Z0(e){return typeof e=="string"&&Pb.test(e)}var hS=Z0;d();c();l();u();var Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function kb(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}d();c();l();u();var yS,eD=new Uint8Array(16);function SS(){if(!yS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yS=crypto.getRandomValues.bind(crypto)}return yS(eD)}d();c();l();u();d();c();l();u();var tD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vS={randomUUID:tD};function rD(e,t,r){e=e||{};let n=e.random??e.rng?.()??SS();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 kb(n)}function nD(e,t,r){return vS.randomUUID&&!t&&!e?vS.randomUUID():rD(e,t,r)}var AS=nD;function oD(_x13){return _oD.apply(this,arguments)}function _oD(){_oD=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _oD.apply(this,arguments)}var Mb="2.1.1",xS=128,Vb=192,Ob=224,_b=240,aD=248;function iD(e){return(e&aD)===_b?4:(e&_b)===Ob?3:(e&Ob)===Vb?2:1}function sD(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&xS)!=xS)break;if(r-=3,(n&Vb)!=xS){t-r>=iD(n)*3&&(r=t);break}}return e.substring(0,r)}function cD(e){let{trackingId:t}=e;return{trackingId:t}}function uD(e){return(e.source||[]).concat([`relay@${Mb}`])}function jb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=cD(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:uD(t),clientId:p,userAgent:a(),referrer:Nb(n()),location:Nb(o())})}function Nb(e){return e!==null?sD(e,1024):null}function lD(e,t,r,n){return{...t,meta:jb(e,r,n)}}var dD="*";function pD(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.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(g){console.error(g)}})}function a(f){if(f===dD)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function Db({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 fD(e){let t=Db(e);return{get:()=>t,update:r=>{t=Db({...t,...r})}}}var CS=mD();function mD(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function gD(){return{getItem(e){return CS.getItem(e)||localStorage.getItem(e)},removeItem(e){CS.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),CS.setItem(e,t,31556952e3)}}}var qb="visitorId";function hD(){let e=document.referrer;return e===""?null:e}function bS(){let e=gD();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=S(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});Tb().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.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 ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>hD(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(qb);if(t&&hS(t))return t;let r=AS();return e.setItem(qb,r),r}}}function yD(){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 SD(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function vD(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=SD();return t&&r?{...r,runtime:"custom"}:t&&AD()&&yD()?bS():n}function AD(){try{return typeof window=="object"}catch{return!1}}function xD(e){return{get:()=>Object.freeze(vD(e))}}function Lb(e){let t=fD(e),r=pD(),n=xD(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=lD(o,a,i,p);return oD({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>jb(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:Mb}}d();c();l();u();function Ub(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Ao="3.51.3",Qb=["@coveo/atomic","@coveo/quantic"];var $i=et(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Ao}`));var Yu=et(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>$i(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=bD(p);return Lb({mode:a?"emit":"disabled",url:o??Ad(e,t),token:r,trackingId:n??null,source:i,environment:f})}),CD={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},bD=e=>{if(!e)return;let t=e();return{...(Ub()?bS():CD),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function zn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Q(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var _e;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(_e||(_e={}));function FS(){return typeof window<"u"}function jS(){return typeof navigator<"u"}function Hi(){return typeof document<"u"}function ES(){try{return typeof localStorage<"u"}catch{return!1}}function wD(){try{return typeof sessionStorage<"u"}catch{return!1}}function rw(){return jS()&&navigator.cookieEnabled}var RD=[_e.click,_e.custom,_e.search,_e.view],FD=(e,t)=>RD.indexOf(e)!==-1?Object.assign({language:Hi()?document.documentElement.lang:"unknown",userAgent:jS()?navigator.userAgent:"unknown"},t):t,Ju=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Bb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Bb(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Bb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function ED(){return ES()?localStorage:rw()?new Zu:wD()?sessionStorage:new Wi}var Zu=class e{getItem(t){return Ju.get(`${e.prefix}${t}`)}removeItem(t){Ju.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ju.set(`${e.prefix}${t}`,r,n)}};Zu.prefix="coveo_";var IS=class{constructor(){this.cookieStorage=new Zu}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)}},Wi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Kd="__coveo.analytics.history",ID=20,TD=1e3*60,PD=75,Jd=class{constructor(t){this.store=t||ED()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return Q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return Q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Kd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return Q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Kd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Kd,JSON.stringify(t.slice(0,ID)))}catch{}}clear(){try{this.store.removeItem(Kd)}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,PD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>TD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var kD=(e,t)=>Q(void 0,void 0,void 0,function*(){return e===_e.view?(yield OD(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),OD=e=>Q(void 0,void 0,void 0,function*(){let t=new Jd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Yd,_D=new Uint8Array(16);function ND(){if(!Yd&&(Yd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Yd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Yd(_D)}var DD=/^(?:[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 Zd(e){return typeof e=="string"&&DD.test(e)}var _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function nw(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}function qD(e){if(!Zd(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 MD(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var VD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",jD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function LD(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=MD(o)),typeof a=="string"&&(a=qD(a)),((f=a)===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(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return nw(m)}try{n.name=e}catch{}return n.DNS=VD,n.URL=jD,n}var UD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gb={randomUUID:UD};function Aa(e,t,r){if(Gb.randomUUID&&!t&&!e)return Gb.randomUUID();e=e||{};let n=e.random||(e.rng||ND)();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 nw(n)}function QD(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 wS(e,t){return e<<t|e>>>32-t}function BD(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.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),a=new Array(o);for(let i=0;i<o;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=a[i][h];for(let h=16;h<80;++h)p[h]=wS(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],v=r[3],C=r[4];for(let h=0;h<80;++h){let x=Math.floor(h/20),b=wS(f,5)+QD(x,m,g,v)+C+t[x]+p[h]>>>0;C=v,v=g,g=wS(m,30)>>>0,m=f,f=b}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+C>>>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 GD=LD("v5",80,BD),$b=GD,ow="2.30.56",Hb=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Xu={pageview:"pageview",event:"event"},ep=class{constructor({client:t,uuidGenerator:r=Aa}){this.client=t,this.uuidGenerator=r}},TS=class extends ep{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Hb(window.location),this.lastReferrer=Hi()?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:Hi()?document.title:"",encoding:Hi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Xu.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Xu.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Xu.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Xu.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 Hb(window.location)}},xo=class e{constructor(t,r){if(!Zd(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Zd(a)?new e(a,Number.parseInt(o)*1e3):null}};xo.cvo_cid="cvo_cid";xo.expirationTime=120;var PS=class extends ep{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return Q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(xo.cvo_cid,new xo(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};PS.Id="link";var yr=Object.keys;function Xd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var RS=128,aw=192,zb=224,Wb=240;function $D(e){return(e&248)===Wb?4:(e&Wb)===zb?3:(e&zb)===aw?2:1}function HD(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&RS)!=RS)break;if(r-=3,(n&aw)!=RS){t-r>=$D(n)*3&&(r=t);break}}return e.substring(0,r)}var kS={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"},zD=yr(kS).map(e=>kS[e]),WD=[...zD].join("|"),KD=new RegExp(`^(${WD}$)`),YD={svcAction:"svc_action",svcActionData:"svc_action_data"},XD=e=>yr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=kS[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),JD=e=>KD.test(e),ZD=[JD],Kb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Yb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},tp={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},eq=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],OS={id:"quoteId",affiliation:"quoteAffiliation"},_S={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},tq={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),tp),purchase:Object.assign(Object.assign({},Mt),tp),quickview:Mt,quote:Object.assign(Object.assign({},Mt),OS),review:Object.assign(Object.assign({},Mt),_S)},rq=yr(Kb).map(e=>Kb[e]),nq=yr(Yb).map(e=>Yb[e]),oq=yr(Mt).map(e=>Mt[e]),aq=yr(tp).map(e=>tp[e]),iq=yr(_S).map(e=>_S[e]),sq=yr(OS).map(e=>OS[e]),cq=[...rq,"custom"].join("|"),uq=[...nq,"custom"].join("|"),iw="(pr[0-9]+)",sw="(il[0-9]+pi[0-9]+)",lq=new RegExp(`^${iw}(${cq})$`),dq=new RegExp(`^(${sw}(${uq}))|(il[0-9]+nm)$`),pq=new RegExp(`^(${oq.join("|")})$`),fq=new RegExp(`^(${aq.join("|")})$`),mq=new RegExp(`^${iw}custom$`),gq=new RegExp(`^${sw}custom$`),hq=new RegExp(`^(${[...eq,...iq,...sq].join("|")})$`),yq=e=>lq.test(e),Sq=e=>dq.test(e),vq=e=>pq.test(e),Aq=e=>fq.test(e),xq=e=>hq.test(e),Cq=[Sq,yq,vq,Aq,xq],bq=[mq,gq],wq={anonymizeIp:"aip"},Rq={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Fq={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Eq=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Iq=Object.assign(Object.assign(Object.assign(Object.assign({},wq),Rq),Fq),Eq.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),NS=Object.assign(Object.assign({},Iq),YD),Tq=e=>{let t=!!e.action&&tq[e.action]||{};return yr(e).reduce((r,n)=>{let o=t[n]||NS[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Pq=yr(NS).map(e=>NS[e]),kq=e=>Pq.indexOf(e)!==-1,Oq=e=>e==="custom",_q=e=>[...Cq,...ZD,kq,Oq].some(t=>t(e)),Nq=e=>yr(e).reduce((t,r)=>{let n=Dq(r);return n?Object.assign(Object.assign({},t),qq(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Dq=e=>{let t;return[...bq].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},qq=(e,t)=>yr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),DS=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return Q(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return Q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[_e.click,_e.custom,_e.search,_e.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}},qS=class{sendEvent(t,r){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}},Xb=y.fetch,rp=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=zn(f,["url"]),v;try{v=yield Xb(m,g)}catch(C){console.error("An error has occured when sending the event.",C);return}if(v.ok){let C=yield v.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Xb(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[_e.click,_e.custom,_e.search,_e.view].indexOf(t)!==-1}getVisitorIdParam(){return Q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},MS=class{constructor(t,r){ES()&&rw()?this.storage=new IS:ES()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Wi),this.client=new rp(t),this.beaconClient=new DS(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},VS=class{constructor(t,r){this.storage=r||new Wi,this.client=new rp(t)}getClientDependingOnEventType(t){return this.client}},np=class{constructor(){this.storage=new Wi,this.client=new qS}getClientDependingOnEventType(t){return this.client}},Mq="xx",Vq=e=>e?.startsWith(Mq)||!1,jq=`
28
+ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":nN(g,n,t);break}}}}function nN(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function oN(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function iC(){return{data:"",event:"",id:"",retry:void 0}}var Vy="text/event-stream",aN=1e3,lC="last-event-id";function dC(){return typeof window<"u"}function hd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,v)=>{let C={...r};C.accept||(C.accept=Vy);let h;function x(){h?.abort(),document.hidden||k()}!p&&dC()&&document.addEventListener("visibilitychange",x);let b=aN,w;function R(){dC()&&document.removeEventListener("visibilitychange",x),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{R(),g()});let E=f??S,I=n??iN;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let T=yield E(e,{...m,headers:C,signal:h?.signal});yield I(T),yield sC(T.body,cC(uC(D=>{D?C[lC]=D:delete C[lC]},D=>{b=D},o))),a?.(),R(),g()}catch(T){if(!h?.signal?.aborted)try{let D=i?.(T)??b;clearTimeout(w),w=setTimeout(k,D)}catch(D){R(),v(D)}}});return _k2.apply(this,arguments)}k()})}function iN(e){let t=e.headers.get("content-type");if(!t?.startsWith(Vy))throw new Error(`Expected content-type to be ${Vy}, Actual: ${t}`)}d();c();l();u();var ho=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 sN=(e,t,r)=>new ho(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,pC=3,cN=5e3,uN="text/event-stream",Uy=1,jy=class extends Error{},Eu=class extends Error{constructor(r){super(r.message);de(this,"payload",r)}},Ly=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)}},yd=class{constructor(t){de(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,v=new Ly;if(!a){this.logger.error("No stream ID found");return}let C=0,h,x=()=>{h&&!v.isActive(h)&&(w?.abort(),g(),R())},b=()=>{v.remove(h),h=aC(x,h,cN),v.add(h)},w=new s.AbortController,R=()=>hd(sN(n,o,a),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===uN)return;throw E.status>=400&&E.status<500&&E.status!==429?new Eu({message:"Error opening stream",code:E.status}):new jy})()},onmessage:E=>{if(w?.signal.aborted)return;let I=JSON.parse(E.data);if(I.finishReason==="ERROR"){v.remove(h),w?.abort(),f({message:I.errorMessage,code:I.statusCode});return}p(I),C=0,I.finishReason==="COMPLETED"?(v.remove(h),m()):b()},onerror:E=>{if(!w?.signal.aborted){if(v.remove(h),E instanceof Eu)throw w?.abort(),f(E),E;if(++C>pC){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Uy};throw w?.abort(),f(I),new Eu(I)}this.logger.info(`Retrying...(${C}/${pC})`),g()}}});return R(),w}};d();c();l();u();var Sd=e=>e;d();c();l();u();d();c();l();u();function Mi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ar(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Mi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Mi(),extendedResults:{},searchAction:void 0}}d();c();l();u();function yo(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var So=e=>{let{response:t}=e;return t.body?lN(e):dN(t)},lN=e=>fN(e)?mN(e):pN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},dN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function pN(e){return e.body.statusCode!==void 0}function fN(e){return e.body.exception!==void 0}var mN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var wC=Vr(AC(),1);d();c();l();u();var K=new Error("Failed to load reducers."),Vi=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."}},da=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 xC(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function CC(e){return typeof e!="object"||!e?!1:Object.values(e).every(LN)}function LN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function bC(e){return e===429}var jr=class e{static call(t){return _asyncToGenerator(function*(){let r=UN(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield S(a,i);if(bC(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,wC.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&bC(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Vi;case 404:throw new da(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new da(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Fu(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function mr(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ji(e,t,r="prod"){return e??mr(t,r)}function St(e,t="prod"){return`${mr(e,t)}/rest/search/v2`}function Ad(e,t="prod"){return`${mr(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function UN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=QN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function QN(e,t){return t==="application/x-www-form-urlencoded"?CC(e)?xC(e):"":JSON.stringify(e)}d();c();l();u();var vo=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function RC(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Qn=(e,t,r,n)=>{let o=new ho(`${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 FC=(e,t)=>{let r=new ho(`${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},EC=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jr.call({...Qn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:yo(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=RC(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return BN(i)?{success:i}:{error:So({response:r,body:i})}});return function EC(_x5,_x6){return _ref3.apply(this,arguments)}}();function BN(e){return typeof e=="string"}d();c();l();u();function GN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function $N(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function xd(e,t){if(t&&e.name==="AbortError")return{error:$N(e)};if(e instanceof da)return{error:GN(e)};throw e}var Cd=class{constructor(t){de(this,"options",t);de(this,"apiCallsQueues",{unknown:new vo,mainSearch:new vo,facetValues:new vo,foldingCollection:new vo,instantResults:new vo})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/plan"),requestParams:yo(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return xd(r);let n=yield r.json();return zN(n)?{success:n}:{error:So({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:yo(t),..._this3.options});if(r instanceof Error)return xd(r);let n=yield r.json(),o={response:r,body:n};return HN(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:So(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>jr.call({...Qn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return xd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return IC(a)?(i.body=TC(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:So(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/facet"),requestParams:yo(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(IC(n)){let o={response:r,body:n};return o.body=TC(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:So({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return EC(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return WN(n)?{success:n}:{error:So({response:r,body:n})}})()}},bd=e=>e.success!==void 0,vt=e=>e.error!==void 0;function IC(e){return e.results!==void 0}function TC(e){let t=Mi();return fe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function HN(e){return e.completions!==void 0}function zN(e){return e.preprocessingOutput!==void 0}function WN(e){return e.fields!==void 0}d();c();l();u();var PC=e=>e,kC=e=>e,OC=e=>e;d();c();l();u();d();c();l();u();var W=new U({required:!0,emptyAllowed:!1}),st=new U({required:!1,emptyAllowed:!1}),Be=new U({required:!0,emptyAllowed:!0}),lK=new U({required:!1,emptyAllowed:!0}),wd=new ie({each:W,required:!0}),_C=new U({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),NC=new U({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),dK=new U({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Bn=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),gr=(e,t)=>{if("required"in t)return{payload:new Se({value:t}).validate({value:e}).value};let o=new J({options:{required:!0},values:t}).validate(e);if(o)throw new wu(o);return{payload:e}},O=(e,t)=>{try{return gr(e,t)}catch(r){return{payload:e,error:Bn(r)}}},lt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return DC(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return DC(e,t,r,o,"Controller initialization error")},DC=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Pt(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 KN=typeof Symbol=="function"&&Symbol.observable||"@@observable",qC=KN,Yy=()=>Math.random().toString(36).substring(7).split("").join("."),YN={INIT:`@@redux/INIT${Yy()}`,REPLACE:`@@redux/REPLACE${Yy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yy()}`},Rd=YN;function Xr(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 Xy(e,t,r){if(typeof e!="function")throw new Error(Pt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Pt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Pt(1));return r(Xy)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((w,R)=>{i.set(R,w)}))}function g(){if(f)throw new Error(Pt(3));return o}function v(w){if(typeof w!="function")throw new Error(Pt(4));if(f)throw new Error(Pt(5));let R=!0;m();let E=p++;return i.set(E,w),function(){if(R){if(f)throw new Error(Pt(6));R=!1,m(),i.delete(E),a=null}}}function C(w){if(!Xr(w))throw new Error(Pt(7));if(typeof w.type>"u")throw new Error(Pt(8));if(typeof w.type!="string")throw new Error(Pt(17));if(f)throw new Error(Pt(9));try{f=!0,o=n(o,w)}finally{f=!1}return(a=i).forEach(E=>{E()}),w}function h(w){if(typeof w!="function")throw new Error(Pt(10));n=w,C({type:Rd.REPLACE})}function x(){let w=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Pt(11));function E(){let k=R;k.next&&k.next(g())}return E(),{unsubscribe:w(E)}},[qC](){return this}}}return C({type:Rd.INIT}),{dispatch:C,subscribe:v,getState:g,replaceReducer:h,[qC]:x}}function XN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Rd.INIT})>"u")throw new Error(Pt(12));if(typeof r(void 0,{type:Rd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pt(13))})}function Li(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{XN(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let v=0;v<n.length;v++){let C=n[v],h=r[C],x=p[C],b=h(x,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Pt(14))}g[C]=b,m=m||b!==x}return m=m||n.length!==Object.keys(p).length,m?g:p}}function Pu(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function MC(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Pt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=Pu(...p)(o.dispatch),{...o,dispatch:a}}}function ku(e){return Xr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var iS=Symbol.for("immer-nothing"),Ou=Symbol.for("immer-draftable"),At=Symbol.for("immer-state");function kt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ir=Object,fa=ir.getPrototypeOf,Nu="constructor",ju="prototype",eS="configurable",Td="enumerable",Ed="writable",Du="value",Wt=e=>!!e&&!!e[At];function Kt(e){return e?$C(e)||Uu(e)||!!e[Ou]||!!e[Nu]?.[Ou]||Qu(e)||Bu(e):!1}var JN=ir[ju][Nu].toString(),VC=new WeakMap;function $C(e){if(!e||!Ui(e))return!1;let t=fa(e);if(t===null||t===ir[ju])return!0;let r=ir.hasOwnProperty.call(t,Nu)&&t[Nu];if(r===Object)return!0;if(!pa(r))return!1;let n=VC.get(r);return n===void 0&&(n=Function.toString.call(r),VC.set(r,n)),n===JN}function HC(e){return Wt(e)||kt(15,e),e[At].base_}function Lu(e,t,r=!0){ma(e)===0?(r?Reflect.ownKeys(e):ir.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ma(e){let t=e[At];return t?t.type_:Uu(e)?1:Qu(e)?2:Bu(e)?3:0}var _u=(e,t,r=ma(e))=>r===2?e.has(t):ir[ju].hasOwnProperty.call(e,t),Gn=(e,t,r=ma(e))=>r===2?e.get(t):e[t],Pd=(e,t,r,n=ma(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function ZN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Uu=Array.isArray,Qu=e=>e instanceof Map,Bu=e=>e instanceof Set,Ui=e=>typeof e=="object",pa=e=>typeof e=="function",Jy=e=>typeof e=="boolean";function e0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var t0=e=>Ui(e)?e?.[At]:null,$n=e=>e.copy_||e.base_;var sS=e=>e.modified_?e.copy_:e.base_;function tS(e,t){if(Qu(e))return new Map(e);if(Bu(e))return new Set(e);if(Uu(e))return Array[ju].slice.call(e);let r=$C(e);if(t===!0||t==="class_only"&&!r){let n=ir.getOwnPropertyDescriptors(e);delete n[At];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Ed]===!1&&(p[Ed]=!0,p[eS]=!0),(p.get||p.set)&&(n[i]={[eS]:!0,[Ed]:!0,[Td]:p[Td],[Du]:e[i]})}return ir.create(fa(e),n)}else{let n=fa(e);if(n!==null&&r)return{...e};let o=ir.create(n);return ir.assign(o,e)}}function cS(e,t=!1){return qd(e)||Wt(e)||!Kt(e)||(ma(e)>1&&ir.defineProperties(e,{set:Fd,add:Fd,clear:Fd,delete:Fd}),ir.freeze(e),t&&Lu(e,(r,n)=>{cS(n,!0)},!1)),e}function r0(){kt(2)}var Fd={[Du]:r0};function qd(e){return e===null||!Ui(e)?!0:ir.isFrozen(e)}var kd="MapSet",Od="Patches",jC="ArrayMethods",_d={};function ga(e){let t=_d[e];return t||kt(0,e),t}var LC=e=>!!_d[e];function n0(e,t){_d[e]||(_d[e]=t)}var qu,zC=()=>qu,o0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:LC(kd)?ga(kd):void 0,arrayMethodsPlugin_:LC(jC)?ga(jC):void 0});function UC(e,t){t&&(e.patchPlugin_=ga(Od),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function rS(e){nS(e),e.drafts_.forEach(a0),e.drafts_=null}function nS(e){e===qu&&(qu=e.parent_)}var QC=e=>qu=o0(qu,e);function a0(e){let t=e[At];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function BC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[At].modified_&&(rS(t),kt(4)),Kt(e)&&(e=GC(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[At].base_,e,t)}else e=GC(t,r);return i0(t,e,!0),rS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==iS?e:void 0}function GC(e,t){if(qd(t))return t;let r=t[At];if(!r)return Nd(t,e.handledSet_,e);if(!Md(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);YC(r,e)}return r.copy_}function i0(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cS(t,r)}function WC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Md=(e,t)=>e.scope_===t,s0=[];function KC(e,t,r,n){let o=$n(e),a=e.type_;if(n!==void 0&&Gn(o,n,a)===t){Pd(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Lu(o,(f,m)=>{if(Wt(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??s0;for(let p of i)Pd(o,p,r,a)}function c0(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Md(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=sS(a);KC(e,a.draft_??a,i,r),YC(a,o)})}function YC(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)}WC(e)}}function u0(e,t,r){let{scope_:n}=e;if(Wt(r)){let o=r[At];Md(o,n)&&o.callbacks_.push(function(){Id(e);let i=sS(o);KC(e,r,i,t)})}else Kt(r)&&e.callbacks_.push(function(){let a=$n(e);e.type_===3?a.has(r)&&Nd(r,n.handledSet_,n):Gn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Nd(Gn(e.copy_,t,e.type_),n.handledSet_,n)})}function Nd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Wt(e)||t.has(e)||!Kt(e)||qd(e)||(t.add(e),Lu(e,(n,o)=>{if(Wt(o)){let a=o[At];if(Md(a,r)){let i=sS(a);Pd(e,n,i,e.type_),WC(a)}}else Kt(o)&&Nd(o,t,r)})),e}function l0(e,t){let r=Uu(e),n={type_:r?1:0,scope_:t?t.scope_:zC(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=Dd;r&&(o=[n],a=Mu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var Dd={get(e,t){if(t===At)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=$n(e);if(!_u(o,t,e.type_))return d0(e,o,t);let a=o[t];if(e.finalized_||!Kt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&e0(t))return a;if(a===Zy(e.base_,t)){Id(e);let i=e.type_===1?+t:t,p=aS(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in $n(e)},ownKeys(e){return Reflect.ownKeys($n(e))},set(e,t,r){let n=XC($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zy($n(e),t),a=o?.[At];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(ZN(r,o)&&(r!==void 0||_u(e.base_,t,e.type_)))return!0;Id(e),oS(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),u0(e,t,r)),!0},deleteProperty(e,t){return Id(e),Zy(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),oS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$n(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ed]:!0,[eS]:e.type_!==1||t!=="length",[Td]:n[Td],[Du]:r[t]}},defineProperty(){kt(11)},getPrototypeOf(e){return fa(e.base_)},setPrototypeOf(){kt(12)}},Mu={};for(let e in Dd){let t=Dd[e];Mu[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Mu.deleteProperty=function(e,t){return Mu.set.call(this,e,t,void 0)};Mu.set=function(e,t,r){return Dd.set.call(this,e[0],t,r,e[0])};function Zy(e,t){let r=e[At];return(r?$n(r):e)[t]}function d0(e,t,r){let n=XC(t,r);return n?Du in n?n[Du]:n.get?.call(e.draft_):void 0}function XC(e,t){if(!(t in e))return;let r=fa(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fa(r)}}function oS(e){e.modified_||(e.modified_=!0,e.parent_&&oS(e.parent_))}function Id(e){e.copy_||(e.assigned_=new Map,e.copy_=tS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var p0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(pa(t)&&!pa(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}pa(r)||kt(6),n!==void 0&&!pa(n)&&kt(7);let o;if(Kt(t)){let a=QC(this),i=aS(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?rS(a):nS(a)}return UC(a,n),BC(o,a)}else if(!t||!Ui(t)){if(o=r(t),o===void 0&&(o=t),o===iS&&(o=void 0),this.autoFreeze_&&cS(o,!0),n){let a=[],i=[];ga(Od).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else kt(1,t)},this.produceWithPatches=(t,r)=>{if(pa(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},Jy(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Jy(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Jy(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Kt(e)||kt(8),Wt(e)&&(e=Vd(e));let t=QC(this),r=aS(t,e,void 0);return r[At].isManual_=!0,nS(t),r}finishDraft(e,t){let r=e&&e[At];(!r||!r.isManual_)&&kt(9);let{scope_:n}=r;return UC(n,t),BC(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=ga(Od).applyPatches_;return Wt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aS(e,t,r,n){let[o,a]=Qu(t)?ga(kd).proxyMap_(t,r):Bu(t)?ga(kd).proxySet_(t,r):l0(t,r);return(r?.scope_??zC()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?c0(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function Vd(e){return Wt(e)||kt(10,e),JC(e)}function JC(e){if(!Kt(e)||qd(e))return e;let t=e[At],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=tS(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=tS(e,!0);return Lu(r,(o,a)=>{Pd(r,o,JC(a))},n),t&&(t.finalized_=!1),r}function ZC(){function t(x,b=[]){if(x.key_!==void 0){let w=x.parent_.copy_??x.parent_.base_,R=t0(Gn(w,x.key_)),E=Gn(w,x.key_);if(E===void 0||E!==x.draft_&&E!==x.base_&&E!==x.copy_||R!=null&&R.base_!==x.base_)return null;let I=x.parent_.type_===3,k;if(I){let T=x.parent_;k=Array.from(T.drafts_.keys()).indexOf(x.key_)}else k=x.key_;if(!(I&&w.size>k||_u(w,k)))return null;b.push(k)}if(x.parent_)return t(x.parent_,b);b.reverse();try{r(x.copy_,b)}catch{return null}return b}function r(x,b){let w=x;for(let R=0;R<b.length-1;R++){let E=b[R];if(w=Gn(w,E),!Ui(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(x,b,w){if(x.scope_.processedForPatches_.has(x))return;x.scope_.processedForPatches_.add(x);let{patches_:R,inversePatches_:E}=w;switch(x.type_){case 0:case 2:return f(x,b,R,E);case 1:return p(x,b,R,E);case 3:return m(x,b,R,E)}}function p(x,b,w,R){let{base_:E,assigned_:I}=x,k=x.copy_;k.length<E.length&&([E,k]=[k,E],[w,R]=[R,w]);let T=x.allIndicesReassigned_===!0;for(let D=0;D<E.length;D++){let G=k[D],L=E[D];if((T||I?.get(D.toString()))&&G!==L){let B=G?.[At];if(B&&B.modified_)continue;let j=b.concat([D]);w.push({op:n,path:j,value:h(G)}),R.push({op:n,path:j,value:h(L)})}}for(let D=E.length;D<k.length;D++){let G=b.concat([D]);w.push({op:o,path:G,value:h(k[D])})}for(let D=k.length-1;E.length<=D;--D){let G=b.concat([D]);R.push({op:a,path:G})}}function f(x,b,w,R){let{base_:E,copy_:I,type_:k}=x;Lu(x.assigned_,(T,D)=>{let G=Gn(E,T,k),L=Gn(I,T,k),V=D?_u(E,T)?n:o:a;if(G===L&&V===n)return;let B=b.concat(T);w.push(V===a?{op:V,path:B}:{op:V,path:B,value:h(L)}),R.push(V===o?{op:a,path:B}:V===a?{op:o,path:B,value:h(G)}:{op:n,path:B,value:h(G)})})}function m(x,b,w,R){let{base_:E,copy_:I}=x,k=0;E.forEach(T=>{if(!I.has(T)){let D=b.concat([k]);w.push({op:a,path:D,value:T}),R.unshift({op:o,path:D,value:T})}k++}),k=0,I.forEach(T=>{if(!E.has(T)){let D=b.concat([k]);w.push({op:o,path:D,value:T}),R.unshift({op:a,path:D,value:T})}k++})}function g(x,b,w){let{patches_:R,inversePatches_:E}=w;R.push({op:n,path:[],value:b===iS?void 0:b}),E.push({op:n,path:[],value:x})}function v(x,b){return b.forEach(w=>{let{path:R,op:E}=w,I=x;for(let G=0;G<R.length-1;G++){let L=ma(I),V=R[G];typeof V!="string"&&typeof V!="number"&&(V=""+V),(L===0||L===1)&&(V==="__proto__"||V===Nu)&&kt(19),pa(I)&&V===ju&&kt(19),I=Gn(I,V),Ui(I)||kt(18,R.join("/"))}let k=ma(I),T=C(w.value),D=R[R.length-1];switch(E){case n:switch(k){case 2:return I.set(D,T);case 3:kt(16);default:return I[D]=T}case o:switch(k){case 1:return D==="-"?I.push(T):I.splice(D,0,T);case 2:return I.set(D,T);case 3:return I.add(T);default:return I[D]=T}case a:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(w.value);default:return delete I[D]}default:kt(17,E)}}),x}function C(x){if(!Kt(x))return x;if(Uu(x))return x.map(C);if(Qu(x))return new Map(Array.from(x.entries()).map(([w,R])=>[w,C(R)]));if(Bu(x))return new Set(Array.from(x).map(C));let b=Object.create(fa(x));for(let w in x)b[w]=C(x[w]);return _u(x,Ou)&&(b[Ou]=x[Ou]),b}function h(x){return Wt(x)?C(x):x}n0(Od,{applyPatches_:v,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var Vu=new p0,ha=Vu.produce,uS=Vu.produceWithPatches.bind(Vu);var lS=Vu.applyPatches.bind(Vu);d();c();l();u();function f0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function m0(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 eb=e=>Array.isArray(e)?e:[e];function g0(e){let t=Array.isArray(e[0])?e[0]:e;return m0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function h0(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var y0=class{constructor(e){this.value=e}deref(){return this.value}},S0=()=>typeof WeakRef>"u"?y0:WeakRef,rb=S0(),v0=0,tb=1;function jd(){return{s:v0,v:void 0,o:null,p:null}}function A0(e){return e instanceof rb?e.deref():e}function Gu(e,t={}){let r=jd(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let v=0,C=f;v<C;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let x=p.o;x===null&&(p.o=x=new WeakMap);let b=x.get(h);b===void 0?(p=jd(),x.set(h,p)):p=b}else{let x=p.p;x===null&&(p.p=x=new Map);let b=x.get(h);b===void 0?(p=jd(),x.set(h,p)):p=b}}let m=p,g;if(p.s===tb)g=p.v;else if(g=e.apply(null,arguments),a++,n){let v=A0(o);v!=null&&n(v,g)&&(g=v,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new rb(g):g}return m.s=tb,m.v=g,g}return i.clearCache=()=>{r=jd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function x0(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),f0(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:v,memoizeOptions:C=[],argsMemoize:h=Gu,argsMemoizeOptions:x=[]}=g,b=eb(C),w=eb(x),R=g0(o),E=v(function(){return a++,m.apply(null,arguments)},...b),I=!0,k=h(function(){i++;let D=h0(R,arguments);return p=E.apply(null,D),p},...w);return Object.assign(k,{resultFunc:m,memoizedResultFunc:E,dependencies:R,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var et=x0(Gu);d();c();l();u();function nb(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var ob=nb(),ab=nb;var C0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pu:Pu.apply(null,arguments)},$K=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},b0=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Yt(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=>ku(n)&&n.type===e,r}var fb=class $u extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,$u.prototype)}static get[Symbol.species](){return $u}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new $u(...t[0].concat(this)):new $u(...t.concat(this))}};function ib(e){return Kt(e)?ha(e,()=>{}):e}function Ld(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function w0(e){return typeof e=="boolean"}var R0=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new fb;return r&&(w0(r)?i.push(ob):i.push(ab(r.extraArgument))),i},Hu="RTK_autoBatch",Gi=()=>e=>({payload:e,meta:{[Hu]:!0}}),sb=e=>t=>{setTimeout(t,e)},F0=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},E0=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?F0(window.requestAnimationFrame,100):sb(10):e.type==="callback"?e.queueNotification:sb(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),C=n.subscribe(v);return p.add(g),()=>{C(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Hu],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},I0=e=>function(r){let{autoBatch:n=!0}=r??{},o=new fb(e);return n&&o.push(E0(typeof n=="object"?n:void 0)),o};function mb(e){let t=R0(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Xr(r))f=Li(r);else throw new Error(Yt(1));let m;typeof n=="function"?m=n(t):m=t();let g=Pu;o&&(g=C0({trace:!1,...(typeof o=="object"&&o)}));let v=MC(...m),C=I0(v),h=typeof p=="function"?p(C):C(),x=g(...h);return Xy(f,i,x)}function gb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Yt(28));if(p in t)throw new Error(Yt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function T0(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=gb(t),a;if(T0(e))a=()=>ib(e());else{let p=ib(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,v)=>{if(v)if(Wt(g)){let h=v(g,f);return h===void 0?g:h}else{if(Kt(g))return ha(g,C=>v(C,f));{let C=v(g,f);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return g},p)}return i.getInitialState=a,i}var hb=(e,t)=>b0(e)?e.match(t):e(t);function Jr(...e){return t=>e.some(r=>hb(r,t))}function Bi(...e){return t=>e.every(r=>hb(r,t))}function Gd(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 zu(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function $d(...e){return e.length===0?t=>Gd(t,["pending"]):zu(e)?Jr(...e.map(t=>t.pending)):$d()(e[0])}function Sa(...e){return e.length===0?t=>Gd(t,["rejected"]):zu(e)?Jr(...e.map(t=>t.rejected)):Sa()(e[0])}function Wu(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Bi(Sa(...e),t):zu(e)?Bi(Sa(...e),t):Wu()(e[0])}function Hn(...e){return e.length===0?t=>Gd(t,["fulfilled"]):zu(e)?Jr(...e.map(t=>t.fulfilled)):Hn()(e[0])}function Hd(...e){return e.length===0?t=>Gd(t,["pending","fulfilled","rejected"]):zu(e)?Jr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Hd()(e[0])}var P0="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ku=(e=21)=>{let t="",r=e;for(;r--;)t+=P0[Math.random()*64|0];return t},k0=["name","message","stack","code"],dS=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},cb=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},O0=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of k0)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ub="External signal was aborted",xe=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,m,g,v)=>({payload:f,meta:{...(v||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=P(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=P(t+"/rejected",(f,m,g,v,C)=>({payload:v,error:(n&&n.serializeError||O0)(f||"Rejected"),meta:{...(C||{}),arg:g,requestId:m,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,v,C)=>{let h=n?.idGenerator?n.idGenerator(f):Ku(),x=new s.AbortController,b,w;function R(I){w=I,x.abort()}m&&(m.aborted?R(ub):m.addEventListener("abort",()=>R(ub),{once:!0}));let E=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(f,{getState:v,extra:C});if(N0(T)&&(T=yield T),T===!1||x.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,L)=>{b=()=>{L({name:"AbortError",message:w||"Aborted"})},x.signal.addEventListener("abort",b,{once:!0})});g(a(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:v,extra:C}))),I=yield Promise.race([D,Promise.resolve(r(f,{dispatch:g,getState:v,extra:C,requestId:h,signal:x.signal,abort:R,rejectWithValue:(G,L)=>new dS(G,L),fulfillWithValue:(G,L)=>new cb(G,L)})).then(G=>{if(G instanceof dS)throw G;return G instanceof cb?o(G.payload,h,f,G.meta):o(G,h,f)})])}catch(T){I=T instanceof dS?i(null,h,f,T.payload,T.meta):i(T,h,f)}finally{b&&x.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&i.match(I)&&I.meta.condition||g(I),I})();return Object.assign(E,{abort:R,requestId:h,arg:f,unwrap(){return E.then(_0)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Jr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function _0(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function N0(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var yb=Symbol.for("rtk-slice-createasyncthunk"),zK={[yb]:xe};function D0(e,t){return`${e}/${t}`}function q0({creators:e}={}){let t=e?.asyncThunk?.[yb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Yt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(V0()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(I,k){let T=typeof I=="string"?I:I.type;if(!T)throw new Error(Yt(12));if(T in f.sliceCaseReducersByType)throw new Error(Yt(13));return f.sliceCaseReducersByType[T]=k,m},addMatcher(I,k){return f.sliceMatchers.push({matcher:I,reducer:k}),m},exposeAction(I,k){return f.actionCreators[I]=k,m},exposeCaseReducer(I,k){return f.sliceCaseReducersByName[I]=k,m}};p.forEach(I=>{let k=i[I],T={reducerName:I,type:D0(o,I),createNotation:typeof n.reducers=="function"};L0(k)?Q0(T,k,m,t):j0(T,k,m)});function g(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?gb(n.extraReducers):[n.extraReducers],D={...I,...f.sliceCaseReducersByType};return ae(n.initialState,G=>{for(let L in D)G.addCase(L,D[L]);for(let L of f.sliceMatchers)G.addMatcher(L.matcher,L.reducer);for(let L of k)G.addMatcher(L.matcher,L.reducer);T&&G.addDefaultCase(T)})}let v=I=>I,C=new Map,h=new WeakMap,x;function b(I,k){return x||(x=g()),x(I,k)}function w(){return x||(x=g()),x.getInitialState()}function R(I,k=!1){function T(G){let L=G[I];return typeof L>"u"&&k&&(L=Ld(h,T,w)),L}function D(G=v){let L=Ld(C,k,()=>new WeakMap);return Ld(L,G,()=>{let V={};for(let[B,j]of Object.entries(n.selectors??{}))V[B]=M0(j,G,()=>Ld(h,G,w),k);return V})}return{reducerPath:I,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let E={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(a),injectInto(I,{reducerPath:k,...T}={}){let D=k??a;return I.inject({reducerPath:D,reducer:b},T),{...E,...R(D,!0)}}};return E}}function M0(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var va=q0();function V0(){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 j0({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!U0(n))throw new Error(Yt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?P(e,i):P(e))}function L0(e){return e._reducerDefinitionType==="asyncThunk"}function U0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Q0({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Yt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,v=o(e,a,g);n.exposeAction(t,v),i&&n.addCase(v.fulfilled,i),p&&n.addCase(v.pending,p),f&&n.addCase(v.rejected,f),m&&n.addMatcher(v.settled,m),n.exposeCaseReducer(t,{fulfilled:i||Ud,pending:p||Ud,rejected:f||Ud,settled:m||Ud})}function Ud(){}var B0="task",Sb="listener",vb="completed",mS="cancelled",G0=`task-${mS}`,$0=`task-${vb}`,pS=`${Sb}-${mS}`,H0=`${Sb}-${vb}`,zd=class{constructor(e){de(this,"code");de(this,"name","TaskAbortError");de(this,"message");this.code=e,this.message=`${B0} ${mS} (reason: ${e})`}},gS=(e,t)=>{if(typeof e!="function")throw new TypeError(Yt(32))},Qd=()=>{},Ab=(e,t=Qd)=>(e.catch(t),e),xb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ya=e=>{if(e.aborted)throw new zd(e.reason)};function Cb(e,t){let r=Qd;return new Promise((n,o)=>{let a=()=>o(new zd(e.reason));if(e.aborted){a();return}r=xb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Qd})}var z0=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof zd?"cancelled":"rejected",error:r}}finally{t?.()}});return function z0(_x7,_x8){return _ref5.apply(this,arguments)}}(),Bd=e=>t=>Ab(Cb(e,t).then(r=>(ya(e),r))),bb=e=>{let t=Bd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Qi}=Object,lb={},Wd="listenerMiddleware",W0=(e,t)=>{let r=n=>xb(e,()=>n.abort(e.reason));return(n,o)=>{gS(n,"taskExecutor");let a=new s.AbortController;r(a);let i=z0(/*#__PURE__*/_asyncToGenerator(function*(){ya(e),ya(a.signal);let p=yield n({pause:Bd(a.signal),delay:bb(a.signal),signal:a.signal});return ya(a.signal),p}),()=>a.abort($0));return o?.autoJoin&&t.push(i.catch(Qd)),{result:Bd(e)(i),cancel(){a.abort(G0)}}}},K0=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){ya(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(v,C)=>{C.unsubscribe(),f([v,C.getState(),C.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield Cb(t,Promise.race(p));return ya(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>Ab(r(n,o))},wb=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Yt(21));return gS(a,"options.listener"),{predicate:o,type:t,effect:a}},Rb=Qi(e=>{let{type:t,predicate:r,effect:n}=wb(e);return{id:Ku(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Yt(22))}}},{withTypes:()=>Rb}),db=(e,t)=>{let{type:r,effect:n,predicate:o}=wb(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},fS=e=>{e.pending.forEach(t=>{t.abort(pS)})},Y0=(e,t)=>()=>{for(let r of t.keys())fS(r);e.clear()},pb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Fb=Qi(P(`${Wd}/add`),{withTypes:()=>Fb}),X0=P(`${Wd}/removeAll`),Eb=Qi(P(`${Wd}/remove`),{withTypes:()=>Eb}),J0=(...e)=>{console.error(`${Wd}/error`,...e)},Ib=(e={})=>{let t=new Map,r=new Map,n=h=>{let x=r.get(h)??0;r.set(h,x+1)},o=h=>{let x=r.get(h)??1;x===1?r.delete(h):r.set(h,x-1)},{extra:a,onError:i=J0}=e;gS(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),x=>{h.unsubscribe(),x?.cancelActive&&fS(h)}),f=h=>{let x=db(t,h)??Rb(h);return p(x)};Qi(f,{withTypes:()=>f});let m=h=>{let x=db(t,h);return x&&(x.unsubscribe(),h.cancelActive&&fS(x)),!!x};Qi(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,x,b,w){let R=new s.AbortController,E=K0(f,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(x,Qi({},b,{getOriginalState:w,condition:(k,T)=>E(k,T).then(Boolean),take:E,delay:bb(R.signal),pause:Bd(R.signal),extra:a,signal:R.signal,fork:W0(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,T,D)=>{k!==R&&(k.abort(pS),D.delete(k))})},cancel:()=>{R.abort(pS),h.pending.delete(R)},throwIfCancelled:()=>{ya(R.signal)}})))}catch(k){k instanceof zd||pb(i,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(H0),o(h),h.pending.delete(R)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),v=Y0(t,r);return{middleware:h=>x=>b=>{if(!ku(b))return x(b);if(Fb.match(b))return f(b.payload);if(X0.match(b)){v();return}if(Eb.match(b))return m(b.payload);let w=h.getState(),R=()=>{if(w===lb)throw new Error(Yt(23));return w},E;try{if(E=x(b),t.size>0){let I=h.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(b,I,w)}catch(G){D=!1,pb(i,G,{raisedBy:"predicate"})}D&&g(T,b,h,R)}}}finally{w=lb}return E},startListening:f,stopListening:m,clearListeners:v}};function Yt(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 Tb(){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 Pb=/^(?:[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 Z0(e){return typeof e=="string"&&Pb.test(e)}var hS=Z0;d();c();l();u();var Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function kb(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}d();c();l();u();var yS,eD=new Uint8Array(16);function SS(){if(!yS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yS=crypto.getRandomValues.bind(crypto)}return yS(eD)}d();c();l();u();d();c();l();u();var tD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vS={randomUUID:tD};function rD(e,t,r){e=e||{};let n=e.random??e.rng?.()??SS();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 kb(n)}function nD(e,t,r){return vS.randomUUID&&!t&&!e?vS.randomUUID():rD(e,t,r)}var AS=nD;function oD(_x13){return _oD.apply(this,arguments)}function _oD(){_oD=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _oD.apply(this,arguments)}var Mb="2.1.1",xS=128,Vb=192,Ob=224,_b=240,aD=248;function iD(e){return(e&aD)===_b?4:(e&_b)===Ob?3:(e&Ob)===Vb?2:1}function sD(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&xS)!=xS)break;if(r-=3,(n&Vb)!=xS){t-r>=iD(n)*3&&(r=t);break}}return e.substring(0,r)}function cD(e){let{trackingId:t}=e;return{trackingId:t}}function uD(e){return(e.source||[]).concat([`relay@${Mb}`])}function jb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=cD(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:uD(t),clientId:p,userAgent:a(),referrer:Nb(n()),location:Nb(o())})}function Nb(e){return e!==null?sD(e,1024):null}function lD(e,t,r,n){return{...t,meta:jb(e,r,n)}}var dD="*";function pD(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.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(g){console.error(g)}})}function a(f){if(f===dD)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function Db({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 fD(e){let t=Db(e);return{get:()=>t,update:r=>{t=Db({...t,...r})}}}var CS=mD();function mD(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function gD(){return{getItem(e){return CS.getItem(e)||localStorage.getItem(e)},removeItem(e){CS.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),CS.setItem(e,t,31556952e3)}}}var qb="visitorId";function hD(){let e=document.referrer;return e===""?null:e}function bS(){let e=gD();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=S(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});Tb().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.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 ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>hD(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(qb);if(t&&hS(t))return t;let r=AS();return e.setItem(qb,r),r}}}function yD(){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 SD(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function vD(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=SD();return t&&r?{...r,runtime:"custom"}:t&&AD()&&yD()?bS():n}function AD(){try{return typeof window=="object"}catch{return!1}}function xD(e){return{get:()=>Object.freeze(vD(e))}}function Lb(e){let t=fD(e),r=pD(),n=xD(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=lD(o,a,i,p);return oD({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>jb(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:Mb}}d();c();l();u();function Ub(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Ao="3.51.4",Qb=["@coveo/atomic","@coveo/quantic"];var $i=et(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Ao}`));var Yu=et(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>$i(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=bD(p);return Lb({mode:a?"emit":"disabled",url:o??Ad(e,t),token:r,trackingId:n??null,source:i,environment:f})}),CD={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},bD=e=>{if(!e)return;let t=e();return{...(Ub()?bS():CD),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function zn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Q(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var _e;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(_e||(_e={}));function FS(){return typeof window<"u"}function jS(){return typeof navigator<"u"}function Hi(){return typeof document<"u"}function ES(){try{return typeof localStorage<"u"}catch{return!1}}function wD(){try{return typeof sessionStorage<"u"}catch{return!1}}function rw(){return jS()&&navigator.cookieEnabled}var RD=[_e.click,_e.custom,_e.search,_e.view],FD=(e,t)=>RD.indexOf(e)!==-1?Object.assign({language:Hi()?document.documentElement.lang:"unknown",userAgent:jS()?navigator.userAgent:"unknown"},t):t,Ju=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Bb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Bb(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Bb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function ED(){return ES()?localStorage:rw()?new Zu:wD()?sessionStorage:new Wi}var Zu=class e{getItem(t){return Ju.get(`${e.prefix}${t}`)}removeItem(t){Ju.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ju.set(`${e.prefix}${t}`,r,n)}};Zu.prefix="coveo_";var IS=class{constructor(){this.cookieStorage=new Zu}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)}},Wi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Kd="__coveo.analytics.history",ID=20,TD=1e3*60,PD=75,Jd=class{constructor(t){this.store=t||ED()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return Q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return Q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Kd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return Q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Kd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Kd,JSON.stringify(t.slice(0,ID)))}catch{}}clear(){try{this.store.removeItem(Kd)}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,PD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>TD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var kD=(e,t)=>Q(void 0,void 0,void 0,function*(){return e===_e.view?(yield OD(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),OD=e=>Q(void 0,void 0,void 0,function*(){let t=new Jd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Yd,_D=new Uint8Array(16);function ND(){if(!Yd&&(Yd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Yd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Yd(_D)}var DD=/^(?:[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 Zd(e){return typeof e=="string"&&DD.test(e)}var _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function nw(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}function qD(e){if(!Zd(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 MD(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var VD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",jD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function LD(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=MD(o)),typeof a=="string"&&(a=qD(a)),((f=a)===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(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return nw(m)}try{n.name=e}catch{}return n.DNS=VD,n.URL=jD,n}var UD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gb={randomUUID:UD};function Aa(e,t,r){if(Gb.randomUUID&&!t&&!e)return Gb.randomUUID();e=e||{};let n=e.random||(e.rng||ND)();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 nw(n)}function QD(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 wS(e,t){return e<<t|e>>>32-t}function BD(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.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),a=new Array(o);for(let i=0;i<o;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=a[i][h];for(let h=16;h<80;++h)p[h]=wS(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],v=r[3],C=r[4];for(let h=0;h<80;++h){let x=Math.floor(h/20),b=wS(f,5)+QD(x,m,g,v)+C+t[x]+p[h]>>>0;C=v,v=g,g=wS(m,30)>>>0,m=f,f=b}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+C>>>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 GD=LD("v5",80,BD),$b=GD,ow="2.30.56",Hb=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Xu={pageview:"pageview",event:"event"},ep=class{constructor({client:t,uuidGenerator:r=Aa}){this.client=t,this.uuidGenerator=r}},TS=class extends ep{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Hb(window.location),this.lastReferrer=Hi()?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:Hi()?document.title:"",encoding:Hi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Xu.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Xu.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Xu.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Xu.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 Hb(window.location)}},xo=class e{constructor(t,r){if(!Zd(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Zd(a)?new e(a,Number.parseInt(o)*1e3):null}};xo.cvo_cid="cvo_cid";xo.expirationTime=120;var PS=class extends ep{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return Q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(xo.cvo_cid,new xo(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};PS.Id="link";var yr=Object.keys;function Xd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var RS=128,aw=192,zb=224,Wb=240;function $D(e){return(e&248)===Wb?4:(e&Wb)===zb?3:(e&zb)===aw?2:1}function HD(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&RS)!=RS)break;if(r-=3,(n&aw)!=RS){t-r>=$D(n)*3&&(r=t);break}}return e.substring(0,r)}var kS={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"},zD=yr(kS).map(e=>kS[e]),WD=[...zD].join("|"),KD=new RegExp(`^(${WD}$)`),YD={svcAction:"svc_action",svcActionData:"svc_action_data"},XD=e=>yr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=kS[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),JD=e=>KD.test(e),ZD=[JD],Kb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Yb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},tp={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},eq=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],OS={id:"quoteId",affiliation:"quoteAffiliation"},_S={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},tq={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),tp),purchase:Object.assign(Object.assign({},Mt),tp),quickview:Mt,quote:Object.assign(Object.assign({},Mt),OS),review:Object.assign(Object.assign({},Mt),_S)},rq=yr(Kb).map(e=>Kb[e]),nq=yr(Yb).map(e=>Yb[e]),oq=yr(Mt).map(e=>Mt[e]),aq=yr(tp).map(e=>tp[e]),iq=yr(_S).map(e=>_S[e]),sq=yr(OS).map(e=>OS[e]),cq=[...rq,"custom"].join("|"),uq=[...nq,"custom"].join("|"),iw="(pr[0-9]+)",sw="(il[0-9]+pi[0-9]+)",lq=new RegExp(`^${iw}(${cq})$`),dq=new RegExp(`^(${sw}(${uq}))|(il[0-9]+nm)$`),pq=new RegExp(`^(${oq.join("|")})$`),fq=new RegExp(`^(${aq.join("|")})$`),mq=new RegExp(`^${iw}custom$`),gq=new RegExp(`^${sw}custom$`),hq=new RegExp(`^(${[...eq,...iq,...sq].join("|")})$`),yq=e=>lq.test(e),Sq=e=>dq.test(e),vq=e=>pq.test(e),Aq=e=>fq.test(e),xq=e=>hq.test(e),Cq=[Sq,yq,vq,Aq,xq],bq=[mq,gq],wq={anonymizeIp:"aip"},Rq={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Fq={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Eq=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Iq=Object.assign(Object.assign(Object.assign(Object.assign({},wq),Rq),Fq),Eq.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),NS=Object.assign(Object.assign({},Iq),YD),Tq=e=>{let t=!!e.action&&tq[e.action]||{};return yr(e).reduce((r,n)=>{let o=t[n]||NS[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Pq=yr(NS).map(e=>NS[e]),kq=e=>Pq.indexOf(e)!==-1,Oq=e=>e==="custom",_q=e=>[...Cq,...ZD,kq,Oq].some(t=>t(e)),Nq=e=>yr(e).reduce((t,r)=>{let n=Dq(r);return n?Object.assign(Object.assign({},t),qq(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Dq=e=>{let t;return[...bq].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},qq=(e,t)=>yr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),DS=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return Q(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return Q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[_e.click,_e.custom,_e.search,_e.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}},qS=class{sendEvent(t,r){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}},Xb=y.fetch,rp=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=zn(f,["url"]),v;try{v=yield Xb(m,g)}catch(C){console.error("An error has occured when sending the event.",C);return}if(v.ok){let C=yield v.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Xb(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[_e.click,_e.custom,_e.search,_e.view].indexOf(t)!==-1}getVisitorIdParam(){return Q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},MS=class{constructor(t,r){ES()&&rw()?this.storage=new IS:ES()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Wi),this.client=new rp(t),this.beaconClient=new DS(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},VS=class{constructor(t,r){this.storage=r||new Wi,this.client=new rp(t)}getClientDependingOnEventType(t){return this.client}},np=class{constructor(){this.storage=new Wi,this.client=new qS}getClientDependingOnEventType(t){return this.client}},Mq="xx",Vq=e=>e?.startsWith(Mq)||!1,jq=`
29
29
  We've detected you're using React Native but have not provided the corresponding runtime,
30
30
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
31
31
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
32
- `;function Lq(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Uq=["1",1,"yes",!0];function op(){let e=[];return FS()&&e.push(window.doNotTrack),jS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Uq.indexOf(t)!==-1)}var cw="v15",uw={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function Qq(e=uw.default,t=cw,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Bq="38824e1f-37f5-42d3-8372-a4b8fa9df946",Zr=class{get defaultOptions(){return{endpoint:uw.default,isCustomEndpoint:!1,token:"",version:cw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return ow}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[kD,FD].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};op()?this.runtime=new np:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(_e.view,{newEventType:_e.view,addClientIdParameter:!0}),this.addEventTypeMapping(_e.click,{newEventType:_e.click,addClientIdParameter:!0}),this.addEventTypeMapping(_e.custom,{newEventType:_e.custom,addClientIdParameter:!0}),this.addEventTypeMapping(_e.search,{newEventType:_e.search,addClientIdParameter:!0})}initRuntime(t){return FS()&&Hi()?new MS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Lq()&&console.warn(jq),new VS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return Q(this,void 0,void 0,function*(){try{return FS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return Q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return Q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return Q(this,void 0,void 0,function*(){if(Zd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId($b(t,$b(r,Bq)))}})}getParameters(t,...r){return Q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return Q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(op())return null;try{let r=new URL(t).searchParams.get(xo.cvo_cid);if(r==null)return null;let n=xo.fromString(r);return!n||!Hi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return Q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>Q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>Q(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>a?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((x,b)=>Q(this,void 0,void 0,function*(){let w=yield x;return yield b(t,w)}),h)].reduce((h,x)=>Q(this,void 0,void 0,function*(){let b=yield h;return yield x(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return Q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?Tq(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,C)=>Q(this,void 0,void 0,function*(){let h=yield v;return yield C(h)}),Promise.resolve(r))})}makeEvent(t,...r){return Q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>Q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return Q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return Q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new Jd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=zn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=zn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return Q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=zn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return Q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return Q(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return Q(this,void 0,void 0,function*(){return yield(yield S(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[_e.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(_q(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=zn(t,["custom"]),o={};r&&Xd(r)&&(o=this.lowercaseKeys(r));let a=Nq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=zn(t,["custom"]);if(r&&Xd(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=zn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==_e.view||r==_e.click||r==_e.search||r==_e.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==_e.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=zn(t,["userId"]);return Vq(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=zn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Xd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Xd(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?HD(t,r):t}get baseUrl(){return Qq(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Wn;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(Wn||(Wn={}));var $;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var Jb={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Wn.expandToFullUI]:"interface",[Wn.openUserActions]:"User Actions",[Wn.showPrecedingSessions]:"User Actions",[Wn.showFollowingSessions]:"User Actions",[Wn.clickViewedDocument]:"User Actions",[Wn.clickPageView]:"User Actions",[Wn.createArticle]:"createArticle"},Ki=class{constructor(){this.runtime=new np,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(_e.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(_e.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(_e.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(_e.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return ow}};function Gq(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function $q(e){return e.map(t=>t.replace(/;/g,""))}function lw(e){let r=e.join(";");return r.length<=256?r:lw(e.slice(1))}var Zb=e=>{let t=$q(e),r=Gq(t);return lw(r)};function ew(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Zb(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Zb(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var ap=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||op();this.coveoAnalyticsClient=n?new Ki:new Zr(t)}disable(){this.coveoAnalyticsClient=new Ki}enable(){this.coveoAnalyticsClient=new Zr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,ew(t))}logOmniboxAnalytics(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,ew(t))}logOmniboxFromLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return Q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return Q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=Jb[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=Jb[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return Q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return Q(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Zr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},ip=Object.assign({},Xu),tw=Object.keys(ip).map(e=>ip[e]),zi=class extends TS{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>tw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(tw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(ip.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(ip.event,{newEventType:_e.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return XD(this.ticket)}};zi.Id="svc";var sp;(function(e){e.click="click",e.flowStart="flowStart"})(sp||(sp={}));var hr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(hr||(hr={}));var cp;(function(e){e.quit="Quit",e.solved="Solved"})(cp||(cp={}));var up=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!op();this.coveoAnalyticsClient=o?new Zr(t):new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Zr(this.options),this.svc=new zi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(hr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(hr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(hr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(hr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(hr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(hr.caseCancelled,{reason:cp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(hr.caseSolved,{reason:cp.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(hr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",sp.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",sp.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Zr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var Co=()=>"default";var Hq=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},xa=class{constructor(t){de(this,"getState",t);de(this,"state");this.state=t()}getLanguage(){return Hq(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Ao),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Co()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var dw=e=>new Zr(e).getCurrentVisitorId(),el=(e,t)=>typeof t=="function"?(...r)=>{let n=Fu(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,tl=(e,t)=>(...r)=>{let n=Fu(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var rl=class extends xa{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},pw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new rl(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new up({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:el(e,n),beforeSendHooks:[tl(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:i},"Analytics request"),C)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Yi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function zq(e,t){return!!t&&t.facetId in e.facetSet}var Lr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),lp=(e,t)=>e.facetSet[t]?.request,Xi=(e,t)=>{let r=Lr(e,t);return zq(e,r)?r:void 0},fw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state==="selected")||[],mw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state!=="idle")||[],en=e=>e.search.isLoading;d();c();l();u();function gw(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function sr(e){let{activeValue:t,ancestryMap:r}=Wq(e);return t?Kq(t,r):[]}function Wq(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function Kq(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function Yq(e,t){return!!t&&t.facetId in e.categoryFacetSet}var QS=(e,t)=>{let r=Lr(e,t);if(Yq(e,r))return r},BS=(e,t)=>e.categoryFacetSet[t]?.request,hw=(e,t)=>{let r=QS(e,t);return sr(r?.values??[])},GS=(e,t)=>{let r=BS(e,t);return sr(r?.currentValues??[])};d();c();l();u();function Ji(){return{}}d();c();l();u();function yw(e,t){return{request:e,tabs:t}}function Zi(){return{}}d();c();l();u();function Sw(e,t){return{request:e,tabs:t}}function es(){return{}}d();c();l();u();function vw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function ts(){return{}}var rs=(e,t)=>{let r=bw(t,e),n=r?r.field:"",o=HS(n,e);return{facetId:e,facetField:n,facetTitle:o}};function ns(e,t){let{facetId:r,facetValue:n}=e,o=rs(r,t),a=ww(t,r);return{...o,facetValue:a==="hierarchical"?Cw(t,r):n}}function cr(e){return{facetSet:e.facetSet??ts(),categoryFacetSet:e.categoryFacetSet??Ji(),dateFacetSet:e.dateFacetSet??Zi(),numericFacetSet:e.numericFacetSet??es(),automaticFacetSet:e.automaticFacetSet??Yi()}}var $S=e=>{let t=[];return Zq(e).forEach((r,n)=>{let o=ww(e,r.facetId),a=oM(r,n+1);if(Jq(r)){if(!!!GS(e,r.facetId).length)return;t.push({...a,...rM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Aw(i,p+1,o),m=Xq(r)?xw(i):tM(i);t.push({...a,...f,...m})})}),eM(e).forEach((r,n)=>{let o=nM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Aw(a,i+1,"specific"),f=xw(a);t.push({...o,...p,...f})})}),t},Xq=e=>e.type==="specific",Jq=e=>e.type==="hierarchical",Zq=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),eM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Aw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),tM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),xw=e=>({displayValue:e.value,value:e.value}),Cw=(e,t)=>GS(e,t).map(n=>n.value).join(";"),rM=(e,t)=>{let n=Cw(e,t);return{value:n,valuePosition:1,displayValue:n}},nM=(e,t)=>({title:HS(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),oM=(e,t)=>({title:HS(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),HS=(e,t)=>`${e}_${t}`,bw=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,ww=(e,t)=>{let r=bw(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var zS=e=>e.configuration.search.locale,Rw=e=>e.configuration.search.timezone,dp=e=>e.configuration.accessToken,pp=e=>e.configuration.organizationId,fp=e=>e.configuration.environment,mp=e=>e.configuration?.knowledge?.agentId,Fw=e=>e.configuration.knowledge.debugAgentSession;var We=e=>{if(aM(e)||WS(e))return e.generatedAnswer?.answerId;if(iM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},aM=e=>"answer"in e&&"generatedAnswer"in e&&!fe(e.generatedAnswer?.answerConfigurationId),WS=e=>{let t=mp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},iM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",KS=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Ca=e=>e.followUpAnswers?.conversationId,sM=e=>e.generatedAnswer?.citations,cM=e=>e.followUpAnswers?.followUpAnswers,uM=et(cM,e=>e?.flatMap(t=>t.citations)),lM=(e,t)=>t,nl=et(sM,uM,lM,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var ol=(r=>(r.Ascending="ascending",r.Descending="descending",r))(ol||{}),ba=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(ba||{}),tn=e=>{if(Ni(e))return e.map(t=>tn(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},os=()=>({by:"relevancy"}),gp=e=>({by:"date",order:e}),hp=(e,t)=>({by:"field",order:t,field:e}),yp=()=>({by:"qre"}),Sp=()=>({by:"nosort"}),Ew=new J({values:{by:new Ru({enum:ba,required:!0}),order:new Ru({enum:ol}),field:new U}});function Sr(){return tn(os())}d();c();l();u();d();c();l();u();d();c();l();u();var as=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?YS(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],YS(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function YS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}d();c();l();u();function dM(){return typeof navigator<"u"}function Iw(){try{return typeof localStorage<"u"}catch{return!1}}function Tw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Pw(){return!!(dM()&&navigator.cookieEnabled)}var kw=null;function Ow(){return kw||(Iw()?localStorage:Pw()?new XS:Tw()?sessionStorage:new JS)}var is=class is{getItem(t){return as.get(`${is.prefix}${t}`)}removeItem(t){as.erase(`${is.prefix}${t}`)}setItem(t,r,n){as.set(`${is.prefix}${t}`,r,n)}};de(is,"prefix","coveo_");var XS=is;var JS=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var vp="__coveo.analytics.history",pM=20,fM=1e3*60,mM=75,wa=class wa{constructor(t){de(this,"store");this.store=t||Ow()}static getInstance(t){return wa.instance||(wa.instance=new wa(t)),wa.instance}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){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(vp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(vp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(vp,JSON.stringify(t.slice(0,pM)))}catch{}}clear(){try{this.store.removeItem(vp)}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,mM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>fM:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};de(wa,"instance",null);var ZS=wa,Xt=ZS;var al=class al extends xa{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return $S(cr(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||al.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||ar().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||al.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=We(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Sr()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||dt().q}get responseTime(){return this.state.search?.duration||ar().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ar().response.totalCountFiltered}};de(al,"fallbackPipelineName","default");var bo=al,_w=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new ap({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:el(e,n),beforeSendHooks:[tl(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:i},"Analytics request"),C)]},o);return m||g.disable(),g},ev=()=>{let t=Xt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ap(e){let t=Nw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return rC([e,...t,...r],o=>o.uniqueId)}function Nw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Nw(t)]):[]}d();c();l();u();var Kn=()=>"";function qw(e,t){return{...new bo(t).getBaseMetadata(),actionCause:e,type:e}}function gM(e){return Object.assign(e,{instantlyCallable:!0})}function hM(e,t){let r=a=>{let i=xe(e,a);return gM(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(v,{getState:C,extra:h}){return yield g({state:C(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var Mw=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return vM(a)}return n},yM=e=>e.configuration.analytics.analyticsMode==="legacy",SM=e=>e.configuration.analytics.analyticsMode==="next",vM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),hM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let v=[],C={log:function(){var _ref14=_asyncToGenerator(function*({state:R}){for(let E of v)yield E(R)});return function log(_x25){return _ref14.apply(this,arguments)}}()},h=p(),x=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(x,p());C.description=b?.description,v.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(R){yM(R)&&(yield AM(b,r,R,g,x.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=Yu(h);return v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(R){if(SM(R)&&o&&n){let E=n(R);yield TM(w,o,E)}});return function(_x27){return _ref16.apply(this,arguments)}}()),C});return function(_x24){return _ref13.apply(this,arguments)}}()));function AM(_x28,_x29,_x30,_x31,_x32){return _AM.apply(this,arguments)}function _AM(){_AM=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _AM.apply(this,arguments)}var xM=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),X=Mw(e=>_w({...e,provider:e.provider||new bo(e.getState)}),e=>e,bo),m5=Mw(pw,xM("caseAssist"),rl);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Uw(e,o),n<0&&(n=IM(e,o)),n<0&&(n=0),bM(e,r(n),t)};var Vw=(e,t)=>({sourceName:CM(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Kn()});function CM(e){let t=e.source;return fe(t)?"unknown":t}var jw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function bM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:FM(e),...(Dw(e)?{documentCategory:Dw(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:EM(e),queryPipeline:r.pipeline||Kn()}}function Dw(e){return e.raw?.objecttype||void 0}var Ke=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),Lw={urihash:new U,sourcetype:new U,permanentid:new U},xp={uniqueId:W,raw:new J({values:Lw}),title:W,uri:W,clickUri:W,rankingModifier:new U({required:!1,emptyAllowed:!0})};function wM(e){return Object.assign({},...Object.keys(Lw).map(t=>({[t]:e[t]})))}function RM(e){return Object.assign({},...Object.keys(xp).map(t=>({[t]:e[t]})),{raw:wM(e.raw)})}function FM(e){let t=e.raw.author;return fe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function EM(e){let t=e.raw.source;return fe(t)?"unknown":t}var Jt=e=>new Se(xp).validate(RM(e));function IM(e,t){for(let[r,n]of t.entries()){let o=Ap(n);if(Uw(e,o)!==-1)return r}return-1}function Uw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function TM(_x34,_x35,_x36){return _TM.apply(this,arguments)}function _TM(){_TM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _TM.apply(this,arguments)}d();c();l();u();var tv=e=>O(e,{evt:W,type:st}),Qw=e=>X("analytics/generic/search",t=>{tv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),Bw=e=>X("analytics/generic/click",(t,r)=>(Jt(e.result),tv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),Gw=e=>X("analytics/generic/custom",t=>(tv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Cp=()=>X("analytics/interface/load",e=>e.makeInterfaceLoad()),wo=()=>X("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),bp=()=>X("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),wp=e=>X("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),$w=()=>({actionCause:"interfaceLoad"}),ss=()=>({actionCause:"interfaceChange"}),Hw=()=>({actionCause:"searchFromLink"}),zw=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var rv=()=>st,Ww=()=>W,rn=P("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new U({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),vr=P("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new U({required:!1,url:!0}),pipeline:new U({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:W})})),PM={enabled:new pe({default:!0}),originContext:rv(),originLevel2:rv(),originLevel3:rv(),proxyBaseUrl:new U({required:!1,url:!0}),runtimeEnvironment:new Qe,anonymous:new pe({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:NC,analyticsMode:new U({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:Qb.reduce((e,t)=>(e[t]=_C,e),{})})},Ro=P("configuration/updateAnalyticsConfiguration",e=>O(e,PM)),cs=P("configuration/analytics/disable"),us=P("configuration/analytics/enable"),Rp=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Ww()})),Fp=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Ww()})),Ep=P("knowledge/setAgentId",e=>O(e,new U({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Ip={q:new U,enableQuerySyntax:new pe,aq:new U,cq:new U,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new U,f:new J,fExcluded:new J,cf:new J,nf:new J,mnf:new J,df:new J,debug:new pe,sf:new J,tab:new U,af:new J};var Me=P("searchParameters/restore",e=>O(e,Ip)),ls=P("searchParameters/restoreTab",e=>O(e,W));d();c();l();u();var Fo=P("debug/enable"),ds=P("debug/disable");d();c();l();u();var Eo=()=>!1;var ps=ae(Eo(),e=>{e.addCase(Fo,()=>!0).addCase(ds,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var nv=P("history/undo"),ov=P("history/redo"),ur=P("history/snapshot"),il=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(nv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Tp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(ov()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=xe("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var fs=P("pipeline/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var ms=ae(Kn(),e=>{e.addCase(fs,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(vr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=P("breadcrumb/deselectAll"),gs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var nn=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new pe({required:!0})}));d();c();l();u();d();c();l();u();var sl=class extends bo{constructor(r){super(r);de(this,"getState",r)}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??ar().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ar().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Kw=e=>X({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Jt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new sl(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),Yw=()=>X("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new sl(e)),Xw=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var av={id:W},kM={...av,q:Be},hs=P("instantResults/register",e=>O(e,av)),on=P("instantResults/updateQuery",e=>O(e,kM)),ys=P("instantResults/clearExpired",e=>O(e,av));d();c();l();u();var Pp=new re({required:!0,min:0}),Ss=P("pagination/registerNumberOfResults",e=>O(e,Pp)),vs=P("pagination/updateNumberOfResults",e=>O(e,Pp)),As=P("pagination/registerPage",e=>O(e,Pp)),an=P("pagination/updatePage",e=>O(e,Pp)),xs=P("pagination/nextPage"),Cs=P("pagination/previousPage");d();c();l();u();var Vt=P("query/updateQuery",e=>O(e,{q:new U,enableQuerySyntax:new pe}));d();c();l();u();d();c();l();u();var Ur=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:$i(e)}});var bs=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Ur(e.configuration.analytics,t,r)),...(e.excerptLength&&!fe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var ws=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield dw(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(ev()&&{pageId:ev()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:$i(e)})}}});return function ws(_x43,_x44){return _ref21.apply(this,arguments)}}();var Io=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield ws(e.configuration.analytics,t))),...(e.excerptLength&&!fe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Io(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Qr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var iv=()=>X("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),To=e=>X("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Qr().aq,cq:r.advancedSearchQueries?.cq||Qr().cq,dq:r.advancedSearchQueries?.dq||Qr().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var ul=Vr(kp(),1),rR=Vr(Jw(),1);d();c();l();u();var Op=Vr(kp(),1),eR=Vr(Zw(),1);Op.default.extend(eR.default);var Rs="YYYY/MM/DD@HH:mm:ss",OM="1401-01-01";function Ra(e,t){let r=(0,Op.default)(e,t);return!r.isValid()&&!t?(0,Op.default)(e,Rs):r}function cl(e){return e.format(Rs)}function tR(e){return cl(Ra(e))===e}function _p(e,t){let r=Ra(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}`)}fv(r)}function fv(e){if(e.isBefore(OM))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}ul.default.extend(rR.default);var nR=["past","now","next"],oR=["minute","hour","day","week","month","quarter","year"],_M=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new U({required:!t,constrainTo:oR}),period:new U({required:!0,constrainTo:nR})}};function Po(e){if(typeof e=="string"&&!sn(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?mv(e):e;new Se(_M(t.period)).validate(t);let r=iR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);fv(r)}function aR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function iR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,ul.default)().subtract(r,n);case"next":return(0,ul.default)().add(r,n);case"now":return(0,ul.default)()}}function ll(e){return cl(iR(mv(e)))}function sR(e){return e.toLocaleLowerCase().split("-")}function sn(e){let[t,r,n]=sR(e);if(t==="now")return!0;if(!nR.includes(t)||!oR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function cR(e){return!!e&&typeof e=="object"&&"period"in e}function mv(e){let[t,r,n]=sR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function uR(e){return Po(e),mv(e)}d();c();l();u();function lR(e){return e.type==="dateRange"}function dR(e){return`start${e}`}function pR(e){return`end${e}`}var gv=()=>({dateFacetValueMap:{}});function NM(e,t,r){let n=e.start,o=e.end;return sn(n)&&(n=ll(n),r.dateFacetValueMap[t][dR(n)]=e.start),sn(o)&&(o=ll(o),r.dateFacetValueMap[t][pR(o)]=e.end),{...e,start:n,end:o}}function hv(e,t){if(lR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>NM(o,r,t))}}return e}function ko(e){let t=gv();return{request:{...e,facets:e.facets?.map(n=>hv(n,t))},mappings:t}}function DM(e,t,r){return{...e,start:r.dateFacetValueMap[t][dR(e.start)]||e.start,end:r.dateFacetValueMap[t][pR(e.end)]||e.end}}function qM(e,t){return e.facetId in t.dateFacetValueMap}function MM(e,t){return qM(e,t)?{...e,values:e.values.map(r=>DM(r,e.facetId,t))}:e}function Np(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>MM(n,t))}}:e}d();c();l();u();d();c();l();u();var Fs=P("didYouMean/enable"),Dp=P("didYouMean/disable"),Es=P("didYouMean/automaticCorrections/disable"),qp=P("didYouMean/automaticCorrections/enable"),Ar=P("didYouMean/correction",e=>O(e,W)),Fa=P("didYouMean/automaticCorrections/mode",e=>O(e,new U({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Mp=()=>X("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),yv=()=>X("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),fR=()=>({actionCause:"didYouMeanClick"}),mR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Vp(){return{contextValues:{}}}d();c();l();u();function jp(){return{contextValues:{}}}d();c();l();u();function Sv(){return{enabled:!0,tabs:{}}}function Lp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Up(){return[]}d();c();l();u();function xr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Qp(){return{}}d();c();l();u();function Bp(){return{}}d();c();l();u();function Gp(){return{}}function gR(){return Br({})}function Br(e){return{context:e.context||Vp(),dictionaryFieldContext:e.dictionaryFieldContext||jp(),facetSet:e.facetSet||ts(),numericFacetSet:e.numericFacetSet||es(),dateFacetSet:e.dateFacetSet||Zi(),categoryFacetSet:e.categoryFacetSet||Ji(),automaticFacetSet:e.automaticFacetSet??Yi(),pagination:e.pagination||xr(),query:e.query||dt(),tabSet:e.tabSet||Gp(),advancedSearchQueries:e.advancedSearchQueries||Qr(),staticFilterSet:e.staticFilterSet||Bp(),querySet:e.querySet||Qp(),sortCriteria:e.sortCriteria||Sr(),pipeline:e.pipeline||Kn(),searchHub:e.searchHub||Co(),facetOptions:e.facetOptions||Lp(),facetOrder:e.facetOrder??Up(),debug:e.debug??Eo()}}d();c();l();u();var VM=new J({values:{undoneQuery:Be},options:{required:!0}}),$p=()=>X("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Hp=e=>X("analytics/trigger/query/undo",t=>(O(e,VM),t.makeUndoTriggerQuery(e))),zp=()=>X("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Wp=()=>X("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),Kp=()=>X("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var Oo=P("trigger/query/ignore",e=>O(e,new U({emptyAllowed:!0,required:!0}))),Is=P("trigger/query/modification",e=>O(e,new J({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function _o(e){return Object.values(e).map(t=>t.request)}function dl(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function hR(e){return _o(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var vv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function jM(e){return _o(e).map(t=>{let r=vv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function LM(e){return[...jM(e.facetSet??{}),...hR(e.numericFacetSet??{}),...hR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function UM(e){return LM(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Yp(e){return dl(UM(e),e.facetOrder??[])}d();c();l();u();var No=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=GM(e),n=Yp(e),o=QM(e),a=yield Io(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return ko({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function No(_x47,_x48){return _ref23.apply(this,arguments)}}();function QM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(BM).filter(r=>r.currentValues.length>0):void 0}function BM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function GM(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=$M(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function $M(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Do=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Np(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(To(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!fe(f)&&!fe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(ur(Br(_this12.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this13.dispatch(To(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(ur(Br(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:yv()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:yv()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Oo("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this14.dispatch(To(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(ur(Br(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:$p()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ar(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(ur(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return bd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield No(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Ar(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Is({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield No(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var yR=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Xp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),SR=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield xv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),vR=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Cv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),AR=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield KM(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),xR=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Av(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),HM=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function HM(_x61,_x62){return _ref29.apply(this,arguments)}}(),zM=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield Io(e);return ko({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function zM(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),WM=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request.numberOfResults=0,r});return function WM(_x66,_x67){return _ref31.apply(this,arguments)}}(),CR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Av(_x68,_x69){return _Av.apply(this,arguments)}function _Av(){_Av=_asyncToGenerator(function*(e,t){O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new Do({...t,analyticsAction:Yw()},m=>{t.dispatch(on({q:m,id:e.id}))}),i=yield zM(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Av.apply(this,arguments)}function xv(_x70,_x71,_x72){return _xv.apply(this,arguments)}function _xv(){_xv=_asyncToGenerator(function*(e,t,r){CR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new Do({...t,analyticsAction:r}),f=yield No(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _xv.apply(this,arguments)}function Cv(_x73,_x74){return _Cv.apply(this,arguments)}function _Cv(){_Cv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield iv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new Do({...e,analyticsAction:iv()}),p=yield HM(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _Cv.apply(this,arguments)}function KM(_x75,_x76,_x77){return _KM.apply(this,arguments)}function _KM(){_KM=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new Do({...e,analyticsAction:t}),f=yield WM(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _KM.apply(this,arguments)}function Xp(_x78,_x79,_x80){return _Xp.apply(this,arguments)}function _Xp(){_Xp=_asyncToGenerator(function*(e,t,r){CR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield No(e,i),f=new Do({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Xp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var bR=et(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Cr=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=wv(e),o=YM(e),a=XM(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Io(e,r):bs(e,t,r);return ko({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:bv(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Cr(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function bv(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function YM(e){return dl(ZM(e),e.facetOrder??[])}function XM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(JM).filter(r=>r.currentValues.length>0):void 0}function JM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function ZM(e){return eV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function eV(e){return[...tV(e.facetSet??{}),...wR(e.numericFacetSet??{}),...wR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function tV(e){return _o(e).map(t=>{let r=vv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function wR(e){return _o(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function wv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=bR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var qo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Np(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(To(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!fe(f)&&!fe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(ur(Br(_this19.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this20.dispatch(To(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(ur(Br(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Oo("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this21.dispatch(To(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(ur(Br(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(ur(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return bd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=mR(),o=yield _this22.fetchFromAPI(yield Cr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Ar(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Is({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Cr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ts=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new U,enableQuerySyntax:new pe,clearFilters:new pe}),e.clearFilters&&(r(ft()),r(gs())),r(nn({allow:!0})),r(Vt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(an(1))}),RR=P("search/updateSearchAction"),z=xe("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Xp(r,t,e.legacy);FR(r);let n=e.next?ER(e.next):void 0,o=yield Cr(r,t.extra.navigatorContext,n),a=new qo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),jt=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(FR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return xv(r,t,e.legacy);let n=new qo({...t,analyticsAction:e.next}),o=yield Cr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),br=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Cv(t,r);let n=qw("browseResults",t.getState),o=new qo({...t,analyticsAction:n}),a=yield rV(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),wr=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Xp(r,t,e.legacy);let n=new qo({...t,analyticsAction:{}}),o=yield oV(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),Ps=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Av(e,t);O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=ER(Xw()),i=yield nV(r,t.extra.navigatorContext,n,o,a),p=new qo({...t,analyticsAction:a},g=>{t.dispatch(on({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),rV=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function rV(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),nV=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=bs(e,t,o);return ko({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function nV(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),oV=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request.numberOfResults=0,n});return function oV(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),FR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},ER=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Mo=(e,t)=>{let r=e;return fe(r[t])?fe(e.raw[t])?null:e.raw[t]:r[t]},aV=e=>t=>e.every(r=>!fe(Mo(t,r))),iV=e=>t=>e.every(r=>fe(Mo(t,r))),sV=(e,t)=>r=>{let n=IR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},cV=(e,t)=>r=>{let n=IR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},IR=(e,t)=>{let r=Mo(t,e);return pd(r)?r:[r]},TR={getResultProperty:Mo,fieldsMustBeDefined:aV,fieldsMustNotBeDefined:iV,fieldMustMatch:sV,fieldMustNotMatch:cV};function pl(e){return e.search.response.searchUid!==""}function PR(e,t,r){return e.search.results.find(n=>Mo(n,t)===r)}var Rv=et(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var ks=P("app/setError");function Fv(e,t){let r=t.payload??null;r&&(e.response=ar().response,e.results=[],e.questionAnswer=Mi()),e.error=r,e.isLoading=!1}function Ev(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function uV(e,t){Ev(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function kR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function lV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ar(),e=>{e.addCase(z.rejected,(t,r)=>Fv(t,r)),e.addCase(br.rejected,(t,r)=>Fv(t,r)),e.addCase(jt.rejected,(t,r)=>Fv(t,r)),e.addCase(z.fulfilled,(t,r)=>{uV(t,r)}),e.addCase(br.fulfilled,(t,r)=>{Ev(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(jt.fulfilled,(t,r)=>{Ev(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(wr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(z.pending,kR),e.addCase(br.pending,lV),e.addCase(jt.pending,kR),e.addCase(RR,(t,r)=>{t.searchAction=r.payload}),e.addCase(ks,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var Os=P("searchHub/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var _s=ae(Co(),e=>{e.addCase(Os,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(vr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var OR=class extends Error{constructor(t){super(t[0].message);de(this,"issues");this.name="SchemaError",this.issues=t}};var Xn="uninitialized",Tv="pending",ml="fulfilled",gl="rejected";function _R(e){return{status:e,isUninitialized:e===Xn,isLoading:e===Tv,isSuccess:e===ml,isError:e===gl}}var NR=Xr;function WR(e,t){if(e===t||!(NR(e)&&NR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=WR(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function Pv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function dV(e){return new RegExp("(^|:)//").test(e)}function pV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Nv(e){return e!=null}function DR(e){return[...(e?.values()??[])].filter(Nv)}function fV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var mV=e=>e.replace(/\/$/,""),gV=e=>e.replace(/^\//,"");function hV(e,t){if(!e)return t;if(!t)return e;if(dV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=mV(e),t=gV(t),`${e}${r}${t}`}function ef(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var kv=()=>new Map,yV=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},SV=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},qR=(...e)=>S(...e),vV=e=>e.status>=200&&e.status<=299,AV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function MR(e){if(!Xr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var xV=e=>typeof e=="object"&&(Xr(e)||Array.isArray(e)||typeof e.toJSON=="function");function KR({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=qR,paramsSerializer:n,isJsonContentType:o=AV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===qR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(C,h,x){let{getState:b,extra:w,endpoint:R,forced:E,type:I}=h,k,{url:T,headers:D=new A(g.headers),params:G=void 0,responseHandler:L=f??"json",validateStatus:V=m??vV,timeout:B=p,...j}=typeof C=="string"?{url:C}:C,_={...g,signal:B?SV(h.signal,yV(B)):h.signal,...j};D=new A(MR(D)),_.headers=(yield t(D,{getState:b,arg:C,extra:w,endpoint:R,forced:E,type:I,extraOptions:x}))||D;let N=xV(_.body);if(_.body!=null&&!N&&typeof _.body!="string"&&_.headers.delete("content-type"),!_.headers.has("content-type")&&N&&_.headers.set("content-type",a),N&&o(_.headers)&&(_.body=JSON.stringify(_.body,i)),_.headers.has("accept")||(L==="json"?_.headers.set("accept","application/json"):L==="text"&&_.headers.set("accept","text/plain, text/html, */*")),G){let ue=~T.indexOf("?")?"&":"?",ye=n?n(G):new URLSearchParams(MR(G));T+=ue+ye}T=hV(e,T);let q=new Request(T,_);k={request:new Request(T,_)};let H;try{H=yield r(q)}catch(ue){return{error:{status:(ue instanceof Error||typeof DOMException<"u"&&ue instanceof DOMException)&&ue.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:k}}let ne=H.clone();k.response=ne;let te,Z="";try{let ue;if(yield Promise.all([v(H,L).then(ye=>te=ye,ye=>ue=ye),ne.text().then(ye=>Z=ye,()=>{})]),ue)throw ue}catch(ue){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(ue)},meta:k}}return V(H,te)?{data:te,meta:k}:{error:{status:H.status,data:te},meta:k}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function v(_x110,_x111){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(C,h){if(typeof h=="function")return h(C);if(h==="content-type"&&(h=o(C.headers)?"json":"text"),h==="json"){let x=yield C.text();return x.length?JSON.parse(x):null}return C.text()});return _v2.apply(this,arguments)}}var Ns=class{constructor(e,t=void 0){de(this,"value");de(this,"meta");this.value=e,this.meta=t}};function CV(){return _CV.apply(this,arguments)}function _CV(){_CV=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _CV.apply(this,arguments)}function YR(e,t){throw Object.assign(new Ns({error:e,meta:t}),{throwImmediately:!0})}function Iv(e){e.aborted&&YR({status:"CUSTOM_ERROR",error:"Aborted"})}var VR={},bV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||VR).maxRetries,(o||VR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:CV,retryCondition:(g,v,{attempt:C})=>C<=i,...t,...o},m=0;for(;;){Iv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Ns(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Ns)return g.value;throw g}if(g instanceof Ns){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Iv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(v){throw Iv(n.signal),v}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),XR=Object.assign(bV,{fail:YR}),rf="__rtkq/",wV="online",RV="offline";var JR="focused";var Dv=P(`${rf}${JR}`),ZR=P(`${rf}un${JR}`),qv=P(`${rf}${wV}`),eF=P(`${rf}${RV}`);var Sl="query",tF="mutation",rF="infinitequery";function nf(e){return e.type===Sl}function FV(e){return e.type===tF}function of(e){return e.type===rF}function tf(e){return nf(e)||of(e)}function Mv(e,t,r,n,o,a){let i=EV(e)?e(t,r,n,o):e;return i?Pv(i,Nv,p=>a(nF(p))):[]}function EV(e){return typeof e=="function"}function nF(e){return typeof e=="string"?{type:e}:e}function IV(e,t){return e.catch(t)}var Ds=(e,t)=>e.endpointDefinitions[t],hl=Symbol("forceQueryFn"),Ov=e=>typeof e[hl]=="function";function TV({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:E,buildInitiateInfiniteQuery:I,buildInitiateMutation:k,getRunningQueryThunk:C,getRunningMutationThunk:h,getRunningQueriesThunk:x,getRunningMutationsThunk:b};function C(T,D){return G=>{let L=Ds(a,T),V=e({queryArgs:D,endpointDefinition:L,endpointName:T});return p(G)?.get(V)}}function h(T,D){return G=>f(G)?.get(D)}function x(){return T=>DR(p(T))}function b(){return T=>DR(f(T))}function w(T){}function R(T,D){let G=(L,{subscribe:V=!0,forceRefetch:B,subscriptionOptions:j,[hl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:L,endpointDefinition:D,endpointName:T}),ne,te={...N,type:Sl,subscribe:V,forceRefetch:B,subscriptionOptions:j,endpointName:T,originalArgs:L,queryCacheKey:H,[hl]:_};if(nf(D))ne=t(te);else{let{direction:Re,initialPageParam:Pe,refetchCachedPages:Ie}=N;ne=r({...te,direction:Re,initialPageParam:Pe,refetchCachedPages:Ie})}let Z=o.endpoints[T].select(L),ue=q(ne),ye=Z(Y());let{requestId:Ve,abort:Xe}=ue,Ue=ye.requestId!==Ve,He=p(q)?.get(H),ze=()=>Z(Y()),Ee=Object.assign(_?ue.then(ze):Ue&&!He?Promise.resolve(ye):Promise.all([He,ue]).then(ze),{arg:L,requestId:Ve,subscriptionOptions:j,queryCacheKey:H,abort:Xe,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(G(L,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){V&&q(m({queryCacheKey:H,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,q(v({endpointName:T,requestId:Ve,queryCacheKey:H,options:Re}))}});if(!He&&!Ue&&!_){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return G}function E(T,D){return R(T,D)}function I(T,D){return R(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:L}={})=>(V,B)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:L}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=IV(_.unwrap().then(ue=>({data:ue})),ue=>({error:ue})),ne=()=>{V(g({requestId:N,fixedCacheKey:L}))},te=Object.assign(H,{arg:_.arg,requestId:N,abort:q,unwrap:Y,reset:ne}),Z=f(V);return Z.set(N,te),te.then(()=>{Z.delete(N)}),L&&(Z.set(L,te),te.then(()=>{Z.get(L)===te&&Z.delete(L)})),te}}}var oF=class extends OR{constructor(t,r,n,o){super(t);de(this,"value");de(this,"schemaName");de(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Ia=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ta(_x115,_x116,_x117,_x118){return _Ta.apply(this,arguments)}function _Ta(){_Ta=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new oF(o.issues,t,r,n);return o.value});return _Ta.apply(this,arguments)}function jR(e){return e}var fl=(e={})=>({...e,[Hu]:!0});function PV({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(j,_,N,q)=>(Y,H)=>{let ne=r[j],te=n({queryArgs:_,endpointDefinition:ne,endpointName:j});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:N})),!q)return;let Z=o.endpoints[j].select(_)(H()),ue=Mv(ne.providesTags,Z.data,void 0,_,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:ue}]))};function v(j,_,N=0){let q=[_,...j];return N&&q.length>N?q.slice(0,-1):q}function C(j,_,N=0){let q=[...j,_];return N&&q.length>N?q.slice(1):q}let h=(j,_,N,q=!0)=>(Y,H)=>{let te=o.endpoints[j].select(_)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(j,_,Z.inversePatches,q))};if(te.status===Xn)return Z;let ue;if("data"in te)if(Kt(te.data)){let[ye,Ve,Xe]=uS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Xe),ue=ye}else ue=N(te.data),Z.patches.push({op:"replace",path:[],value:ue}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(j,_,Z.patches,q)),Z},x=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[hl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:jR,w=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(j,{signal:_,abort:N,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[j.endpointName],{metaSchema:ue,skipSchemaValidation:ye=m}=Z,Ve=j.type===Sl;try{let Xe=jR,Ue={signal:_,abort:N,dispatch:H,getState:ne,extra:te,endpoint:j.endpointName,type:j.type,forced:Ve?R(j,ne()):void 0,queryCacheKey:Ve?j.queryCacheKey:void 0},He=Ve?j[hl]:void 0,ze,Ee=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(Pe,Ie,ut,yt){if(Ie==null&&Pe.pages.length)return Promise.resolve({data:Pe});let qr={queryArg:j.originalArgs,pageParam:Ie},or=yield Re(qr),Yr=yt?v:C;return{data:{pages:Yr(Pe.pages,or.data,ut),pageParams:Yr(Pe.pageParams,Ie,ut)},meta:or.meta}});return function Ee(_x121,_x122,_x123,_x124){return _ref44.apply(this,arguments)}}();function Re(_x125){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(Pe){let Ie,{extraOptions:ut,argSchema:yt,rawResponseSchema:qr,responseSchema:or}=Z;if(yt&&!Ia(ye,"arg")&&(Pe=yield Ta(yt,Pe,"argSchema",{})),He?Ie=He():Z.query?(Xe=b(Z,"transformResponse"),Ie=yield t(Z.query(Pe),Ue,ut)):Ie=yield Z.queryFn(Pe,Ue,ut,Mr=>t(Mr,Ue,ut)),typeof process<"u",Ie.error)throw new Ns(Ie.error,Ie.meta);let{data:Yr}=Ie;qr&&!Ia(ye,"rawResponse")&&(Yr=yield Ta(qr,Ie.data,"rawResponseSchema",Ie.meta));let fr=yield Xe(Yr,Ie.meta,Pe);return or&&!Ia(ye,"response")&&(fr=yield Ta(or,fr,"responseSchema",Ie.meta)),{...Ie,data:fr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:Pe}=Z,{maxPages:Ie=1/0}=Pe,ut=j.refetchCachedPages??Pe.refetchCachedPages??!0,yt,qr={pages:[],pageParams:[]},or=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,fr=R(j,ne())&&!j.direction||!or?qr:or;if("direction"in j&&j.direction&&fr.pages.length){let Mr=j.direction==="backward",id=(Mr?aF:_v)(Pe,fr,j.originalArgs);yt=yield Ee(fr,id,Ie,Mr)}else{let{initialPageParam:Mr=Pe.initialPageParam}=j,Su=or?.pageParams??[],id=Su[0]??Mr,v_=Su.length;if(yt=yield Ee(fr,id,Ie),He&&(yt={data:yt.data.pages[0]}),ut)for(let Vx=1;Vx<v_;Vx++){let A_=_v(Pe,yt.data,j.originalArgs);yt=yield Ee(yt.data,A_,Ie)}}ze=yt}else ze=yield Re(j.originalArgs);return ue&&!Ia(ye,"meta")&&ze.meta&&(ze.meta=yield Ta(ue,ze.meta,"metaSchema",ze.meta)),Y(ze.data,fl({fulfilledTimeStamp:Date.now(),baseQueryMeta:ze.meta}))}catch(Xe){let Ue=Xe;if(Ue instanceof Ns){let He=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:ze,errorResponseSchema:Ee}=Z,{value:Re,meta:Pe}=Ue;try{ze&&!Ia(ye,"rawErrorResponse")&&(Re=yield Ta(ze,Re,"rawErrorResponseSchema",Pe)),ue&&!Ia(ye,"meta")&&(Pe=yield Ta(ue,Pe,"metaSchema",Pe));let Ie=yield He(Re,Pe,j.originalArgs);return Ee&&!Ia(ye,"errorResponse")&&(Ie=yield Ta(Ee,Ie,"errorResponseSchema",Pe)),q(Ie,fl({baseQueryMeta:Pe}))}catch(Ie){Ue=Ie}}try{if(Ue instanceof oF){let He={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:Ve?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Ue,He),p?.(Ue,He);let{catchSchemaFailure:ze=f}=Z;if(ze)return q(ze(Ue,He),fl({baseQueryMeta:Ue._bqMeta}))}}catch(He){Ue=He}throw typeof process<"u",console.error(Ue),Ue}});return function w(_x119,_x120){return _ref43.apply(this,arguments)}}();function R(j,_){let N=i.selectQueryEntry(_,j.queryCacheKey),q=i.selectConfig(_).refetchOnMountOrArgChange,Y=N?.fulfilledTimeStamp,H=j.forceRefetch??(j.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let E=()=>xe(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return fl({startedTimeStamp:Date.now(),...(of(N)?{direction:_.direction}:{})})},condition(_,{getState:N}){let q=N(),Y=i.selectQueryEntry(q,_.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=_.originalArgs,te=Y?.originalArgs,Z=r[_.endpointName],ue=_.direction;return Ov(_)?!0:Y?.status==="pending"?!1:R(_,q)||nf(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),I=E(),k=E(),T=xe(`${e}/executeMutation`,w,{getPendingMeta(){return fl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,L=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=G(N)&&N.ifOlderThan,te=(ue=!0)=>{let ye={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,ye)},Z=o.endpoints[j].select(_)(Y());if(H)q(te());else if(ne){let ue=Z?.fulfilledTimeStamp;if(!ue){q(te());return}(Number(new Date)-Number(new Date(ue)))/1e3>=ne&&q(te())}else q(te(!1))};function V(j){return _=>_?.meta?.arg?.endpointName===j}function B(j,_){return{matchPending:Bi($d(j),V(_)),matchFulfilled:Bi(Hn(j),V(_)),matchRejected:Bi(Sa(j),V(_))}}return{queryThunk:I,mutationThunk:T,infiniteQueryThunk:k,prefetch:L,updateQueryData:h,upsertQueryData:x,patchQueryData:g,buildMatchThunkActions:B}}function _v(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function aF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function iF(e,t,r,n){return Mv(r[e.meta.arg.endpointName][t],Hn(e)?e.payload:void 0,Wu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function LR(e){return Wt(e)?Vd(e):e}function Jp(e,t,r){let n=e[t];n&&r(n)}function yl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function UR(e,t,r){let n=e[yl(t)];n&&r(n)}var Zp={};function kV({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=P(`${e}/resetApiState`);function v(V,B,j,_){var N;V[N=B.queryCacheKey]??(V[N]={status:Xn,endpointName:B.endpointName}),Jp(V,B.queryCacheKey,q=>{q.status=Tv,q.requestId=j&&q.requestId?q.requestId:_.requestId,B.originalArgs!==void 0&&(q.originalArgs=B.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];of(Y)&&"direction"in B&&(q.direction=B.direction)})}function C(V,B,j,_){Jp(V,B.arg.queryCacheKey,N=>{if(N.requestId!==B.requestId&&!_)return;let{merge:q}=o[B.arg.endpointName];if(N.status=ml,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=B,Z=ha(N.data,ue=>q(ue,j,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));N.data=Z}else N.data=j;}else N.data=o[B.arg.endpointName].structuralSharing??!0?WR(Wt(N.data)?HC(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=B.fulfilledTimeStamp})}let h=va({name:`${e}/queries`,initialState:Zp,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:B}}){delete V[B]},prepare:Gi()},cacheEntriesUpserted:{reducer(V,B){for(let j of B.payload){let{queryDescription:_,value:N}=j;v(V,_,!0,{arg:_,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),C(V,{arg:_,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:Sl,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[Hu]:!0,requestId:Ku(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:B,patches:j}}){Jp(V,B,_=>{_.data=lS(_.data,j.concat())})},prepare:Gi()}},extraReducers(V){V.addCase(t.pending,(B,{meta:j,meta:{arg:_}})=>{let N=Ov(_);v(B,_,N,j)}).addCase(t.fulfilled,(B,{meta:j,payload:_})=>{let N=Ov(j.arg);C(B,j,_,N)}).addCase(t.rejected,(B,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{Jp(B,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=gl,H.error=Y??q}})}).addMatcher(p,(B,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===ml||q?.status===gl)&&(B[N]=q)})}}),x=va({name:`${e}/mutations`,initialState:Zp,reducers:{removeMutationResult:{reducer(V,{payload:B}){let j=yl(B);j in V&&delete V[j]},prepare:Gi()}},extraReducers(V){V.addCase(r.pending,(B,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(B[yl(j)]={requestId:_,status:Tv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(B,{payload:j,meta:_})=>{_.arg.track&&UR(B,_,N=>{N.requestId===_.requestId&&(N.status=ml,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:j,error:_,meta:N})=>{N.arg.track&&UR(B,N,q=>{q.requestId===N.requestId&&(q.status=gl,q.error=j??_)})}).addMatcher(p,(B,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===ml||q?.status===gl)&&N!==q?.requestId&&(B[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,B){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of B.payload){R(V,q);for(let{type:H,id:ne}of Y){let te=(_=(j=V.tags)[H]??(j[H]={}))[N=ne||"__internal_without_id"]??(_[N]=[]);te.includes(q)||te.push(q)}V.keys[q]=Y}},prepare:Gi()}},extraReducers(V){V.addCase(h.actions.removeQueryResult,(B,{payload:{queryCacheKey:j}})=>{R(B,j)}).addMatcher(p,(B,j)=>{var N,q,Y;let{provided:_}=i(j);for(let[H,ne]of Object.entries(_.tags??{}))for(let[te,Z]of Object.entries(ne)){let ue=(q=(N=B.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let ye of Z)ue.includes(ye)||ue.push(ye),B.keys[ye]=_.keys[ye]}}).addMatcher(Jr(Hn(t),Wu(t)),(B,j)=>{E(B,[j])}).addMatcher(h.actions.cacheEntriesUpserted.match,(B,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));E(B,_)})}});function R(V,B){let j=LR(V.keys[B]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=LR(Y).filter(H=>H!==B))}delete V.keys[B]}function E(V,B){let j=B.map(_=>{let N=iF(_,"providesTags",o,f),{queryCacheKey:q}=_.meta.arg;return{queryCacheKey:q,providedTags:N}});w.caseReducers.updateProvidedBy(V,w.actions.updateProvidedBy(j))}let I=va({name:`${e}/subscriptions`,initialState:Zp,reducers:{updateSubscriptionOptions(V,B){},unsubscribeQueryResult(V,B){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:Zp,reducers:{subscriptionsUpdated:{reducer(V,B){return lS(V,B.payload)},prepare:Gi()}}}),T=va({name:`${e}/config`,initialState:{online:fV(),focused:pV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:B}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:V=>{V.addCase(qv,B=>{B.online=!0}).addCase(eF,B=>{B.online=!1}).addCase(Dv,B=>{B.focused=!0}).addCase(ZR,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),D=Li({queries:h.reducer,mutations:x.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(V,B)=>D(g.match(B)?void 0:V,B),L={...T.actions,...h.actions,...I.actions,...k.actions,...x.actions,...w.actions,resetApiState:g};return{reducer:G,actions:L}}var Pa=Symbol.for("RTKQ/skipToken"),sF={status:Xn},QR=ha(sF,()=>{}),BR=ha(sF,()=>{});function OV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>QR,o=I=>BR;return{buildQuerySelector:C,buildInfiniteQuerySelector:h,buildMutationSelector:x,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(I){return{...I,..._R(I.status)}}function i(I){return I[t]}function p(I){return i(I)?.queries}function f(I,k){return p(I)?.[k]}function m(I){return i(I)?.mutations}function g(I){return i(I)?.config}function v(I,k,T){return D=>{if(D===Pa)return r(n,T);let G=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(V=>f(V,G)??QR,T)}}function C(I,k){return v(I,k,a)}function h(I,k){let{infiniteQueryOptions:T}=k;function D(G){let L={...G,..._R(G.status)},{isLoading:V,isError:B,direction:j}=L,_=j==="forward",N=j==="backward";return{...L,hasNextPage:R(T,L.data,L.originalArgs),hasPreviousPage:E(T,L.data,L.originalArgs),isFetchingNextPage:V&&_,isFetchingPreviousPage:V&&N,isFetchNextPageError:B&&_,isFetchPreviousPageError:B&&N}}return v(I,k,D)}function x(){return I=>{let k;return typeof I=="object"?k=yl(I)??Pa:k=I,r(k===Pa?o:G=>i(G)?.mutations?.[k]??BR,a)}}function b(I,k){let T=I[t],D=new Set,G=Pv(k,Nv,nF);for(let L of G){let V=T.provided.tags[L.type];if(!V)continue;let B=(L.id!==void 0?V[L.id]:Object.values(V).flat())??[];for(let j of B)D.add(j)}return Array.from(D.values()).flatMap(L=>{let V=T.queries[L];return V?{queryCacheKey:L,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function w(I,k){return Pv(Object.values(p(I)),T=>T?.endpointName===k&&T.status!==Xn,T=>T.originalArgs)}function R(I,k,T){return k?_v(I,k,T)!=null:!1}function E(I,k,T){return!k||!I.getPreviousPageParam?!1:aF(I,k,T)!=null}}var GR=WeakMap?new WeakMap:void 0,$R=({endpointName:e,queryArgs:t})=>{let r="",n=GR?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Xr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Xr(t)&&GR?.set(t,o),r=o}return`${e}(${r})`};function _V(...e){return function(r){let n=Gu(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=$R;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;g=C=>{let h=v(C);return typeof h=="string"?h:$R({...C,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Ku(),extractRehydrationInfo:n,hasRehydrationInfo:Gu(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let v of m)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,C]of Object.entries(g))typeof C=="function"?C(Ds(a,v)):Object.assign(Ds(a,v)||{},C);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:v=>({...v,type:Sl}),mutation:v=>({...v,type:tF}),infiniteQuery:v=>({...v,type:rF})});for(let[v,C]of Object.entries(g)){if(m.overrideExisting!==!0&&v in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Yt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[v]=C;for(let h of p)h.injectEndpoint(v,C)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Yn(e,...t){return Object.assign(e,...t)}var NV=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(b,w)=>{if(p.match(w)){let{queryCacheKey:E,requestId:I,options:k}=w.payload,T=b.get(E);return T?.has(I)&&T.set(I,k),!0}if(f.match(w)){let{queryCacheKey:E,requestId:I}=w.payload,k=b.get(E);return k&&k.delete(I),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:E,requestId:I}}=w,k=ef(b,E.queryCacheKey,kv);return E.subscribe&&k.set(I,E.subscriptionOptions??k.get(I)??{}),!0}let R=!1;if(t.rejected.match(w)){let{meta:{condition:E,arg:I,requestId:k}}=w;if(E&&I.subscribe){let T=ef(b,I.queryCacheKey,kv);T.set(k,I.subscriptionOptions??T.get(k)??{}),R=!0}}return R},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function x(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,R])=>[w,Object.fromEntries(R)]))))}return(b,w)=>{if(a||(a=x(r.currentSubscriptions)),e.util.resetApiState.match(b))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(b))return[!1,h];let R=m(r.currentSubscriptions,b),E=!0;if(R){i||(i=setTimeout(()=>{let T=x(r.currentSubscriptions),[,D]=uS(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(D)),a=T,i=null},500));let I=typeof b.type=="string"&&!!b.type.startsWith(o),k=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;E=!I&&!k}return[E,!1]}},DV=2147483647/1e3-1,qV=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,C=Jr(g.match,r.fulfilled,r.rejected,v.match);function h(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let x={};function b(I){for(let k of I.values())k?.abort?.()}let w=(I,k)=>{let T=k.getState(),D=i(T);if(C(I)){let G;if(v.match(I))G=I.payload.map(L=>L.queryDescription.queryCacheKey);else{let{queryCacheKey:L}=g.match(I)?I.payload:I.meta.arg;G=[L]}R(G,k,D)}if(t.util.resetApiState.match(I)){for(let[G,L]of Object.entries(x))L&&clearTimeout(L),delete x[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),k,D)}};function R(I,k,T){let D=k.getState();for(let G of I){let L=a(D,G);L?.endpointName&&E(G,L.endpointName,k,T)}}function E(I,k,T,D){let L=Ds(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let V=Math.max(0,Math.min(L,DV));if(!h(I)){let B=x[I];B&&clearTimeout(B),x[I]=setTimeout(()=>{if(!h(I)){let j=a(T.getState(),I);j?.endpointName&&T.dispatch(p(j.endpointName,j.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:I}))}delete x[I]},V*1e3)}}return w},HR=new Error("Promise never resolved before cacheEntryRemoved."),MV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Hd(n),m=Hd(o),g=Hn(n,o),v={},{removeQueryResult:C,removeMutationResult:h,cacheEntriesUpserted:x}=e.internalActions;function b(T,D,G){let L=v[T];L?.valueResolved&&(L.valueResolved({data:D,meta:G}),delete L.valueResolved)}function w(T){let D=v[T];D&&(delete v[T],D.cacheEntryRemoved())}function R(T){let{arg:D,requestId:G}=T.meta,{endpointName:L,originalArgs:V}=D;return[L,V,G]}let E=(T,D,G)=>{let L=I(T);function V(B,j,_,N){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&k(B,N,j,D,_)}if(n.pending.match(T)){let[B,j,_]=R(T);V(B,L,_,j)}else if(x.match(T))for(let{queryDescription:B,value:j}of T.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=B;V(_,q,T.meta.requestId,N),b(q,j,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[L]){let[j,_,N]=R(T);k(j,_,L,D,N)}}else if(g(T))b(L,T.payload,T.meta.baseQueryMeta);else if(C.match(T)||h.match(T))w(L);else if(e.util.resetApiState.match(T))for(let B of Object.keys(v))w(B)};function I(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:C.match(T)?T.payload.queryCacheKey:h.match(T)?yl(T.payload):""}function k(T,D,G,L,V){let B=Ds(r,T),j=B?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw HR})]);q.catch(()=>{}),v[G]=_;let Y=e.endpoints[T].select(tf(B)?D:G),H=L.dispatch((Z,ue,ye)=>ye),ne={...L,getCacheEntry:()=>Y(L.getState()),requestId:V,extra:H,updateCachedData:tf(B)?Z=>L.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:N},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==HR)throw Z})}return E},VV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},jV=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Jr(Hn(n),Wu(n)),v=Jr(Hn(o,n),Sa(o,n)),C=[],h=0,x=(R,E)=>{(o.pending.match(R)||n.pending.match(R))&&h++,v(R)&&(h=Math.max(0,h-1)),g(R)?w(iF(R,"invalidatesTags",r,i),E):v(R)?w([],E):a.util.invalidateTags.match(R)&&w(Mv(R.payload,void 0,void 0,void 0,void 0,i),E)};function b(){return h>0}function w(R,E){let I=E.getState(),k=I[e];if(C.push(...R),k.config.invalidationBehavior==="delayed"&&b())return;let T=C;if(C=[],T.length===0)return;let D=a.util.selectInvalidatedBy(I,T);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:L}of G){let V=k.queries[L],B=ef(f.currentSubscriptions,L,kv);V&&(B.size===0?E.dispatch(m({queryCacheKey:L})):V.status!==Xn&&E.dispatch(p(V)))}})}return x},LV=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,R)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,R),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,R),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&v(w.meta.arg,R),r.util.resetApiState.match(w)&&(x(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,R){p.add(w),f||(f=setTimeout(()=>{for(let E of p)C({queryCacheKey:E},R);p.clear(),f=null},0))}function v({queryCacheKey:w},R){let E=R.getState()[e],I=E.queries[w],k=i.get(w);if(!I||I.status===Xn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let L=Date.now()+T;a.set(w,{nextPollTimestamp:L,pollingInterval:T,timeout:setTimeout(()=>{(E.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:w},R)},T)})}function C({queryCacheKey:w},R){let I=R.getState()[e].queries[w],k=i.get(w);if(!I||I.status===Xn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){h(w);return}let D=a.get(w),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:w},R)}function h(w){let R=a.get(w);R?.timeout&&clearTimeout(R.timeout),a.delete(w)}function x(){for(let w of a.keys())h(w)}function b(w=new Map){let R=!1,E=Number.POSITIVE_INFINITY;for(let I of w.values())I.pollingInterval&&(E=Math.min(I.pollingInterval,E),R=I.skipPollingIfUnfocused||R);return{lowestPollingInterval:E,skipPollingIfUnfocused:R}}return m},UV=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=$d(r,n),a=Sa(r,n),i=Hn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:v,arg:{endpointName:C,originalArgs:h}}=m.meta,x=Ds(t,C),b=x?.onQueryStarted;if(b){let w={},R=new Promise((T,D)=>{w.resolve=T,w.reject=D});R.catch(()=>{}),p[v]=w;let E=e.endpoints[C].select(tf(x)?h:v),I=g.dispatch((T,D,G)=>G),k={...g,getCacheEntry:()=>E(g.getState()),requestId:v,extra:I,updateCachedData:tf(x)?T=>g.dispatch(e.util.updateQueryData(C,h,T)):void 0,queryFulfilled:R};b(h,k)}}else if(i(m)){let{requestId:v,baseQueryMeta:C}=m.meta;p[v]?.resolve({data:m.payload,meta:C}),delete p[v]}else if(a(m)){let{requestId:v,rejectedWithValue:C,baseQueryMeta:h}=m.meta;p[v]?.reject({error:m.payload??m.error,isUnhandledError:!C,meta:h}),delete p[v]}}},QV=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Dv.match(f)&&p(m,"refetchOnFocus"),qv.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],v=g.queries,C=o.currentSubscriptions;t.batch(()=>{for(let h of C.keys()){let x=v[h],b=C.get(h);if(!b||!x)continue;let w=[...b.values()];(w.some(E=>E[m]===!0)||w.every(E=>E[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:h})):x.status!==Xn&&f.dispatch(n(x)))}})}return i};function BV(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=C=>C.type.startsWith(`${t}/`),m=[VV,qV,jV,LV,MV,UV];return{middleware:C=>{let h=!1,x=a(C.dispatch),b={...e,internalState:x,refetchQuery:v,isThisApiSliceAction:f,mwApi:C},w=m.map(I=>I(b)),R=NV(b),E=QV(b);return I=>k=>{if(!ku(k))return I(k);h||(h=!0,C.dispatch(n.internalActions.middlewareRegistered(i)));let T={...C,next:I},D=C.getState(),[G,L]=R(k,T,D),V;if(G?V=I(k):V=L,C.getState()[t]&&(E(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,D);return V}},actions:p};function v(C){return e.api.endpoints[C.endpointName].initiate(C.originalArgs,{subscribe:!1,forceRefetch:!0})}}var zR=Symbol(),GV=({createSelector:e=et}={})=>({name:zR,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:h},x){ZC();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:qv,onOffline:eF,onFocus:Dv,onFocusLost:ZR},util:{}});let w=OV({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:R,selectCachedArgsForQuery:E,buildQuerySelector:I,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Yn(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:E});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=PV({baseQuery:r,reducerPath:o,context:x,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:h}),{reducer:q,actions:Y}=kV({context:x,queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Yn(t.util,{patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Yn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>ef(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Xe,getRunningQueryThunk:Ue}=TV({queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:x,getInternalState:ne});Yn(t.util,{getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueryThunk:Ue,getRunningQueriesThunk:Xe});let{middleware:He,actions:ze}=BV({reducerPath:o,context:x,queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Ue,getInternalState:ne});return Yn(t.util,ze),Yn(t,{reducer:q,middleware:He}),{name:zR,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});nf(Re)&&Yn(Ie,{name:Ee,select:I(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),FV(Re)&&Yn(Ie,{name:Ee,select:T(),initiate:ue(Ee)},N(L,Ee)),of(Re)&&Yn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),cF=_V(GV());d();c();l();u();d();c();l();u();var ka=e=>e.query,uF=e=>e.query?.enableQuerySyntax;var lF=et(e=>ka(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),af=et(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var sf=e=>{if(e==="yes")return!0;if(e==="no")return!1},$V=()=>X("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function HV(e,t){return X({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??We(n),a=nl(n,e);if(!o||!a)return null;let i=Ca(n);return r.makeGeneratedAnswerCitationClick(Vw(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:jw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=nl(r,e);return{answerId:t??We(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function zV(e,t,r){return X({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??We(o),i=nl(o,e);if(!a||!i)return null;let p=Ca(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=nl(n,e);return{answerId:r??We(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function WV(e,t){return X({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function KV(e){return X({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"like"})})}function YV(e){return X({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"dislike"})})}var XV=e=>X({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=We(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=We(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:sf(o),documented:sf(a),correctTopic:sf(p),hallucinationFree:sf(i)},additionalNotes:m,correctAnswerUrl:f}}}),Jn=(e,t,r)=>X({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??We(o);if(!a)return null;let i=Ca(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??We(n)??"",answerGenerated:e??!1})}),Vo=e=>X({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),JV=()=>X({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"show"})}),ZV=()=>X({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"hide"})}),ej=()=>X({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"expand"})}),tj=()=>X({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"collapse"})});function rj(e){return X({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"copyToClipboard"})})}var jo={logCopyGeneratedAnswer:rj,logGeneratedAnswerHideAnswers:ZV,logGeneratedAnswerShowAnswers:JV,logGeneratedAnswerStreamEnd:Jn,logGeneratedAnswerFeedback:XV,logDislikeGeneratedAnswer:YV,logLikeGeneratedAnswer:KV,logGeneratedAnswerOpenInlineLink:WV,logHoverCitation:zV,logOpenGeneratedAnswerSource:HV,logRetryGeneratedAnswer:$V,logGeneratedAnswerExpand:ej,logGeneratedAnswerCollapse:tj};d();c();l();u();d();c();l();u();var dF=et(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Vv=e=>e.context;d();c();l();u();var jv=e=>e.pipeline;d();c();l();u();var Lv=e=>e.searchHub;d();c();l();u();var Lt=et(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),vie=et(e=>e,e=>{let t=Lt(e);return t&&e?e[t].expression:""});d();c();l();u();var pF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var fF=e=>e.excerptLength?.length;d();c();l();u();var cn=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,mF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var gF=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var hF=e=>e.sortCriteria;var yF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ji(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function yF(_x126){return _ref45.apply(this,arguments)}}(),SF=(e,t)=>{let r=ka(e)?.q,{aq:n,cq:o,dq:a,lq:i}=xF(e),p=Vv(e),f=Ur(e.configuration.analytics,t,{actionCause:Rv(e)}),m=Lv(e),g=jv(e),v=KS(e)??[],C=AF(e),h=Lt(e.tabSet)||"default",x=zS(e),b=Rw(e),w=t.referrer||"",R=mF(e),E=hF(e),I=nj(e),k=fF(e),T=gF(e),D=pF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:uF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(C.length&&{facets:C}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:bv(e),firstResult:e.pagination.firstResult}),tab:h,locale:x,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...I,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:E,...(R&&{facetOptions:R}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},vF=(e,t)=>{let r=ka(e)?.q,n=AF(e),o=Ur(e.configuration.analytics,t,{actionCause:Rv(e)}),a=zS(e),i=Lt(e.tabSet)||"default",p=t.referrer||"",{aq:f,cq:m}=xF(e),g=Lv(e),v=jv(e),C=Vv(e),h=KS(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(C?.contextValues&&{context:C.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},AF=e=>Yp(e)?.map(t=>hv(t,gv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),nj=e=>({actionsHistory:e.configuration.analytics.enabled?Xt.getInstance().getHistory():[]}),xF=e=>{let t=dF(e),r=wv(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var cf=["searching","thinking","answering"];function uf(e){return e.toLowerCase()}function Uv(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var CF=["text/plain","text/markdown"];var qs=new U({required:!0}),bF=new U,Ms=new pe({required:!0}),Qv={id:qs,title:qs,uri:qs,permanentid:qs,clickUri:bF},lf=new U({required:!0,constrainTo:CF}),wF=new U({required:!0,constrainTo:cf}),RF=e=>({...e,name:uf(e.name)}),Vs=P("generatedAnswer/setIsVisible",e=>O(e,Ms)),js=P("generatedAnswer/setAnswerId",e=>O(e,W)),df=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new U({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),vl=P("generatedAnswer/setIsEnabled",e=>O(e,Ms)),_a=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:qs})),Na=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new J({values:Qv})})})),Da=P("generatedAnswer/updateError",e=>O(e,{message:bF,code:new re({min:0})})),lr=P("generatedAnswer/resetAnswer"),pf=P("generatedAnswer/like"),ff=P("generatedAnswer/dislike"),mf=P("generatedAnswer/feedbackModal/open"),Al=P("generatedAnswer/expand"),gf=P("generatedAnswer/collapse"),hf=P("generatedAnswer/setId",e=>O(e,{id:new U({required:!0})})),yf=P("generatedAnswer/feedbackModal/close"),Ls=P("generatedAnswer/sendFeedback"),un=P("generatedAnswer/setIsLoading",e=>O(e,Ms)),Oa=P("generatedAnswer/setIsStreaming",e=>O(e,Ms)),qa=P("generatedAnswer/setAnswerContentFormat",e=>O(e,lf)),Sf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:lf,default:["text/plain"]})})),vf=P("knowledge/updateAnswerConfigurationId",e=>O(e,qs)),Af=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,wd)),xl=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,Ms)),Ma=P("generatedAnswer/setCannotAnswer",e=>O(e,Ms)),Bv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),xf=P("generatedAnswer/startStep",e=>O(RF(e),{name:wF,startedAt:new re({min:0,required:!0})})),Cf=P("generatedAnswer/finishStep",e=>O(RF(e),{name:wF,finishedAt:new re({min:0,required:!0})})),FF=xe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield yF(r),g=(h,x)=>{switch(h){case"genqa.headerMessageType":{let b=JSON.parse(x);n(qa(b.contentFormat));break}case"genqa.messageType":n(_a(JSON.parse(x)));break;case"genqa.citationsType":n(Na(JSON.parse(x)));break;case"genqa.endOfStreamType":{let b=JSON.parse(x).answerGenerated,{answerId:w,answer:R}=a().generatedAnswer,I=p.length!==0&&!b,k=!R?.trim();n(Ma(I)),n(Oa(!1)),n(xl(b)),n(Jn(b,w,b?k:void 0)),n(Vo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(un(!0));let v=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,C=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{v(m)&&(n(un(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{v(m)&&n(Da(h))},close:()=>{v(m)&&n(Oa(!1))},resetAnswer:()=>{v(m)&&n(lr())}});C?f(C):n(un(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),bf=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(lr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=SF(a,n);r(Bv(i)),yield r(wf(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x129,_x130){return _ref47.apply(this,arguments)}}());d();c();l();u();var oj=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=ji(n.configuration.search?.apiBaseUrl,i,a);return KR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,C={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{C[h]=g[h]}),C.duplex="half",C.body=yield g.text(),S(v,C)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function oj(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),Rf=cF({reducerPath:"answer",baseQuery:XR(oj,{maxRetries:3}),endpoints:()=>({})});var aj=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},ij=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(e.answer=n?.trim()?n.concat(r):r)},sj=(e,t)=>{e.citations=t.citations},cj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},uj=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},lj=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&uj(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(aj(t,o),r(qa(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(ij(t,o),r(_a({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(sj(t,o),r(Na({citations:o.citations})));break;case"genqa.endOfStreamType":{cj(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Jn(i,a,p)),r(Vo());break}}},dj=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Va=Rf.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x135,_x136){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:v}=i,C=ji(i.search.apiBaseUrl,m,g),h=dj(C,m,p.answerConfigurationId,f?.insightId);yield hd(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(x){let b=x.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(js(b))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:x=>{o(b=>{lj(x,b,a)})},onerror:x=>{throw x},onclose:()=>{o(x=>{a(Ma(!x.generated))})}})}).apply(this,arguments)}})})}),wf=e=>Va.endpoints.getAnswer.initiate(e),Gv=e=>{let t=af(e);return Va.endpoints.getAnswer.select(t??Pa)(e)};d();c();l();u();var EF=ae(Ao,e=>e);d();c();l();u();function pj(e){let t=e.payload?.analyticsAction;return IF(e)&&!fe(t)}function IF(e){return"type"in e}var TF=e=>t=>r=>{let n;pj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return IF(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var Us=P("tab/register",e=>{let t=new J({values:{id:W,expression:Be}});return O(e,t)}),ht=P("tab/updateActiveTab",e=>O(e,W));d();c();l();u();var Ff=Vr(kp(),1),OF=Vr(PF(),1),_F=Vr(kF(),1);Ff.default.extend(_F.default);Ff.default.extend(OF.default);var Qs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Ff.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var fj=/(^|; )Coveo-Pendragon=([^;]*)/,mj=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function NF(){return typeof window>"u"?!1:fj.exec(document.cookie)?.pop()||null}function DF(){return typeof window>"u"?!1:mj.test(document.cookie)}var Ef=ae(Qs(),e=>e.addCase(rn,(t,r)=>{gj(t,r.payload)}).addCase(vr,(t,r)=>{hj(t,r.payload)}).addCase(Ro,(t,r)=>{yj(t,r.payload)}).addCase(cs,t=>{t.analytics.enabled=!1}).addCase(us,t=>{t.analytics.enabled=!0}).addCase(Rp,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Fp,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ls,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{fe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Ep,(t,{payload:r})=>{Sj(t,r)}));function gj(e,t){fe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",fe(t.organizationId)||(e.organizationId=t.organizationId)}function hj(e,t){fe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),fe(t.locale)||(e.search.locale=t.locale),fe(t.timezone)||(e.search.timezone=t.timezone),fe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function yj(e,t){fe(t.enabled)||(e.analytics.enabled=t.enabled),fe(t.originContext)||(e.analytics.originContext=t.originContext),fe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),fe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),fe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),fe(t.trackingId)||(e.analytics.trackingId=t.trackingId),fe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),fe(t.source)||(e.analytics.source=t.source);try{let r=NF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}fe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),fe(t.anonymous)||(e.analytics.anonymous=t.anonymous),fe(t.deviceId)||(e.analytics.deviceId=t.deviceId),fe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),fe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function Sj(e,t){e.knowledge.agentId=t;try{let r=DF();fe(r)||(e.knowledge.debugAgentSession=!0)}catch{}}var me=Ef;d();c();l();u();function vj(e){return e.instantlyCallable}var qF=()=>e=>t=>e(vj(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function MF(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}d();c();l();u();var Kv,Aj=new Uint8Array(16);function Yv(){if(!Kv){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Kv=crypto.getRandomValues.bind(crypto)}return Kv(Aj)}d();c();l();u();d();c();l();u();var xj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xv={randomUUID:xj};function Cj(e,t,r){if(Xv.randomUUID&&!t&&!e)return Xv.randomUUID();e=e||{};let n=e.random??e.rng?.()??Yv();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 MF(n)}var Lo=Cj;d();c();l();u();d();c();l();u();var F={};Au(F,{BRAND:()=>Wj,DIRTY:()=>ja,EMPTY_PATH:()=>Fj,INVALID:()=>Ce,NEVER:()=>OL,OK:()=>Ut,ParseStatus:()=>Dt,Schema:()=>ke,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>Ua,ZodBoolean:()=>Qa,ZodBranded:()=>bl,ZodCatch:()=>Za,ZodDate:()=>Ba,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>Pf,ZodEffects:()=>Er,ZodEnum:()=>Ya,ZodError:()=>er,ZodFirstPartyTypeKind:()=>be,ZodFunction:()=>Of,ZodIntersection:()=>za,ZodIssueCode:()=>ee,ZodLazy:()=>Wa,ZodLiteral:()=>Ka,ZodMap:()=>Ws,ZodNaN:()=>Ys,ZodNativeEnum:()=>Xa,ZodNever:()=>Gr,ZodNull:()=>$a,ZodNullable:()=>pn,ZodNumber:()=>La,ZodObject:()=>tr,ZodOptional:()=>Rr,ZodParsedType:()=>le,ZodPipeline:()=>wl,ZodPromise:()=>Go,ZodReadonly:()=>ei,ZodRecord:()=>kf,ZodSchema:()=>ke,ZodSet:()=>Ks,ZodString:()=>Qo,ZodSymbol:()=>Hs,ZodTransformer:()=>Er,ZodTuple:()=>dn,ZodType:()=>ke,ZodUndefined:()=>Ga,ZodUnion:()=>Ha,ZodUnknown:()=>to,ZodVoid:()=>zs,addIssueToContext:()=>ce,any:()=>nL,array:()=>sL,bigint:()=>Jj,boolean:()=>WF,coerce:()=>kL,custom:()=>$F,date:()=>Zj,datetimeRegex:()=>BF,defaultErrorMap:()=>Zn,discriminatedUnion:()=>dL,effect:()=>bL,enum:()=>AL,function:()=>yL,getErrorMap:()=>Bs,getParsedType:()=>ln,instanceof:()=>Yj,intersection:()=>pL,isAborted:()=>If,isAsync:()=>Gs,isDirty:()=>Tf,isValid:()=>Uo,late:()=>Kj,lazy:()=>SL,literal:()=>vL,makeIssue:()=>Cl,map:()=>gL,nan:()=>Xj,nativeEnum:()=>xL,never:()=>aL,null:()=>rL,nullable:()=>RL,number:()=>zF,object:()=>cL,objectUtil:()=>Jv,oboolean:()=>PL,onumber:()=>TL,optional:()=>wL,ostring:()=>IL,pipeline:()=>EL,preprocess:()=>FL,promise:()=>CL,quotelessJson:()=>bj,record:()=>mL,set:()=>hL,setErrorMap:()=>Rj,strictObject:()=>uL,string:()=>HF,symbol:()=>eL,transformer:()=>bL,tuple:()=>fL,undefined:()=>tL,union:()=>lL,unknown:()=>oL,util:()=>De,void:()=>iL});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var De;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(De||(De={}));var Jv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Jv||(Jv={}));var le=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ln=e=>{switch(typeof e){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(e)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(e)?le.array:e===null?le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?le.promise:typeof Map<"u"&&e instanceof Map?le.map:typeof Set<"u"&&e instanceof Set?le.set:typeof Date<"u"&&e instanceof Date?le.date:le.object;default:return le.unknown}};var ee=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),bj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),er=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=e=>new er(e);var wj=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===le.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}},Zn=wj;var VF=Zn;function Rj(e){VF=e}function Bs(){return VF}d();c();l();u();var Cl=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},Fj=[];function ce(e,t){let r=Bs(),n=Cl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Zn?void 0:Zn].filter(o=>!!o)});e.common.issues.push(n)}var Dt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ce;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return Ce;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},Ce=Object.freeze({status:"aborted"}),ja=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),If=e=>e.status==="aborted",Tf=e=>e.status==="dirty",Uo=e=>e.status==="valid",Gs=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));var Fr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},jF=(e,t)=>{if(Uo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var ke=class{get description(){return this._def.description}_getType(t){return ln(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ln(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:ln(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Gs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ln(t)},o=this._parseSync({data:t,path:n.path,parent:n});return jF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ln(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Uo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Uo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:ln(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Gs(o)?o:Promise.resolve(o);return jF(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:ee.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Er({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Rr.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Go.create(this,this._def)}or(t){return Ha.create([this,t],this._def)}and(t){return za.create(this,t,this._def)}transform(t){return new Er({...Te(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new bl({typeName:be.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Za({...Te(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return wl.create(this,t)}readonly(){return ei.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ej=/^c[^\s-]{8,}$/i,Ij=/^[0-9a-z]+$/,Tj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Pj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kj=/^[a-z0-9_-]{21}$/i,Oj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_j=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Zv,qj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Vj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,UF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qj=new RegExp(`^${UF}$`);function QF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Bj(e){return new RegExp(`^${QF(e)}$`)}function BF(e){let t=`${UF}T${QF(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Gj(e,t){return!!((t==="v4"||!t)&&qj.test(e)||(t==="v6"||!t)&&Vj.test(e))}function $j(e,t){if(!Oj.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Hj(e,t){return!!((t==="v4"||!t)&&Mj.test(e)||(t==="v6"||!t)&&jj.test(e))}var Qo=class e extends ke{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==le.string){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.string,received:a.parsedType}),Ce}let n=new Dt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Nj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Zv||(Zv=new RegExp(Dj,"u")),Zv.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Pj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")kj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ej.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ij.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Tj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:ee.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:ee.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?BF(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Qj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Bj(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?_j.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Gj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?$j(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Hj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Lj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Uj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):De.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.invalid_string,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Qo.create=e=>new Qo({checks:[],typeName:be.ZodString,coerce:e?.coerce??!1,...Te(e)});function zj(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var La=class e extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==le.number){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.number,received:a.parsedType}),Ce}let n,o=new Dt;for(let a of this._def.checks)a.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?zj(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};La.create=e=>new La({checks:[],typeName:be.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var Ua=class e extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==le.bigint)return this._getInvalidInput(t);let n,o=new Dt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.bigint,received:r.parsedType}),Ce}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ua.create=e=>new Ua({checks:[],typeName:be.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Qa=class extends ke{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==le.boolean){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),Ce}return Ut(t.data)}};Qa.create=e=>new Qa({typeName:be.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Ba=class e extends ke{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==le.date){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.date,received:a.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),Ce}let n=new Dt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):De.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ba.create=e=>new Ba({checks:[],coerce:e?.coerce||!1,typeName:be.ZodDate,...Te(e)});var Hs=class extends ke{_parse(t){if(this._getType(t)!==le.symbol){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),Ce}return Ut(t.data)}};Hs.create=e=>new Hs({typeName:be.ZodSymbol,...Te(e)});var Ga=class extends ke{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),Ce}return Ut(t.data)}};Ga.create=e=>new Ga({typeName:be.ZodUndefined,...Te(e)});var $a=class extends ke{_parse(t){if(this._getType(t)!==le.null){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),Ce}return Ut(t.data)}};$a.create=e=>new $a({typeName:be.ZodNull,...Te(e)});var Bo=class extends ke{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Bo.create=e=>new Bo({typeName:be.ZodAny,...Te(e)});var to=class extends ke{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ut(t.data)}};to.create=e=>new to({typeName:be.ZodUnknown,...Te(e)});var Gr=class extends ke{_parse(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.never,received:r.parsedType}),Ce}};Gr.create=e=>new Gr({typeName:be.ZodNever,...Te(e)});var zs=class extends ke{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),Ce}return Ut(t.data)}};zs.create=e=>new zs({typeName:be.ZodVoid,...Te(e)});var ro=class e extends ke{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==le.array)return ce(r,{code:ee.invalid_type,expected:le.array,received:r.parsedType}),Ce;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ce(r,{code:i?ee.too_big:ee.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ce(r,{code:ee.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ce(r,{code:ee.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Fr(r,i,r.path,p)))).then(i=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Fr(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.toString(r)}})}nonempty(t){return this.min(1,t)}};ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...Te(t)});function $s(e){if(e instanceof tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Rr.create($s(n))}return new tr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:$s(e.element)}):e instanceof Rr?Rr.create($s(e.unwrap())):e instanceof pn?pn.create($s(e.unwrap())):e instanceof dn?dn.create(e.items.map(t=>$s(t))):e}var tr=class e extends ke{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=De.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==le.object){let m=this._getOrReturnCtx(t);return ce(m,{code:ee.invalid_type,expected:le.object,received:m.parsedType}),Ce}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Gr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],v=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Fr(o,v,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Gr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ce(o,{code:ee.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let v=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Fr(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let v=yield g.key,C=yield g.value;m.push({key:v,value:C,alwaysSet:g.alwaysSet})}return m})).then(m=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ge.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:be.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of De.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return $s(this)}partial(t){let r={};for(let n of De.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Rr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return GF(De.objectKeys(this.shape))}};tr.create=(e,t)=>new tr({shape:()=>e,unknownKeys:"strip",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});tr.strictCreate=(e,t)=>new tr({shape:()=>e,unknownKeys:"strict",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});tr.lazycreate=(e,t)=>new tr({shape:e,unknownKeys:"strip",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});var Ha=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new er(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),Ce}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x138){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new er(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),Ce}}get options(){return this._def.options}};Ha.create=(e,t)=>new Ha({options:e,typeName:be.ZodUnion,...Te(t)});var eo=e=>e instanceof Wa?eo(e.schema):e instanceof Er?eo(e.innerType()):e instanceof Ka?[e.value]:e instanceof Ya?e.options:e instanceof Xa?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ga?[void 0]:e instanceof $a?[null]:e instanceof Rr?[void 0,...eo(e.unwrap())]:e instanceof pn?[null,...eo(e.unwrap())]:e instanceof bl||e instanceof ei?eo(e.unwrap()):e instanceof Za?eo(e._def.innerType):[],Pf=class e extends ke{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.object)return ce(r,{code:ee.invalid_type,expected:le.object,received:r.parsedType}),Ce;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=eo(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:be.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Te(n)})}};function eA(e,t){let r=ln(e),n=ln(t);if(e===t)return{valid:!0,data:e};if(r===le.object&&n===le.object){let o=De.objectKeys(t),a=De.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=eA(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===le.array&&n===le.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=eA(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===le.date&&n===le.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var za=class extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(If(a)||If(i))return Ce;let p=eA(a.value,i.value);return p.valid?((Tf(a)||Tf(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};za.create=(e,t,r)=>new za({left:e,right:t,typeName:be.ZodIntersection,...Te(r)});var dn=class e extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.array)return ce(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),Ce;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Fr(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Dt.mergeArray(r,i)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};dn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new dn({items:e,typeName:be.ZodTuple,rest:null,...Te(t)})};var kf=class e extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.object)return ce(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),Ce;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Fr(n,p,n.path,p)),value:i._parse(new Fr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Dt.mergeObjectAsync(r,o):Dt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ke?new e({keyType:t,valueType:r,typeName:be.ZodRecord,...Te(n)}):new e({keyType:Qo.create(),valueType:t,typeName:be.ZodRecord,...Te(r)})}},Ws=class extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.map)return ce(n,{code:ee.invalid_type,expected:le.map,received:n.parsedType}),Ce;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Fr(n,p,n.path,[m,"key"])),value:a._parse(new Fr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Ws.create=(e,t,r)=>new Ws({valueType:t,keyType:e,typeName:be.ZodMap,...Te(r)});var Ks=class e extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.set)return ce(n,{code:ee.invalid_type,expected:le.set,received:n.parsedType}),Ce;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ce(n,{code:ee.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(ce(n,{code:ee.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return Ce;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Fr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ks.create=(e,t)=>new Ks({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...Te(t)});var Of=class e extends ke{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.function)return ce(r,{code:ee.invalid_type,expected:le.function,received:r.parsedType}),Ce;function n(p,f){return Cl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return Cl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Go){let p=this;return Ut(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new er([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),v=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(v,a).catch(h=>{throw m.addIssue(o(v,h)),m})}))}else{let p=this;return Ut(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new er([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),v=p._def.returns.safeParse(g,a);if(!v.success)throw new er([o(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:dn.create(t).rest(to.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||dn.create([]).rest(to.create()),returns:r||to.create(),typeName:be.ZodFunction,...Te(n)})}},Wa=class extends ke{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Wa.create=(e,t)=>new Wa({getter:e,typeName:be.ZodLazy,...Te(t)});var Ka=class extends ke{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ka.create=(e,t)=>new Ka({value:e,typeName:be.ZodLiteral,...Te(t)});function GF(e,t){return new Ya({values:e,typeName:be.ZodEnum,...Te(t)})}var Ya=class e extends ke{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),Ce}return Ut(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ya.create=GF;var Xa=class extends ke{_parse(t){let r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==le.string&&n.parsedType!==le.number){let o=De.objectValues(r);return ce(n,{expected:De.joinValues(o),received:n.parsedType,code:ee.invalid_type}),Ce}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:o}),Ce}return Ut(t.data)}get enum(){return this._def.values}};Xa.create=(e,t)=>new Xa({values:e,typeName:be.ZodNativeEnum,...Te(t)});var Go=class extends ke{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:le.promise,received:r.parsedType}),Ce;let n=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Ut(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Go.create=(e,t)=>new Go({type:e,typeName:be.ZodPromise,...Te(t)});var Er=class extends ke{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ce(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return Ce;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?Ce:f.status==="dirty"?ja(f.value):r.value==="dirty"?ja(f.value):f});return function(_x139){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return Ce;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?Ce:p.status==="dirty"?ja(p.value):r.value==="dirty"?ja(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Uo(i))return Ce;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Uo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):Ce);De.assertNever(o)}};Er.create=(e,t,r)=>new Er({schema:e,typeName:be.ZodEffects,effect:t,...Te(r)});Er.createWithPreprocess=(e,t,r)=>new Er({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...Te(r)});var Rr=class extends ke{_parse(t){return this._getType(t)===le.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Rr.create=(e,t)=>new Rr({innerType:e,typeName:be.ZodOptional,...Te(t)});var pn=class extends ke{_parse(t){return this._getType(t)===le.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};pn.create=(e,t)=>new pn({innerType:e,typeName:be.ZodNullable,...Te(t)});var Ja=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===le.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Za=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Gs(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Za.create=(e,t)=>new Za({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Ys=class extends ke{_parse(t){if(this._getType(t)!==le.nan){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),Ce}return{status:"valid",value:t.data}}};Ys.create=e=>new Ys({typeName:be.ZodNaN,...Te(e)});var Wj=Symbol("zod_brand"),bl=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},wl=class e extends ke{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),ja(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ce:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:be.ZodPipeline})}},ei=class extends ke{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return Gs(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};ei.create=(e,t)=>new ei({innerType:e,typeName:be.ZodReadonly,...Te(t)});function LF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function $F(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=LF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=LF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var Kj={object:tr.lazycreate},be;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(be||(be={}));var Yj=(e,t={message:`Input not instance of ${e.name}`})=>$F(r=>r instanceof e,t),HF=Qo.create,zF=La.create,Xj=Ys.create,Jj=Ua.create,WF=Qa.create,Zj=Ba.create,eL=Hs.create,tL=Ga.create,rL=$a.create,nL=Bo.create,oL=to.create,aL=Gr.create,iL=zs.create,sL=ro.create,cL=tr.create,uL=tr.strictCreate,lL=Ha.create,dL=Pf.create,pL=za.create,fL=dn.create,mL=kf.create,gL=Ws.create,hL=Ks.create,yL=Of.create,SL=Wa.create,vL=Ka.create,AL=Ya.create,xL=Xa.create,CL=Go.create,bL=Er.create,wL=Rr.create,RL=pn.create,FL=Er.createWithPreprocess,EL=wl.create,IL=()=>HF().optional(),TL=()=>zF().optional(),PL=()=>WF().optional(),kL={string:e=>Qo.create({...e,coerce:!0}),number:e=>La.create({...e,coerce:!0}),boolean:e=>Qa.create({...e,coerce:!0}),bigint:e=>Ua.create({...e,coerce:!0}),date:e=>Ba.create({...e,coerce:!0})};var OL=Ce;var _L=F.object({name:F.string(),arguments:F.string()}),NL=F.object({id:F.string(),type:F.literal("function"),function:_L,encryptedValue:F.string().optional()}),_f=F.object({id:F.string(),role:F.string(),content:F.string().optional(),name:F.string().optional(),encryptedValue:F.string().optional()}),DL=F.object({type:F.literal("text"),text:F.string()}),qL=F.object({type:F.literal("data"),value:F.string(),mimeType:F.string()}),ML=F.object({type:F.literal("url"),value:F.string(),mimeType:F.string().optional()}),Nf=F.discriminatedUnion("type",[qL,ML]),VL=F.object({type:F.literal("image"),source:Nf,metadata:F.unknown().optional()}),jL=F.object({type:F.literal("audio"),source:Nf,metadata:F.unknown().optional()}),LL=F.object({type:F.literal("video"),source:Nf,metadata:F.unknown().optional()}),UL=F.object({type:F.literal("document"),source:Nf,metadata:F.unknown().optional()});var KF=F.object({type:F.literal("binary"),mimeType:F.string(),id:F.string().optional(),url:F.string().optional(),data:F.string().optional(),filename:F.string().optional()}),YF=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:F.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},tde=KF.superRefine((e,t)=>{YF(e,t)}),QL=F.discriminatedUnion("type",[DL,VL,jL,LL,UL,KF]),BL=QL.superRefine((e,t)=>{e.type==="binary"&&YF(e,t)}),GL=_f.extend({role:F.literal("developer"),content:F.string()}),$L=_f.extend({role:F.literal("system"),content:F.string()}),HL=_f.extend({role:F.literal("assistant"),content:F.string().optional(),toolCalls:F.array(NL).optional()}),zL=_f.extend({role:F.literal("user"),content:F.union([F.string(),F.array(BL)])}),WL=F.object({id:F.string(),content:F.string(),role:F.literal("tool"),toolCallId:F.string(),error:F.string().optional(),encryptedValue:F.string().optional()}),KL=F.object({id:F.string(),role:F.literal("activity"),activityType:F.string(),content:F.record(F.any())}),YL=F.object({id:F.string(),role:F.literal("reasoning"),content:F.string(),encryptedValue:F.string().optional()}),XF=F.discriminatedUnion("role",[GL,$L,HL,zL,WL,KL,YL]),rde=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user"),F.literal("tool"),F.literal("activity"),F.literal("reasoning")]),XL=F.object({description:F.string(),value:F.string()}),JF=F.object({name:F.string(),description:F.string(),parameters:F.any(),metadata:F.record(F.any()).optional()}),JL=F.object({threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),state:F.any(),messages:F.array(XF),tools:F.array(JF),context:F.array(XL),forwardedProps:F.any()}),ZL=F.any(),nt=class extends Error{constructor(e){super(e)}},tA=class extends nt{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},eU=F.object({name:F.string(),description:F.string().optional()}),tU=F.object({name:F.string().optional(),type:F.string().optional(),description:F.string().optional(),version:F.string().optional(),provider:F.string().optional(),documentationUrl:F.string().optional(),metadata:F.record(F.unknown()).optional()}),rU=F.object({streaming:F.boolean().optional(),websocket:F.boolean().optional(),httpBinary:F.boolean().optional(),pushNotifications:F.boolean().optional(),resumable:F.boolean().optional()}),nU=F.object({supported:F.boolean().optional(),items:F.array(JF).optional(),parallelCalls:F.boolean().optional(),clientProvided:F.boolean().optional()}),oU=F.object({structuredOutput:F.boolean().optional(),supportedMimeTypes:F.array(F.string()).optional()}),aU=F.object({snapshots:F.boolean().optional(),deltas:F.boolean().optional(),memory:F.boolean().optional(),persistentState:F.boolean().optional()}),iU=F.object({supported:F.boolean().optional(),delegation:F.boolean().optional(),handoffs:F.boolean().optional(),subAgents:F.array(eU).optional()}),sU=F.object({supported:F.boolean().optional(),streaming:F.boolean().optional(),encrypted:F.boolean().optional()}),cU=F.object({image:F.boolean().optional(),audio:F.boolean().optional(),video:F.boolean().optional(),pdf:F.boolean().optional(),file:F.boolean().optional()}),uU=F.object({image:F.boolean().optional(),audio:F.boolean().optional()}),lU=F.object({input:cU.optional(),output:uU.optional()}),dU=F.object({codeExecution:F.boolean().optional(),sandboxed:F.boolean().optional(),maxIterations:F.number().optional(),maxExecutionTime:F.number().optional()}),pU=F.object({supported:F.boolean().optional(),approvals:F.boolean().optional(),interventions:F.boolean().optional(),feedback:F.boolean().optional()}),nde=F.object({identity:tU.optional(),transport:rU.optional(),tools:nU.optional(),output:oU.optional(),state:aU.optional(),multiAgent:iU.optional(),reasoning:sU.optional(),multimodal:lU.optional(),execution:dU.optional(),humanInTheLoop:pU.optional(),custom:F.record(F.unknown()).optional()}),ZF=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user")]),M=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),je=F.object({type:F.nativeEnum(M),timestamp:F.number().optional(),rawEvent:F.any().optional()}).passthrough(),fU=je.extend({type:F.literal(M.TEXT_MESSAGE_START),messageId:F.string(),role:ZF.default("assistant"),name:F.string().optional()}),eE=je.extend({type:F.literal(M.TEXT_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),mU=je.extend({type:F.literal(M.TEXT_MESSAGE_END),messageId:F.string()}),gU=je.extend({type:F.literal(M.TEXT_MESSAGE_CHUNK),messageId:F.string().optional(),role:ZF.optional(),delta:F.string().optional(),name:F.string().optional()}),hU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_START)}),yU=eE.omit({messageId:!0,type:!0}).extend({type:F.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),SU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_END)}),vU=je.extend({type:F.literal(M.TOOL_CALL_START),toolCallId:F.string(),toolCallName:F.string(),parentMessageId:F.string().optional()}),AU=je.extend({type:F.literal(M.TOOL_CALL_ARGS),toolCallId:F.string(),delta:F.string()}),xU=je.extend({type:F.literal(M.TOOL_CALL_END),toolCallId:F.string()}),CU=je.extend({messageId:F.string(),type:F.literal(M.TOOL_CALL_RESULT),toolCallId:F.string(),content:F.string(),role:F.literal("tool").optional()}),bU=je.extend({type:F.literal(M.TOOL_CALL_CHUNK),toolCallId:F.string().optional(),toolCallName:F.string().optional(),parentMessageId:F.string().optional(),delta:F.string().optional()}),wU=je.extend({type:F.literal(M.THINKING_START),title:F.string().optional()}),RU=je.extend({type:F.literal(M.THINKING_END)}),FU=je.extend({type:F.literal(M.STATE_SNAPSHOT),snapshot:ZL}),EU=je.extend({type:F.literal(M.STATE_DELTA),delta:F.array(F.any())}),IU=je.extend({type:F.literal(M.MESSAGES_SNAPSHOT),messages:F.array(XF)}),TU=je.extend({type:F.literal(M.ACTIVITY_SNAPSHOT),messageId:F.string(),activityType:F.string(),content:F.record(F.any()),replace:F.boolean().optional().default(!0)}),PU=je.extend({type:F.literal(M.ACTIVITY_DELTA),messageId:F.string(),activityType:F.string(),patch:F.array(F.any())}),kU=je.extend({type:F.literal(M.RAW),event:F.any(),source:F.string().optional()}),OU=je.extend({type:F.literal(M.CUSTOM),name:F.string(),value:F.any()}),_U=je.extend({type:F.literal(M.RUN_STARTED),threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),input:JL.optional()}),NU=je.extend({type:F.literal(M.RUN_FINISHED),threadId:F.string(),runId:F.string(),result:F.any().optional()}),DU=je.extend({type:F.literal(M.RUN_ERROR),message:F.string(),code:F.string().optional()}),qU=je.extend({type:F.literal(M.STEP_STARTED),stepName:F.string()}),MU=je.extend({type:F.literal(M.STEP_FINISHED),stepName:F.string()}),VU=F.union([F.literal("tool-call"),F.literal("message")]),jU=je.extend({type:F.literal(M.REASONING_START),messageId:F.string()}),LU=je.extend({type:F.literal(M.REASONING_MESSAGE_START),messageId:F.string(),role:F.literal("reasoning")}),UU=je.extend({type:F.literal(M.REASONING_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),QU=je.extend({type:F.literal(M.REASONING_MESSAGE_END),messageId:F.string()}),BU=je.extend({type:F.literal(M.REASONING_MESSAGE_CHUNK),messageId:F.string().optional(),delta:F.string().optional()}),GU=je.extend({type:F.literal(M.REASONING_END),messageId:F.string()}),$U=je.extend({type:F.literal(M.REASONING_ENCRYPTED_VALUE),subtype:VU,entityId:F.string(),encryptedValue:F.string()}),Df=F.discriminatedUnion("type",[fU,eE,mU,gU,wU,RU,hU,yU,SU,vU,AU,xU,bU,CU,FU,EU,IU,TU,PU,kU,OU,_U,NU,DU,qU,MU,jU,LU,UU,QU,BU,GU,$U]);d();c();l();u();var rA={};Au(rA,{JsonPatchError:()=>at,_areEquals:()=>El,applyOperation:()=>ti,applyPatch:()=>Qf,applyReducer:()=>YU,deepClone:()=>WU,getValueByPointer:()=>Lf,validate:()=>rE,validator:()=>Uf});d();c();l();u();d();c();l();u();var HU=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),zU=Object.prototype.hasOwnProperty;function Mf(e,t){return zU.call(e,t)}function Vf(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Mf(e,o)&&n.push(o);return n}function qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function jf(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function fn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Rl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function qf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(qf(e[t]))return!0}else if(typeof e=="object"){for(var n=Vf(e),o=n.length,a=0;a<o;a++)if(qf(e[n[a]]))return!0}}return!1}function tE(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
32
+ `;function Lq(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Uq=["1",1,"yes",!0];function op(){let e=[];return FS()&&e.push(window.doNotTrack),jS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Uq.indexOf(t)!==-1)}var cw="v15",uw={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function Qq(e=uw.default,t=cw,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Bq="38824e1f-37f5-42d3-8372-a4b8fa9df946",Zr=class{get defaultOptions(){return{endpoint:uw.default,isCustomEndpoint:!1,token:"",version:cw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return ow}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[kD,FD].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};op()?this.runtime=new np:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(_e.view,{newEventType:_e.view,addClientIdParameter:!0}),this.addEventTypeMapping(_e.click,{newEventType:_e.click,addClientIdParameter:!0}),this.addEventTypeMapping(_e.custom,{newEventType:_e.custom,addClientIdParameter:!0}),this.addEventTypeMapping(_e.search,{newEventType:_e.search,addClientIdParameter:!0})}initRuntime(t){return FS()&&Hi()?new MS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Lq()&&console.warn(jq),new VS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return Q(this,void 0,void 0,function*(){try{return FS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return Q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return Q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return Q(this,void 0,void 0,function*(){if(Zd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId($b(t,$b(r,Bq)))}})}getParameters(t,...r){return Q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return Q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(op())return null;try{let r=new URL(t).searchParams.get(xo.cvo_cid);if(r==null)return null;let n=xo.fromString(r);return!n||!Hi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return Q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>Q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>Q(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>a?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((x,b)=>Q(this,void 0,void 0,function*(){let w=yield x;return yield b(t,w)}),h)].reduce((h,x)=>Q(this,void 0,void 0,function*(){let b=yield h;return yield x(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return Q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?Tq(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,C)=>Q(this,void 0,void 0,function*(){let h=yield v;return yield C(h)}),Promise.resolve(r))})}makeEvent(t,...r){return Q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>Q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return Q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return Q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new Jd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=zn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=zn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return Q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=zn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return Q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return Q(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return Q(this,void 0,void 0,function*(){return yield(yield S(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[_e.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(_q(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=zn(t,["custom"]),o={};r&&Xd(r)&&(o=this.lowercaseKeys(r));let a=Nq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=zn(t,["custom"]);if(r&&Xd(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=zn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==_e.view||r==_e.click||r==_e.search||r==_e.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==_e.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=zn(t,["userId"]);return Vq(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=zn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Xd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Xd(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?HD(t,r):t}get baseUrl(){return Qq(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Wn;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(Wn||(Wn={}));var $;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var Jb={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Wn.expandToFullUI]:"interface",[Wn.openUserActions]:"User Actions",[Wn.showPrecedingSessions]:"User Actions",[Wn.showFollowingSessions]:"User Actions",[Wn.clickViewedDocument]:"User Actions",[Wn.clickPageView]:"User Actions",[Wn.createArticle]:"createArticle"},Ki=class{constructor(){this.runtime=new np,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(_e.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(_e.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(_e.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(_e.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return ow}};function Gq(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function $q(e){return e.map(t=>t.replace(/;/g,""))}function lw(e){let r=e.join(";");return r.length<=256?r:lw(e.slice(1))}var Zb=e=>{let t=$q(e),r=Gq(t);return lw(r)};function ew(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Zb(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Zb(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var ap=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||op();this.coveoAnalyticsClient=n?new Ki:new Zr(t)}disable(){this.coveoAnalyticsClient=new Ki}enable(){this.coveoAnalyticsClient=new Zr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,ew(t))}logOmniboxAnalytics(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,ew(t))}logOmniboxFromLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return Q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return Q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=Jb[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=Jb[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return Q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return Q(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Zr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},ip=Object.assign({},Xu),tw=Object.keys(ip).map(e=>ip[e]),zi=class extends TS{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>tw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(tw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(ip.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(ip.event,{newEventType:_e.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return XD(this.ticket)}};zi.Id="svc";var sp;(function(e){e.click="click",e.flowStart="flowStart"})(sp||(sp={}));var hr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(hr||(hr={}));var cp;(function(e){e.quit="Quit",e.solved="Solved"})(cp||(cp={}));var up=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!op();this.coveoAnalyticsClient=o?new Zr(t):new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Zr(this.options),this.svc=new zi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(hr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(hr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(hr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(hr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(hr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(hr.caseCancelled,{reason:cp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(hr.caseSolved,{reason:cp.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(hr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",sp.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",sp.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Zr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var Co=()=>"default";var Hq=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},xa=class{constructor(t){de(this,"getState",t);de(this,"state");this.state=t()}getLanguage(){return Hq(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Ao),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Co()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var dw=e=>new Zr(e).getCurrentVisitorId(),el=(e,t)=>typeof t=="function"?(...r)=>{let n=Fu(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,tl=(e,t)=>(...r)=>{let n=Fu(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var rl=class extends xa{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},pw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new rl(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new up({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:el(e,n),beforeSendHooks:[tl(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:i},"Analytics request"),C)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Yi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function zq(e,t){return!!t&&t.facetId in e.facetSet}var Lr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),lp=(e,t)=>e.facetSet[t]?.request,Xi=(e,t)=>{let r=Lr(e,t);return zq(e,r)?r:void 0},fw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state==="selected")||[],mw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state!=="idle")||[],en=e=>e.search.isLoading;d();c();l();u();function gw(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function sr(e){let{activeValue:t,ancestryMap:r}=Wq(e);return t?Kq(t,r):[]}function Wq(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function Kq(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function Yq(e,t){return!!t&&t.facetId in e.categoryFacetSet}var QS=(e,t)=>{let r=Lr(e,t);if(Yq(e,r))return r},BS=(e,t)=>e.categoryFacetSet[t]?.request,hw=(e,t)=>{let r=QS(e,t);return sr(r?.values??[])},GS=(e,t)=>{let r=BS(e,t);return sr(r?.currentValues??[])};d();c();l();u();function Ji(){return{}}d();c();l();u();function yw(e,t){return{request:e,tabs:t}}function Zi(){return{}}d();c();l();u();function Sw(e,t){return{request:e,tabs:t}}function es(){return{}}d();c();l();u();function vw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function ts(){return{}}var rs=(e,t)=>{let r=bw(t,e),n=r?r.field:"",o=HS(n,e);return{facetId:e,facetField:n,facetTitle:o}};function ns(e,t){let{facetId:r,facetValue:n}=e,o=rs(r,t),a=ww(t,r);return{...o,facetValue:a==="hierarchical"?Cw(t,r):n}}function cr(e){return{facetSet:e.facetSet??ts(),categoryFacetSet:e.categoryFacetSet??Ji(),dateFacetSet:e.dateFacetSet??Zi(),numericFacetSet:e.numericFacetSet??es(),automaticFacetSet:e.automaticFacetSet??Yi()}}var $S=e=>{let t=[];return Zq(e).forEach((r,n)=>{let o=ww(e,r.facetId),a=oM(r,n+1);if(Jq(r)){if(!!!GS(e,r.facetId).length)return;t.push({...a,...rM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Aw(i,p+1,o),m=Xq(r)?xw(i):tM(i);t.push({...a,...f,...m})})}),eM(e).forEach((r,n)=>{let o=nM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Aw(a,i+1,"specific"),f=xw(a);t.push({...o,...p,...f})})}),t},Xq=e=>e.type==="specific",Jq=e=>e.type==="hierarchical",Zq=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),eM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Aw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),tM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),xw=e=>({displayValue:e.value,value:e.value}),Cw=(e,t)=>GS(e,t).map(n=>n.value).join(";"),rM=(e,t)=>{let n=Cw(e,t);return{value:n,valuePosition:1,displayValue:n}},nM=(e,t)=>({title:HS(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),oM=(e,t)=>({title:HS(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),HS=(e,t)=>`${e}_${t}`,bw=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,ww=(e,t)=>{let r=bw(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var zS=e=>e.configuration.search.locale,Rw=e=>e.configuration.search.timezone,dp=e=>e.configuration.accessToken,pp=e=>e.configuration.organizationId,fp=e=>e.configuration.environment,mp=e=>e.configuration?.knowledge?.agentId,Fw=e=>e.configuration.knowledge.debugAgentSession;var We=e=>{if(aM(e)||WS(e))return e.generatedAnswer?.answerId;if(iM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},aM=e=>"answer"in e&&"generatedAnswer"in e&&!fe(e.generatedAnswer?.answerConfigurationId),WS=e=>{let t=mp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},iM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",KS=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Ca=e=>e.followUpAnswers?.conversationId,sM=e=>e.generatedAnswer?.citations,cM=e=>e.followUpAnswers?.followUpAnswers,uM=et(cM,e=>e?.flatMap(t=>t.citations)),lM=(e,t)=>t,nl=et(sM,uM,lM,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var ol=(r=>(r.Ascending="ascending",r.Descending="descending",r))(ol||{}),ba=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(ba||{}),tn=e=>{if(Ni(e))return e.map(t=>tn(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},os=()=>({by:"relevancy"}),gp=e=>({by:"date",order:e}),hp=(e,t)=>({by:"field",order:t,field:e}),yp=()=>({by:"qre"}),Sp=()=>({by:"nosort"}),Ew=new J({values:{by:new Ru({enum:ba,required:!0}),order:new Ru({enum:ol}),field:new U}});function Sr(){return tn(os())}d();c();l();u();d();c();l();u();d();c();l();u();var as=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?YS(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],YS(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function YS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}d();c();l();u();function dM(){return typeof navigator<"u"}function Iw(){try{return typeof localStorage<"u"}catch{return!1}}function Tw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Pw(){return!!(dM()&&navigator.cookieEnabled)}var kw=null;function Ow(){return kw||(Iw()?localStorage:Pw()?new XS:Tw()?sessionStorage:new JS)}var is=class is{getItem(t){return as.get(`${is.prefix}${t}`)}removeItem(t){as.erase(`${is.prefix}${t}`)}setItem(t,r,n){as.set(`${is.prefix}${t}`,r,n)}};de(is,"prefix","coveo_");var XS=is;var JS=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var vp="__coveo.analytics.history",pM=20,fM=1e3*60,mM=75,wa=class wa{constructor(t){de(this,"store");this.store=t||Ow()}static getInstance(t){return wa.instance||(wa.instance=new wa(t)),wa.instance}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){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(vp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(vp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(vp,JSON.stringify(t.slice(0,pM)))}catch{}}clear(){try{this.store.removeItem(vp)}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,mM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>fM:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};de(wa,"instance",null);var ZS=wa,Xt=ZS;var al=class al extends xa{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return $S(cr(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||al.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||ar().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||al.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=We(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Sr()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||dt().q}get responseTime(){return this.state.search?.duration||ar().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ar().response.totalCountFiltered}};de(al,"fallbackPipelineName","default");var bo=al,_w=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new ap({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:el(e,n),beforeSendHooks:[tl(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:i},"Analytics request"),C)]},o);return m||g.disable(),g},ev=()=>{let t=Xt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ap(e){let t=Nw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return rC([e,...t,...r],o=>o.uniqueId)}function Nw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Nw(t)]):[]}d();c();l();u();var Kn=()=>"";function qw(e,t){return{...new bo(t).getBaseMetadata(),actionCause:e,type:e}}function gM(e){return Object.assign(e,{instantlyCallable:!0})}function hM(e,t){let r=a=>{let i=xe(e,a);return gM(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(v,{getState:C,extra:h}){return yield g({state:C(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var Mw=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return vM(a)}return n},yM=e=>e.configuration.analytics.analyticsMode==="legacy",SM=e=>e.configuration.analytics.analyticsMode==="next",vM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),hM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let v=[],C={log:function(){var _ref14=_asyncToGenerator(function*({state:R}){for(let E of v)yield E(R)});return function log(_x25){return _ref14.apply(this,arguments)}}()},h=p(),x=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(x,p());C.description=b?.description,v.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(R){yM(R)&&(yield AM(b,r,R,g,x.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=Yu(h);return v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(R){if(SM(R)&&o&&n){let E=n(R);yield TM(w,o,E)}});return function(_x27){return _ref16.apply(this,arguments)}}()),C});return function(_x24){return _ref13.apply(this,arguments)}}()));function AM(_x28,_x29,_x30,_x31,_x32){return _AM.apply(this,arguments)}function _AM(){_AM=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _AM.apply(this,arguments)}var xM=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),X=Mw(e=>_w({...e,provider:e.provider||new bo(e.getState)}),e=>e,bo),m5=Mw(pw,xM("caseAssist"),rl);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Uw(e,o),n<0&&(n=IM(e,o)),n<0&&(n=0),bM(e,r(n),t)};var Vw=(e,t)=>({sourceName:CM(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Kn()});function CM(e){let t=e.source;return fe(t)?"unknown":t}var jw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function bM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:FM(e),...(Dw(e)?{documentCategory:Dw(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:EM(e),queryPipeline:r.pipeline||Kn()}}function Dw(e){return e.raw?.objecttype||void 0}var Ke=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),Lw={urihash:new U,sourcetype:new U,permanentid:new U},xp={uniqueId:W,raw:new J({values:Lw}),title:W,uri:W,clickUri:W,rankingModifier:new U({required:!1,emptyAllowed:!0})};function wM(e){return Object.assign({},...Object.keys(Lw).map(t=>({[t]:e[t]})))}function RM(e){return Object.assign({},...Object.keys(xp).map(t=>({[t]:e[t]})),{raw:wM(e.raw)})}function FM(e){let t=e.raw.author;return fe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function EM(e){let t=e.raw.source;return fe(t)?"unknown":t}var Jt=e=>new Se(xp).validate(RM(e));function IM(e,t){for(let[r,n]of t.entries()){let o=Ap(n);if(Uw(e,o)!==-1)return r}return-1}function Uw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function TM(_x34,_x35,_x36){return _TM.apply(this,arguments)}function _TM(){_TM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _TM.apply(this,arguments)}d();c();l();u();var tv=e=>O(e,{evt:W,type:st}),Qw=e=>X("analytics/generic/search",t=>{tv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),Bw=e=>X("analytics/generic/click",(t,r)=>(Jt(e.result),tv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),Gw=e=>X("analytics/generic/custom",t=>(tv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Cp=()=>X("analytics/interface/load",e=>e.makeInterfaceLoad()),wo=()=>X("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),bp=()=>X("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),wp=e=>X("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),$w=()=>({actionCause:"interfaceLoad"}),ss=()=>({actionCause:"interfaceChange"}),Hw=()=>({actionCause:"searchFromLink"}),zw=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var rv=()=>st,Ww=()=>W,rn=P("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new U({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),vr=P("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new U({required:!1,url:!0}),pipeline:new U({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:W})})),PM={enabled:new pe({default:!0}),originContext:rv(),originLevel2:rv(),originLevel3:rv(),proxyBaseUrl:new U({required:!1,url:!0}),runtimeEnvironment:new Qe,anonymous:new pe({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:NC,analyticsMode:new U({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:Qb.reduce((e,t)=>(e[t]=_C,e),{})})},Ro=P("configuration/updateAnalyticsConfiguration",e=>O(e,PM)),cs=P("configuration/analytics/disable"),us=P("configuration/analytics/enable"),Rp=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Ww()})),Fp=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Ww()})),Ep=P("knowledge/setAgentId",e=>O(e,new U({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Ip={q:new U,enableQuerySyntax:new pe,aq:new U,cq:new U,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new U,f:new J,fExcluded:new J,cf:new J,nf:new J,mnf:new J,df:new J,debug:new pe,sf:new J,tab:new U,af:new J};var Me=P("searchParameters/restore",e=>O(e,Ip)),ls=P("searchParameters/restoreTab",e=>O(e,W));d();c();l();u();var Fo=P("debug/enable"),ds=P("debug/disable");d();c();l();u();var Eo=()=>!1;var ps=ae(Eo(),e=>{e.addCase(Fo,()=>!0).addCase(ds,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var nv=P("history/undo"),ov=P("history/redo"),ur=P("history/snapshot"),il=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(nv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Tp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(ov()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=xe("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var fs=P("pipeline/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var ms=ae(Kn(),e=>{e.addCase(fs,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(vr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=P("breadcrumb/deselectAll"),gs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var nn=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new pe({required:!0})}));d();c();l();u();d();c();l();u();var sl=class extends bo{constructor(r){super(r);de(this,"getState",r)}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??ar().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ar().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Kw=e=>X({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Jt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new sl(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),Yw=()=>X("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new sl(e)),Xw=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var av={id:W},kM={...av,q:Be},hs=P("instantResults/register",e=>O(e,av)),on=P("instantResults/updateQuery",e=>O(e,kM)),ys=P("instantResults/clearExpired",e=>O(e,av));d();c();l();u();var Pp=new re({required:!0,min:0}),Ss=P("pagination/registerNumberOfResults",e=>O(e,Pp)),vs=P("pagination/updateNumberOfResults",e=>O(e,Pp)),As=P("pagination/registerPage",e=>O(e,Pp)),an=P("pagination/updatePage",e=>O(e,Pp)),xs=P("pagination/nextPage"),Cs=P("pagination/previousPage");d();c();l();u();var Vt=P("query/updateQuery",e=>O(e,{q:new U,enableQuerySyntax:new pe}));d();c();l();u();d();c();l();u();var Ur=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:$i(e)}});var bs=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Ur(e.configuration.analytics,t,r)),...(e.excerptLength&&!fe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var ws=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield dw(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(ev()&&{pageId:ev()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:$i(e)})}}});return function ws(_x43,_x44){return _ref21.apply(this,arguments)}}();var Io=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield ws(e.configuration.analytics,t))),...(e.excerptLength&&!fe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Io(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Qr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var iv=()=>X("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),To=e=>X("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Qr().aq,cq:r.advancedSearchQueries?.cq||Qr().cq,dq:r.advancedSearchQueries?.dq||Qr().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var ul=Vr(kp(),1),rR=Vr(Jw(),1);d();c();l();u();var Op=Vr(kp(),1),eR=Vr(Zw(),1);Op.default.extend(eR.default);var Rs="YYYY/MM/DD@HH:mm:ss",OM="1401-01-01";function Ra(e,t){let r=(0,Op.default)(e,t);return!r.isValid()&&!t?(0,Op.default)(e,Rs):r}function cl(e){return e.format(Rs)}function tR(e){return cl(Ra(e))===e}function _p(e,t){let r=Ra(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}`)}fv(r)}function fv(e){if(e.isBefore(OM))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}ul.default.extend(rR.default);var nR=["past","now","next"],oR=["minute","hour","day","week","month","quarter","year"],_M=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new U({required:!t,constrainTo:oR}),period:new U({required:!0,constrainTo:nR})}};function Po(e){if(typeof e=="string"&&!sn(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?mv(e):e;new Se(_M(t.period)).validate(t);let r=iR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);fv(r)}function aR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function iR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,ul.default)().subtract(r,n);case"next":return(0,ul.default)().add(r,n);case"now":return(0,ul.default)()}}function ll(e){return cl(iR(mv(e)))}function sR(e){return e.toLocaleLowerCase().split("-")}function sn(e){let[t,r,n]=sR(e);if(t==="now")return!0;if(!nR.includes(t)||!oR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function cR(e){return!!e&&typeof e=="object"&&"period"in e}function mv(e){let[t,r,n]=sR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function uR(e){return Po(e),mv(e)}d();c();l();u();function lR(e){return e.type==="dateRange"}function dR(e){return`start${e}`}function pR(e){return`end${e}`}var gv=()=>({dateFacetValueMap:{}});function NM(e,t,r){let n=e.start,o=e.end;return sn(n)&&(n=ll(n),r.dateFacetValueMap[t][dR(n)]=e.start),sn(o)&&(o=ll(o),r.dateFacetValueMap[t][pR(o)]=e.end),{...e,start:n,end:o}}function hv(e,t){if(lR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>NM(o,r,t))}}return e}function ko(e){let t=gv();return{request:{...e,facets:e.facets?.map(n=>hv(n,t))},mappings:t}}function DM(e,t,r){return{...e,start:r.dateFacetValueMap[t][dR(e.start)]||e.start,end:r.dateFacetValueMap[t][pR(e.end)]||e.end}}function qM(e,t){return e.facetId in t.dateFacetValueMap}function MM(e,t){return qM(e,t)?{...e,values:e.values.map(r=>DM(r,e.facetId,t))}:e}function Np(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>MM(n,t))}}:e}d();c();l();u();d();c();l();u();var Fs=P("didYouMean/enable"),Dp=P("didYouMean/disable"),Es=P("didYouMean/automaticCorrections/disable"),qp=P("didYouMean/automaticCorrections/enable"),Ar=P("didYouMean/correction",e=>O(e,W)),Fa=P("didYouMean/automaticCorrections/mode",e=>O(e,new U({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Mp=()=>X("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),yv=()=>X("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),fR=()=>({actionCause:"didYouMeanClick"}),mR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Vp(){return{contextValues:{}}}d();c();l();u();function jp(){return{contextValues:{}}}d();c();l();u();function Sv(){return{enabled:!0,tabs:{}}}function Lp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Up(){return[]}d();c();l();u();function xr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Qp(){return{}}d();c();l();u();function Bp(){return{}}d();c();l();u();function Gp(){return{}}function gR(){return Br({})}function Br(e){return{context:e.context||Vp(),dictionaryFieldContext:e.dictionaryFieldContext||jp(),facetSet:e.facetSet||ts(),numericFacetSet:e.numericFacetSet||es(),dateFacetSet:e.dateFacetSet||Zi(),categoryFacetSet:e.categoryFacetSet||Ji(),automaticFacetSet:e.automaticFacetSet??Yi(),pagination:e.pagination||xr(),query:e.query||dt(),tabSet:e.tabSet||Gp(),advancedSearchQueries:e.advancedSearchQueries||Qr(),staticFilterSet:e.staticFilterSet||Bp(),querySet:e.querySet||Qp(),sortCriteria:e.sortCriteria||Sr(),pipeline:e.pipeline||Kn(),searchHub:e.searchHub||Co(),facetOptions:e.facetOptions||Lp(),facetOrder:e.facetOrder??Up(),debug:e.debug??Eo()}}d();c();l();u();var VM=new J({values:{undoneQuery:Be},options:{required:!0}}),$p=()=>X("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Hp=e=>X("analytics/trigger/query/undo",t=>(O(e,VM),t.makeUndoTriggerQuery(e))),zp=()=>X("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Wp=()=>X("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),Kp=()=>X("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var Oo=P("trigger/query/ignore",e=>O(e,new U({emptyAllowed:!0,required:!0}))),Is=P("trigger/query/modification",e=>O(e,new J({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function _o(e){return Object.values(e).map(t=>t.request)}function dl(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function hR(e){return _o(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var vv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function jM(e){return _o(e).map(t=>{let r=vv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function LM(e){return[...jM(e.facetSet??{}),...hR(e.numericFacetSet??{}),...hR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function UM(e){return LM(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Yp(e){return dl(UM(e),e.facetOrder??[])}d();c();l();u();var No=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=GM(e),n=Yp(e),o=QM(e),a=yield Io(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return ko({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function No(_x47,_x48){return _ref23.apply(this,arguments)}}();function QM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(BM).filter(r=>r.currentValues.length>0):void 0}function BM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function GM(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=$M(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function $M(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Do=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Np(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(To(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!fe(f)&&!fe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(ur(Br(_this12.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this13.dispatch(To(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(ur(Br(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:yv()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:yv()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Oo("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this14.dispatch(To(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(ur(Br(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:$p()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ar(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(ur(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return bd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield No(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Ar(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Is({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield No(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var yR=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Xp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),SR=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield xv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),vR=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Cv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),AR=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield KM(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),xR=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Av(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),HM=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function HM(_x61,_x62){return _ref29.apply(this,arguments)}}(),zM=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield Io(e);return ko({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function zM(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),WM=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request.numberOfResults=0,r});return function WM(_x66,_x67){return _ref31.apply(this,arguments)}}(),CR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Av(_x68,_x69){return _Av.apply(this,arguments)}function _Av(){_Av=_asyncToGenerator(function*(e,t){O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new Do({...t,analyticsAction:Yw()},m=>{t.dispatch(on({q:m,id:e.id}))}),i=yield zM(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Av.apply(this,arguments)}function xv(_x70,_x71,_x72){return _xv.apply(this,arguments)}function _xv(){_xv=_asyncToGenerator(function*(e,t,r){CR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new Do({...t,analyticsAction:r}),f=yield No(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _xv.apply(this,arguments)}function Cv(_x73,_x74){return _Cv.apply(this,arguments)}function _Cv(){_Cv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield iv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new Do({...e,analyticsAction:iv()}),p=yield HM(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _Cv.apply(this,arguments)}function KM(_x75,_x76,_x77){return _KM.apply(this,arguments)}function _KM(){_KM=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new Do({...e,analyticsAction:t}),f=yield WM(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _KM.apply(this,arguments)}function Xp(_x78,_x79,_x80){return _Xp.apply(this,arguments)}function _Xp(){_Xp=_asyncToGenerator(function*(e,t,r){CR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield No(e,i),f=new Do({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Xp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var bR=et(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Cr=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=wv(e),o=YM(e),a=XM(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Io(e,r):bs(e,t,r);return ko({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:bv(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Cr(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function bv(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function YM(e){return dl(ZM(e),e.facetOrder??[])}function XM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(JM).filter(r=>r.currentValues.length>0):void 0}function JM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function ZM(e){return eV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function eV(e){return[...tV(e.facetSet??{}),...wR(e.numericFacetSet??{}),...wR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function tV(e){return _o(e).map(t=>{let r=vv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function wR(e){return _o(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function wv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=bR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var qo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Np(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(To(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!fe(f)&&!fe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(ur(Br(_this19.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this20.dispatch(To(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(ur(Br(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Oo("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this21.dispatch(To(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(ur(Br(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(ur(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return bd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=mR(),o=yield _this22.fetchFromAPI(yield Cr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Ar(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Is({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Cr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ts=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new U,enableQuerySyntax:new pe,clearFilters:new pe}),e.clearFilters&&(r(ft()),r(gs())),r(nn({allow:!0})),r(Vt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(an(1))}),RR=P("search/updateSearchAction"),z=xe("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Xp(r,t,e.legacy);FR(r);let n=e.next?ER(e.next):void 0,o=yield Cr(r,t.extra.navigatorContext,n),a=new qo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),jt=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(FR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return xv(r,t,e.legacy);let n=new qo({...t,analyticsAction:e.next}),o=yield Cr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),br=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Cv(t,r);let n=qw("browseResults",t.getState),o=new qo({...t,analyticsAction:n}),a=yield rV(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),wr=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Xp(r,t,e.legacy);let n=new qo({...t,analyticsAction:{}}),o=yield oV(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),Ps=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Av(e,t);O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=ER(Xw()),i=yield nV(r,t.extra.navigatorContext,n,o,a),p=new qo({...t,analyticsAction:a},g=>{t.dispatch(on({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),rV=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function rV(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),nV=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=bs(e,t,o);return ko({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function nV(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),oV=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request.numberOfResults=0,n});return function oV(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),FR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},ER=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Mo=(e,t)=>{let r=e;return fe(r[t])?fe(e.raw[t])?null:e.raw[t]:r[t]},aV=e=>t=>e.every(r=>!fe(Mo(t,r))),iV=e=>t=>e.every(r=>fe(Mo(t,r))),sV=(e,t)=>r=>{let n=IR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},cV=(e,t)=>r=>{let n=IR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},IR=(e,t)=>{let r=Mo(t,e);return pd(r)?r:[r]},TR={getResultProperty:Mo,fieldsMustBeDefined:aV,fieldsMustNotBeDefined:iV,fieldMustMatch:sV,fieldMustNotMatch:cV};function pl(e){return e.search.response.searchUid!==""}function PR(e,t,r){return e.search.results.find(n=>Mo(n,t)===r)}var Rv=et(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var ks=P("app/setError");function Fv(e,t){let r=t.payload??null;r&&(e.response=ar().response,e.results=[],e.questionAnswer=Mi()),e.error=r,e.isLoading=!1}function Ev(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function uV(e,t){Ev(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function kR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function lV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ar(),e=>{e.addCase(z.rejected,(t,r)=>Fv(t,r)),e.addCase(br.rejected,(t,r)=>Fv(t,r)),e.addCase(jt.rejected,(t,r)=>Fv(t,r)),e.addCase(z.fulfilled,(t,r)=>{uV(t,r)}),e.addCase(br.fulfilled,(t,r)=>{Ev(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(jt.fulfilled,(t,r)=>{Ev(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(wr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(z.pending,kR),e.addCase(br.pending,lV),e.addCase(jt.pending,kR),e.addCase(RR,(t,r)=>{t.searchAction=r.payload}),e.addCase(ks,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var Os=P("searchHub/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var _s=ae(Co(),e=>{e.addCase(Os,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(vr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var OR=class extends Error{constructor(t){super(t[0].message);de(this,"issues");this.name="SchemaError",this.issues=t}};var Xn="uninitialized",Tv="pending",ml="fulfilled",gl="rejected";function _R(e){return{status:e,isUninitialized:e===Xn,isLoading:e===Tv,isSuccess:e===ml,isError:e===gl}}var NR=Xr;function WR(e,t){if(e===t||!(NR(e)&&NR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=WR(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function Pv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function dV(e){return new RegExp("(^|:)//").test(e)}function pV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Nv(e){return e!=null}function DR(e){return[...(e?.values()??[])].filter(Nv)}function fV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var mV=e=>e.replace(/\/$/,""),gV=e=>e.replace(/^\//,"");function hV(e,t){if(!e)return t;if(!t)return e;if(dV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=mV(e),t=gV(t),`${e}${r}${t}`}function ef(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var kv=()=>new Map,yV=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},SV=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},qR=(...e)=>S(...e),vV=e=>e.status>=200&&e.status<=299,AV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function MR(e){if(!Xr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var xV=e=>typeof e=="object"&&(Xr(e)||Array.isArray(e)||typeof e.toJSON=="function");function KR({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=qR,paramsSerializer:n,isJsonContentType:o=AV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===qR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(C,h,x){let{getState:b,extra:w,endpoint:R,forced:E,type:I}=h,k,{url:T,headers:D=new A(g.headers),params:G=void 0,responseHandler:L=f??"json",validateStatus:V=m??vV,timeout:B=p,...j}=typeof C=="string"?{url:C}:C,_={...g,signal:B?SV(h.signal,yV(B)):h.signal,...j};D=new A(MR(D)),_.headers=(yield t(D,{getState:b,arg:C,extra:w,endpoint:R,forced:E,type:I,extraOptions:x}))||D;let N=xV(_.body);if(_.body!=null&&!N&&typeof _.body!="string"&&_.headers.delete("content-type"),!_.headers.has("content-type")&&N&&_.headers.set("content-type",a),N&&o(_.headers)&&(_.body=JSON.stringify(_.body,i)),_.headers.has("accept")||(L==="json"?_.headers.set("accept","application/json"):L==="text"&&_.headers.set("accept","text/plain, text/html, */*")),G){let ue=~T.indexOf("?")?"&":"?",ye=n?n(G):new URLSearchParams(MR(G));T+=ue+ye}T=hV(e,T);let q=new Request(T,_);k={request:new Request(T,_)};let H;try{H=yield r(q)}catch(ue){return{error:{status:(ue instanceof Error||typeof DOMException<"u"&&ue instanceof DOMException)&&ue.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:k}}let ne=H.clone();k.response=ne;let te,Z="";try{let ue;if(yield Promise.all([v(H,L).then(ye=>te=ye,ye=>ue=ye),ne.text().then(ye=>Z=ye,()=>{})]),ue)throw ue}catch(ue){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(ue)},meta:k}}return V(H,te)?{data:te,meta:k}:{error:{status:H.status,data:te},meta:k}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function v(_x110,_x111){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(C,h){if(typeof h=="function")return h(C);if(h==="content-type"&&(h=o(C.headers)?"json":"text"),h==="json"){let x=yield C.text();return x.length?JSON.parse(x):null}return C.text()});return _v2.apply(this,arguments)}}var Ns=class{constructor(e,t=void 0){de(this,"value");de(this,"meta");this.value=e,this.meta=t}};function CV(){return _CV.apply(this,arguments)}function _CV(){_CV=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _CV.apply(this,arguments)}function YR(e,t){throw Object.assign(new Ns({error:e,meta:t}),{throwImmediately:!0})}function Iv(e){e.aborted&&YR({status:"CUSTOM_ERROR",error:"Aborted"})}var VR={},bV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||VR).maxRetries,(o||VR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:CV,retryCondition:(g,v,{attempt:C})=>C<=i,...t,...o},m=0;for(;;){Iv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Ns(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Ns)return g.value;throw g}if(g instanceof Ns){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Iv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(v){throw Iv(n.signal),v}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),XR=Object.assign(bV,{fail:YR}),rf="__rtkq/",wV="online",RV="offline";var JR="focused";var Dv=P(`${rf}${JR}`),ZR=P(`${rf}un${JR}`),qv=P(`${rf}${wV}`),eF=P(`${rf}${RV}`);var Sl="query",tF="mutation",rF="infinitequery";function nf(e){return e.type===Sl}function FV(e){return e.type===tF}function of(e){return e.type===rF}function tf(e){return nf(e)||of(e)}function Mv(e,t,r,n,o,a){let i=EV(e)?e(t,r,n,o):e;return i?Pv(i,Nv,p=>a(nF(p))):[]}function EV(e){return typeof e=="function"}function nF(e){return typeof e=="string"?{type:e}:e}function IV(e,t){return e.catch(t)}var Ds=(e,t)=>e.endpointDefinitions[t],hl=Symbol("forceQueryFn"),Ov=e=>typeof e[hl]=="function";function TV({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:E,buildInitiateInfiniteQuery:I,buildInitiateMutation:k,getRunningQueryThunk:C,getRunningMutationThunk:h,getRunningQueriesThunk:x,getRunningMutationsThunk:b};function C(T,D){return G=>{let L=Ds(a,T),V=e({queryArgs:D,endpointDefinition:L,endpointName:T});return p(G)?.get(V)}}function h(T,D){return G=>f(G)?.get(D)}function x(){return T=>DR(p(T))}function b(){return T=>DR(f(T))}function w(T){}function R(T,D){let G=(L,{subscribe:V=!0,forceRefetch:B,subscriptionOptions:j,[hl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:L,endpointDefinition:D,endpointName:T}),ne,te={...N,type:Sl,subscribe:V,forceRefetch:B,subscriptionOptions:j,endpointName:T,originalArgs:L,queryCacheKey:H,[hl]:_};if(nf(D))ne=t(te);else{let{direction:Re,initialPageParam:Pe,refetchCachedPages:Ie}=N;ne=r({...te,direction:Re,initialPageParam:Pe,refetchCachedPages:Ie})}let Z=o.endpoints[T].select(L),ue=q(ne),ye=Z(Y());let{requestId:Ve,abort:Xe}=ue,Ue=ye.requestId!==Ve,He=p(q)?.get(H),ze=()=>Z(Y()),Ee=Object.assign(_?ue.then(ze):Ue&&!He?Promise.resolve(ye):Promise.all([He,ue]).then(ze),{arg:L,requestId:Ve,subscriptionOptions:j,queryCacheKey:H,abort:Xe,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(G(L,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){V&&q(m({queryCacheKey:H,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,q(v({endpointName:T,requestId:Ve,queryCacheKey:H,options:Re}))}});if(!He&&!Ue&&!_){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return G}function E(T,D){return R(T,D)}function I(T,D){return R(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:L}={})=>(V,B)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:L}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=IV(_.unwrap().then(ue=>({data:ue})),ue=>({error:ue})),ne=()=>{V(g({requestId:N,fixedCacheKey:L}))},te=Object.assign(H,{arg:_.arg,requestId:N,abort:q,unwrap:Y,reset:ne}),Z=f(V);return Z.set(N,te),te.then(()=>{Z.delete(N)}),L&&(Z.set(L,te),te.then(()=>{Z.get(L)===te&&Z.delete(L)})),te}}}var oF=class extends OR{constructor(t,r,n,o){super(t);de(this,"value");de(this,"schemaName");de(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Ia=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ta(_x115,_x116,_x117,_x118){return _Ta.apply(this,arguments)}function _Ta(){_Ta=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new oF(o.issues,t,r,n);return o.value});return _Ta.apply(this,arguments)}function jR(e){return e}var fl=(e={})=>({...e,[Hu]:!0});function PV({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(j,_,N,q)=>(Y,H)=>{let ne=r[j],te=n({queryArgs:_,endpointDefinition:ne,endpointName:j});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:N})),!q)return;let Z=o.endpoints[j].select(_)(H()),ue=Mv(ne.providesTags,Z.data,void 0,_,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:ue}]))};function v(j,_,N=0){let q=[_,...j];return N&&q.length>N?q.slice(0,-1):q}function C(j,_,N=0){let q=[...j,_];return N&&q.length>N?q.slice(1):q}let h=(j,_,N,q=!0)=>(Y,H)=>{let te=o.endpoints[j].select(_)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(j,_,Z.inversePatches,q))};if(te.status===Xn)return Z;let ue;if("data"in te)if(Kt(te.data)){let[ye,Ve,Xe]=uS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Xe),ue=ye}else ue=N(te.data),Z.patches.push({op:"replace",path:[],value:ue}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(j,_,Z.patches,q)),Z},x=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[hl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:jR,w=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(j,{signal:_,abort:N,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[j.endpointName],{metaSchema:ue,skipSchemaValidation:ye=m}=Z,Ve=j.type===Sl;try{let Xe=jR,Ue={signal:_,abort:N,dispatch:H,getState:ne,extra:te,endpoint:j.endpointName,type:j.type,forced:Ve?R(j,ne()):void 0,queryCacheKey:Ve?j.queryCacheKey:void 0},He=Ve?j[hl]:void 0,ze,Ee=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(Pe,Ie,ut,yt){if(Ie==null&&Pe.pages.length)return Promise.resolve({data:Pe});let qr={queryArg:j.originalArgs,pageParam:Ie},or=yield Re(qr),Yr=yt?v:C;return{data:{pages:Yr(Pe.pages,or.data,ut),pageParams:Yr(Pe.pageParams,Ie,ut)},meta:or.meta}});return function Ee(_x121,_x122,_x123,_x124){return _ref44.apply(this,arguments)}}();function Re(_x125){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(Pe){let Ie,{extraOptions:ut,argSchema:yt,rawResponseSchema:qr,responseSchema:or}=Z;if(yt&&!Ia(ye,"arg")&&(Pe=yield Ta(yt,Pe,"argSchema",{})),He?Ie=He():Z.query?(Xe=b(Z,"transformResponse"),Ie=yield t(Z.query(Pe),Ue,ut)):Ie=yield Z.queryFn(Pe,Ue,ut,Mr=>t(Mr,Ue,ut)),typeof process<"u",Ie.error)throw new Ns(Ie.error,Ie.meta);let{data:Yr}=Ie;qr&&!Ia(ye,"rawResponse")&&(Yr=yield Ta(qr,Ie.data,"rawResponseSchema",Ie.meta));let fr=yield Xe(Yr,Ie.meta,Pe);return or&&!Ia(ye,"response")&&(fr=yield Ta(or,fr,"responseSchema",Ie.meta)),{...Ie,data:fr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:Pe}=Z,{maxPages:Ie=1/0}=Pe,ut=j.refetchCachedPages??Pe.refetchCachedPages??!0,yt,qr={pages:[],pageParams:[]},or=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,fr=R(j,ne())&&!j.direction||!or?qr:or;if("direction"in j&&j.direction&&fr.pages.length){let Mr=j.direction==="backward",id=(Mr?aF:_v)(Pe,fr,j.originalArgs);yt=yield Ee(fr,id,Ie,Mr)}else{let{initialPageParam:Mr=Pe.initialPageParam}=j,Su=or?.pageParams??[],id=Su[0]??Mr,v_=Su.length;if(yt=yield Ee(fr,id,Ie),He&&(yt={data:yt.data.pages[0]}),ut)for(let Vx=1;Vx<v_;Vx++){let A_=_v(Pe,yt.data,j.originalArgs);yt=yield Ee(yt.data,A_,Ie)}}ze=yt}else ze=yield Re(j.originalArgs);return ue&&!Ia(ye,"meta")&&ze.meta&&(ze.meta=yield Ta(ue,ze.meta,"metaSchema",ze.meta)),Y(ze.data,fl({fulfilledTimeStamp:Date.now(),baseQueryMeta:ze.meta}))}catch(Xe){let Ue=Xe;if(Ue instanceof Ns){let He=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:ze,errorResponseSchema:Ee}=Z,{value:Re,meta:Pe}=Ue;try{ze&&!Ia(ye,"rawErrorResponse")&&(Re=yield Ta(ze,Re,"rawErrorResponseSchema",Pe)),ue&&!Ia(ye,"meta")&&(Pe=yield Ta(ue,Pe,"metaSchema",Pe));let Ie=yield He(Re,Pe,j.originalArgs);return Ee&&!Ia(ye,"errorResponse")&&(Ie=yield Ta(Ee,Ie,"errorResponseSchema",Pe)),q(Ie,fl({baseQueryMeta:Pe}))}catch(Ie){Ue=Ie}}try{if(Ue instanceof oF){let He={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:Ve?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Ue,He),p?.(Ue,He);let{catchSchemaFailure:ze=f}=Z;if(ze)return q(ze(Ue,He),fl({baseQueryMeta:Ue._bqMeta}))}}catch(He){Ue=He}throw typeof process<"u",console.error(Ue),Ue}});return function w(_x119,_x120){return _ref43.apply(this,arguments)}}();function R(j,_){let N=i.selectQueryEntry(_,j.queryCacheKey),q=i.selectConfig(_).refetchOnMountOrArgChange,Y=N?.fulfilledTimeStamp,H=j.forceRefetch??(j.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let E=()=>xe(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return fl({startedTimeStamp:Date.now(),...(of(N)?{direction:_.direction}:{})})},condition(_,{getState:N}){let q=N(),Y=i.selectQueryEntry(q,_.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=_.originalArgs,te=Y?.originalArgs,Z=r[_.endpointName],ue=_.direction;return Ov(_)?!0:Y?.status==="pending"?!1:R(_,q)||nf(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),I=E(),k=E(),T=xe(`${e}/executeMutation`,w,{getPendingMeta(){return fl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,L=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=G(N)&&N.ifOlderThan,te=(ue=!0)=>{let ye={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,ye)},Z=o.endpoints[j].select(_)(Y());if(H)q(te());else if(ne){let ue=Z?.fulfilledTimeStamp;if(!ue){q(te());return}(Number(new Date)-Number(new Date(ue)))/1e3>=ne&&q(te())}else q(te(!1))};function V(j){return _=>_?.meta?.arg?.endpointName===j}function B(j,_){return{matchPending:Bi($d(j),V(_)),matchFulfilled:Bi(Hn(j),V(_)),matchRejected:Bi(Sa(j),V(_))}}return{queryThunk:I,mutationThunk:T,infiniteQueryThunk:k,prefetch:L,updateQueryData:h,upsertQueryData:x,patchQueryData:g,buildMatchThunkActions:B}}function _v(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function aF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function iF(e,t,r,n){return Mv(r[e.meta.arg.endpointName][t],Hn(e)?e.payload:void 0,Wu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function LR(e){return Wt(e)?Vd(e):e}function Jp(e,t,r){let n=e[t];n&&r(n)}function yl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function UR(e,t,r){let n=e[yl(t)];n&&r(n)}var Zp={};function kV({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=P(`${e}/resetApiState`);function v(V,B,j,_){var N;V[N=B.queryCacheKey]??(V[N]={status:Xn,endpointName:B.endpointName}),Jp(V,B.queryCacheKey,q=>{q.status=Tv,q.requestId=j&&q.requestId?q.requestId:_.requestId,B.originalArgs!==void 0&&(q.originalArgs=B.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];of(Y)&&"direction"in B&&(q.direction=B.direction)})}function C(V,B,j,_){Jp(V,B.arg.queryCacheKey,N=>{if(N.requestId!==B.requestId&&!_)return;let{merge:q}=o[B.arg.endpointName];if(N.status=ml,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=B,Z=ha(N.data,ue=>q(ue,j,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));N.data=Z}else N.data=j;}else N.data=o[B.arg.endpointName].structuralSharing??!0?WR(Wt(N.data)?HC(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=B.fulfilledTimeStamp})}let h=va({name:`${e}/queries`,initialState:Zp,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:B}}){delete V[B]},prepare:Gi()},cacheEntriesUpserted:{reducer(V,B){for(let j of B.payload){let{queryDescription:_,value:N}=j;v(V,_,!0,{arg:_,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),C(V,{arg:_,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:Sl,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[Hu]:!0,requestId:Ku(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:B,patches:j}}){Jp(V,B,_=>{_.data=lS(_.data,j.concat())})},prepare:Gi()}},extraReducers(V){V.addCase(t.pending,(B,{meta:j,meta:{arg:_}})=>{let N=Ov(_);v(B,_,N,j)}).addCase(t.fulfilled,(B,{meta:j,payload:_})=>{let N=Ov(j.arg);C(B,j,_,N)}).addCase(t.rejected,(B,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{Jp(B,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=gl,H.error=Y??q}})}).addMatcher(p,(B,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===ml||q?.status===gl)&&(B[N]=q)})}}),x=va({name:`${e}/mutations`,initialState:Zp,reducers:{removeMutationResult:{reducer(V,{payload:B}){let j=yl(B);j in V&&delete V[j]},prepare:Gi()}},extraReducers(V){V.addCase(r.pending,(B,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(B[yl(j)]={requestId:_,status:Tv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(B,{payload:j,meta:_})=>{_.arg.track&&UR(B,_,N=>{N.requestId===_.requestId&&(N.status=ml,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:j,error:_,meta:N})=>{N.arg.track&&UR(B,N,q=>{q.requestId===N.requestId&&(q.status=gl,q.error=j??_)})}).addMatcher(p,(B,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===ml||q?.status===gl)&&N!==q?.requestId&&(B[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,B){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of B.payload){R(V,q);for(let{type:H,id:ne}of Y){let te=(_=(j=V.tags)[H]??(j[H]={}))[N=ne||"__internal_without_id"]??(_[N]=[]);te.includes(q)||te.push(q)}V.keys[q]=Y}},prepare:Gi()}},extraReducers(V){V.addCase(h.actions.removeQueryResult,(B,{payload:{queryCacheKey:j}})=>{R(B,j)}).addMatcher(p,(B,j)=>{var N,q,Y;let{provided:_}=i(j);for(let[H,ne]of Object.entries(_.tags??{}))for(let[te,Z]of Object.entries(ne)){let ue=(q=(N=B.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let ye of Z)ue.includes(ye)||ue.push(ye),B.keys[ye]=_.keys[ye]}}).addMatcher(Jr(Hn(t),Wu(t)),(B,j)=>{E(B,[j])}).addMatcher(h.actions.cacheEntriesUpserted.match,(B,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));E(B,_)})}});function R(V,B){let j=LR(V.keys[B]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=LR(Y).filter(H=>H!==B))}delete V.keys[B]}function E(V,B){let j=B.map(_=>{let N=iF(_,"providesTags",o,f),{queryCacheKey:q}=_.meta.arg;return{queryCacheKey:q,providedTags:N}});w.caseReducers.updateProvidedBy(V,w.actions.updateProvidedBy(j))}let I=va({name:`${e}/subscriptions`,initialState:Zp,reducers:{updateSubscriptionOptions(V,B){},unsubscribeQueryResult(V,B){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:Zp,reducers:{subscriptionsUpdated:{reducer(V,B){return lS(V,B.payload)},prepare:Gi()}}}),T=va({name:`${e}/config`,initialState:{online:fV(),focused:pV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:B}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:V=>{V.addCase(qv,B=>{B.online=!0}).addCase(eF,B=>{B.online=!1}).addCase(Dv,B=>{B.focused=!0}).addCase(ZR,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),D=Li({queries:h.reducer,mutations:x.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(V,B)=>D(g.match(B)?void 0:V,B),L={...T.actions,...h.actions,...I.actions,...k.actions,...x.actions,...w.actions,resetApiState:g};return{reducer:G,actions:L}}var Pa=Symbol.for("RTKQ/skipToken"),sF={status:Xn},QR=ha(sF,()=>{}),BR=ha(sF,()=>{});function OV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>QR,o=I=>BR;return{buildQuerySelector:C,buildInfiniteQuerySelector:h,buildMutationSelector:x,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(I){return{...I,..._R(I.status)}}function i(I){return I[t]}function p(I){return i(I)?.queries}function f(I,k){return p(I)?.[k]}function m(I){return i(I)?.mutations}function g(I){return i(I)?.config}function v(I,k,T){return D=>{if(D===Pa)return r(n,T);let G=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(V=>f(V,G)??QR,T)}}function C(I,k){return v(I,k,a)}function h(I,k){let{infiniteQueryOptions:T}=k;function D(G){let L={...G,..._R(G.status)},{isLoading:V,isError:B,direction:j}=L,_=j==="forward",N=j==="backward";return{...L,hasNextPage:R(T,L.data,L.originalArgs),hasPreviousPage:E(T,L.data,L.originalArgs),isFetchingNextPage:V&&_,isFetchingPreviousPage:V&&N,isFetchNextPageError:B&&_,isFetchPreviousPageError:B&&N}}return v(I,k,D)}function x(){return I=>{let k;return typeof I=="object"?k=yl(I)??Pa:k=I,r(k===Pa?o:G=>i(G)?.mutations?.[k]??BR,a)}}function b(I,k){let T=I[t],D=new Set,G=Pv(k,Nv,nF);for(let L of G){let V=T.provided.tags[L.type];if(!V)continue;let B=(L.id!==void 0?V[L.id]:Object.values(V).flat())??[];for(let j of B)D.add(j)}return Array.from(D.values()).flatMap(L=>{let V=T.queries[L];return V?{queryCacheKey:L,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function w(I,k){return Pv(Object.values(p(I)),T=>T?.endpointName===k&&T.status!==Xn,T=>T.originalArgs)}function R(I,k,T){return k?_v(I,k,T)!=null:!1}function E(I,k,T){return!k||!I.getPreviousPageParam?!1:aF(I,k,T)!=null}}var GR=WeakMap?new WeakMap:void 0,$R=({endpointName:e,queryArgs:t})=>{let r="",n=GR?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Xr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Xr(t)&&GR?.set(t,o),r=o}return`${e}(${r})`};function _V(...e){return function(r){let n=Gu(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=$R;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;g=C=>{let h=v(C);return typeof h=="string"?h:$R({...C,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Ku(),extractRehydrationInfo:n,hasRehydrationInfo:Gu(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let v of m)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,C]of Object.entries(g))typeof C=="function"?C(Ds(a,v)):Object.assign(Ds(a,v)||{},C);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:v=>({...v,type:Sl}),mutation:v=>({...v,type:tF}),infiniteQuery:v=>({...v,type:rF})});for(let[v,C]of Object.entries(g)){if(m.overrideExisting!==!0&&v in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Yt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[v]=C;for(let h of p)h.injectEndpoint(v,C)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Yn(e,...t){return Object.assign(e,...t)}var NV=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(b,w)=>{if(p.match(w)){let{queryCacheKey:E,requestId:I,options:k}=w.payload,T=b.get(E);return T?.has(I)&&T.set(I,k),!0}if(f.match(w)){let{queryCacheKey:E,requestId:I}=w.payload,k=b.get(E);return k&&k.delete(I),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:E,requestId:I}}=w,k=ef(b,E.queryCacheKey,kv);return E.subscribe&&k.set(I,E.subscriptionOptions??k.get(I)??{}),!0}let R=!1;if(t.rejected.match(w)){let{meta:{condition:E,arg:I,requestId:k}}=w;if(E&&I.subscribe){let T=ef(b,I.queryCacheKey,kv);T.set(k,I.subscriptionOptions??T.get(k)??{}),R=!0}}return R},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function x(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,R])=>[w,Object.fromEntries(R)]))))}return(b,w)=>{if(a||(a=x(r.currentSubscriptions)),e.util.resetApiState.match(b))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(b))return[!1,h];let R=m(r.currentSubscriptions,b),E=!0;if(R){i||(i=setTimeout(()=>{let T=x(r.currentSubscriptions),[,D]=uS(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(D)),a=T,i=null},500));let I=typeof b.type=="string"&&!!b.type.startsWith(o),k=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;E=!I&&!k}return[E,!1]}},DV=2147483647/1e3-1,qV=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,C=Jr(g.match,r.fulfilled,r.rejected,v.match);function h(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let x={};function b(I){for(let k of I.values())k?.abort?.()}let w=(I,k)=>{let T=k.getState(),D=i(T);if(C(I)){let G;if(v.match(I))G=I.payload.map(L=>L.queryDescription.queryCacheKey);else{let{queryCacheKey:L}=g.match(I)?I.payload:I.meta.arg;G=[L]}R(G,k,D)}if(t.util.resetApiState.match(I)){for(let[G,L]of Object.entries(x))L&&clearTimeout(L),delete x[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),k,D)}};function R(I,k,T){let D=k.getState();for(let G of I){let L=a(D,G);L?.endpointName&&E(G,L.endpointName,k,T)}}function E(I,k,T,D){let L=Ds(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let V=Math.max(0,Math.min(L,DV));if(!h(I)){let B=x[I];B&&clearTimeout(B),x[I]=setTimeout(()=>{if(!h(I)){let j=a(T.getState(),I);j?.endpointName&&T.dispatch(p(j.endpointName,j.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:I}))}delete x[I]},V*1e3)}}return w},HR=new Error("Promise never resolved before cacheEntryRemoved."),MV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Hd(n),m=Hd(o),g=Hn(n,o),v={},{removeQueryResult:C,removeMutationResult:h,cacheEntriesUpserted:x}=e.internalActions;function b(T,D,G){let L=v[T];L?.valueResolved&&(L.valueResolved({data:D,meta:G}),delete L.valueResolved)}function w(T){let D=v[T];D&&(delete v[T],D.cacheEntryRemoved())}function R(T){let{arg:D,requestId:G}=T.meta,{endpointName:L,originalArgs:V}=D;return[L,V,G]}let E=(T,D,G)=>{let L=I(T);function V(B,j,_,N){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&k(B,N,j,D,_)}if(n.pending.match(T)){let[B,j,_]=R(T);V(B,L,_,j)}else if(x.match(T))for(let{queryDescription:B,value:j}of T.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=B;V(_,q,T.meta.requestId,N),b(q,j,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[L]){let[j,_,N]=R(T);k(j,_,L,D,N)}}else if(g(T))b(L,T.payload,T.meta.baseQueryMeta);else if(C.match(T)||h.match(T))w(L);else if(e.util.resetApiState.match(T))for(let B of Object.keys(v))w(B)};function I(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:C.match(T)?T.payload.queryCacheKey:h.match(T)?yl(T.payload):""}function k(T,D,G,L,V){let B=Ds(r,T),j=B?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw HR})]);q.catch(()=>{}),v[G]=_;let Y=e.endpoints[T].select(tf(B)?D:G),H=L.dispatch((Z,ue,ye)=>ye),ne={...L,getCacheEntry:()=>Y(L.getState()),requestId:V,extra:H,updateCachedData:tf(B)?Z=>L.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:N},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==HR)throw Z})}return E},VV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},jV=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Jr(Hn(n),Wu(n)),v=Jr(Hn(o,n),Sa(o,n)),C=[],h=0,x=(R,E)=>{(o.pending.match(R)||n.pending.match(R))&&h++,v(R)&&(h=Math.max(0,h-1)),g(R)?w(iF(R,"invalidatesTags",r,i),E):v(R)?w([],E):a.util.invalidateTags.match(R)&&w(Mv(R.payload,void 0,void 0,void 0,void 0,i),E)};function b(){return h>0}function w(R,E){let I=E.getState(),k=I[e];if(C.push(...R),k.config.invalidationBehavior==="delayed"&&b())return;let T=C;if(C=[],T.length===0)return;let D=a.util.selectInvalidatedBy(I,T);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:L}of G){let V=k.queries[L],B=ef(f.currentSubscriptions,L,kv);V&&(B.size===0?E.dispatch(m({queryCacheKey:L})):V.status!==Xn&&E.dispatch(p(V)))}})}return x},LV=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,R)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,R),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,R),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&v(w.meta.arg,R),r.util.resetApiState.match(w)&&(x(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,R){p.add(w),f||(f=setTimeout(()=>{for(let E of p)C({queryCacheKey:E},R);p.clear(),f=null},0))}function v({queryCacheKey:w},R){let E=R.getState()[e],I=E.queries[w],k=i.get(w);if(!I||I.status===Xn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let L=Date.now()+T;a.set(w,{nextPollTimestamp:L,pollingInterval:T,timeout:setTimeout(()=>{(E.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:w},R)},T)})}function C({queryCacheKey:w},R){let I=R.getState()[e].queries[w],k=i.get(w);if(!I||I.status===Xn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){h(w);return}let D=a.get(w),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:w},R)}function h(w){let R=a.get(w);R?.timeout&&clearTimeout(R.timeout),a.delete(w)}function x(){for(let w of a.keys())h(w)}function b(w=new Map){let R=!1,E=Number.POSITIVE_INFINITY;for(let I of w.values())I.pollingInterval&&(E=Math.min(I.pollingInterval,E),R=I.skipPollingIfUnfocused||R);return{lowestPollingInterval:E,skipPollingIfUnfocused:R}}return m},UV=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=$d(r,n),a=Sa(r,n),i=Hn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:v,arg:{endpointName:C,originalArgs:h}}=m.meta,x=Ds(t,C),b=x?.onQueryStarted;if(b){let w={},R=new Promise((T,D)=>{w.resolve=T,w.reject=D});R.catch(()=>{}),p[v]=w;let E=e.endpoints[C].select(tf(x)?h:v),I=g.dispatch((T,D,G)=>G),k={...g,getCacheEntry:()=>E(g.getState()),requestId:v,extra:I,updateCachedData:tf(x)?T=>g.dispatch(e.util.updateQueryData(C,h,T)):void 0,queryFulfilled:R};b(h,k)}}else if(i(m)){let{requestId:v,baseQueryMeta:C}=m.meta;p[v]?.resolve({data:m.payload,meta:C}),delete p[v]}else if(a(m)){let{requestId:v,rejectedWithValue:C,baseQueryMeta:h}=m.meta;p[v]?.reject({error:m.payload??m.error,isUnhandledError:!C,meta:h}),delete p[v]}}},QV=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Dv.match(f)&&p(m,"refetchOnFocus"),qv.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],v=g.queries,C=o.currentSubscriptions;t.batch(()=>{for(let h of C.keys()){let x=v[h],b=C.get(h);if(!b||!x)continue;let w=[...b.values()];(w.some(E=>E[m]===!0)||w.every(E=>E[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:h})):x.status!==Xn&&f.dispatch(n(x)))}})}return i};function BV(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=C=>C.type.startsWith(`${t}/`),m=[VV,qV,jV,LV,MV,UV];return{middleware:C=>{let h=!1,x=a(C.dispatch),b={...e,internalState:x,refetchQuery:v,isThisApiSliceAction:f,mwApi:C},w=m.map(I=>I(b)),R=NV(b),E=QV(b);return I=>k=>{if(!ku(k))return I(k);h||(h=!0,C.dispatch(n.internalActions.middlewareRegistered(i)));let T={...C,next:I},D=C.getState(),[G,L]=R(k,T,D),V;if(G?V=I(k):V=L,C.getState()[t]&&(E(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,D);return V}},actions:p};function v(C){return e.api.endpoints[C.endpointName].initiate(C.originalArgs,{subscribe:!1,forceRefetch:!0})}}var zR=Symbol(),GV=({createSelector:e=et}={})=>({name:zR,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:h},x){ZC();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:qv,onOffline:eF,onFocus:Dv,onFocusLost:ZR},util:{}});let w=OV({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:R,selectCachedArgsForQuery:E,buildQuerySelector:I,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Yn(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:E});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=PV({baseQuery:r,reducerPath:o,context:x,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:h}),{reducer:q,actions:Y}=kV({context:x,queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Yn(t.util,{patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Yn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>ef(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Xe,getRunningQueryThunk:Ue}=TV({queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:x,getInternalState:ne});Yn(t.util,{getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueryThunk:Ue,getRunningQueriesThunk:Xe});let{middleware:He,actions:ze}=BV({reducerPath:o,context:x,queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Ue,getInternalState:ne});return Yn(t.util,ze),Yn(t,{reducer:q,middleware:He}),{name:zR,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});nf(Re)&&Yn(Ie,{name:Ee,select:I(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),FV(Re)&&Yn(Ie,{name:Ee,select:T(),initiate:ue(Ee)},N(L,Ee)),of(Re)&&Yn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),cF=_V(GV());d();c();l();u();d();c();l();u();var ka=e=>e.query,uF=e=>e.query?.enableQuerySyntax;var lF=et(e=>ka(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),af=et(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var sf=e=>{if(e==="yes")return!0;if(e==="no")return!1},$V=()=>X("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function HV(e,t){return X({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??We(n),a=nl(n,e);if(!o||!a)return null;let i=Ca(n);return r.makeGeneratedAnswerCitationClick(Vw(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:jw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=nl(r,e);return{answerId:t??We(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function zV(e,t,r){return X({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??We(o),i=nl(o,e);if(!a||!i)return null;let p=Ca(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=nl(n,e);return{answerId:r??We(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function WV(e,t){return X({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function KV(e){return X({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"like"})})}function YV(e){return X({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"dislike"})})}var XV=e=>X({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=We(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=We(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:sf(o),documented:sf(a),correctTopic:sf(p),hallucinationFree:sf(i)},additionalNotes:m,correctAnswerUrl:f}}}),Jn=(e,t,r)=>X({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??We(o);if(!a)return null;let i=Ca(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??We(n)??"",answerGenerated:e??!1})}),Vo=e=>X({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),JV=()=>X({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"show"})}),ZV=()=>X({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"hide"})}),ej=()=>X({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"expand"})}),tj=()=>X({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"collapse"})});function rj(e){return X({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"copyToClipboard"})})}var jo={logCopyGeneratedAnswer:rj,logGeneratedAnswerHideAnswers:ZV,logGeneratedAnswerShowAnswers:JV,logGeneratedAnswerStreamEnd:Jn,logGeneratedAnswerFeedback:XV,logDislikeGeneratedAnswer:YV,logLikeGeneratedAnswer:KV,logGeneratedAnswerOpenInlineLink:WV,logHoverCitation:zV,logOpenGeneratedAnswerSource:HV,logRetryGeneratedAnswer:$V,logGeneratedAnswerExpand:ej,logGeneratedAnswerCollapse:tj};d();c();l();u();d();c();l();u();var dF=et(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Vv=e=>e.context;d();c();l();u();var jv=e=>e.pipeline;d();c();l();u();var Lv=e=>e.searchHub;d();c();l();u();var Lt=et(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),vie=et(e=>e,e=>{let t=Lt(e);return t&&e?e[t].expression:""});d();c();l();u();var pF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var fF=e=>e.excerptLength?.length;d();c();l();u();var cn=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,mF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var gF=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var hF=e=>e.sortCriteria;var yF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ji(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function yF(_x126){return _ref45.apply(this,arguments)}}(),SF=(e,t)=>{let r=ka(e)?.q,{aq:n,cq:o,dq:a,lq:i}=xF(e),p=Vv(e),f=Ur(e.configuration.analytics,t,{actionCause:Rv(e)}),m=Lv(e),g=jv(e),v=KS(e)??[],C=AF(e),h=Lt(e.tabSet)||"default",x=zS(e),b=Rw(e),w=t.referrer||"",R=mF(e),E=hF(e),I=nj(e),k=fF(e),T=gF(e),D=pF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:uF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(C.length&&{facets:C}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:bv(e),firstResult:e.pagination.firstResult}),tab:h,locale:x,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...I,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:E,...(R&&{facetOptions:R}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},vF=(e,t)=>{let r=ka(e)?.q,n=AF(e),o=Ur(e.configuration.analytics,t,{actionCause:Rv(e)}),a=zS(e),i=Lt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=xF(e),g=Lv(e),v=jv(e),C=Vv(e),h=KS(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(C?.contextValues&&{context:C.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},AF=e=>Yp(e)?.map(t=>hv(t,gv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),nj=e=>({actionsHistory:e.configuration.analytics.enabled?Xt.getInstance().getHistory():[]}),xF=e=>{let t=dF(e),r=wv(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var cf=["searching","thinking","answering"];function uf(e){return e.toLowerCase()}function Uv(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var CF=["text/plain","text/markdown"];var qs=new U({required:!0}),bF=new U,Ms=new pe({required:!0}),Qv={id:qs,title:qs,uri:qs,permanentid:qs,clickUri:bF},lf=new U({required:!0,constrainTo:CF}),wF=new U({required:!0,constrainTo:cf}),RF=e=>({...e,name:uf(e.name)}),Vs=P("generatedAnswer/setIsVisible",e=>O(e,Ms)),js=P("generatedAnswer/setAnswerId",e=>O(e,W)),df=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new U({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),vl=P("generatedAnswer/setIsEnabled",e=>O(e,Ms)),_a=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:qs})),Na=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new J({values:Qv})})})),Da=P("generatedAnswer/updateError",e=>O(e,{message:bF,code:new re({min:0})})),lr=P("generatedAnswer/resetAnswer"),pf=P("generatedAnswer/like"),ff=P("generatedAnswer/dislike"),mf=P("generatedAnswer/feedbackModal/open"),Al=P("generatedAnswer/expand"),gf=P("generatedAnswer/collapse"),hf=P("generatedAnswer/setId",e=>O(e,{id:new U({required:!0})})),yf=P("generatedAnswer/feedbackModal/close"),Ls=P("generatedAnswer/sendFeedback"),un=P("generatedAnswer/setIsLoading",e=>O(e,Ms)),Oa=P("generatedAnswer/setIsStreaming",e=>O(e,Ms)),qa=P("generatedAnswer/setAnswerContentFormat",e=>O(e,lf)),Sf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:lf,default:["text/plain"]})})),vf=P("knowledge/updateAnswerConfigurationId",e=>O(e,qs)),Af=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,wd)),xl=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,Ms)),Ma=P("generatedAnswer/setCannotAnswer",e=>O(e,Ms)),Bv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),xf=P("generatedAnswer/startStep",e=>O(RF(e),{name:wF,startedAt:new re({min:0,required:!0})})),Cf=P("generatedAnswer/finishStep",e=>O(RF(e),{name:wF,finishedAt:new re({min:0,required:!0})})),FF=xe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield yF(r),g=(h,x)=>{switch(h){case"genqa.headerMessageType":{let b=JSON.parse(x);n(qa(b.contentFormat));break}case"genqa.messageType":n(_a(JSON.parse(x)));break;case"genqa.citationsType":n(Na(JSON.parse(x)));break;case"genqa.endOfStreamType":{let b=JSON.parse(x).answerGenerated,{answerId:w,answer:R}=a().generatedAnswer,I=p.length!==0&&!b,k=!R?.trim();n(Ma(I)),n(Oa(!1)),n(xl(b)),n(Jn(b,w,b?k:void 0)),n(Vo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(un(!0));let v=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,C=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{v(m)&&(n(un(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{v(m)&&n(Da(h))},close:()=>{v(m)&&n(Oa(!1))},resetAnswer:()=>{v(m)&&n(lr())}});C?f(C):n(un(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),bf=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(lr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=SF(a,n);r(Bv(i)),yield r(wf(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x129,_x130){return _ref47.apply(this,arguments)}}());d();c();l();u();var oj=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=ji(n.configuration.search?.apiBaseUrl,i,a);return KR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,C={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{C[h]=g[h]}),C.duplex="half",C.body=yield g.text(),S(v,C)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function oj(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),Rf=cF({reducerPath:"answer",baseQuery:XR(oj,{maxRetries:3}),endpoints:()=>({})});var aj=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},ij=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(e.answer=n?.trim()?n.concat(r):r)},sj=(e,t)=>{e.citations=t.citations},cj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},uj=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},lj=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&uj(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(aj(t,o),r(qa(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(ij(t,o),r(_a({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(sj(t,o),r(Na({citations:o.citations})));break;case"genqa.endOfStreamType":{cj(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Jn(i,a,p)),r(Vo());break}}},dj=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Va=Rf.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x135,_x136){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:v}=i,C=ji(i.search.apiBaseUrl,m,g),h=dj(C,m,p.answerConfigurationId,f?.insightId);yield hd(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(x){let b=x.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(js(b))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:x=>{o(b=>{lj(x,b,a)})},onerror:x=>{throw x},onclose:()=>{o(x=>{a(Ma(!x.generated))})}})}).apply(this,arguments)}})})}),wf=e=>Va.endpoints.getAnswer.initiate(e),Gv=e=>{let t=af(e);return Va.endpoints.getAnswer.select(t??Pa)(e)};d();c();l();u();var EF=ae(Ao,e=>e);d();c();l();u();function pj(e){let t=e.payload?.analyticsAction;return IF(e)&&!fe(t)}function IF(e){return"type"in e}var TF=e=>t=>r=>{let n;pj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return IF(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var Us=P("tab/register",e=>{let t=new J({values:{id:W,expression:Be}});return O(e,t)}),ht=P("tab/updateActiveTab",e=>O(e,W));d();c();l();u();var Ff=Vr(kp(),1),OF=Vr(PF(),1),_F=Vr(kF(),1);Ff.default.extend(_F.default);Ff.default.extend(OF.default);var Qs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Ff.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var fj=/(^|; )Coveo-Pendragon=([^;]*)/,mj=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function NF(){return typeof window>"u"?!1:fj.exec(document.cookie)?.pop()||null}function DF(){return typeof window>"u"?!1:mj.test(document.cookie)}var Ef=ae(Qs(),e=>e.addCase(rn,(t,r)=>{gj(t,r.payload)}).addCase(vr,(t,r)=>{hj(t,r.payload)}).addCase(Ro,(t,r)=>{yj(t,r.payload)}).addCase(cs,t=>{t.analytics.enabled=!1}).addCase(us,t=>{t.analytics.enabled=!0}).addCase(Rp,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Fp,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ls,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{fe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Ep,(t,{payload:r})=>{Sj(t,r)}));function gj(e,t){fe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",fe(t.organizationId)||(e.organizationId=t.organizationId)}function hj(e,t){fe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),fe(t.locale)||(e.search.locale=t.locale),fe(t.timezone)||(e.search.timezone=t.timezone),fe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function yj(e,t){fe(t.enabled)||(e.analytics.enabled=t.enabled),fe(t.originContext)||(e.analytics.originContext=t.originContext),fe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),fe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),fe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),fe(t.trackingId)||(e.analytics.trackingId=t.trackingId),fe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),fe(t.source)||(e.analytics.source=t.source);try{let r=NF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}fe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),fe(t.anonymous)||(e.analytics.anonymous=t.anonymous),fe(t.deviceId)||(e.analytics.deviceId=t.deviceId),fe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),fe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function Sj(e,t){e.knowledge.agentId=t;try{let r=DF();fe(r)||(e.knowledge.debugAgentSession=!0)}catch{}}var me=Ef;d();c();l();u();function vj(e){return e.instantlyCallable}var qF=()=>e=>t=>e(vj(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function MF(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}d();c();l();u();var Kv,Aj=new Uint8Array(16);function Yv(){if(!Kv){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Kv=crypto.getRandomValues.bind(crypto)}return Kv(Aj)}d();c();l();u();d();c();l();u();var xj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xv={randomUUID:xj};function Cj(e,t,r){if(Xv.randomUUID&&!t&&!e)return Xv.randomUUID();e=e||{};let n=e.random??e.rng?.()??Yv();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 MF(n)}var Lo=Cj;d();c();l();u();d();c();l();u();var F={};Au(F,{BRAND:()=>Wj,DIRTY:()=>ja,EMPTY_PATH:()=>Fj,INVALID:()=>Ce,NEVER:()=>OL,OK:()=>Ut,ParseStatus:()=>Dt,Schema:()=>ke,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>Ua,ZodBoolean:()=>Qa,ZodBranded:()=>bl,ZodCatch:()=>Za,ZodDate:()=>Ba,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>Pf,ZodEffects:()=>Er,ZodEnum:()=>Ya,ZodError:()=>er,ZodFirstPartyTypeKind:()=>be,ZodFunction:()=>Of,ZodIntersection:()=>za,ZodIssueCode:()=>ee,ZodLazy:()=>Wa,ZodLiteral:()=>Ka,ZodMap:()=>Ws,ZodNaN:()=>Ys,ZodNativeEnum:()=>Xa,ZodNever:()=>Gr,ZodNull:()=>$a,ZodNullable:()=>pn,ZodNumber:()=>La,ZodObject:()=>tr,ZodOptional:()=>Rr,ZodParsedType:()=>le,ZodPipeline:()=>wl,ZodPromise:()=>Go,ZodReadonly:()=>ei,ZodRecord:()=>kf,ZodSchema:()=>ke,ZodSet:()=>Ks,ZodString:()=>Qo,ZodSymbol:()=>Hs,ZodTransformer:()=>Er,ZodTuple:()=>dn,ZodType:()=>ke,ZodUndefined:()=>Ga,ZodUnion:()=>Ha,ZodUnknown:()=>to,ZodVoid:()=>zs,addIssueToContext:()=>ce,any:()=>nL,array:()=>sL,bigint:()=>Jj,boolean:()=>WF,coerce:()=>kL,custom:()=>$F,date:()=>Zj,datetimeRegex:()=>BF,defaultErrorMap:()=>Zn,discriminatedUnion:()=>dL,effect:()=>bL,enum:()=>AL,function:()=>yL,getErrorMap:()=>Bs,getParsedType:()=>ln,instanceof:()=>Yj,intersection:()=>pL,isAborted:()=>If,isAsync:()=>Gs,isDirty:()=>Tf,isValid:()=>Uo,late:()=>Kj,lazy:()=>SL,literal:()=>vL,makeIssue:()=>Cl,map:()=>gL,nan:()=>Xj,nativeEnum:()=>xL,never:()=>aL,null:()=>rL,nullable:()=>RL,number:()=>zF,object:()=>cL,objectUtil:()=>Jv,oboolean:()=>PL,onumber:()=>TL,optional:()=>wL,ostring:()=>IL,pipeline:()=>EL,preprocess:()=>FL,promise:()=>CL,quotelessJson:()=>bj,record:()=>mL,set:()=>hL,setErrorMap:()=>Rj,strictObject:()=>uL,string:()=>HF,symbol:()=>eL,transformer:()=>bL,tuple:()=>fL,undefined:()=>tL,union:()=>lL,unknown:()=>oL,util:()=>De,void:()=>iL});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var De;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(De||(De={}));var Jv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Jv||(Jv={}));var le=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ln=e=>{switch(typeof e){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(e)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(e)?le.array:e===null?le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?le.promise:typeof Map<"u"&&e instanceof Map?le.map:typeof Set<"u"&&e instanceof Set?le.set:typeof Date<"u"&&e instanceof Date?le.date:le.object;default:return le.unknown}};var ee=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),bj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),er=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=e=>new er(e);var wj=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===le.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}},Zn=wj;var VF=Zn;function Rj(e){VF=e}function Bs(){return VF}d();c();l();u();var Cl=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},Fj=[];function ce(e,t){let r=Bs(),n=Cl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Zn?void 0:Zn].filter(o=>!!o)});e.common.issues.push(n)}var Dt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ce;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return Ce;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},Ce=Object.freeze({status:"aborted"}),ja=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),If=e=>e.status==="aborted",Tf=e=>e.status==="dirty",Uo=e=>e.status==="valid",Gs=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));var Fr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},jF=(e,t)=>{if(Uo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var ke=class{get description(){return this._def.description}_getType(t){return ln(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ln(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:ln(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Gs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ln(t)},o=this._parseSync({data:t,path:n.path,parent:n});return jF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ln(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Uo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Uo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:ln(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Gs(o)?o:Promise.resolve(o);return jF(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:ee.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Er({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Rr.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Go.create(this,this._def)}or(t){return Ha.create([this,t],this._def)}and(t){return za.create(this,t,this._def)}transform(t){return new Er({...Te(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new bl({typeName:be.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Za({...Te(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return wl.create(this,t)}readonly(){return ei.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ej=/^c[^\s-]{8,}$/i,Ij=/^[0-9a-z]+$/,Tj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Pj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kj=/^[a-z0-9_-]{21}$/i,Oj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_j=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Zv,qj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Vj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,UF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qj=new RegExp(`^${UF}$`);function QF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Bj(e){return new RegExp(`^${QF(e)}$`)}function BF(e){let t=`${UF}T${QF(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Gj(e,t){return!!((t==="v4"||!t)&&qj.test(e)||(t==="v6"||!t)&&Vj.test(e))}function $j(e,t){if(!Oj.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Hj(e,t){return!!((t==="v4"||!t)&&Mj.test(e)||(t==="v6"||!t)&&jj.test(e))}var Qo=class e extends ke{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==le.string){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.string,received:a.parsedType}),Ce}let n=new Dt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Nj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Zv||(Zv=new RegExp(Dj,"u")),Zv.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Pj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")kj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ej.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ij.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Tj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:ee.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:ee.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?BF(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Qj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Bj(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?_j.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Gj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?$j(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Hj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Lj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Uj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):De.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.invalid_string,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Qo.create=e=>new Qo({checks:[],typeName:be.ZodString,coerce:e?.coerce??!1,...Te(e)});function zj(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var La=class e extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==le.number){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.number,received:a.parsedType}),Ce}let n,o=new Dt;for(let a of this._def.checks)a.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?zj(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};La.create=e=>new La({checks:[],typeName:be.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var Ua=class e extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==le.bigint)return this._getInvalidInput(t);let n,o=new Dt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.bigint,received:r.parsedType}),Ce}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ua.create=e=>new Ua({checks:[],typeName:be.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Qa=class extends ke{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==le.boolean){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),Ce}return Ut(t.data)}};Qa.create=e=>new Qa({typeName:be.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Ba=class e extends ke{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==le.date){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.date,received:a.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),Ce}let n=new Dt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):De.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ba.create=e=>new Ba({checks:[],coerce:e?.coerce||!1,typeName:be.ZodDate,...Te(e)});var Hs=class extends ke{_parse(t){if(this._getType(t)!==le.symbol){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),Ce}return Ut(t.data)}};Hs.create=e=>new Hs({typeName:be.ZodSymbol,...Te(e)});var Ga=class extends ke{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),Ce}return Ut(t.data)}};Ga.create=e=>new Ga({typeName:be.ZodUndefined,...Te(e)});var $a=class extends ke{_parse(t){if(this._getType(t)!==le.null){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),Ce}return Ut(t.data)}};$a.create=e=>new $a({typeName:be.ZodNull,...Te(e)});var Bo=class extends ke{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Bo.create=e=>new Bo({typeName:be.ZodAny,...Te(e)});var to=class extends ke{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ut(t.data)}};to.create=e=>new to({typeName:be.ZodUnknown,...Te(e)});var Gr=class extends ke{_parse(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.never,received:r.parsedType}),Ce}};Gr.create=e=>new Gr({typeName:be.ZodNever,...Te(e)});var zs=class extends ke{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),Ce}return Ut(t.data)}};zs.create=e=>new zs({typeName:be.ZodVoid,...Te(e)});var ro=class e extends ke{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==le.array)return ce(r,{code:ee.invalid_type,expected:le.array,received:r.parsedType}),Ce;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ce(r,{code:i?ee.too_big:ee.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ce(r,{code:ee.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ce(r,{code:ee.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Fr(r,i,r.path,p)))).then(i=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Fr(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.toString(r)}})}nonempty(t){return this.min(1,t)}};ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...Te(t)});function $s(e){if(e instanceof tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Rr.create($s(n))}return new tr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:$s(e.element)}):e instanceof Rr?Rr.create($s(e.unwrap())):e instanceof pn?pn.create($s(e.unwrap())):e instanceof dn?dn.create(e.items.map(t=>$s(t))):e}var tr=class e extends ke{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=De.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==le.object){let m=this._getOrReturnCtx(t);return ce(m,{code:ee.invalid_type,expected:le.object,received:m.parsedType}),Ce}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Gr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],v=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Fr(o,v,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Gr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ce(o,{code:ee.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let v=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Fr(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let v=yield g.key,C=yield g.value;m.push({key:v,value:C,alwaysSet:g.alwaysSet})}return m})).then(m=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ge.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:be.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of De.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return $s(this)}partial(t){let r={};for(let n of De.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Rr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return GF(De.objectKeys(this.shape))}};tr.create=(e,t)=>new tr({shape:()=>e,unknownKeys:"strip",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});tr.strictCreate=(e,t)=>new tr({shape:()=>e,unknownKeys:"strict",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});tr.lazycreate=(e,t)=>new tr({shape:e,unknownKeys:"strip",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});var Ha=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new er(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),Ce}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x138){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new er(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),Ce}}get options(){return this._def.options}};Ha.create=(e,t)=>new Ha({options:e,typeName:be.ZodUnion,...Te(t)});var eo=e=>e instanceof Wa?eo(e.schema):e instanceof Er?eo(e.innerType()):e instanceof Ka?[e.value]:e instanceof Ya?e.options:e instanceof Xa?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ga?[void 0]:e instanceof $a?[null]:e instanceof Rr?[void 0,...eo(e.unwrap())]:e instanceof pn?[null,...eo(e.unwrap())]:e instanceof bl||e instanceof ei?eo(e.unwrap()):e instanceof Za?eo(e._def.innerType):[],Pf=class e extends ke{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.object)return ce(r,{code:ee.invalid_type,expected:le.object,received:r.parsedType}),Ce;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=eo(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:be.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Te(n)})}};function eA(e,t){let r=ln(e),n=ln(t);if(e===t)return{valid:!0,data:e};if(r===le.object&&n===le.object){let o=De.objectKeys(t),a=De.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=eA(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===le.array&&n===le.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=eA(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===le.date&&n===le.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var za=class extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(If(a)||If(i))return Ce;let p=eA(a.value,i.value);return p.valid?((Tf(a)||Tf(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};za.create=(e,t,r)=>new za({left:e,right:t,typeName:be.ZodIntersection,...Te(r)});var dn=class e extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.array)return ce(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),Ce;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Fr(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Dt.mergeArray(r,i)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};dn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new dn({items:e,typeName:be.ZodTuple,rest:null,...Te(t)})};var kf=class e extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.object)return ce(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),Ce;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Fr(n,p,n.path,p)),value:i._parse(new Fr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Dt.mergeObjectAsync(r,o):Dt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ke?new e({keyType:t,valueType:r,typeName:be.ZodRecord,...Te(n)}):new e({keyType:Qo.create(),valueType:t,typeName:be.ZodRecord,...Te(r)})}},Ws=class extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.map)return ce(n,{code:ee.invalid_type,expected:le.map,received:n.parsedType}),Ce;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Fr(n,p,n.path,[m,"key"])),value:a._parse(new Fr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Ws.create=(e,t,r)=>new Ws({valueType:t,keyType:e,typeName:be.ZodMap,...Te(r)});var Ks=class e extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.set)return ce(n,{code:ee.invalid_type,expected:le.set,received:n.parsedType}),Ce;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ce(n,{code:ee.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(ce(n,{code:ee.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return Ce;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Fr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ks.create=(e,t)=>new Ks({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...Te(t)});var Of=class e extends ke{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.function)return ce(r,{code:ee.invalid_type,expected:le.function,received:r.parsedType}),Ce;function n(p,f){return Cl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return Cl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Go){let p=this;return Ut(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new er([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),v=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(v,a).catch(h=>{throw m.addIssue(o(v,h)),m})}))}else{let p=this;return Ut(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new er([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),v=p._def.returns.safeParse(g,a);if(!v.success)throw new er([o(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:dn.create(t).rest(to.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||dn.create([]).rest(to.create()),returns:r||to.create(),typeName:be.ZodFunction,...Te(n)})}},Wa=class extends ke{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Wa.create=(e,t)=>new Wa({getter:e,typeName:be.ZodLazy,...Te(t)});var Ka=class extends ke{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ka.create=(e,t)=>new Ka({value:e,typeName:be.ZodLiteral,...Te(t)});function GF(e,t){return new Ya({values:e,typeName:be.ZodEnum,...Te(t)})}var Ya=class e extends ke{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),Ce}return Ut(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ya.create=GF;var Xa=class extends ke{_parse(t){let r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==le.string&&n.parsedType!==le.number){let o=De.objectValues(r);return ce(n,{expected:De.joinValues(o),received:n.parsedType,code:ee.invalid_type}),Ce}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:o}),Ce}return Ut(t.data)}get enum(){return this._def.values}};Xa.create=(e,t)=>new Xa({values:e,typeName:be.ZodNativeEnum,...Te(t)});var Go=class extends ke{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:le.promise,received:r.parsedType}),Ce;let n=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Ut(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Go.create=(e,t)=>new Go({type:e,typeName:be.ZodPromise,...Te(t)});var Er=class extends ke{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ce(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return Ce;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?Ce:f.status==="dirty"?ja(f.value):r.value==="dirty"?ja(f.value):f});return function(_x139){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return Ce;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?Ce:p.status==="dirty"?ja(p.value):r.value==="dirty"?ja(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Uo(i))return Ce;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Uo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):Ce);De.assertNever(o)}};Er.create=(e,t,r)=>new Er({schema:e,typeName:be.ZodEffects,effect:t,...Te(r)});Er.createWithPreprocess=(e,t,r)=>new Er({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...Te(r)});var Rr=class extends ke{_parse(t){return this._getType(t)===le.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Rr.create=(e,t)=>new Rr({innerType:e,typeName:be.ZodOptional,...Te(t)});var pn=class extends ke{_parse(t){return this._getType(t)===le.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};pn.create=(e,t)=>new pn({innerType:e,typeName:be.ZodNullable,...Te(t)});var Ja=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===le.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Za=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Gs(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Za.create=(e,t)=>new Za({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Ys=class extends ke{_parse(t){if(this._getType(t)!==le.nan){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),Ce}return{status:"valid",value:t.data}}};Ys.create=e=>new Ys({typeName:be.ZodNaN,...Te(e)});var Wj=Symbol("zod_brand"),bl=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},wl=class e extends ke{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),ja(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ce:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:be.ZodPipeline})}},ei=class extends ke{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return Gs(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};ei.create=(e,t)=>new ei({innerType:e,typeName:be.ZodReadonly,...Te(t)});function LF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function $F(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=LF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=LF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var Kj={object:tr.lazycreate},be;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(be||(be={}));var Yj=(e,t={message:`Input not instance of ${e.name}`})=>$F(r=>r instanceof e,t),HF=Qo.create,zF=La.create,Xj=Ys.create,Jj=Ua.create,WF=Qa.create,Zj=Ba.create,eL=Hs.create,tL=Ga.create,rL=$a.create,nL=Bo.create,oL=to.create,aL=Gr.create,iL=zs.create,sL=ro.create,cL=tr.create,uL=tr.strictCreate,lL=Ha.create,dL=Pf.create,pL=za.create,fL=dn.create,mL=kf.create,gL=Ws.create,hL=Ks.create,yL=Of.create,SL=Wa.create,vL=Ka.create,AL=Ya.create,xL=Xa.create,CL=Go.create,bL=Er.create,wL=Rr.create,RL=pn.create,FL=Er.createWithPreprocess,EL=wl.create,IL=()=>HF().optional(),TL=()=>zF().optional(),PL=()=>WF().optional(),kL={string:e=>Qo.create({...e,coerce:!0}),number:e=>La.create({...e,coerce:!0}),boolean:e=>Qa.create({...e,coerce:!0}),bigint:e=>Ua.create({...e,coerce:!0}),date:e=>Ba.create({...e,coerce:!0})};var OL=Ce;var _L=F.object({name:F.string(),arguments:F.string()}),NL=F.object({id:F.string(),type:F.literal("function"),function:_L,encryptedValue:F.string().optional()}),_f=F.object({id:F.string(),role:F.string(),content:F.string().optional(),name:F.string().optional(),encryptedValue:F.string().optional()}),DL=F.object({type:F.literal("text"),text:F.string()}),qL=F.object({type:F.literal("data"),value:F.string(),mimeType:F.string()}),ML=F.object({type:F.literal("url"),value:F.string(),mimeType:F.string().optional()}),Nf=F.discriminatedUnion("type",[qL,ML]),VL=F.object({type:F.literal("image"),source:Nf,metadata:F.unknown().optional()}),jL=F.object({type:F.literal("audio"),source:Nf,metadata:F.unknown().optional()}),LL=F.object({type:F.literal("video"),source:Nf,metadata:F.unknown().optional()}),UL=F.object({type:F.literal("document"),source:Nf,metadata:F.unknown().optional()});var KF=F.object({type:F.literal("binary"),mimeType:F.string(),id:F.string().optional(),url:F.string().optional(),data:F.string().optional(),filename:F.string().optional()}),YF=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:F.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},tde=KF.superRefine((e,t)=>{YF(e,t)}),QL=F.discriminatedUnion("type",[DL,VL,jL,LL,UL,KF]),BL=QL.superRefine((e,t)=>{e.type==="binary"&&YF(e,t)}),GL=_f.extend({role:F.literal("developer"),content:F.string()}),$L=_f.extend({role:F.literal("system"),content:F.string()}),HL=_f.extend({role:F.literal("assistant"),content:F.string().optional(),toolCalls:F.array(NL).optional()}),zL=_f.extend({role:F.literal("user"),content:F.union([F.string(),F.array(BL)])}),WL=F.object({id:F.string(),content:F.string(),role:F.literal("tool"),toolCallId:F.string(),error:F.string().optional(),encryptedValue:F.string().optional()}),KL=F.object({id:F.string(),role:F.literal("activity"),activityType:F.string(),content:F.record(F.any())}),YL=F.object({id:F.string(),role:F.literal("reasoning"),content:F.string(),encryptedValue:F.string().optional()}),XF=F.discriminatedUnion("role",[GL,$L,HL,zL,WL,KL,YL]),rde=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user"),F.literal("tool"),F.literal("activity"),F.literal("reasoning")]),XL=F.object({description:F.string(),value:F.string()}),JF=F.object({name:F.string(),description:F.string(),parameters:F.any(),metadata:F.record(F.any()).optional()}),JL=F.object({threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),state:F.any(),messages:F.array(XF),tools:F.array(JF),context:F.array(XL),forwardedProps:F.any()}),ZL=F.any(),nt=class extends Error{constructor(e){super(e)}},tA=class extends nt{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},eU=F.object({name:F.string(),description:F.string().optional()}),tU=F.object({name:F.string().optional(),type:F.string().optional(),description:F.string().optional(),version:F.string().optional(),provider:F.string().optional(),documentationUrl:F.string().optional(),metadata:F.record(F.unknown()).optional()}),rU=F.object({streaming:F.boolean().optional(),websocket:F.boolean().optional(),httpBinary:F.boolean().optional(),pushNotifications:F.boolean().optional(),resumable:F.boolean().optional()}),nU=F.object({supported:F.boolean().optional(),items:F.array(JF).optional(),parallelCalls:F.boolean().optional(),clientProvided:F.boolean().optional()}),oU=F.object({structuredOutput:F.boolean().optional(),supportedMimeTypes:F.array(F.string()).optional()}),aU=F.object({snapshots:F.boolean().optional(),deltas:F.boolean().optional(),memory:F.boolean().optional(),persistentState:F.boolean().optional()}),iU=F.object({supported:F.boolean().optional(),delegation:F.boolean().optional(),handoffs:F.boolean().optional(),subAgents:F.array(eU).optional()}),sU=F.object({supported:F.boolean().optional(),streaming:F.boolean().optional(),encrypted:F.boolean().optional()}),cU=F.object({image:F.boolean().optional(),audio:F.boolean().optional(),video:F.boolean().optional(),pdf:F.boolean().optional(),file:F.boolean().optional()}),uU=F.object({image:F.boolean().optional(),audio:F.boolean().optional()}),lU=F.object({input:cU.optional(),output:uU.optional()}),dU=F.object({codeExecution:F.boolean().optional(),sandboxed:F.boolean().optional(),maxIterations:F.number().optional(),maxExecutionTime:F.number().optional()}),pU=F.object({supported:F.boolean().optional(),approvals:F.boolean().optional(),interventions:F.boolean().optional(),feedback:F.boolean().optional()}),nde=F.object({identity:tU.optional(),transport:rU.optional(),tools:nU.optional(),output:oU.optional(),state:aU.optional(),multiAgent:iU.optional(),reasoning:sU.optional(),multimodal:lU.optional(),execution:dU.optional(),humanInTheLoop:pU.optional(),custom:F.record(F.unknown()).optional()}),ZF=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user")]),M=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),je=F.object({type:F.nativeEnum(M),timestamp:F.number().optional(),rawEvent:F.any().optional()}).passthrough(),fU=je.extend({type:F.literal(M.TEXT_MESSAGE_START),messageId:F.string(),role:ZF.default("assistant"),name:F.string().optional()}),eE=je.extend({type:F.literal(M.TEXT_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),mU=je.extend({type:F.literal(M.TEXT_MESSAGE_END),messageId:F.string()}),gU=je.extend({type:F.literal(M.TEXT_MESSAGE_CHUNK),messageId:F.string().optional(),role:ZF.optional(),delta:F.string().optional(),name:F.string().optional()}),hU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_START)}),yU=eE.omit({messageId:!0,type:!0}).extend({type:F.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),SU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_END)}),vU=je.extend({type:F.literal(M.TOOL_CALL_START),toolCallId:F.string(),toolCallName:F.string(),parentMessageId:F.string().optional()}),AU=je.extend({type:F.literal(M.TOOL_CALL_ARGS),toolCallId:F.string(),delta:F.string()}),xU=je.extend({type:F.literal(M.TOOL_CALL_END),toolCallId:F.string()}),CU=je.extend({messageId:F.string(),type:F.literal(M.TOOL_CALL_RESULT),toolCallId:F.string(),content:F.string(),role:F.literal("tool").optional()}),bU=je.extend({type:F.literal(M.TOOL_CALL_CHUNK),toolCallId:F.string().optional(),toolCallName:F.string().optional(),parentMessageId:F.string().optional(),delta:F.string().optional()}),wU=je.extend({type:F.literal(M.THINKING_START),title:F.string().optional()}),RU=je.extend({type:F.literal(M.THINKING_END)}),FU=je.extend({type:F.literal(M.STATE_SNAPSHOT),snapshot:ZL}),EU=je.extend({type:F.literal(M.STATE_DELTA),delta:F.array(F.any())}),IU=je.extend({type:F.literal(M.MESSAGES_SNAPSHOT),messages:F.array(XF)}),TU=je.extend({type:F.literal(M.ACTIVITY_SNAPSHOT),messageId:F.string(),activityType:F.string(),content:F.record(F.any()),replace:F.boolean().optional().default(!0)}),PU=je.extend({type:F.literal(M.ACTIVITY_DELTA),messageId:F.string(),activityType:F.string(),patch:F.array(F.any())}),kU=je.extend({type:F.literal(M.RAW),event:F.any(),source:F.string().optional()}),OU=je.extend({type:F.literal(M.CUSTOM),name:F.string(),value:F.any()}),_U=je.extend({type:F.literal(M.RUN_STARTED),threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),input:JL.optional()}),NU=je.extend({type:F.literal(M.RUN_FINISHED),threadId:F.string(),runId:F.string(),result:F.any().optional()}),DU=je.extend({type:F.literal(M.RUN_ERROR),message:F.string(),code:F.string().optional()}),qU=je.extend({type:F.literal(M.STEP_STARTED),stepName:F.string()}),MU=je.extend({type:F.literal(M.STEP_FINISHED),stepName:F.string()}),VU=F.union([F.literal("tool-call"),F.literal("message")]),jU=je.extend({type:F.literal(M.REASONING_START),messageId:F.string()}),LU=je.extend({type:F.literal(M.REASONING_MESSAGE_START),messageId:F.string(),role:F.literal("reasoning")}),UU=je.extend({type:F.literal(M.REASONING_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),QU=je.extend({type:F.literal(M.REASONING_MESSAGE_END),messageId:F.string()}),BU=je.extend({type:F.literal(M.REASONING_MESSAGE_CHUNK),messageId:F.string().optional(),delta:F.string().optional()}),GU=je.extend({type:F.literal(M.REASONING_END),messageId:F.string()}),$U=je.extend({type:F.literal(M.REASONING_ENCRYPTED_VALUE),subtype:VU,entityId:F.string(),encryptedValue:F.string()}),Df=F.discriminatedUnion("type",[fU,eE,mU,gU,wU,RU,hU,yU,SU,vU,AU,xU,bU,CU,FU,EU,IU,TU,PU,kU,OU,_U,NU,DU,qU,MU,jU,LU,UU,QU,BU,GU,$U]);d();c();l();u();var rA={};Au(rA,{JsonPatchError:()=>at,_areEquals:()=>El,applyOperation:()=>ti,applyPatch:()=>Qf,applyReducer:()=>YU,deepClone:()=>WU,getValueByPointer:()=>Lf,validate:()=>rE,validator:()=>Uf});d();c();l();u();d();c();l();u();var HU=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),zU=Object.prototype.hasOwnProperty;function Mf(e,t){return zU.call(e,t)}function Vf(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Mf(e,o)&&n.push(o);return n}function qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function jf(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function fn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Rl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function qf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(qf(e[t]))return!0}else if(typeof e=="object"){for(var n=Vf(e),o=n.length,a=0;a<o;a++)if(qf(e[n[a]]))return!0}}return!1}function tE(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
33
33
  `)}var Fl=function(e){HU(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,tE(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=tE(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=Fl,WU=qt,Xs={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Lf(r,this.path);n&&(n=qt(n));var o=ti(r,{op:"remove",path:this.from}).removed;return ti(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Lf(r,this.from);return ti(r,{op:"add",path:this.path,value:qt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:El(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},KU={add:function(e,t,r){return jf(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Xs.move,copy:Xs.copy,test:Xs.test,_get:Xs._get};function Lf(e,t){if(t=="")return e;var r={op:"_get",path:t};return ti(e,r),r.value}function ti(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):Uf(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=Lf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=El(e,t.value),i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=qt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,v=f.length,C=void 0,h=void 0,x=void 0;for(typeof r=="function"?x=r:x=Uf;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=Rl(h)),o&&(h=="__proto__"||h=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&C===void 0&&(m[h]===void 0?C=f.slice(0,g).join("/"):g==v-1&&(C=t.path),C!==void 0&&x(t,0,e,C)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!jf(h))throw new at("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);jf(h)&&(h=~~h)}if(g>=v){if(r&&t.op==="add"&&h>m.length)throw new at("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=KU[t.op].call(t,m,h,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=v){var i=Xs[t.op].call(t,m,h,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[h],r&&g<v&&(!m||typeof m!="object"))throw new at("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Qf(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=qt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=ti(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function YU(e,t,r){var n=ti(e,t);if(n.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Uf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new at("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Xs[e.op]){if(typeof e.path!="string")throw new at("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new at("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new at("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&qf(e.value))throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new at("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new at("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=rE([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new at("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function rE(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Qf(qt(t),qt(e),r||!0);else{r=r||Uf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof at)return o;throw o}}function El(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!El(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!El(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var iA={};Au(iA,{compare:()=>oQ,generate:()=>nA,observe:()=>nQ,unobserve:()=>rQ});d();c();l();u();var oA=new WeakMap,XU=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),JU=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function ZU(e){return oA.get(e)}function eQ(e,t){return e.observers.get(t)}function tQ(e,t){e.observers.delete(t.callback)}function rQ(e,t){t.unobserve()}function nQ(e,t){var r=[],n,o=ZU(e);if(!o)o=new XU(e),oA.set(e,o);else{var a=eQ(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=qt(e),t){n.callback=t,n.next=null;var i=function(){nA(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){nA(n),clearTimeout(n.next),tQ(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new JU(t,n)),n}function nA(e,t){t===void 0&&(t=!1);var r=oA.get(e.object);aA(r.value,e.object,e.patches,"",t),e.patches.length&&Qf(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function aA(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Vf(t),i=Vf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],v=e[g];if(Mf(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var C=t[g];typeof v=="object"&&v!=null&&typeof C=="object"&&C!=null&&Array.isArray(v)===Array.isArray(C)?aA(v,C,r,n+"/"+fn(g),o):v!==C&&(p=!0,o&&r.push({op:"test",path:n+"/"+fn(g),value:qt(v)}),r.push({op:"replace",path:n+"/"+fn(g),value:qt(C)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+fn(g),value:qt(v)}),r.push({op:"remove",path:n+"/"+fn(g)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var g=a[m];!Mf(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+fn(g),value:qt(t[g])})}}}function oQ(e,t,r){r===void 0&&(r=!1);var n=[];return aA(e,t,n,"",r),n}var Bf=Object.assign({},rA,iA,{JsonPatchError:Fl,deepClone:qt,escapePathComponent:fn,unescapePathComponent:Rl});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var sA=function(e,t){return sA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},sA(e,t)};function mn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");sA(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function nE(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function Gf(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function no(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Js(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Zs(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function ri(e){return this instanceof ri?(this.v=e,this):new ri(e)}function oE(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(h){return function(x){return Promise.resolve(x).then(h,v)}}function p(h,x){n[h]&&(o[h]=function(b){return new Promise(function(w,R){a.push([h,b,w,R])>1||f(h,b)})},x&&(o[h]=x(o[h])))}function f(h,x){try{m(n[h](x))}catch(b){C(a[0][3],b)}}function m(h){h.value instanceof ri?Promise.resolve(h.value.v).then(g,v):C(a[0][2],h)}function g(h){f("next",h)}function v(h){f("throw",h)}function C(h,x){h(x),a.shift(),a.length&&f(a[0][0],a[0][1])}}function aE(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof no=="function"?no(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function Ne(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function ec(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var $f=ec(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
34
34
  `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
35
35
  `):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Il(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var tc=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=no(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(b){t={error:b}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var g=this.initialTeardown;if(Ne(g))try{g()}catch(b){a=b instanceof $f?b.errors:[b]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var C=no(v),h=C.next();!h.done;h=C.next()){var x=h.value;try{iE(x)}catch(b){a=a??[],b instanceof $f?a=Zs(Zs([],Js(a)),Js(b.errors)):a.push(b)}}}catch(b){n={error:b}}finally{try{h&&!h.done&&(o=C.return)&&o.call(C)}finally{if(n)throw n.error}}}if(a)throw new $f(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)iE(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Il(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Il(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var cA=tc.EMPTY;function Hf(e){return e instanceof tc||e&&"closed"in e&&Ne(e.remove)&&Ne(e.add)&&Ne(e.unsubscribe)}function iE(e){Ne(e)?e():e.unsubscribe()}d();c();l();u();var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var rc={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=rc.delegate;return o?.setTimeout?o.setTimeout.apply(o,Zs([e,t],Js(r))):setTimeout.apply(void 0,Zs([e,t],Js(r)))},clearTimeout:function(e){var t=rc.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function zf(e){rc.setTimeout(function(){var t=$r.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function Tl(){}d();c();l();u();var sE=function(){return uA("C",void 0,void 0)}();function cE(e){return uA("E",void 0,e)}function uE(e){return uA("N",e,void 0)}function uA(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var ni=null;function nc(e){if($r.useDeprecatedSynchronousErrorHandling){var t=!ni;if(t&&(ni={errorThrown:!1,error:null}),e(),t){var r=ni,n=r.errorThrown,o=r.error;if(ni=null,n)throw o}}else e()}function lE(e){$r.useDeprecatedSynchronousErrorHandling&&ni&&(ni.errorThrown=!0,ni.error=e)}var Pl=function(e){mn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Hf(r)&&r.add(n)):n.destination=cQ,n}return t.create=function(r,n,o){return new Kf(r,n,o)},t.prototype.next=function(r){this.isStopped?dA(uE(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?dA(cE(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?dA(sE,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(tc);var aQ=Function.prototype.bind;function lA(e,t){return aQ.call(e,t)}var iQ=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Wf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Wf(n)}else Wf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Wf(r)}},e}(),Kf=function(e){mn(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Ne(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&$r.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&lA(r.next,p),error:r.error&&lA(r.error,p),complete:r.complete&&lA(r.complete,p)}):i=r}return a.destination=new iQ(i),a}return t}(Pl);function Wf(e){$r.useDeprecatedSynchronousErrorHandling?lE(e):zf(e)}function sQ(e){throw e}function dA(e,t){var r=$r.onStoppedNotification;r&&rc.setTimeout(function(){return r(e,t)})}var cQ={closed:!0,next:Tl,error:sQ,complete:Tl};d();c();l();u();var oc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function ac(e){return e}function Yf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pA(e)}function pA(e){return e.length===0?ac:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Je=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=lQ(t)?t:new Kf(t,r,n);return nc(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=dE(r),new r(function(o,a){var i=new Kf({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[oc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return pA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=dE(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function dE(e){var t;return(t=e??$r.Promise)!==null&&t!==void 0?t:Promise}function uQ(e){return e&&Ne(e.next)&&Ne(e.error)&&Ne(e.complete)}function lQ(e){return e&&e instanceof Pl||uQ(e)&&Hf(e)}d();c();l();u();function dQ(e){return Ne(e?.lift)}function mt(e){return function(t){if(dQ(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function xt(e,t,r,n,o){return new pQ(e,t,r,n,o)}var pQ=function(e){mn(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(Pl);d();c();l();u();d();c();l();u();var pE=ec(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var gn=function(e){mn(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new fE(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new pE},t.prototype.next=function(r){var n=this;nc(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=no(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;nc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;nc(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?cA:(this.currentObservers=null,p.push(r),new tc(function(){n.currentObservers=null,Il(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new Je;return r.source=this,r},t.create=function(r,n){return new fE(r,n)},t}(Je);var fE=function(e){mn(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:cA},t}(gn);d();c();l();u();d();c();l();u();var fA={now:function(){return(fA.delegate||Date).now()},delegate:void 0};var Xf=function(e){mn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=fA);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,g=1;g<a.length&&a[g]<=f;g+=2)m=g;m&&a.splice(0,m+1)}},t}(gn);d();c();l();u();var Jf=new Je(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function mE(e){return e&&Ne(e.schedule)}function fQ(e){return e[e.length-1]}function gE(e){return mE(fQ(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Zf=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function em(e){return Ne(e?.then)}d();c();l();u();function tm(e){return Ne(e[oc])}d();c();l();u();function rm(e){return Symbol.asyncIterator&&Ne(e?.[Symbol.asyncIterator])}d();c();l();u();function nm(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function mQ(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var om=mQ();function am(e){return Ne(e?.[om])}d();c();l();u();function im(e){return oE(this,arguments,function(){var r,n,o,a;return Gf(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,ri(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,ri(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,ri(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function sm(e){return Ne(e?.getReader)}function Ct(e){if(e instanceof Je)return e;if(e!=null){if(tm(e))return gQ(e);if(Zf(e))return hQ(e);if(em(e))return yQ(e);if(rm(e))return hE(e);if(am(e))return SQ(e);if(sm(e))return vQ(e)}throw nm(e)}function gQ(e){return new Je(function(t){var r=e[oc]();if(Ne(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function hQ(e){return new Je(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function yQ(e){return new Je(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,zf)})}function SQ(e){return new Je(function(t){var r,n;try{for(var o=no(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function hE(e){return new Je(function(t){AQ(e,t).catch(function(r){return t.error(r)})})}function vQ(e){return hE(im(e))}function AQ(e,t){var r,n,o,a;return nE(this,void 0,void 0,function(){var i,p;return Gf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=aE(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function Ir(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function cm(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(xt(n,function(o){return Ir(n,e,function(){return n.next(o)},t)},function(){return Ir(n,e,function(){return n.complete()},t)},function(o){return Ir(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function um(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function yE(e,t){return Ct(e).pipe(um(t),cm(t))}d();c();l();u();function SE(e,t){return Ct(e).pipe(um(t),cm(t))}d();c();l();u();function vE(e,t){return new Je(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function AE(e,t){return new Je(function(r){var n;return Ir(r,t,function(){n=e[om](),Ir(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return Ne(n?.return)&&n.return()}})}d();c();l();u();function lm(e,t){if(!e)throw new Error("Iterable cannot be null");return new Je(function(r){Ir(r,t,function(){var n=e[Symbol.asyncIterator]();Ir(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function xE(e,t){return lm(im(e),t)}function CE(e,t){if(e!=null){if(tm(e))return yE(e,t);if(Zf(e))return vE(e,t);if(em(e))return SE(e,t);if(rm(e))return lm(e,t);if(am(e))return AE(e,t);if(sm(e))return xE(e,t)}throw nm(e)}function oi(e,t){return t?CE(e,t):Ct(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=gE(e);return oi(e,r)}d();c();l();u();function Ze(e,t){var r=Ne(e)?e:function(){return e},n=function(o){return o.error(r())};return new Je(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var bE=ec(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function dm(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new bE)}})})}d();c();l();u();function ai(e,t){return mt(function(r,n){var o=0;r.subscribe(xt(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function wE(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,v=!1,C=function(){v&&!f.length&&!m&&t.complete()},h=function(b){return m<n?x(b):f.push(b)},x=function(b){a&&t.next(b),m++;var w=!1;Ct(r(b,g++)).subscribe(xt(t,function(R){o?.(R),a?h(R):t.next(R)},function(){w=!0},void 0,function(){if(w)try{m--;for(var R=function(){var E=f.shift();i?Ir(t,i,function(){return x(E)}):x(E)};f.length&&m<n;)R();C()}catch(E){t.error(E)}}))};return e.subscribe(xt(t,h,function(){v=!0,C()})),function(){p?.()}}function rr(e,t,r){return r===void 0&&(r=1/0),Ne(t)?rr(function(n,o){return ai(function(a,i){return t(n,a,o,i)})(Ct(e(n,o)))},r):(typeof t=="number"&&(r=t),mt(function(n,o){return wE(n,o,e,r)}))}function mA(e){return e===void 0&&(e=1/0),rr(ac,e)}d();c();l();u();function pm(e){return new Je(function(t){Ct(e()).subscribe(t)})}d();c();l();u();function kl(e){return mt(function(t,r){var n=null,o=!1,a;n=t.subscribe(xt(r,void 0,void 0,function(i){a=Ct(e(i,kl(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function fm(e,t){return Ne(t)?rr(e,t,1):rr(e,1)}d();c();l();u();function gA(e){return mt(function(t,r){var n=!1;t.subscribe(xt(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function ii(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function hA(e,t){return mt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(xt(n,function(f){o?.unsubscribe();var m=0,g=a++;Ct(e(f,g)).subscribe(o=xt(n,function(v){return n.next(t?t(f,v,g,m++):v)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function mm(e){return mt(function(t,r){Ct(e).subscribe(xt(r,function(){return r.complete()},Tl)),!r.closed&&t.subscribe(r)})}d();c();l();u();function yA(e,t,r){var n=Ne(e)||t||r?{next:e,error:t,complete:r}:e;return n?mt(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(xt(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):ac}d();c();l();u();d();c();l();u();function RE(e){return` \r
@@ -79,4 +79,4 @@ fast-json-patch/module/duplex.mjs:
79
79
  *)
80
80
  */if(__exports!=exports)module.exports=exports;return module.exports});
81
81
 
82
- window.coveoQuanticVersion = '3.39.0';
82
+ window.coveoQuanticVersion = '3.40.0';