1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4682],{98411:function(e,t,r){r.r(t),r.d(t,{DefaultFieldsToInclude:function(){return _c},EcommerceDefaultFieldsToInclude:function(){return $c},HighlightUtils:function(){return U},MinimumFieldsToInclude:function(){return Pc},ResultTemplatesHelpers:function(){return Jd},buildContext:function(){return Hd},buildController:function(){return Td},buildDictionaryFieldContext:function(){return Bd},buildInteractiveResult:function(){return Ud},buildRecommendationEngine:function(){return sc},buildRecommendationList:function(){return Fd},buildResultTemplatesManager:function(){return Wd},getOrganizationEndpoints:function(){return ke},getSampleRecommendationEngineConfiguration:function(){return ac},loadAdvancedSearchQueryActions:function(){return fc},loadClickAnalyticsActions:function(){return Bc},loadConfigurationActions:function(){return uc},loadContextActions:function(){return Sc},loadDebugActions:function(){return zc},loadDictionaryFieldContextActions:function(){return qc},loadFieldActions:function(){return Lc},loadPaginationActions:function(){return Ed},loadPipelineActions:function(){return Vc},loadRecommendationActions:function(){return Hc},loadSearchConfigurationActions:function(){return cc},loadSearchHubActions:function(){return Nc}});r(34155);var n=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,c=r(91960),l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),d=(e,t,r)=>(r=null!=e?n(s(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of o(t))!u.call(e,s)&&s!==r&&i(e,s,{get:()=>t[s],enumerable:!(n=a(t,s))||n.enumerable});return e})(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),p=(e,t,r)=>((e,t,r)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),h=l(((e,t)=>{function r(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e);return t<0?void 0:t}t.exports=function(e){if(0===arguments.length)throw new TypeError("1 argument required, but only 0 present.");if((e=(e=`${e}`).replace(/[ \t\n\f\r]/g,"")).length%4===0&&(e=e.replace(/==?$/,"")),e.length%4===1||/[^+/0-9A-Za-z]/.test(e))return null;let t="",n=0,i=0;for(let a=0;a<e.length;a++)n<<=6,n|=r(e[a]),i+=6,24===i&&(t+=String.fromCharCode((16711680&n)>>16),t+=String.fromCharCode((65280&n)>>8),t+=String.fromCharCode(255&n),n=i=0);return 12===i?(n>>=4,t+=String.fromCharCode(n)):18===i&&(n>>=2,t+=String.fromCharCode((65280&n)>>8),t+=String.fromCharCode(255&n)),t}})),f=l(((e,t)=>{function r(e){if(e>=0&&e<64)return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e]}t.exports=function(e){if(0===arguments.length)throw new TypeError("1 argument required, but only 0 present.");let t;for(e=`${e}`,t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return null;let n="";for(t=0;t<e.length;t+=3){let i=[void 0,void 0,void 0,void 0];i[0]=e.charCodeAt(t)>>2,i[1]=(3&e.charCodeAt(t))<<4,e.length>t+1&&(i[1]|=e.charCodeAt(t+1)>>4,i[2]=(15&e.charCodeAt(t+1))<<2),e.length>t+2&&(i[2]|=e.charCodeAt(t+2)>>6,i[3]=63&e.charCodeAt(t+2));for(let e=0;e<i.length;e++)typeof i[e]>"u"?n+="=":n+=r(i[e])}return n}})),g=l(((e,t)=>{var r=h(),n=f();t.exports={atob:r,btoa:n}})),m=l(((e,t)=>{t.exports=fetch})),y=l((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};e.getSanitizedOptions=function(e){var n=t(t({},r),e);return n.numOfAttempts<1&&(n.numOfAttempts=1),n}})),v=l((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fullJitter=function(e){var t=Math.random()*e;return Math.round(t)}})),w=l((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.noJitter=function(e){return e}})),b=l((e=>
1{Object.defineProperty(e,"__esModule",{value:!0});var t=v(),r=w();e.JitterFactory=function(e){return"full"===e.jitter?t.fullJitter:r.noJitter}})),S=l((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=b(),r=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise((function(t){return setTimeout(t,e.jitteredDelay)}))},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return t.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var e=this.options.startingDelay,t=this.options.timeMultiple,r=this.numOfDelayedAttempts,n=e*Math.pow(t,r);return Math.min(n,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();e.Delay=r})),k=l((e=>{var t=e&&e.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),r=e&&e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(t)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(o,s)}u((n=n.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(s){a=[6,s],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.prototype.apply=function(){return r(this,void 0,void 0,(function(){return n(this,(function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]}))}))},Object.defineProperty(i.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),i}(S().Delay);e.SkipFirstDelay=i})),C=l((e=>{var t=e&&e.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),r}(S().Delay);e.AlwaysDelay=r})),I=l((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=k(),r=C();e.DelayFactory=function(e,n){var i=function(e){return e.delayFirstAttempt?new r.AlwaysDelay(e):new t.SkipFirstDelay(e)}(e);return i.setAttemptNumber(n),i}})),A=l((e=>{var t=e&&e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(t)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(o,s)}u((n=n.apply(e,t||[])).next())}))},r=e&&e.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;
1function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(s){a=[6,s],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var n=y(),i=I();e.backOff=function(e,i){return void 0===i&&(i={}),t(this,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return t=n.getSanitizedOptions(i),[4,new a(e,t).execute()];case 1:return[2,r.sent()]}}))}))};var a=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return t(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}}))}))},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return t(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,i.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}}))}))},e}()})),q=l(((e,t)=>{var r=typeof self<"u"?self:typeof window<"u"?window:void 0;if(!r)throw new Error("Unable to find global scope. Are you sure this is running in the browser?");if(!r.AbortController)throw new Error('Could not find "AbortController" in the global scope. You need to polyfill it first');t.exports.AbortController=r.AbortController})),O=l(((e,t)=>{var r,n;r=e,n=function(){var e=6e4,t=36e5,r="millisecond",n="second",i="minute",a="hour",o="day",s="week",u="month",c="quarter",l="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},m=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},y={s:m,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+m(n,2,"0")+":"+m(i,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,u),a=r-i<0,o=t.clone().add(n+(a?-1:1),u);return+(-(n+(r-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:l,w:s,d:o,D:d,h:a,m:i,s:n,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",w={};w[v]=g;var b="$isDayjsObject",S=function(e){return e instanceof A||!(!e||!e[b])},k=function e(t,r,n){var i;if(!t)return v;if("string"==typeof t){var a=t.toLowerCase();w[a]&&(i=a),r&&(w[a]=r,i=a);var o=t.split("-");if(!i&&o.length>1)return e(o[0])}else{var s=t.name;w[s]=t,i=s}return!n&&i&&(v=i),i||!n&&v},C=function(e,t){if(S(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new A(r)},I=y;I.l=k,I.i=S,I.w=function(e,t){return C(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var A=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var m=g.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(I.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return I},m.isValid=function(){return this.$d.toString()!==p},m.isSame=function(e,t){var r=C(e);return this.startOf(t)<=r&&r<=this.endOf(t)},m.isAfter=function(e,t){return C(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<C(e)},m.$g=function(e,t,r){return I.u(e)?this[t]:this.set(r,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var r=this,c=!!I.u(t)||t,p=I.p(e),h=function(e,t){var n=I.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return c?n:n.endOf(o)},f=function(e,t){return I.w(r.toDate()[e].apply(r.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},g=this.$W,m=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case l:return c?h(1,0):h(31,11);case u:return c?h(1,m):h(0,m+1);case s:var w=this.$locale().weekStart||0,b=(g<w?g+7:g)-w;return h(c?y-b:y+(6-b),m);case o:case d:return f(v+"Hours",0);case a:return f(v+"Minutes",1);case i:return f(v+"Seconds",2);case n:return f(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var s,c=I.p(e),p="set"+(this.$u?"UTC":""),h=(s={},s[o]=p+"Date",s[d]=p+"Date",s[u]=p+"Month",s[l]=p+"FullYear",s[a]=p+"Hours",s[i]=p+"Minutes",s[n]=p+"Seconds",s[r]=p+"Milliseconds",s)[c],f=c===o?this.$D+(t-this.$W):t;if(c===u||c===l){var g=this.clone().set(d,1);g.$d[h](f),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[I.p(e)]()},m.add=function(r,c){var d,p=this;r=Number(r);var h=I.p(c),f=function(e){var t=C(p);return I.w(t.date(t.date()+Math.round(e*r)),p)};if(h===u)return this.set(u,this.$M+r);if(h===l)return this.set(l,this.$y+r);if(h===o)return f(1);if(h===s)return f(7);var g=(d={},d[i]=e,d[a]=t,d[n]=1e3,d)[h]||1,m=this.$d.getTime()+r*g;return I.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=I.z(this),a=this.$H,o=this.$m,s=this.$M,u=r.weekdays,c=r.months,l=r.meridiem,d=function(e,r,i,a){return e&&(e[r]||e(t,n))||i[r].slice(0,a)},h=function(e){return I.s(a%12||12,e,"0")},g=l||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(f,(function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return I.s(t.$y,4,"0");case"M":return s+1;case"MM":return I.s(s+1,2,"0");case"MMM":return d(r.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return I.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(r.weekdaysMin,t.$W,u,2);case"ddd":return d(r.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(a);case"HH":return I.s(a,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return g(a,o,!0);case"A":return g(a,o,!1);case"m":return String(o);case"mm":return I.s(o,2,"0");case"s":return String(t.$s);case"ss":return I.s(t.$s,2,"0");case"SSS":return I.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))}
1,m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,p){var h,f=this,g=I.p(d),m=C(r),y=(m.utcOffset()-this.utcOffset())*e,v=this-m,w=function(){return I.m(f,m)};switch(g){case l:h=w()/12;break;case u:h=w();break;case c:h=w()/3;break;case s:h=(v-y)/6048e5;break;case o:h=(v-y)/864e5;break;case a:h=v/t;break;case i:h=v/e;break;case n:h=v/1e3;break;default:h=v}return p?h:I.a(h)},m.daysInMonth=function(){return this.endOf(u).$D},m.$locale=function(){return w[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=k(e,t,!0);return n&&(r.$L=n),r},m.clone=function(){return I.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},g}(),q=A.prototype;return C.prototype=q,[["$ms",r],["$s",n],["$m",i],["$H",a],["$W",o],["$M",u],["$y",l],["$D",d]].forEach((function(e){q[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),C.extend=function(e,t){return e.$i||(e(t,A,C),e.$i=!0),C},C.locale=k,C.isDayjs=S,C.unix=function(e){return C(1e3*e)},C.en=w[v],C.Ls=w,C.p={},C},"object"==typeof e&&typeof t<"u"?t.exports=n():"function"==typeof define&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self).dayjs=n()})),R=l(((e,t)=>{var r,n;r=e,n=function(){var e="month",t="quarter";return function(r,n){var i=n.prototype;i.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var a=i.add;i.add=function(r,n){return r=Number(r),this.$utils().p(n)===t?this.add(3*r,e):a.bind(this)(r,n)};var o=i.startOf;i.startOf=function(r,n){var i=this.$utils(),a=!!i.u(n)||n;if(i.p(r)===t){var s=this.quarter()-1;return a?this.month(3*s).startOf(e).startOf("day"):this.month(3*s+2).endOf(e).endOf("day")}return o.bind(this)(r,n)}}},"object"==typeof e&&typeof t<"u"?t.exports=n():"function"==typeof define&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self).dayjs_plugin_quarterOfYear=n()})),x=l(((e,t)=>{var r,n;r=e,n=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,n=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},o=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e||"Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),r=60*t[1]+(+t[2]||0);return 0===r?0:"+"===t[0]?-r:r}(e)}],c=function(e){var t=a[e];return t&&(t.indexOf?t:t.s.concat(t.f))},l=function(e,t){var r,n=a.meridiem;if(n){for(var i=1;i<=24;i+=1)if(e.indexOf(n(i,0,t))>-1){r=i>12;break}}else r=e===(t?"pm":"PM");return r},d={A:[i,function(e){this.afternoon=l(e,!1)}],a:[i,function(e){this.afternoon=l(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,s("seconds")],ss:[n,s("seconds")],m:[n,s("minutes")],mm:[n,s("minutes")],H:[n,s("hours")],h:[n,s("hours")],HH:[n,s("hours")],hh:[n,s("hours")],D:[n,s("day")],DD:[r,s("day")],Do:[i,function(e){var t=a.ordinal,r=e.match(/\d+/);if(this.day=r[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],M:[n,s("month")],MM:[r,s("month")],MMM:[i,function(e){var t=c("months"),r=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[r,function(e){this.year=o(e)}],YYYY:[/\d{4}/,s("year")],Z:u,ZZ:u};return function(r,n,i){i.p.customParseFormat=!0,r&&r.parseTwoDigitYear&&(o=r.parseTwoDigitYear);var s=n.prototype,u=s.parse;s.parse=function(r){var n=r.date,o=r.utc,s=r.args;this.$u=o;var c=s[1];if("string"==typeof c){var l=!0===s[2],p=!0===s[3],h=l||p,f=s[2];p&&(f=s[2]),a=this.$locale(),!l&&f&&(a=i.Ls[f]),this.$d=function(r,n,i){try{if(["x","X"].indexOf(n)>-1)return new Date(("X"===n?1e3:1)*r);var o=function(r){var n,i;n=r,i=a&&a.formats;for(var o=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,n){var a=n&&n.toUpperCase();return r||i[n]||e[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,r){return t||r.slice(1)}))}))).match(t),s=o.length,u=0;u<s;
1u+=1){var c=o[u],l=d[c],p=l&&l[0],h=l&&l[1];o[u]=h?{regex:p,parser:h}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},r=0,n=0;r<s;r+=1){var i=o[r];if("string"==typeof i)n+=i.length;else{var a=i.regex,u=i.parser,c=e.slice(n),l=a.exec(c)[0];u.call(t,l),e=e.replace(l,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var r=e.hours;t?r<12&&(e.hours+=12):12===r&&(e.hours=0),delete e.afternoon}}(t),t}}(n)(r),s=o.year,u=o.month,c=o.day,l=o.hours,p=o.minutes,h=o.seconds,f=o.milliseconds,g=o.zone,m=new Date,y=c||(s||u?1:m.getDate()),v=s||m.getFullYear(),w=0;s&&!u||(w=u>0?u-1:m.getMonth());var b=l||0,S=p||0,k=h||0,C=f||0;return g?new Date(Date.UTC(v,w,y,b,S,k,C+60*g.offset*1e3)):i?new Date(Date.UTC(v,w,y,b,S,k,C)):new Date(v,w,y,b,S,k,C)}catch{return new Date("")}}(n,c,o),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),h&&n!=this.format(c)&&(this.$d=new Date("")),a={}}else if(c instanceof Array)for(var g=c.length,m=1;m<=g;m+=1){s[1]=c[m-1];var y=i.apply(this,s);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}m===g&&(this.$d=new Date(""))}else u.call(this,r)}}},"object"==typeof e&&typeof t<"u"?t.exports=n():"function"==typeof define&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self).dayjs_plugin_customParseFormat=n()})),D=l(((e,t)=>{var r=/(^|; )Coveo-Pendragon=([^;]*)/;t.exports=()=>r.exec(document.cookie)?.pop()||null})),E=l(((e,t)=>{var r,n;r=e,n=function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,i){var a,o=function(e,r,n){void 0===n&&(n={});var i=new Date(e);return function(e,r){void 0===r&&(r={});var n=r.timeZoneName||"short",i=e+"|"+n,a=t[i];return a||(a=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),t[i]=a),a}(r,n).formatToParts(i)},s=function(t,r){for(var n=o(t,r),a=[],s=0;s<n.length;s+=1){var u=n[s],c=u.type,l=u.value,d=e[c];d>=0&&(a[d]=parseInt(l,10))}var p=a[3],h=24===p?0:p,f=a[0]+"-"+a[1]+"-"+a[2]+" "+h+":"+a[4]+":"+a[5]+":000",g=+t;return(i.utc(f).valueOf()-(g-=g%1e3))/6e4},u=n.prototype;u.tz=function(e,t){void 0===e&&(e=a);var r,n=this.utcOffset(),o=this.toDate(),s=o.toLocaleString("en-US",{timeZone:e}),u=Math.round((o-new Date(s))/1e3/60),c=15*-Math.round(o.getTimezoneOffset()/15)-u;if(Number(c)){if(r=i(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var l=r.utcOffset();r=r.add(n-l,"minute")}}else r=this.utcOffset(0,t);return r.$x.$timezone=e,r},u.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),r=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return r&&r.value};var c=u.startOf;u.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var r=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(r,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,r){var n=r&&t,o=r||t||a,u=s(+i(),o);if("string"!=typeof e)return i(e).tz(o);var c=function(e,t,r){var n=e-60*t*1e3,i=s(n,r);if(t===i)return[n,t];var a=s(n-=60*(i-t)*1e3,r);return i===a?[n,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(i.utc(e,n).valueOf(),u,o),l=c[0],d=c[1],p=i(l).utcOffset(d);return p.$x.$timezone=o,p},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}},"object"==typeof e&&typeof t<"u"?t.exports=n():"function"==typeof define&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self).dayjs_plugin_timezone=n()})),T=l(((e,t)=>{var r,n;r=e,n=function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,a){var o=i.prototype;a.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},o.utc=function(t){var r=a(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var u=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else u.call(this)};var c=o.utcOffset;o.utcOffset=function(n,i){var a=this.$utils().u;if(a(n))return this.$u?0:a(this.$offset)?c.call(this):this.$offset;if("string"==typeof n&&null===(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],a=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===a?o:-o}(n)))return this;var o=Math.abs(n)<=16?60*n:n,s=this;if(i)return s.$offset=o,s.$u=0===n,s;if(0!==n){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(o+u,e)).$offset=o,s.$x.$localOffset=u}else s=this.utc();return s};var l=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=o.diff;o.diff=function(e,t,r){if(e&&this.$u===e.$u)return p.call(this,e,t,r);var n=this.local(),i=a(e).local();return p.call(n,i,t,r)}}}
1,"object"==typeof e&&typeof t<"u"?t.exports=n():"function"==typeof define&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self).dayjs_plugin_utc=n()})),M=l(((e,t)=>{function r(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}t.exports=function(e,t,n){var i=n&&n.stringify||r;if("object"==typeof e&&null!==e){var a=t.length+1;if(1===a)return e;var o=new Array(a);o[0]=i(e);for(var s=1;s<a;s++)o[s]=i(t[s]);return o.join(" ")}if("string"!=typeof e)return e;var u=t.length;if(0===u)return e;for(var c="",l=0,d=-1,p=e&&e.length||0,h=0;h<p;){if(37===e.charCodeAt(h)&&h+1<p){switch(d=d>-1?d:0,e.charCodeAt(h+1)){case 100:case 102:if(l>=u||null==t[l])break;d<h&&(c+=e.slice(d,h)),c+=Number(t[l]),d=h+2,h++;break;case 105:if(l>=u||null==t[l])break;d<h&&(c+=e.slice(d,h)),c+=Math.floor(Number(t[l])),d=h+2,h++;break;case 79:case 111:case 106:if(l>=u||void 0===t[l])break;d<h&&(c+=e.slice(d,h));var f=typeof t[l];if("string"===f){c+="'"+t[l]+"'",d=h+2,h++;break}if("function"===f){c+=t[l].name||"<anonymous>",d=h+2,h++;break}c+=i(t[l]),d=h+2,h++;break;case 115:if(l>=u)break;d<h&&(c+=e.slice(d,h)),c+=String(t[l]),d=h+2,h++;break;case 37:d<h&&(c+=e.slice(d,h)),c+="%",d=h+2,h++,l--}++l}++h}return-1===d?e:(d<p&&(c+=e.slice(d)),c)}})),F=l(((e,t)=>{var r=M();t.exports=l;var n=function(){function e(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}().console||{},i={mapHttpRequest:v,mapHttpResponse:v,wrapRequestSerializer:w,wrapResponseSerializer:w,wrapErrorSerializer:w,req:v,res:v,err:m,errWithCause:m};function a(e,t){return"silent"===e?1/0:t.levels.values[e]}var o=Symbol("pino.logFuncs"),s=Symbol("pino.hierarchy"),u={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function c(e,t){let r={logger:t,parent:e[s]};t[s]=r}function l(e){(e=e||{}).browser=e.browser||{};let t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");let r=e.browser.write||n;e.browser.write&&(e.browser.asObject=!0);let i=e.serializers||{},s=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,i),p=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(p=!1);let f=Object.keys(e.customLevels||{}),m=["error","fatal","warn","info","debug","trace"].concat(f);"function"==typeof r&&m.forEach((function(e){r[e]=r})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let v=e.level||"info",w=Object.create(r);w.log||(w.log=b),function(e,t,r){let i={};t.forEach((e=>{i[e]=r[e]?r[e]:n[e]||n[u[e]||"log"]||b})),e[o]=i}(w,m,r),c({},w),Object.defineProperty(w,"levelVal",{get:function(){return a(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,S,w,"error"),d(this,S,w,"fatal"),d(this,S,w,"warn"),d(this,S,w,"info"),d(this,S,w,"debug"),d(this,S,w,"trace"),f.forEach((e=>{d(this,S,w,e)}))}});let S={transmit:t,serialize:s,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:m,timestamp:y(e)};return w.levels=function(e){let t=e.customLevels||{},r=Object.assign({},l.levels.values,t),n=Object.assign({},l.levels.labels,function(e){let t={};return Object.keys(e).forEach((function(r){t[e[r]]=r})),t}(t));return{values:r,labels:n}}(e),w.level=v,w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=b,w.serializers=i,w._serialize=s,w._stdErrSerialize=p,w.child=function(r,n){if(!r)throw new Error("missing bindings for child Pino");n=n||{},s&&r.serializers&&(n.serializers=r.serializers);let a=n.serializers;if(s&&a){var o=Object.assign({},i,a),u=!0===e.browser.serialize?Object.keys(o):s;delete r.serializers,h([r],u,o,this._stdErrSerialize)}function l(e){this._childLevel=1+(0|e._childLevel),this.bindings=r,o&&(this.serializers=o,this._serialize=u),t&&(this._logEvent=g([].concat(e._logEvent.bindings,r)))}l.prototype=this;let d=new l(this);return c(this,d),d.level=this.level,d},t&&(w._logEvent=g()),w}function d(e,t,r,i){if(Object.defineProperty(e,i,{value:a(e.level,r)>a(i,r)?b:r[o][i],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[i]===b)return;e[i]=function(e,t,r,i){return function(o){return function(){let s=t.timestamp(),u=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var l=0;l<u.length;l++)u[l]=arguments[l];if(t.serialize&&!t.asObject&&h(u,this._serialize,this.serializers,this._stdErrSerialize),t.asObject||t.formatters?o.call(c,p(this,i,u,s,t.formatters)):o.apply(c,u),t.transmit){let n=t.transmit.level||e._level,o=r.levels.values[n],c=r.levels.values[i];if(c<o)return;f(this,{ts:s,methodLevel:i,methodValue:c,transmitLevel:n,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:a(e._level,r)},u)}}}(e[o][i])}(e,t,r,i);let u=function(e){let t=[];e.bindings&&t.push(e.bindings);
1let r=e[s];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==u.length&&(e[i]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(u,e[i]))}function p(e,t,n,i,a={}){let{level:o=(()=>e.levels.values[t]),log:s=(e=>e)}=a;e._serialize&&h(n,e._serialize,e.serializers,e._stdErrSerialize);let u=n.slice(),c=u[0],l={};i&&(l.time=i),l.level=o(t,e.levels.values[t]);let d=1+(0|e._childLevel);if(d<1&&(d=1),null!==c&&"object"==typeof c){for(;d--&&"object"==typeof u[0];)Object.assign(l,u.shift());c=u.length?r(u.shift(),u):void 0}else"string"==typeof c&&(c=r(u.shift(),u));return void 0!==c&&(l.msg=c),s(l)}function h(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=l.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i]))for(let n in e[i])t&&t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function f(e,t,r){let n=t.send,i=t.ts,a=t.methodLevel,o=t.methodValue,s=t.val,u=e._logEvent.bindings;h(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter((function(e){return-1===u.indexOf(e)})),e._logEvent.level.label=a,e._logEvent.level.value=o,n(a,e._logEvent,s),e._logEvent=g(u)}function g(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function m(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function y(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?S:k}function v(){return{}}function w(e){return e}function b(){}function S(){return!1}function k(){return Date.now()}l.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},l.stdSerializers=i,l.stdTimeFunctions=Object.assign({},{nullTime:S,epochTime:k,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),t.exports.default=l,t.exports.pino=l})),j=()=>r.g.crypto,U={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(U,{escape:()=>oe,getHighlightedSuggestion:()=>ie,highlightString:()=>ne});var P=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},_=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];
1for(let i in this.definition){let e=this.definition[i].validate(r[i]);e&&n.push(`${i}: ${e}`)}if(n.length)throw function(e,t){let r=`\n The following properties are invalid:\n\n ${e.join("\n\t")}\n \n ${t}\n `;return new P(r)}(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;void 0!==r&&(e[t]=r)}return e}},$=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&L(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return!0===this.baseConfig.required}};function Q(e){return void 0===e}function L(e){return Q(e)||function(e){return null===e}(e)}var V=class{constructor(e={}){this.config=e,this.value=new $(e)}validate(e){return this.value.validate(e)||(function(e){return Q(e)||N(e)}(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 N(e){return"number"==typeof e&&!isNaN(e)}var z=class{constructor(e={}){this.value=new $(e)}validate(e){return this.value.validate(e)||(function(e){return Q(e)||H(e)}(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function H(e){return"boolean"==typeof e}var B=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i,Y=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,W=class{constructor(e={}){this.config={emptyAllowed:!0,url:!1,...e},this.value=new $(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:a}=this.config;return this.value.validate(e)||(Q(e)?null:G(e)?t||e.length?r&&!B.test(e)?"value is not a valid URL.":n&&!n.test(e)?`value did not match provided regex ${n}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:!a||Y.test(e)&&"Invalid Date"!==new Date(e).toString()?null:"value is not a valid ISO8601 date string":"value is an empty string.":"value is not a string.")}get default(){return this.value.default}get required(){return this.value.required}};function G(e){return"[object String]"===Object.prototype.toString.call(e)}var K=class{constructor(e={}){this.config={options:{required:!1},values:{},...e}}validate(e){if(Q(e))return this.config.options.required?"value is required and is currently undefined":null;if(!J(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&L(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],a=n.validate(i);null!==a&&(t+=" "+a)}return""===t?null:t}get default(){}get required(){return!!this.config.options.required}};function J(e){return void 0!==e&&"object"==typeof e}var Z=class{constructor(e={}){this.config=e,this.value=new $(this.config)}validate(e){if(!L(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(null!==t)return t;if(L(e))return null;if(void 0!==this.config.max&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(void 0!==this.config.min&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(void 0!==this.config.each){let t="";return e.forEach((r=>{this.config.each.required&&L(r)&&(t=`value is null or undefined: ${e.join(",")}`);let n=this.validatePrimitiveValue(r,this.config.each);null!==n&&(t+=" "+n)})),""===t?null:t}return null}validatePrimitiveValue(e,t){return H(e)||G(e)||N(e)||J(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};var X=class{constructor(e){this.config=e,this.value=new $(e)}validate(e){let t=this.value.validate(e);return null!==t?t:Q(e)||Object.values(this.config.enum).find((t=>t===e))?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d(g());function ee(e){return""===e.trim()}var te=new Set(["1",1,"yes",!0]);function re(e){if("object"!=typeof e||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function ne(e){if(ee(e.openingDelimiter)||ee(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(L(e.content)||ee(e.content))return e.content;if(0===e.highlights.length)return oe(e.content);let t=e.content.length,r="",n=0;for(let i=0;i<e.highlights.length;i++){let a=e.highlights[i],o=a.offset,s=o+a.length;if(s>t)break;r+=oe(e.content.slice(n,o)),r+=e.openingDelimiter,r+=oe(e.content.slice(o,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=oe(e.content.slice(n))),r}function ie(e,t){return(e=oe(e)).replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,((e,r,n,i)=>r?ae(r,t.notMatchDelimiters):n?ae(n,t.exactMatchDelimiters):i?ae(i,t.correctionDelimiters):e))}function ae(e,t){return t?t.open+e+t.close:e}function oe(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return n.test(e)?e.replace(i,(e=>t[e])):e}var se=e=>e;function ue(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...a}=e;return a}var ce=e=>{let{response:t}=e;return t.body?le(e):de(t)},le=e=>function(e){return void 0!==e.body.exception}(e)?pe(e):function(e){return void 0!==e.body.statusCode}(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},de=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};var pe=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code}),he=d(m()),fe=d(A()),ge=new Error("Failed to load reducers."),me=class extends
1Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}},ye=class extends Error{constructor(e,t){super(),this.name="Disconnected",this.message=`Client could not connect to the following URL: ${e}`,this.statusCode=t??0}};function ve(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function we(e){return 429===e}var be=class e{static async call(t){let r=function(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:a,signal:o}=e,s="POST"===e.method||"PUT"===e.method,u=function(e,t){return"application/x-www-form-urlencoded"===t?function(e){return!("object"!=typeof e||!e)&&Object.values(e).every(ve)}(e)?function(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}(e):"":JSON.stringify(e)}(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:u},signal:o}}(t),{logger:n}=t,i=await e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:a,...o}=i,s=async()=>{let e=await(0,he.default)(a,o);if(we(e.status))throw e;return e};try{let e=await(0,fe.backOff)(s,{retry:e=>{let t=e&&we(e.status);return t&&n.info("Platform retrying request"),t}});switch(e.status){case 419:case 401:throw n.info("Platform renewing token"),new me;case 404:throw new ye(a,e.status);default:return n.info({response:e,requestInfo:i},"Platform response"),e}}catch(u){return"Failed to fetch"===u.message?new ye(a):u}}static async preprocessRequest(e,t){let{origin:r,preprocessRequest:n,logger:i,requestMetadata:a}=t,{signal:o,...s}=e,u=re(s);try{let t=await n(e,r,a);return{...e,...t}}catch(c){i.error(c,"Platform request preprocessing failed. Returning default request options.")}return u}};function Se(e,t){return`https://${e}${t&&t.environment&&"prod"!==t.environment?t.environment:""}${t&&t.region&&"us"!==t.region?`-${t.region}`:""}.cloud.coveo.com`}function ke(e,t="prod"){let r="prod"===t?"":t,n=`https://${e}.org${r}.coveo.com`;return{platform:n,analytics:`https://${e}.analytics.org${r}.coveo.com`,search:`${n}/rest/search/v2`,admin:`https://${e}.admin.org${r}.coveo.com`}}function Ce(e){return e?.multiRegionSubDomain?`https://${e.multiRegionSubDomain}.org.coveo.com`:Se("platform",e)}function Ie(e){return Se("analytics",e)}var Ae=class{constructor(){this.currentAbortController=null}async enqueue(e,t){let r=this.currentAbortController,n=this.currentAbortController=function(){if(typeof window>"u"){let{AbortController:e}=q();return new e}return typeof AbortController>"u"?null:new AbortController}();r&&(t.warnOnAbort&&t.logger.warn("Cancelling current pending search query"),r.abort());try{return await e(n?.signal??null)}finally{this.currentAbortController===n&&(this.currentAbortController=null)}}},qe=e=>{let t=e.match(/^https:\/\/(?<organizationId>\w+)\.org(?<environment>dev|stg|hipaa)?\.coveo\.com/);return t?.groups?t.groups:null};var Oe=(e,t,r,n)=>{let i=new class{constructor(e){this._params={},this._basePath=e}addParam(e,t){this._params={...this.params,[e]:t}}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((([e,t])=>`${e}=${encodeURIComponent(t)}`)).join("&")}`:this.basePath}}(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};function Re(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function xe(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function De(e,t){if(t&&"AbortError"===e.name)return{error:xe(e)};if(e instanceof ye)return{error:Re(e)};throw e}var Ee=e=>void 0!==e.success,Te=e=>void 0!==e.error;function Me(e){return void 0!==e.results}function Fe(e){let t={answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0};return L(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}var je=e=>e,Ue=e=>e,Pe=e=>e;function _e(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 $e="function"==typeof Symbol&&Symbol.observable||"@@observable",Qe=()=>Math.random().toString(36).substring(7).split("").join("."),Le={INIT:`@@redux/INIT${Qe()}`,REPLACE:`@@redux/REPLACE${Qe()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Qe()}`};function Ve(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Ne(e,t,r){if("function"!=typeof e)throw new Error(_e(2));if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(_e(0));if("function"==typeof t&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if("function"!=typeof r)throw new Error(_e(1));return r(Ne)(e,t)}let n=e,i=t,a=new Map,o=a,s=0,u=!1;function c(){o===a&&(o=new Map,a.forEach(((e,t)=>{o.set(t,e)})))}function l(){if(u)throw new Error(_e(3));return i}function d(e){if("function"!=typeof e)throw new Error(_e(4));if(u)throw new Error(_e(5));let t=!0;c();let r=s++;return o.set(r,e),function(){if(t){if(u)throw new Error(_e(6));t=!1,c(),o.delete(r),a=null}}}function p(e){if(!Ve(e))throw new Error(_e(7));if(typeof e.type>"u")throw new Error(_e(8));if("string"!=typeof e.type)throw new Error(_e(17));if(u)throw new Error(_e(9));try{u=!0,i=n(i,e)}finally{u=!1}
1return(a=o).forEach((e=>{e()})),e}function h(e){if("function"!=typeof e)throw new Error(_e(10));n=e,p({type:Le.REPLACE})}function f(){let e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(_e(11));function r(){let e=t;e.next&&e.next(l())}return r(),{unsubscribe:e(r)}},[$e](){return this}}}return p({type:Le.INIT}),{dispatch:p,subscribe:d,getState:l,replaceReducer:h,[$e]:f}}function ze(e){let t=Object.keys(e),r={};for(let o=0;o<t.length;o++){let n=t[o];"function"==typeof e[n]&&(r[n]=e[n])}let n,i=Object.keys(r);try{!function(e){Object.keys(e).forEach((t=>{let r=e[t];if(typeof r(void 0,{type:Le.INIT})>"u")throw new Error(_e(12));if(typeof r(void 0,{type:Le.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(_e(13))}))}(r)}catch(a){n=a}return function(e={},t){if(n)throw n;let a=!1,o={};for(let n=0;n<i.length;n++){let s=i[n],u=r[s],c=e[s],l=u(c,t);if(typeof l>"u"){t&&t.type;throw new Error(_e(14))}o[s]=l,a=a||l!==c}return a=a||i.length!==Object.keys(e).length,a?o:e}}function He(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...r)=>e(t(...r))))}function Be(e){return Ve(e)&&"type"in e&&"string"==typeof e.type}var Ye=Symbol.for("immer-nothing"),We=Symbol.for("immer-draftable"),Ge=Symbol.for("immer-state");function Ke(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Je=Object.getPrototypeOf;function Ze(e){return!!e&&!!e[Ge]}function Xe(e){return!!e&&(tt(e)||Array.isArray(e)||!!e[We]||!!e.constructor?.[We]||st(e)||ut(e))}var et=Object.prototype.constructor.toString();function tt(e){if(!e||"object"!=typeof e)return!1;let t=Je(e);if(null===t)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===et}function rt(e,t){0===nt(e)?Object.entries(e).forEach((([r,n])=>{t(r,n,e)})):e.forEach(((r,n)=>t(n,r,e)))}function nt(e){let t=e[Ge];return t?t.type_:Array.isArray(e)?1:st(e)?2:ut(e)?3:0}function it(e,t){return 2===nt(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function at(e,t){return 2===nt(e)?e.get(t):e[t]}function ot(e,t,r){let n=nt(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function st(e){return e instanceof Map}function ut(e){return e instanceof Set}function ct(e){return e.copy_||e.base_}function lt(e,t){if(st(e))return new Map(e);if(ut(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&tt(e))return Je(e)?{...e}:Object.assign(Object.create(null),e);let r=Object.getOwnPropertyDescriptors(e);delete r[Ge];let n=Reflect.ownKeys(r);for(let i=0;i<n.length;i++){let t=n[i],a=r[t];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[t]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[t]})}return Object.create(Je(e),r)}function dt(e,t=!1){return ht(e)||Ze(e)||!Xe(e)||(nt(e)>1&&(e.set=e.add=e.clear=e.delete=pt),Object.freeze(e),t&&rt(e,((e,t)=>dt(t,!0)))),e}function pt(){Ke(2)}function ht(e){return Object.isFrozen(e)}var ft,gt={};function mt(e){let t=gt[e];return t||Ke(0),t}function yt(){return ft}function vt(e,t){t&&(mt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wt(e){bt(e),e.drafts_.forEach(kt),e.drafts_=null}function bt(e){e===ft&&(ft=e.parent_)}function St(e){return ft=function(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(ft,e)}function kt(e){let t=e[Ge];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ct(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return void 0!==e&&e!==r?(r[Ge].modified_&&(wt(t),Ke(4)),Xe(e)&&(e=It(t,e),t.parent_||qt(t,e)),t.patches_&&mt("Patches").generateReplacementPatches_(r[Ge].base_,e,t.patches_,t.inversePatches_)):e=It(t,r,[]),wt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ye?e:void 0}function It(e,t,r){if(ht(t))return t;let n=t[Ge];if(!n)return rt(t,((i,a)=>At(e,n,t,i,a,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return qt(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let t=n.copy_,i=t,a=!1;3===n.type_&&(i=new Set(t),t.clear(),a=!0),rt(i,((i,o)=>At(e,n,t,i,o,r,a))),qt(e,t,!1),r&&e.patches_&&mt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function At(e,t,r,n,i,a,o){if(Ze(i)){let o=It(e,i,a&&t&&3!==t.type_&&!it(t.assigned_,n)?a.concat(n):void 0);if(ot(r,n,o),!Ze(o))return;e.canAutoFreeze_=!1}else o&&r.add(i);
1if(Xe(i)&&!ht(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;It(e,i),(!t||!t.scope_.parent_)&&qt(e,i)}}function qt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dt(t,r)}var Ot={get(e,t){if(t===Ge)return e;let r=ct(e);if(!it(r,t))return function(e,t,r){let n=Dt(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);let n=r[t];return e.finalized_||!Xe(n)?n:n===xt(e.base_,t)?(Tt(e),e.copy_[t]=Mt(n,e)):n},has:(e,t)=>t in ct(e),ownKeys:e=>Reflect.ownKeys(ct(e)),set(e,t,r){let n=Dt(ct(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=xt(ct(e),t),i=n?.[Ge];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}(r,n)&&(void 0!==r||it(e.base_,t)))return!0;Tt(e),Et(e)}return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==xt(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Tt(e),Et(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=ct(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty(){Ke(11)},getPrototypeOf:e=>Je(e.base_),setPrototypeOf(){Ke(12)}},Rt={};function xt(e,t){let r=e[Ge];return(r?ct(r):e)[t]}function Dt(e,t){if(!(t in e))return;let r=Je(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Je(r)}}function Et(e){e.modified_||(e.modified_=!0,e.parent_&&Et(e.parent_))}function Tt(e){e.copy_||(e.copy_=lt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}rt(Ot,((e,t)=>{Rt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Rt.deleteProperty=function(e,t){return Rt.set.call(this,e,t,void 0)},Rt.set=function(e,t,r){return Ot.set.call(this,e[0],t,r,e[0])};function Mt(e,t){let r=st(e)?mt("MapSet").proxyMap_(e,t):ut(e)?mt("MapSet").proxySet_(e,t):function(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:yt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,a=Ot;r&&(i=[n],a=Rt);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return n.draft_=s,n.revoke_=o,s}(e,t);return(t?t.scope_:yt()).drafts_.push(r),r}function Ft(e){if(!Xe(e)||ht(e))return e;let t,r=e[Ge];if(r){if(!r.modified_)return r.base_;r.finalized_=!0,t=lt(e,r.scope_.immer_.useStrictShallowCopy_)}else t=lt(e,!0);return rt(t,((e,r)=>{ot(t,e,Ft(r))})),r&&(r.finalized_=!1),t}function jt(){let e="replace",t="add",r="remove";function n(e){if(!Xe(e))return e;if(Array.isArray(e))return e.map(n);if(st(e))return new Map(Array.from(e.entries()).map((([e,t])=>[e,n(t)])));if(ut(e))return new Set(Array.from(e).map(n));let t=Object.create(Je(e));for(let r in e)t[r]=n(e[r]);return it(e,We)&&(t[We]=e[We]),t}function i(e){return Ze(e)?n(e):e}!function(e,t){gt[e]||(gt[e]=t)}("Patches",{applyPatches_:function(i,a){return a.forEach((a=>{let{path:o,op:s}=a,u=i;for(let e=0;e<o.length-1;e++){let t=nt(u),r=o[e];"string"!=typeof r&&"number"!=typeof r&&(r=""+r),(0===t||1===t)&&("__proto__"===r||"constructor"===r)&&Ke(19),"function"==typeof u&&"prototype"===r&&Ke(19),u=at(u,r),"object"!=typeof u&&Ke(18,o.join("/"))}let c=nt(u),l=n(a.value),d=o[o.length-1];switch(s){case e:switch(c){case 2:return u.set(d,l);case 3:Ke(16);default:return u[d]=l}case t:switch(c){case 1:return"-"===d?u.push(l):u.splice(d,0,l);case 2:return u.set(d,l);case 3:return u.add(l);default:return u[d]=l}case r:switch(c){case 1:return u.splice(d,1);case 2:return u.delete(d);case 3:return u.delete(a.value);default:return delete u[d]}default:Ke(17)}})),i},generatePatches_:function(n,a,o,s){switch(n.type_){case 0:case 2:return function(n,a,o,s){let{base_:u,copy_:c}=n;rt(n.assigned_,((n,l)=>{let d=at(u,n),p=at(c,n),h=l?it(u,n)?e:t:r;if(d===p&&h===e)return;let f=a.concat(n);o.push(h===r?{op:h,path:f}:{op:h,path:f,value:p}),s.push(h===t?{op:r,path:f}:h===r?{op:t,path:f,value:i(d)}:{op:e,path:f,value:i(d)})}))}(n,a,o,s);case 1:return function(n,a,o,s){let{base_:u,assigned_:c}=n,l=n.copy_;l.length<u.length&&([u,l]=[l,u],[o,s]=[s,o]);for(let t=0;t<u.length;t++)if(c[t]&&l[t]!==u[t]){let r=a.concat([t]);o.push({op:e,path:r,value:i(l[t])}),s.push({op:e,path:r,value:i(u[t])})}for(let e=u.length;e<l.length;e++){let r=a.concat([e]);o.push({op:t,path:r,value:i(l[e])})}for(let e=l.length-1;u.length<=e;--e){let t=a.concat([e]);s.push({op:r,path:t})}}(n,a,o,s);case 3:return function(e,n,i,a){let{base_:o,copy_:s}
1=e,u=0;o.forEach((e=>{if(!s.has(e)){let o=n.concat([u]);i.push({op:r,path:o,value:e}),a.unshift({op:t,path:o,value:e})}u++})),u=0,s.forEach((e=>{if(!o.has(e)){let o=n.concat([u]);i.push({op:t,path:o,value:e}),a.unshift({op:r,path:o,value:e})}u++}))}(n,a,o,s)}},generateReplacementPatches_:function(t,r,n,i){n.push({op:e,path:[],value:r===Ye?void 0:r}),i.push({op:e,path:[],value:t})}})}var Ut=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){let r=t;t=e;let n=this;return function(e=r,...i){return n.produce(e,(e=>t.call(this,e,...i)))}}let n;if("function"!=typeof t&&Ke(6),void 0!==r&&"function"!=typeof r&&Ke(7),Xe(e)){let i=St(this),a=Mt(e,void 0),o=!0;try{n=t(a),o=!1}finally{o?wt(i):bt(i)}return vt(i,r),Ct(n,i)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===Ye&&(n=void 0),this.autoFreeze_&&dt(n,!0),r){let t=[],i=[];mt("Patches").generateReplacementPatches_(e,n,t,i),r(t,i)}return n}Ke(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Xe(e)||Ke(8),Ze(e)&&(e=function(e){return Ze(e)||Ke(10),Ft(e)}(e));let t=St(this),r=Mt(e,void 0);return r[Ge].isManual_=!0,bt(t),r}finishDraft(e,t){let r=e&&e[Ge];(!r||!r.isManual_)&&Ke(9);let{scope_:n}=r;return vt(n,t),Ct(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=mt("Patches").applyPatches_;return Ze(e)?n(e,t):this.produce(e,(e=>n(e,t)))}},Pt=Ut.produce,_t=Ut.produceWithPatches.bind(Ut),$t=(Ut.setAutoFreeze.bind(Ut),Ut.setUseStrictShallowCopy.bind(Ut),Ut.applyPatches.bind(Ut));Ut.createDraft.bind(Ut),Ut.finishDraft.bind(Ut);var Qt=e=>Array.isArray(e)?e:[e];function Lt(e){let t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){let r=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${r}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Vt(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}Symbol(),Object.getPrototypeOf({});var Nt=typeof WeakRef<"u"?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function zt(e,t={}){let r,n={s:0,v:void 0,o:null,p:null},{resultEqualityCheck:i}=t,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,r=o;e<r;e++){let r=arguments[e];if("function"==typeof r||"object"==typeof r&&null!==r){let e=t.o;null===e&&(t.o=e=new WeakMap);let n=e.get(r);void 0===n?(t={s:0,v:void 0,o:null,p:null},e.set(r,t)):t=n}else{let e=t.p;null===e&&(t.p=e=new Map);let n=e.get(r);void 0===n?(t={s:0,v:void 0,o:null,p:null},e.set(r,t)):t=n}}let s,u=t;if(1===t.s?s=t.v:(s=e.apply(null,arguments),a++),u.s=1,i){let e=r?.deref?.()??r;null!=e&&i(e,s)&&(s=e,0!==a&&a--),r="object"==typeof s&&null!==s||"function"==typeof s?new Nt(s):s}return u.v=s,s}return o.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}var Ht=function(e,...t){let r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,n=(...e)=>{let t,n=0,i=0,a={},o=e.pop();"object"==typeof o&&(a=o,o=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let s={...r,...a},{memoize:u,memoizeOptions:c=[],argsMemoize:l=zt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,h=Qt(c),f=Qt(d),g=Lt(e),m=u((function(){return n++,o.apply(null,arguments)}),...h),y=l((function(){i++;let e=Vt(g,arguments);return t=m.apply(null,e),t}),...f);
1return Object.assign(y,{resultFunc:o,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>t,recomputations:()=>n,resetRecomputations:()=>{n=0},memoize:u,argsMemoize:l})};return Object.assign(n,{withTypes:()=>n}),n}(zt),Bt=Object.assign(((e,t=Ht)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);let r=Object.keys(e);return t(r.map((t=>e[t])),((...e)=>e.reduce(((e,t,n)=>(e[r[n]]=t,e)),{})))}),{withTypes:()=>Bt});function Yt(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var Wt=Yt(),Gt=Yt,Kt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?He:He.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Jt(e,t){function r(...r){if(t){let n=t(...r);if(!n)throw new Error(jr(0));return{type:e,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:e,payload:r[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>Be(t)&&t.type===e,r}var Zt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Xt(e){return Xe(e)?Pt(e,(()=>{})):e}function er(e,t,r){if(e.has(t)){let n=e.get(t);return r.update&&(n=r.update(n,t,e),e.set(t,n)),n}if(!r.insert)throw new Error(jr(10));let n=r.insert(t,e);return e.set(t,n),n}var tr="RTK_autoBatch",rr=()=>e=>({payload:e,meta:{[tr]:!0}}),nr=e=>t=>{setTimeout(t,e)},ir=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:nr(10),ar=e=>function(t){let{autoBatch:r=!0}=t??{},n=new Zt(e);return r&&n.push(((e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,a=!1,o=!1,s=new Set,u="tick"===e.type?queueMicrotask:"raf"===e.type?ir:"callback"===e.type?e.queueNotification:nr(e.timeout),c=()=>{o=!1,a&&(a=!1,s.forEach((e=>e())))};return Object.assign({},n,{subscribe(e){let t=n.subscribe((()=>i&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[tr],a=!i,a&&(o||(o=!0,u(c))),n.dispatch(e)}finally{i=!0}}})})("object"==typeof r?r:void 0)),n};function or(e){let t,r,n=function(e){let{thunk:t=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:i=!0}=e??{},a=new Zt;return t&&("boolean"==typeof t?a.push(Wt):a.push(Gt(t.extraArgument))),a},{reducer:i,middleware:a,devTools:o=!0,preloadedState:s,enhancers:u}=e||{};if("function"==typeof i)t=i;else{if(!Ve(i))throw new Error(jr(1));t=ze(i)}r="function"==typeof a?a(n):n();let c=He;o&&(c=Kt({trace:!1,..."object"==typeof o&&o}));let l=function(...e){return t=>(r,n)=>{let i=t(r,n),a=()=>{throw new Error(_e(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)},s=e.map((e=>e(o)));return a=He(...s)(i.dispatch),{...i,dispatch:a}}}(...r),d=ar(l);return Ne(t,s,c(..."function"==typeof u?u(d):d()))}function sr(e){let t,r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw new Error(jr(28));if(n in r)throw new Error(jr(29));return r[n]=t,i},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(t=e,i)};return e(i),[r,n,t]}function ur(e,t){let r,[n,i,a]=sr(t);if(function(e){return"function"==typeof e}(e))r=()=>Xt(e());else{let t=Xt(e);r=()=>t}function o(e=r(),t){let o=[n[t.type],...i.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===o.filter((e=>!!e)).length&&(o=[a]),o.reduce(((e,r)=>{if(r){if(Ze(e)){let n=r(e,t);return void 0===n?e:n}if(Xe(e))return Pt(e,(e=>r(e,t)));{let n=r(e,t);if(void 0===n){if(null===e)return e;throw new Error(jr(9))}return n}}return e}),e)}return o.getInitialState=r,o}var cr=(e,t)=>(e=>e&&"function"==typeof e.match)(e)?e.match(t):e(t);function lr(...e){return t=>e.some((e=>cr(e,t)))}function dr(...e){return t=>e.every((e=>cr(e,t)))}function pr(e,t){if(!e||!e.meta)return!1;let r="string"==typeof e.meta.requestId,n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function hr(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function fr(...e){return 0===e.length?e=>pr(e,["pending"]):hr(e)?lr(...e.map((e=>e.pending))):fr()(e[0])}function gr(...e){return 0===e.length?e=>pr(e,["rejected"]):hr(e)?lr(...e.map((e=>e.rejected))):gr()(e[0])}function mr(...e){let t=e=>e&&e.meta&&e.meta.rejectedWithValue;return 0===e.length||hr(e)?dr(gr(...e),t):mr()(e[0])}function yr(...e){return 0===e.length?e=>pr(e,["fulfilled"]):hr(e)?lr(...e.map((e=>e.fulfilled))):yr()(e[0])}function vr(...e){return 0===e.length?e=>pr(e,["pending","fulfilled","rejected"]):hr(e)?lr(...e.flatMap((e=>[e.pending,e.rejected,e.fulfilled]))):vr()(e[0])}var wr=(e=21)=>{let t="",r=e;for(;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},br=["name","message","stack","code"],Sr=class{constructor(e,t){p(this,"_type"),this.payload=e,this.meta=t}},kr=class{constructor(e,t){p(this,"_type"),this.payload=e,this.meta=t}},Cr=e=>{if("object"==typeof e&&null!==e){let t={};for(let r of br)"string"==typeof e[r]&&(t[r]=e[r]);return t}return{message:String(e)}},Ir=(()=>{function e(e,t,r){let n=Jt(e+"/fulfilled",((e,t,r,n)=>({payload:e,meta:{...n||{},arg:r,requestId:t,requestStatus:"fulfilled"}}))),i=Jt(e+"/pending",((e,t,r)=>({payload:void 0,meta:{...r||{},arg:t,requestId:e,requestStatus:"pending"}}))),a=Jt(e+"/rejected",((e,t,n,i,a)=>({payload:i,error:(r&&r.serializeError||Cr)(e||"Rejected"),meta:{...a||{},arg:n,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(o,s,u)=>{let c,l,d=r?.idGenerator?r.idGenerator(e):wr(),p=new AbortController;function h(e){l=e,p.abort()}
1let f=async function(){let f;try{let a=r?.condition?.(e,{getState:s,extra:u});if(function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.then}(a)&&(a=await a),!1===a||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let g=new Promise(((e,t)=>{c=()=>{t({name:"AbortError",message:l||"Aborted"})},p.signal.addEventListener("abort",c)}));o(i(d,e,r?.getPendingMeta?.({requestId:d,arg:e},{getState:s,extra:u}))),f=await Promise.race([g,Promise.resolve(t(e,{dispatch:o,getState:s,extra:u,requestId:d,signal:p.signal,abort:h,rejectWithValue:(e,t)=>new Sr(e,t),fulfillWithValue:(e,t)=>new kr(e,t)})).then((t=>{if(t instanceof Sr)throw t;return t instanceof kr?n(t.payload,d,e,t.meta):n(t,d,e)}))])}catch(g){f=g instanceof Sr?a(null,d,e,g.payload,g.meta):a(g,d,e)}finally{c&&p.signal.removeEventListener("abort",c)}return r&&!r.dispatchConditionRejection&&a.match(f)&&f.meta.condition||o(f),f}();return Object.assign(f,{abort:h,requestId:d,arg:e,unwrap:()=>f.then(Ar)})}}),{pending:i,rejected:a,fulfilled:n,settled:lr(a,n),typePrefix:e})}return e.withTypes=()=>e,e})();function Ar(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var qr=Symbol.for("rtk-slice-createasyncthunk");function Or(e,t){return`${e}/${t}`}function Rr(e,t,r,n){function i(i,...a){let o=t(i);return typeof o>"u"&&n&&(o=r()),e(o,...a)}return i.unwrapped=e,i}var xr=function({creators:e}={}){let t=e?.asyncThunk?.[qr];return function(e){let{name:r,reducerPath:n=r}=e;if(!r)throw new Error(jr(11));let i=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let r="string"==typeof e?e:e.type;if(!r)throw new Error(jr(12));if(r in o.sliceCaseReducersByType)throw new Error(jr(13));return o.sliceCaseReducersByType[r]=t,s},addMatcher:(e,t)=>(o.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(o.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(o.sliceCaseReducersByName[e]=t,s)};function u(){let[t={},r=[],n]="function"==typeof e.extraReducers?sr(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return ur(e.initialState,(e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)}))}a.forEach((n=>{let a=i[n],o={reducerName:n,type:Or(r,n),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(a)?function({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(n))throw new Error(jr(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Jt(e,o):Jt(e))}(o,a,s):function({type:e,reducerName:t},r,n,i){if(!i)throw new Error(jr(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:u,settled:c,options:l}=r,d=i(e,a,l);n.exposeAction(t,d),o&&n.addCase(d.fulfilled,o),s&&n.addCase(d.pending,s),u&&n.addCase(d.rejected,u),c&&n.addMatcher(d.settled,c),n.exposeCaseReducer(t,{fulfilled:o||Dr,pending:s||Dr,rejected:u||Dr,settled:c||Dr})}(o,a,s,t)}));let c,l=e=>e,d=new Map;function p(e,t){return c||(c=u()),c(e,t)}function h(){return c||(c=u()),c.getInitialState()}function f(t,r=!1){function n(e){let n=e[t];return typeof n>"u"&&r&&(n=h()),n}function i(t=l){let n=er(d,r,{insert:()=>new WeakMap});return er(n,t,{insert:()=>{let n={};for(let[i,a]of Object.entries(e.selectors??{}))n[i]=Rr(a,t,h,r);return n}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(n)},selectSlice:n}}let g={name:r,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:h,...f(n),injectInto(e,{reducerPath:t,...r}={}){let i=t??n;return e.inject({reducerPath:i,reducer:p},r),{...g,...f(i,!0)}}};return g}}();function Dr(){}var{assign:Er}=Object,Tr="listenerMiddleware",Mr=Er(Jt(`${Tr}/add`),{withTypes:()=>Mr}),Fr=(Jt(`${Tr}/removeAll`),Er(Jt(`${Tr}/remove`),{withTypes:()=>Fr}));Symbol.for("rtk-state-proxy-original");function jr(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. `}var Ur,Pr,_r=new W({required:!0,emptyAllowed:!1}),$r=new W({required:!1,emptyAllowed:!1}),Qr=new W({required:!0,emptyAllowed:!0}),Lr=(new W({required:!1,emptyAllowed:!0}),new Z({each:_r,required:!0})),Vr=new W({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Nr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),zr=(e,t)=>{if("required"in t)return{payload:new _({value:t}
1).validate({value:e}).value};let r=new K({options:{required:!0},values:t}).validate(e);if(r)throw new P(r);return{payload:e}},Hr=(e,t)=>{try{return zr(e,t)}catch(ga){return{payload:e,error:Nr(ga)}}},Br=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(fa){throw e.logger.error(fa,i),fa}},Yr="2.80.7",Wr=()=>$r,Gr=()=>_r,Kr=Jt("configuration/updateBasicConfiguration",(e=>Hr(e,{accessToken:$r,organizationId:$r,platformUrl:$r}))),Jr=Jt("configuration/updateSearchConfiguration",(e=>Hr(e,{apiBaseUrl:$r,pipeline:new W({required:!1,emptyAllowed:!0}),searchHub:$r,timezone:$r,locale:$r,authenticationProviders:new Z({required:!1,each:_r})}))),Zr={enabled:new z({default:!0}),originContext:Wr(),originLevel2:Wr(),originLevel3:Wr(),apiBaseUrl:$r,nextApiBaseUrl:$r,runtimeEnvironment:new $,anonymous:new z({default:!1}),deviceId:$r,userDisplayName:$r,documentLocation:$r,trackingId:$r,analyticsMode:new W({constrainTo:["legacy","next"],required:!1,default:"legacy"}),source:new K({options:{required:!1},values:["@coveo/atomic","@coveo/quantic"].reduce(((e,t)=>(e[t]=Vr,e)),{})})},Xr=Jt("configuration/updateAnalyticsConfiguration",(e=>Hr(e,Zr))),en=Jt("configuration/analytics/disable"),tn=Jt("configuration/analytics/enable"),rn=Jt("configuration/analytics/originlevel2",(e=>Hr(e,{originLevel2:Gr()}))),nn=Jt("configuration/analytics/originlevel3",(e=>Hr(e,{originLevel3:Gr()}))),an={q:new W,enableQuerySyntax:new z,aq:new W,cq:new W,firstResult:new V({min:0}),numberOfResults:new V({min:0}),sortCriteria:new W,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new z,sf:new K,tab:new W,af:new K},on=Jt("searchParameters/restore",(e=>Hr(e,an))),sn=Jt("debug/enable"),un=Jt("debug/disable"),cn=ur(!1,(e=>{e.addCase(sn,(()=>!0)).addCase(un,(()=>!1)).addCase(on,((e,t)=>t.payload.debug??e))})),ln=Jt("pipeline/set",(e=>Hr(e,new W({required:!0,emptyAllowed:!0})))),dn=Jt("history/undo"),pn=Jt("history/redo"),hn=Jt("history/snapshot"),fn=(Ir("history/back",(async(e,{dispatch:t})=>{t(dn()),await t(fn())})),Ir("history/forward",(async(e,{dispatch:t})=>{t(pn()),await t(fn())})),Ir("history/change",(async(e,{getState:t})=>t().history.present))),gn=ur("",(e=>{e.addCase(ln,((e,t)=>t.payload)).addCase(fn.fulfilled,((e,t)=>t.payload?.pipeline??e)).addCase(Jr,((e,t)=>t.payload.pipeline||e))}));function mn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function yn(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(t)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function vn(){return typeof window<"u"}function wn(){return typeof navigator<"u"}function bn(){return typeof document<"u"}function Sn(){try{return typeof localStorage<"u"}catch{return!1}}function kn(){return wn()&&navigator.cookieEnabled}(Pr=Ur||(Ur={})).search="search",Pr.click="click",Pr.custom="custom",Pr.view="view",Pr.collect="collect";var Cn=[Ur.click,Ur.custom,Ur.search,Ur.view],In=(e,t)=>-1!==Cn.indexOf(e)?Object.assign({language:bn()?document.documentElement.lang:"unknown",userAgent:wn()?navigator.userAgent:"unknown"},t):t,An=class e{static set(e,t,r){var n,i,a;r&&(n=new Date).setTime(n.getTime()+r),-1===(a=window.location.hostname).indexOf(".")?qn(e,t,n):qn(e,t,n,(i=a.split("."))[i.length-2]+"."+i[i.length-1])}static get(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var i=r[n];if(0===(i=i.replace(/^\s+/,"")).lastIndexOf(t,0))return i.substring(t.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function qn(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function On(){return Sn()?localStorage:kn()?new Rn:function(){try{return typeof sessionStorage<"u"}catch{return!1}}()?sessionStorage:new Dn}var Rn=class e{getItem(t){return An.get(`${e.prefix}${t}`)}removeItem(t){An.erase(`${e.prefix}${t}`)}setItem(t,r,n){An.set(`${e.prefix}${t}`,r,n)}};Rn.prefix="coveo_";var xn,Dn=class{getItem(e){return null}removeItem(e){}setItem(e,t){}},En="__coveo.analytics.history",Tn=class{constructor(e){this.store=e||On()}addElement(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])}addElementAsync(e){return yn(this,void 0,void 0,(function*(){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=yield this.getHistoryWithInternalTimeAsync();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])}))}getHistory(){let e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))}getHistoryAsync(){return yn(this,void 0,void 0,(function*(){let e=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(e))}))}getHistoryWithInternalTime(){try{let e=this.store.getItem(En);return e&&"string"==typeof e?JSON.parse(e):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return yn(this,void 0,void 0,(function*(){try{let e=yield this.store.getItem(En);return e?JSON.parse(e):[]}catch{return[]}}))}setHistory(e){try{this.store.setItem(En,JSON.stringify(e.slice(0,20)))}catch{}}clear(){try{this.store.removeItem(En)}catch{}}getMostRecentElement(){let e=this.getHistoryWithInternalTime();return Array.isArray(e)?e.sort(((e,t)=>(t.internalTime||0)-(e.internalTime||0)))[0]:null}cropQueryElement(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e}isValidEntry(e){let t=this.getMostRecentElement();return!t||t.value!=e.value||(e.internalTime||0)-(t.internalTime||0)>6e4}stripInternalTime(e){return Array.isArray(e)?e.map((e=>{let{name:t,time:r,value:n}=e;return{name:t,time:r,value:n}})):[]}stripEmptyQuery(e){let{name:t,time:r,value:n}=e;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e}stripEmptyQueries(e){return e.map((e=>this.stripEmptyQuery(e)))}},Mn=Object.freeze({__proto__:null,HistoryStore:Tn,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MAX_VALUE_SIZE:75,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,STORE_KEY:En,default:Tn}),Fn=(e,t)=>yn(void 0,void 0,void 0,(function*(){return e===Ur.view?(yield jn(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t})),jn=e=>yn(void 0,void 0,void 0,(function*(){let t=new Tn,r={name:"PageView",value:e,time:(new Date).toISOString()};yield t.addElementAsync(r)})),Un=new Uint8Array(16);function Pn(){if(!xn&&!(xn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xn(Un)}var _n=/^(?:[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 $n(e){return"string"==typeof e&&_n.test(e)}var Qn=[];for(let Zd=0;Zd<256;++Zd)Qn.push((Zd+256).toString(16).slice(1));function Ln(e,t=0){return(Qn[e[t+0]]+Qn[e[t+1]]+Qn[e[t+2]]+Qn[e[t+3]]+"-"+Qn[e[t+4]]+Qn[e[t+5]]+"-"+Qn[e[t+6]]+Qn[e[t+7]]+"-"+Qn[e[t+8]]+Qn[e[t+9]]+"-"+Qn[e[t+10]]+Qn[e[t+11]]+Qn[e[t+12]]+Qn[e[t+13]]+Qn[e[t+14]]+Qn[e[t+15]]).toLowerCase()}var Vn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Nn(e,t,r){if(Vn.randomUUID&&!t&&!e)return Vn.randomUUID();let n=(e=e||{}).random||(e.rng||Pn)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return Ln(n)}function zn(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function Hn(e,t){return e<<t|e>>>32-t}var Bn=function(e,t,r){function n(e,n,i,a){var o;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=function(e){if(!$n(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]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,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]=255&t,r}(n)),16!==(null===(o=n)||void 0===o?void 0:o.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+e.length);if(s.set(n),s.set(e,n.length),s=r(s),s[6]=15&s[6]|t,s[8]=63&s[8]|128,i){a=a||0;for(let e=0;e<16;++e)i[a+e]=s[e];return i}return Ln(s)}try{n.name=e}catch{}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,(function(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,i=Math.ceil(n/16),a=new Array(i);for(let o=0;o<i;++o){let t=new Uint32Array(16);for(let r=0;r<16;++r)t[r]=e[64*o+4*r]<<24|e[64*o+4*r+1]<<16|e[64*o+4*r+2]<<8|e[64*o+4*r+3];a[o]=t}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(let o=0;o<i;++o){let e=new Uint32Array(80);for(let t=0;t<16;++t)e[t]=a[o][t];for(let t=16;t<80;++t)e[t]=Hn(e[t-3]^e[t-8]^e[t-14]^e[t-16],1);let n=r[0],i=r[1],s=r[2],u=r[3],c=r[4];for(let r=0;r<80;++r){let a=Math.floor(r/20),o=Hn(n,5)+zn(a,i,s,u)+c+t[a]+e[r]>>>0;c=u,u=s,s=Hn(i,30)>>>0,i=n,n=o}r[0]=r[0]+n>>>0,r[1]=r[1]+i>>>0,r[2]=r[2]+s>>>0,r[3]=r[3]+u>>>0,r[4]=r[4]+c>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),Yn=Bn,Wn="2.30.38",Gn=e=>`${e.protocol}//${e.hostname}${0===e.pathname.indexOf("/")?e.pathname:`/${e.pathname}`}${e.search}`,Kn={pageview:"pageview",event:"event"},Jn=class{constructor({client:e,uuidGenerator:t=Nn}){this.client=e,this.uuidGenerator=t}},Zn=class extends Jn{constructor({client:e,uuidGenerator:t=Nn}){super({client:e,uuidGenerator:t}),this.actionData={},this.pageViewId=t(),this.nextPageViewId=this.pageViewId,this.currentLocation=Gn(window.location),this.lastReferrer=bn()?document.referrer:"",this.addHooks()}getApi(e){return"setAction"===e?this.setAction:null}setAction(e,t){this.action=e,this.actionData=t}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(e,t){return Object.assign({hitType:e},this.getNextValues(e,t))}updateLocationInformation(e,t){this.updateLocationForNextPageView(e,t)}getDefaultContextInformation(e){let t={title:bn()?document.title:"",encoding:bn()?document.characterSet:"UTF-8"},r={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},n={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),r),n),t)}updateLocationForNextPageView(e,t){let{pageViewId:r,referrer:n,location:i}=this.getNextValues(e,t);this.lastReferrer=n,this.pageViewId=r,this.currentLocation=i,e===Kn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(e,t){return{pageViewId:e===Kn.pageview?this.nextPageViewId:this.pageViewId,referrer:e===Kn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===Kn.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}}getCurrentLocationFromPayload(e){if(e.page){let t=e=>e.replace(/^\/?(.*)$/,"/$1");return`${(e=>this.currentLocation.split("/").slice(0,3).join("/"))()}${t(e.page)}`}return Gn(window.location)}},Xn=class e{constructor(e,t){if(!$n(e))throw Error("Not a valid uuid");this.clientId=e,this.creationDate=Math.floor(t/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(e,t){return!this.expired&&this.matchReferrer(e,t)}matchReferrer(e,t){try{let r=new URL(e);return t.some((e=>new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(r.host)))}catch{return!1}}static fromString(t){let r=t.split(".");if(2!==r.length)return null;let[n,i]=r;if(32!==n.length||isNaN(parseInt(i)))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 $n(a)?new e(a,1e3*Number.parseInt(i)):null}};Xn.cvo_cid="cvo_cid",Xn.expirationTime=120;(class extends Jn{constructor({client:e,uuidGenerator:t=Nn}){super({client:e,uuidGenerator:t})}getApi(e){switch(e){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(e){return yn(this,void 0,void 0,(function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let t=new URL(e),r=yield this.client.getCurrentVisitorId();return t.searchParams.set(Xn.cvo_cid,new Xn(r,Date.now()).toString()),t.toString()}catch{throw new Error("Invalid URL provided")}}))}acceptFrom(e){this.client.setAcceptedLinkReferrers(e)}}).Id="link";var ei=Object.keys;function ti(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function ri(e){return 240===(248&e)?4:224===(240&e)?3:192===(224&e)?2:1}var ni={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"},ii=ei(ni).map((e=>ni[e])),ai=[...ii].join("|"),oi=new RegExp(`^(${ai}$)`),si=[e=>
1oi.test(e)],ui={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ci={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},li={action:"pa",list:"pal",listSource:"pls"},di={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},pi={id:"quoteId",affiliation:"quoteAffiliation"},hi={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},fi={add:li,bookmark_add:li,bookmark_remove:li,click:li,checkout:li,checkout_option:li,detail:li,impression:li,remove:li,refund:Object.assign(Object.assign({},li),di),purchase:Object.assign(Object.assign({},li),di),quickview:li,quote:Object.assign(Object.assign({},li),pi),review:Object.assign(Object.assign({},li),hi)},gi=ei(ui).map((e=>ui[e])),mi=ei(ci).map((e=>ci[e])),yi=ei(li).map((e=>li[e])),vi=ei(di).map((e=>di[e])),wi=ei(hi).map((e=>hi[e])),bi=ei(pi).map((e=>pi[e])),Si=[...gi,"custom"].join("|"),ki=[...mi,"custom"].join("|"),Ci="(pr[0-9]+)",Ii="(il[0-9]+pi[0-9]+)",Ai=new RegExp(`^${Ci}(${Si})$`),qi=new RegExp(`^(${Ii}(${ki}))|(il[0-9]+nm)$`),Oi=new RegExp(`^(${yi.join("|")})$`),Ri=new RegExp(`^(${vi.join("|")})$`),xi=new RegExp(`^${Ci}custom$`),Di=new RegExp(`^${Ii}custom$`),Ei=new RegExp(`^(${["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit",...wi,...bi].join("|")})$`),Ti=[e=>qi.test(e),e=>Ai.test(e),e=>Oi.test(e),e=>Ri.test(e),e=>Ei.test(e)],Mi=[xi,Di],Fi=Object.assign(Object.assign(Object.assign(Object.assign({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:t})),{})),ji=Object.assign(Object.assign({},Fi),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Ui=ei(ji).map((e=>ji[e])),Pi=e=>-1!==Ui.indexOf(e),_i=e=>"custom"===e,$i=e=>{let t;return[...Mi].every((r=>{var n;return t=null===(n=r.exec(e))||void 0===n?void 0:n[1],!t})),t},Qi=(e,t)=>ei(t).reduce(((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]})),{}),Li=class{constructor(e){this.opts=e}sendEvent(e,t){return yn(this,void 0,void 0,(function*(){let r,{baseUrl:n,visitorIdProvider:i,preprocessRequest:a}=this.opts,o=this.shouldAppendVisitorId(e)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${e}${o}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},u=Object.assign(Object.assign({},s),a?yield a(s,"analyticsFetch"):{}),{url:c}=u,l=mn(u,["url"]);try{r=yield fetch(c,l)}catch(d){return void console.error("An error has occured when sending the event.",d)}if(r.ok){let e=yield r.json();return e.visitorId&&i.setCurrentVisitorId(e.visitorId),e}try{r.json()}catch{}throw console.error(`An error has occured when sending the "${e}" event.`,r,t),new Error(`An error has occurred when sending the "${e}" event. Check the console logs for more details.`)}))}deleteHttpCookieVisitorId(){return yn(this,void 0,void 0,(function*(){let{baseUrl:e}=this.opts,t=`${e}/analytics/visit`;yield fetch(t,{headers:this.getHeaders(),method:"DELETE"})}))}shouldAppendVisitorId(e){return-1!==[Ur.click,Ur.custom,Ur.search,Ur.view].indexOf(e)}getVisitorIdParam(){return yn(this,void 0,void 0,(function*(){let{visitorIdProvider:e}=this.opts,t=yield e.getCurrentVisitorId();return t?`?visitor=${t}`:""}))}getHeaders(){let{token:e}=this.opts;return Object.assign(Object.assign({},e?{Authorization:`Bearer ${e}`}:{}),{"Content-Type":"application/json"})}},Vi=class{constructor(){this.storage=new Dn,this.client=new class{sendEvent(e,t){return yn(this,void 0,void 0,(function*(){return Promise.resolve()}))}deleteHttpCookieVisitorId(){return yn(this,void 0,void 0,(function*(){return Promise.resolve()}))}}}
1getClientDependingOnEventType(e){return this.client}};var Ni=["1",1,"yes",!0];function zi(){return wn()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some((e=>-1!==Ni.indexOf(e)))}var Hi="https://analytics.cloud.coveo.com/rest/ua";var Bi,Yi,Wi=class{get defaultOptions(){return{endpoint:Hi,isCustomEndpoint:!1,token:"",version:"v15",beforeSendHooks:[],afterSendHooks:[]}}get version(){return Wn}constructor(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Fn,In].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let t={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};zi()?this.runtime=new Vi:this.runtime=this.options.runtimeEnvironment||this.initRuntime(t),this.addEventTypeMapping(Ur.view,{newEventType:Ur.view,addClientIdParameter:!0}),this.addEventTypeMapping(Ur.click,{newEventType:Ur.click,addClientIdParameter:!0}),this.addEventTypeMapping(Ur.custom,{newEventType:Ur.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Ur.search,{newEventType:Ur.search,addClientIdParameter:!0})}initRuntime(e){return vn()&&bn()?new class{constructor(e,t){Sn()&&kn()?this.storage=new class{constructor(){this.cookieStorage=new Rn}getItem(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)}removeItem(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)}setItem(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t,31556926e3)}}:Sn()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Dn),this.client=new Li(e),this.beaconClient=new class{constructor(e){this.opts=e}sendEvent(e,t){return yn(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:r,preprocessRequest:n}=this.opts,i=yield this.getQueryParamsForEventType(e),{url:a,payload:o}=yield this.preProcessRequestAsPotentialJSONString(`${r}/analytics/${e}?${i}`,t,n),s=this.encodeForEventType(e,o),u=new Blob([s],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)}))}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(e,t,r){return yn(this,void 0,void 0,(function*(){let n=e,i=t;if(r){let o=yield r({url:e,body:JSON.stringify(t)},"analyticsBeacon"),{url:s,body:u}=o;n=s||e;try{i=JSON.parse(u)}catch(a){console.error("Unable to process the request body as a JSON string",a)}}return{payload:i,url:n}}))}encodeForEventType(e,t){return this.isEventTypeLegacy(e)?this.encodeEventToJson(e,t):this.encodeEventToJson(e,t,this.opts.token)}getQueryParamsForEventType(e){return yn(this,void 0,void 0,(function*(){let{token:t,visitorIdProvider:r}=this.opts,n=yield r.getCurrentVisitorId();return[t&&this.isEventTypeLegacy(e)?`access_token=${t}`:"",n?`visitorId=${n}`:"","discardVisitInfo=true"].filter((e=>!!e)).join("&")}))}isEventTypeLegacy(e){return-1!==[Ur.click,Ur.custom,Ur.search,Ur.view].indexOf(e)}encodeEventToJson(e,t,r){let n=`${e}Event=${encodeURIComponent(JSON.stringify(t))}`;return r&&(n=`access_token=${encodeURIComponent(r)}&${n}`),n}}(e),window.addEventListener("beforeunload",(()=>{let e=t();for(let{eventType:t,payload:r}of e)this.beaconClient.sendEvent(t,r)}))}getClientDependingOnEventType(e){return"click"===e&&this.beaconClient.isAvailable()?this.beaconClient:this.client}}(e,(()=>{let e=[...this.bufferedRequests];return this.bufferedRequests=[],e})):(typeof navigator<"u"&&"ReactNative"==navigator.product&&console.warn("\n We've detected you're using React Native but have not provided the corresponding runtime, \n for an optimal experience please use the \"coveo.analytics/react-native\" subpackage.\n Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native\n "),new class{constructor(e,t){this.storage=t||new Dn,this.client=new Li(e)}
1getClientDependingOnEventType(e){return this.client}}(e))}get storage(){return this.runtime.storage}determineVisitorId(){return yn(this,void 0,void 0,(function*(){try{return vn()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Nn()}catch(e){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",e),Nn()}}))}getCurrentVisitorId(){return yn(this,void 0,void 0,(function*(){if(!this.visitorId){let e=yield this.determineVisitorId();yield this.setCurrentVisitorId(e)}return this.visitorId}))}setCurrentVisitorId(e){return yn(this,void 0,void 0,(function*(){this.visitorId=e,yield this.storage.setItem("visitorId",e)}))}setClientId(e,t){return yn(this,void 0,void 0,(function*(){if($n(e))this.setCurrentVisitorId(e.toLowerCase());else{if(!t)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Yn(e,Yn(t,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}}))}getParameters(e,...t){return yn(this,void 0,void 0,(function*(){return yield this.resolveParameters(e,...t)}))}getPayload(e,...t){return yn(this,void 0,void 0,(function*(){let r=yield this.resolveParameters(e,...t);return yield this.resolvePayloadForParameters(e,r)}))}get currentVisitorId(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(Nn()),this.visitorId}set currentVisitorId(e){this.visitorId=e,this.storage.setItem("visitorId",e)}extractClientIdFromLink(e){if(zi())return null;try{let t=new URL(e).searchParams.get(Xn.cvo_cid);if(null==t)return null;let r=Xn.fromString(t);return r&&bn()&&r.validate(document.referrer,this.acceptedLinkReferrers)?r.clientId:null}catch{}return null}resolveParameters(e,...t){return yn(this,void 0,void 0,(function*(){let{variableLengthArgumentsNames:r=[],addVisitorIdParameter:n=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[e]||{};return yield[e=>r.length>0?this.parseVariableArgumentsPayload(r,e):e[0],e=>yn(this,void 0,void 0,(function*(){return Object.assign(Object.assign({},e),{visitorId:n?yield this.getCurrentVisitorId():""})})),e=>yn(this,void 0,void 0,(function*(){return a?Object.assign(Object.assign({},e),{clientId:yield this.getCurrentVisitorId()}):e})),e=>i?this.ensureAnonymousUserWhenUsingApiKey(e):e,t=>this.beforeSendHooks.reduce(((t,r)=>yn(this,void 0,void 0,(function*(){let n=yield t;return yield r(e,n)}))),t)].reduce(((e,t)=>yn(this,void 0,void 0,(function*(){let r=yield e;return yield t(r)}))),Promise.resolve(t))}))}resolvePayloadForParameters(e,t){return yn(this,void 0,void 0,(function*(){let{usesMeasurementProtocol:r=!1}=this.eventTypeMapping[e]||{};return yield[e=>this.setTrackingIdIfTrackingIdNotPresent(e),t=>this.removeEmptyPayloadValues(t,e),t=>this.validateParams(t,e),e=>r?(e=>{let t=!!e.action&&fi[e.action]||{};return ei(e).reduce(((r,n)=>{let i=t[n]||ji[n]||n;return Object.assign(Object.assign({},r),{[i]:e[n]})}),{})})(e):e,e=>r?this.removeUnknownParameters(e):e,e=>r?this.processCustomParameters(e):this.mapCustomParametersToCustomData(e)].reduce(((e,t)=>yn(this,void 0,void 0,(function*(){let r=yield e;return yield t(r)}))),Promise.resolve(t))}))}makeEvent(e,...t){return yn(this,void 0,void 0,(function*(){let{newEventType:r=e}=this.eventTypeMapping[e]||{},n=yield this.resolveParameters(e,...t),i=yield this.resolvePayloadForParameters(e,n);return{eventType:r,payload:i,log:t=>yn(this,void 0,void 0,(function*(){return this.bufferedRequests.push({eventType:r,payload:Object.assign(Object.assign({},i),t)}),yield Promise.all(this.afterSendHooks.map((r=>r(e,Object.assign(Object.assign({},n),t))))),yield this.deferExecution(),yield this.sendFromBuffer()}))}}))}sendEvent(e,...t){return yn(this,void 0,void 0,(function*(){return(yield this.makeEvent(e,...t)).log({})}))}deferExecution(){return new Promise((e=>setTimeout(e,0)))}sendFromBuffer(){return yn(this,void 0,void 0,(function*(){let e=this.bufferedRequests.shift();if(e){let{eventType:t,payload:r}=e;return this.runtime.getClientDependingOnEventType(t).sendEvent(t,r)}}))}clear(){this.storage.removeItem("visitorId"),(new Tn).clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(e){return yn(this,void 0,void 0,(function*(){return this.makeEvent(Ur.search,e)}))}sendSearchEvent(e){var{searchQueryUid:t}=e,r=mn(e,["searchQueryUid"]);return yn(this,void 0,void 0,(function*(){return(yield this.makeSearchEvent(r)).log({searchQueryUid:t})}))}makeClickEvent(e){return yn(this,void 0,void 0,(function*(){return this.makeEvent(Ur.click,e)}))}sendClickEvent(e){var{searchQueryUid:t}=e,r=mn(e,["searchQueryUid"]);return yn(this,void 0,void 0,(function*(){return(yield this.makeClickEvent(r)).log({searchQueryUid:t})}))}makeCustomEvent(e){return yn(this,void 0,void 0,(function*(){return this.makeEvent(Ur.custom,e)}))}sendCustomEvent(e){var{lastSearchQueryUid:t}=e,r=mn(e,["lastSearchQueryUid"]);return yn(this,void 0,void 0,(function*(){return(yield this.makeCustomEvent(r)).log({lastSearchQueryUid:t})}))}makeViewEvent(e){return yn(this,void 0,void 0,(function*(){return this.makeEvent(Ur.view,e)}))}sendViewEvent(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeViewEvent(e)).log({})}))}getVisit(){return yn(this,void 0,void 0,(function*(){let e=yield(yield fetch(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=e.visitorId,e}))}getHealth(){return yn(this,void 0,void 0,(function*(){return yield(yield fetch(`${this.baseUrl}/analytics/monitoring/health`)).json()}))}registerBeforeSendEventHook(e){this.beforeSendHooks.push(e)}registerAfterSendEventHook(e){this.afterSendHooks.push(e)}addEventTypeMapping(e,t){this.eventTypeMapping[e]=t}setAcceptedLinkReferrers(e){if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=e}parseVariableArgumentsPayload(e,t){let r={};for(let n=0,i=t.length;n<i;n++){let i=t[n];if("string"==typeof i)r[e[n]]=i;else if("object"==typeof i)return Object.assign(Object.assign({},r),i)}return r}isKeyAllowedEmpty(e,t){return-1!==({[Ur.search]:["queryText"]}[e]||[]).indexOf(t)}removeEmptyPayloadValues(e,t){return Object.keys(e).filter((r=>this.isKeyAllowedEmpty(t,r)||(e=>typeof e<"u"&&null!==e&&""!==e)(e[r]))).reduce(((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]})),{})}removeUnknownParameters(e){return Object.keys(e).filter((e=>{if((e=>[...Ti,...si,Pi,_i].some((t=>t(e))))(e))return!0;console.log(e,"is not processed by coveoua")})).reduce(((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]})),{})}processCustomParameters(e){let{custom:t}=e,r=mn(e,["custom"]),n={};t&&ti(t)&&(n=this.lowercaseKeys(t));let i=(e=>ei(e).reduce(((t,r)=>{let n=$i(r);return n?Object.assign(Object.assign({},t),Qi(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})}),{}))(r);return Object.assign(Object.assign({},n),i)}mapCustomParametersToCustomData(e){let{custom:t}=e,r=mn(e,["custom"]);if(t&&ti(t)){let n=this.lowercaseKeys(t);return Object.assign(Object.assign({},r),{customData:Object.assign(Object.assign({},n),e.customData)})}return e}lowercaseKeys(e){let t=Object.keys(e),r={};return t.forEach((t=>{r[t.toLowerCase()]=e[t]})),r}validateParams(e,t){let{anonymizeIp:r}=e,n=mn(e,["anonymizeIp"]);return void 0!==r&&-1==["0","false","undefined","null","{}","[]",""].indexOf(`${r}`.toLowerCase())&&(n.anonymizeIp=1),(t==Ur.view||t==Ur.click||t==Ur.search||t==Ur.custom)&&(n.originLevel3=this.limit(n.originLevel3,1024)),t==Ur.view&&(n.location=this.limit(n.location,1024)),("pageview"==t||"event"==t)&&(n.referrer=this.limit(n.referrer,2048),n.location=this.limit(n.location,2048),n.page=this.limit(n.page,2048)),n}ensureAnonymousUserWhenUsingApiKey(e){let{userId:t}=e,r=mn(e,["userId"]);return(e=>e?.startsWith("xx")||!1)(this.options.token)&&!t?(r.userId="anonymous",r):e}setTrackingIdIfTrackingIdNotPresent(e){let{trackingId:t}=e,r=mn(e,["trackingId"]);return t?e:(r.hasOwnProperty("custom")&&ti(r.custom)&&(r.custom.hasOwnProperty("context_website")||r.custom.hasOwnProperty("siteName"))&&(r.trackingId=r.custom.context_website||r.custom.siteName),r.hasOwnProperty("customData")&&ti(r.customData)&&(r.customData.hasOwnProperty("context_website")||r.customData.hasOwnProperty("siteName"))&&(r.trackingId=r.customData.context_website||r.customData.siteName),r)}limit(e,t){return"string"==typeof e?function(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(128!=(128&n))break;if(r-=3,128!=(192&n)){t-r>=3*ri(n)&&(r=t);break}}return e.substring(0,r)}(e,t):e}get baseUrl(){return function(e=Hi,t="v15",r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}};!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"}(Bi||(Bi={})),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.
1showLessFoldedResults="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.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"}(Yi||(Yi={}));var Gi={[Yi.triggerNotify]:"queryPipelineTriggers",[Yi.triggerExecute]:"queryPipelineTriggers",[Yi.triggerQuery]:"queryPipelineTriggers",[Yi.triggerRedirect]:"queryPipelineTriggers",[Yi.queryError]:"errors",[Yi.queryErrorBack]:"errors",[Yi.queryErrorClear]:"errors",[Yi.queryErrorRetry]:"errors",[Yi.pagerNext]:"getMoreResults",[Yi.pagerPrevious]:"getMoreResults",[Yi.pagerNumber]:"getMoreResults",[Yi.pagerResize]:"getMoreResults",[Yi.pagerScrolling]:"getMoreResults",[Yi.facetSearch]:"facet",[Yi.facetShowLess]:"facet",[Yi.facetShowMore]:"facet",[Yi.recommendation]:"recommendation",[Yi.likeSmartSnippet]:"smartSnippet",[Yi.dislikeSmartSnippet]:"smartSnippet",[Yi.expandSmartSnippet]:"smartSnippet",[Yi.collapseSmartSnippet]:"smartSnippet",[Yi.openSmartSnippetFeedbackModal]:"smartSnippet",[Yi.closeSmartSnippetFeedbackModal]:"smartSnippet",[Yi.sendSmartSnippetReason]:"smartSnippet",[Yi.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[Yi.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[Yi.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[Yi.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[Yi.clearRecentQueries]:"recentQueries",[Yi.recentResultClick]:"recentlyClickedDocuments",[Yi.clearRecentResults]:"recentlyClickedDocuments",[Yi.showLessFoldedResults]:"folding",[Yi.caseDetach]:"case",[Yi.likeGeneratedAnswer]:"generatedAnswer",[Yi.dislikeGeneratedAnswer]:"generatedAnswer",[Yi.openGeneratedAnswerSource]:"generatedAnswer",[Yi.generatedAnswerStreamEnd]:"generatedAnswer",[Yi.generatedAnswerSourceHover]:"generatedAnswer",[Yi.generatedAnswerCopyToClipboard]:"generatedAnswer",[Yi.generatedAnswerHideAnswers]:"generatedAnswer",[Yi.generatedAnswerShowAnswers]:"generatedAnswer",[Yi.generatedAnswerExpand]:"generatedAnswer",[Yi.generatedAnswerCollapse]:"generatedAnswer",[Yi.generatedAnswerFeedbackSubmit]:"generatedAnswer",[Yi.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Bi.expandToFullUI]:"interface",[Bi.openUserActions]:"User Actions",[Bi.showPrecedingSessions]:"User Actions",[Bi.showFollowingSessions]:"User Actions",[Bi.clickViewedDocument]:"User Actions",[Bi.clickPageView]:"User Actions",[Bi.createArticle]:"createArticle"},Ki=class{constructor(){this.runtime=new Vi,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(e){return Promise.resolve({eventType:e,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(Ur.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Ur.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Ur.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Ur.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Wn}};function Ji(e){let t=e.join(";");return t.length<=256?t:Ji(e.slice(1))}var Zi=e=>{let t=function(e){return e.map((e=>e.replace(/;/g,"")))}(e),r=function(e){let t="";return e.filter((e=>{let r=e!==t;return t=e,r}))}(t);return Ji(r)};function Xi(e){let t="string"==typeof e.partialQueries?e.partialQueries:Zi(e.partialQueries),r="string"==typeof e.suggestions?e.suggestions:Zi(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var ea,ta,ra,na=class{constructor(e,t){this.opts=e,this.provider=t;let r=!1===e.enableAnalytics||zi();this.coveoAnalyticsClient=r?new Ki:new Wi(e)}disable(){this.coveoAnalyticsClient=new Ki}enable(){this.coveoAnalyticsClient=new Wi(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(Yi.interfaceLoad)}logInterfaceLoad(){return yn(this,void 0,void 0,(function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})}))}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(Yi.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return yn(this,void 0,void 0,(function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})}))}makeRecommendation(){return this.makeCustomEvent(Yi.recommendation)}logRecommendation(){return yn(this,void 0,void 0,(function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})}))}makeRecommendationOpen(e,t){return this.makeClickEvent(Yi.recommendationOpen,e,t)}logRecommendationOpen(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeRecommendationOpen(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeStaticFilterClearAll(e){return this.makeSearchEvent(Yi.staticFilterClearAll,e)}logStaticFilterClearAll(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeStaticFilterClearAll(e)).log({searchUID:this.provider.getSearchUID()})}))}makeStaticFilterSelect(e){return this.makeSearchEvent(Yi.staticFilterSelect,e)}logStaticFilterSelect(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeStaticFilterSelect(e)).log({searchUID:this.provider.getSearchUID()})}))}makeStaticFilterDeselect(e){return this.makeSearchEvent(Yi.staticFilterDeselect,e)}logStaticFilterDeselect(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeStaticFilterDeselect(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFetchMoreResults(){return this.makeCustomEvent(Yi.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return yn(this,void 0,void 0,(function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})}))}makeInterfaceChange(e){return this.makeSearchEvent(Yi.interfaceChange,e)}logInterfaceChange(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeInterfaceChange(e)).log({searchUID:this.provider.getSearchUID()})}))}makeDidYouMeanAutomatic(){return this.makeSearchEvent(Yi.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return yn(this,void 0,void 0,(function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})}))}makeDidYouMeanClick(){return this.makeSearchEvent(Yi.didyoumeanClick)}logDidYouMeanClick(){return yn(this,void 0,void 0,(function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})}))}makeResultsSort(e){return this.makeSearchEvent(Yi.resultsSort,e)}logResultsSort(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeResultsSort(e)).log({searchUID:this.provider.getSearchUID()})}))}makeSearchboxSubmit(){return this.makeSearchEvent(Yi.searchboxSubmit)}logSearchboxSubmit(){return yn(this,void 0,void 0,(function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})}))}makeSearchboxClear(){return this.makeSearchEvent(Yi.searchboxClear)}logSearchboxClear(){return yn(this,void 0,void 0,(function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})}))}makeSearchboxAsYouType(){return this.makeSearchEvent(Yi.searchboxAsYouType)}logSearchboxAsYouType(){return yn(this,void 0,void 0,(function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})}))}makeBreadcrumbFacet(e){return this.makeSearchEvent(Yi.breadcrumbFacet,e)}logBreadcrumbFacet(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeBreadcrumbFacet(e)).log({searchUID:this.provider.getSearchUID()})}))}makeBreadcrumbResetAll(){return this.makeSearchEvent(Yi.breadcrumbResetAll)}logBreadcrumbResetAll(){return yn(this,void 0,void 0,(function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})}))}makeDocumentQuickview(e,t){return this.makeClickEvent(Yi.documentQuickview,e,t)}logDocumentQuickview(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeDocumentQuickview(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeDocumentOpen(e,t){return this.makeClickEvent(Yi.documentOpen,e,t)}logDocumentOpen(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeDocumentOpen(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeOmniboxAnalytics(e){return this.makeSearchEvent(Yi.omniboxAnalytics,Xi(e))}logOmniboxAnalytics(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeOmniboxAnalytics(e)).log({searchUID:this.provider.getSearchUID()})}))}makeOmniboxFromLink(e){return this.makeSearchEvent(Yi.omniboxFromLink,Xi(e))}logOmniboxFromLink(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeOmniboxFromLink(e)).log({searchUID:this.provider.getSearchUID()})}))}makeSearchFromLink(){return this.makeSearchEvent(Yi.searchFromLink)}logSearchFromLink(){return yn(this,void 0,void 0,(function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})}))}makeTriggerNotify(e){return this.makeCustomEvent(Yi.triggerNotify,e)}logTriggerNotify(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeTriggerNotify(e)).log({searchUID:this.provider.getSearchUID()})}))}makeTriggerExecute(e){return this.makeCustomEvent(Yi.triggerExecute,e)}logTriggerExecute(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeTriggerExecute(e)).log({searchUID:this.provider.getSearchUID()})}))}makeTriggerQuery(){return this.makeCustomEvent(Yi.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return yn(this,void 0,void 0,(function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})}))}makeUndoTriggerQuery(e){return this.makeSearchEvent(Yi.undoTriggerQuery,e)}logUndoTriggerQuery(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeUndoTriggerQuery(e)).log({searchUID:this.provider.getSearchUID()})}))}makeTriggerRedirect(e){return this.makeCustomEvent(Yi.triggerRedirect,Object.assign(Object.assign({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeTriggerRedirect(e)).log({searchUID:this.provider.getSearchUID()})}))}makePagerResize(e){return this.makeCustomEvent(Yi.pagerResize,e)}logPagerResize(e){return yn(this,void 0,void 0,(function*(){return(yield this.makePagerResize(e)).log({searchUID:this.provider.getSearchUID()})}))}makePagerNumber(e){return this.makeCustomEvent(Yi.pagerNumber,e)}logPagerNumber(e){return yn(this,void 0,void 0,(function*(){return(yield this.makePagerNumber(e)).log({searchUID:this.provider.getSearchUID()})}))}makePagerNext(e){return this.makeCustomEvent(Yi.pagerNext,e)}logPagerNext(e){return yn(this,void 0,void 0,(function*(){return(yield this.makePagerNext(e)).log({searchUID:this.provider.getSearchUID()})}))}makePagerPrevious(e){return this.makeCustomEvent(Yi.pagerPrevious,e)}logPagerPrevious(e){return yn(this,void 0,void 0,(function*(){return(yield this.makePagerPrevious(e)).log({searchUID:this.provider.getSearchUID()})}))}makePagerScrolling(){return this.makeCustomEvent(Yi.pagerScrolling)}logPagerScrolling(){return yn(this,void 0,void 0,(function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})}))}makeFacetClearAll(e){return this.makeSearchEvent(Yi.facetClearAll,e)}logFacetClearAll(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetClearAll(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetSearch(e){return this.makeSearchEvent(Yi.facetSearch,e)}logFacetSearch(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetSearch(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetSelect(e){return this.makeSearchEvent(Yi.facetSelect,e)}logFacetSelect(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetSelect(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetDeselect(e){return this.makeSearchEvent(Yi.facetDeselect,e)}logFacetDeselect(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetDeselect(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetExclude(e){return this.makeSearchEvent(Yi.facetExclude,e)}logFacetExclude(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetExclude(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetUnexclude(e){return this.makeSearchEvent(Yi.facetUnexclude,e)}logFacetUnexclude(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetUnexclude(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetSelectAll(e){return this.makeSearchEvent(Yi.facetSelectAll,e)}logFacetSelectAll(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetSelectAll(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetUpdateSort(e){return this.makeSearchEvent(Yi.facetUpdateSort,e)}
1logFacetUpdateSort(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetUpdateSort(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetShowMore(e){return this.makeCustomEvent(Yi.facetShowMore,e)}logFacetShowMore(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetShowMore(e)).log({searchUID:this.provider.getSearchUID()})}))}makeFacetShowLess(e){return this.makeCustomEvent(Yi.facetShowLess,e)}logFacetShowLess(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeFacetShowLess(e)).log({searchUID:this.provider.getSearchUID()})}))}makeQueryError(e){return this.makeCustomEvent(Yi.queryError,e)}logQueryError(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeQueryError(e)).log({searchUID:this.provider.getSearchUID()})}))}makeQueryErrorBack(){return yn(this,void 0,void 0,(function*(){let e=yield this.makeCustomEvent(Yi.queryErrorBack);return{description:e.description,log:()=>yn(this,void 0,void 0,(function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(Yi.queryErrorBack)}))}}))}logQueryErrorBack(){return yn(this,void 0,void 0,(function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})}))}makeQueryErrorRetry(){return yn(this,void 0,void 0,(function*(){let e=yield this.makeCustomEvent(Yi.queryErrorRetry);return{description:e.description,log:()=>yn(this,void 0,void 0,(function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(Yi.queryErrorRetry)}))}}))}logQueryErrorRetry(){return yn(this,void 0,void 0,(function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})}))}makeQueryErrorClear(){return yn(this,void 0,void 0,(function*(){let e=yield this.makeCustomEvent(Yi.queryErrorClear);return{description:e.description,log:()=>yn(this,void 0,void 0,(function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(Yi.queryErrorClear)}))}}))}logQueryErrorClear(){return yn(this,void 0,void 0,(function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})}))}makeLikeSmartSnippet(){return this.makeCustomEvent(Yi.likeSmartSnippet)}logLikeSmartSnippet(){return yn(this,void 0,void 0,(function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})}))}makeDislikeSmartSnippet(){return this.makeCustomEvent(Yi.dislikeSmartSnippet)}logDislikeSmartSnippet(){return yn(this,void 0,void 0,(function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})}))}makeExpandSmartSnippet(){return this.makeCustomEvent(Yi.expandSmartSnippet)}logExpandSmartSnippet(){return yn(this,void 0,void 0,(function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})}))}makeCollapseSmartSnippet(){return this.makeCustomEvent(Yi.collapseSmartSnippet)}logCollapseSmartSnippet(){return yn(this,void 0,void 0,(function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})}))}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(Yi.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return yn(this,void 0,void 0,(function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})}))}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(Yi.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return yn(this,void 0,void 0,(function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})}))}makeSmartSnippetFeedbackReason(e,t){return this.makeCustomEvent(Yi.sendSmartSnippetReason,{reason:e,details:t})}logSmartSnippetFeedbackReason(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeSmartSnippetFeedbackReason(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeExpandSmartSnippetSuggestion(e){return this.makeCustomEvent(Yi.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})}logExpandSmartSnippetSuggestion(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeExpandSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})}))}makeCollapseSmartSnippetSuggestion(e){return this.makeCustomEvent(Yi.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})}logCollapseSmartSnippetSuggestion(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeCollapseSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})}))}makeShowMoreSmartSnippetSuggestion(e){return this.makeCustomEvent(Yi.showMoreSmartSnippetSuggestion,e)}logShowMoreSmartSnippetSuggestion(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})}))}makeShowLessSmartSnippetSuggestion(e){return this.makeCustomEvent(Yi.showLessSmartSnippetSuggestion,e)}logShowLessSmartSnippetSuggestion(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeShowLessSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})}))}makeOpenSmartSnippetSource(e,t){return this.makeClickEvent(Yi.openSmartSnippetSource,e,t)}logOpenSmartSnippetSource(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeOpenSmartSnippetSource(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeOpenSmartSnippetSuggestionSource(e,t){return this.makeClickEvent(Yi.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)}makeCopyToClipboard(e,t){return this.makeClickEvent(Yi.copyToClipboard,e,t)}logCopyToClipboard(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeCopyToClipboard(e,t)).log({searchUID:this.provider.getSearchUID()})}))}logOpenSmartSnippetSuggestionSource(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeOpenSmartSnippetInlineLink(e,t){return this.makeClickEvent(Yi.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)}logOpenSmartSnippetInlineLink(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeOpenSmartSnippetInlineLink(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeOpenSmartSnippetSuggestionInlineLink(e,t){return this.makeClickEvent(Yi.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)}logOpenSmartSnippetSuggestionInlineLink(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeRecentQueryClick(){return this.makeSearchEvent(Yi.recentQueryClick)}logRecentQueryClick(){return yn(this,void 0,void 0,(function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})}))}makeClearRecentQueries(){return this.makeCustomEvent(Yi.clearRecentQueries)}logClearRecentQueries(){return yn(this,void 0,void 0,(function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})}))}makeRecentResultClick(e,t){return this.makeCustomEvent(Yi.recentResultClick,{info:e,identifier:t})}logRecentResultClick(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeRecentResultClick(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeClearRecentResults(){return this.makeCustomEvent(Yi.clearRecentResults)}logClearRecentResults(){return yn(this,void 0,void 0,(function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})}))}makeNoResultsBack(){return this.makeSearchEvent(Yi.noResultsBack)}logNoResultsBack(){return yn(this,void 0,void 0,(function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})}))}makeShowMoreFoldedResults(e,t){return this.makeClickEvent(Yi.showMoreFoldedResults,e,t)}logShowMoreFoldedResults(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeShowMoreFoldedResults(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeShowLessFoldedResults(){return this.makeCustomEvent(Yi.showLessFoldedResults)}logShowLessFoldedResults(){return yn(this,void 0,void 0,(function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})}))}makeEventDescription(e,t){var r;return{actionCause:t,customData:null===(r=e.payload)||void 0===r?void 0:r.customData}}makeCustomEvent(e,t,r=Gi[e]){return yn(this,void 0,void 0,(function*(){this.coveoAnalyticsClient.getParameters;let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(n)),{eventType:r,eventValue:e}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({lastSearchQueryUid:e})}}))}logCustomEvent(e,t,r=Gi[e]){return yn(this,void 0,void 0,(function*(){return(yield this.makeCustomEvent(e,t,r)).log({searchUID:this.provider.getSearchUID()})}))}makeCustomEventWithType(e,t,r){return yn(this,void 0,void 0,(function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(n)),{eventType:t,eventValue:e}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({lastSearchQueryUid:e})}}))}logCustomEventWithType(e,t,r){return yn(this,void 0,void 0,(function*(){return(yield this.makeCustomEventWithType(e,t,r)).log({searchUID:this.provider.getSearchUID()})}))}logSearchEvent(e,t){return yn(this,void 0,void 0,(function*(){return(yield this.makeSearchEvent(e,t)).log({searchUID:this.provider.getSearchUID()})}))}makeSearchEvent(e,t){return yn(this,void 0,void 0,(function*(){let r=yield this.getBaseSearchEventRequest(e,t),n=yield this.coveoAnalyticsClient.makeSearchEvent(r);return{description:this.makeEventDescription(n,e),log:({searchUID:e})=>n.log({searchQueryUid:e})}}))}makeClickEvent(e,t,r,n){return yn(this,void 0,void 0,(function*(){let i=Object.assign(Object.assign(Object.assign({},t),yield this.getBaseEventRequest(Object.assign(Object.assign({},r),n))),{queryPipeline:this.provider.getPipeline(),actionCause:e}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({searchQueryUid:e})}}))}logClickEvent(e,t,r,n){return yn(this,void 0,void 0,(function*(){return(yield this.makeClickEvent(e,t,r,n)).log({searchUID:this.provider.getSearchUID()})}))}getBaseSearchEventRequest(e,t){var r,n;return yn(this,void 0,void 0,(function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},t),null===(n=(r=this.provider).getGeneratedAnswerMetadata)||void 0===n?void 0:n.call(r)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:e})}))}getBaseEventRequest(e){return yn(this,void 0,void 0,(function*(){let t=Object.assign(Object.assign({},this.provider.getBaseMetadata()),e);return Object.assign(Object.assign(Object.assign({}
1,this.getOrigins()),this.getSplitTestRun()),{customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})}))}getOrigins(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Wi?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})}makeLikeGeneratedAnswer(e){return this.makeCustomEvent(Yi.likeGeneratedAnswer,e)}logLikeGeneratedAnswer(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeLikeGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})}))}makeDislikeGeneratedAnswer(e){return this.makeCustomEvent(Yi.dislikeGeneratedAnswer,e)}logDislikeGeneratedAnswer(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeDislikeGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})}))}makeOpenGeneratedAnswerSource(e){return this.makeCustomEvent(Yi.openGeneratedAnswerSource,e)}logOpenGeneratedAnswerSource(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeOpenGeneratedAnswerSource(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerSourceHover(e){return this.makeCustomEvent(Yi.generatedAnswerSourceHover,e)}logGeneratedAnswerSourceHover(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerSourceHover(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerCopyToClipboard(e){return this.makeCustomEvent(Yi.generatedAnswerCopyToClipboard,e)}logGeneratedAnswerCopyToClipboard(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerHideAnswers(e){return this.makeCustomEvent(Yi.generatedAnswerHideAnswers,e)}logGeneratedAnswerHideAnswers(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerHideAnswers(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerShowAnswers(e){return this.makeCustomEvent(Yi.generatedAnswerShowAnswers,e)}logGeneratedAnswerShowAnswers(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerShowAnswers(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerExpand(e){return this.makeCustomEvent(Yi.generatedAnswerExpand,e)}logGeneratedAnswerExpand(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerExpand(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerCollapse(e){return this.makeCustomEvent(Yi.generatedAnswerCollapse,e)}logGeneratedAnswerCollapse(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerCollapse(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerFeedbackSubmit(e){return this.makeCustomEvent(Yi.generatedAnswerFeedbackSubmit,e)}logGeneratedAnswerFeedbackSubmit(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(e)).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerFeedbackSubmitV2(e){return this.makeCustomEvent(Yi.generatedAnswerFeedbackSubmitV2,e)}logGeneratedAnswerFeedbackSubmitV2(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(e)).log({searchUID:this.provider.getSearchUID()})}))}makeRephraseGeneratedAnswer(e){return this.makeSearchEvent(Yi.rephraseGeneratedAnswer,e)}logRephraseGeneratedAnswer(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeRephraseGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})}))}makeRetryGeneratedAnswer(){return this.makeSearchEvent(Yi.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return yn(this,void 0,void 0,(function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})}))}makeGeneratedAnswerStreamEnd(e){return this.makeCustomEvent(Yi.generatedAnswerStreamEnd,e)}logGeneratedAnswerStreamEnd(e){return yn(this,void 0,void 0,(function*(){return(yield this.makeGeneratedAnswerStreamEnd(e)).log({searchUID:this.provider.getSearchUID()})}))}},ia=Object.assign({},Kn),aa=Object.keys(ia).map((e=>ia[e])),oa=class extends Zn{constructor({client:e,uuidGenerator:t=Nn}){super({client:e,uuidGenerator:t}),this.ticket={}}getApi(e){let t=super.getApi(e);return null!==t?t:"setTicket"===e?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(e){this.ticket=e}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook(((e,...[t])=>-1!==aa.indexOf(e)?this.addSVCDataToPayload(e,t):t)),this.client.registerAfterSendEventHook(((e,...[t])=>(-1!==aa.indexOf(e)&&this.updateLocationInformation(e,t),t)))}addHooksForPageView(){this.client.addEventTypeMapping(ia.pageview,{newEventType:Ur.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(ia.event,{newEventType:Ur.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(e,t){var r;let n=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),Object.keys(null!==(r=this.actionData)&&void 0!==r?r:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),n),t)}getTicketPayload(){return(e=>ei(e).filter((t=>void 0!==e[t])).reduce(((t,r)=>{let n=ni[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})}),{}))(this.ticket)}};oa.Id="svc",function(e){e.click="click",e.flowStart="flowStart"}(ea||(ea={})),function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.suggestionClick="suggestion_click",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"}(ta||(ta={})),function(e){e.quit="Quit",e.solved="Solved"}(ra||(ra={}));var sa=e=>
1new Wi(e).getCurrentVisitorId(),ua=new Mn.HistoryStore,ca=(e,t)=>"function"==typeof t?(...r)=>{let n=re(r[0]);try{return t.apply(t,r)}catch(i){return e.error(i,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,la=(e,t)=>(...r)=>{let n=re(r[1]);try{return t.apply(t,r)}catch(i){return e.error(i,"Error in analytics hook. Returning original request."),n}},da=Ht((e=>e.source),(e=>Object.entries(e).map((([e,t])=>`${e}@${t}`)).concat(`@coveo/headless@${Yr}`)));function pa(e){let{activeValue:t,ancestryMap:r}=function(e){let t=[...e],r=new Map;for(;t.length>0;){let e=t.shift();if("selected"===e.state)return{activeValue:e,ancestryMap:r};if(r)for(let t of e.children)r.set(t,e);t.unshift(...e.children)}return{}}(e);return t?function(e,t){let r=[];if(!e)return[];let n=e;do{r.unshift(n),n=t.get(n)}while(n);return r}(t,r):[]}var ha=(e,t)=>{let r=((e,t)=>e.categoryFacetSet[t]?.request)(e,t);return pa(r?.currentValues??[])};var fa,ga,ma=e=>"specific"===e.type,ya=e=>"hierarchical"===e.type,va=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map((e=>e.request)),wa=e=>[...Object.values(e.automaticFacetSet.set)].map((e=>e.response)),ba=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),Sa=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),ka=e=>({displayValue:e.value,value:e.value}),Ca=(e,t)=>{let r=((e,t)=>ha(e,t).map((e=>e.value)).join(";"))(e,t);return{value:r,valuePosition:1,displayValue:r}},Ia=(e,t)=>({title:qa(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Aa=(e,t)=>({title:qa(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),qa=(e,t)=>`${e}_${t}`,Oa=(e,t)=>{let r=((e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response)(e,t);return r?r.type:"specific"},Ra=((ga=Ra||{}).Ascending="ascending",ga.Descending="descending",ga),xa=((fa=xa||{}).Relevancy="relevancy",fa.QRE="qre",fa.Date="date",fa.Field="field",fa.NoSort="nosort",fa),Da=e=>{if(function(e){return Array.isArray(e)}(e))return e.map((e=>Da(e))).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""}};new K({values:{by:new X({enum:xa,required:!0}),order:new X({enum:Ra}),field:new W}});function Ea(){return Da({by:"relevancy"})}var Ta=class{constructor(e){this.getState=e,this.state=e()}getLanguage(){return(e=>{let t=e.configuration.search.locale.split("-")[0];return t&&2===t.length?t:"en"})(this.state)}getBaseMetadata(){let{context:e,configuration:t}=this.state,r=e?.contextValues||{},n={};for(let[i,a]of Object.entries(r)){n[`context_${i}`]=a}return"legacy"===t.analytics.analyticsMode&&(n.coveoHeadlessVersion=Yr),n}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||"default"}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}},Ma=class e extends Ta{constructor(){super(...arguments),this.getFacetRequest=e=>this.state.facetSet?.[e]?.request||this.state.categoryFacetSet?.[e]?.request||this.state.dateFacetSet?.[e]?.request||this.state.numericFacetSet?.[e]?.request||this.state.automaticFacetSet?.set[e]?.response}getFacetState(){return(e=>{let t=[];return va(e).forEach(((r,n)=>{let i=Oa(e,r.facetId),a=Aa(r,n+1);if(ya(r)){if(!ha(e,r.facetId).length)return;t.push({...a,...Ca(e,r.facetId),facetType:i,state:"selected"})}else r.currentValues.forEach(((e,n)=>{if("idle"===e.state)return;let o=ba(e,n+1,i),s=ma(r)?ka(e):Sa(e);t.push({...a,...o,...s})}))})),wa(e).forEach(((e,r)=>{let n=Ia(e,r+1);e.values.forEach(((e,r)=>{if("idle"===e.state)return;let i=ba(e,r+1,"specific"),a=ka(e);t.push({...n,...i,...a})}))})),t})(function(e){return{facetSet:e.facetSet??{},categoryFacetSet:e.categoryFacetSet??{},dateFacetSet:e.dateFacetSet??{},numericFacetSet:e.numericFacetSet??{},automaticFacetSet:e.automaticFacetSet??{desiredCount:5,numberOfValues:8,set:{}}}}(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||e.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let e=this.getState();return e.search?.searchResponseId||e.search?.response.searchUid||""}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.search?.response.pipeline||this.state.pipeline||e.fallbackPipelineName;return t?r:void 0}getBaseMetadata(){let e=this.getState(),t=super.getBaseMetadata(),r=e.search?.response?.extendedResults?.generativeQuestionAnsweringId;return r&&(t.generativeQuestionAnsweringId=r),t}
1getFacetMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:r,facetValue:t,facetTitle:`${r}_${e}`}}getFacetClearAllMetadata(e){let t=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:t,facetTitle:`${t}_${e}`}}getFacetUpdateSortMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:r,criteria:t,facetTitle:`${r}_${e}`}}getRangeBreadcrumbFacetMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:r,facetRangeEnd:t.end,facetRangeEndInclusive:t.endInclusive,facetRangeStart:t.start,facetTitle:`${r}_${e}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Ea()}}getStaticFilterToggleMetadata(e,t){return{...this.getBaseMetadata(),staticFilterId:e,staticFilterValue:t}}getStaticFilterClearAllMetadata(e){return{...this.getBaseMetadata(),staticFilterId:e}}getUndoTriggerQueryMetadata(e){return{...this.getBaseMetadata(),undoneQuery:e}}getCategoryBreadcrumbFacetMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:e,categoryFacetField:r,categoryFacetPath:t,categoryFacetTitle:`${r}_${e}`}}getOmniboxAnalyticsMetadata(e,t){let r=this.state.querySuggest&&this.state.querySuggest[e],n=r.completions.map((e=>e.expression)),i=r.partialQueries.length-1,a=r.partialQueries[i]||"",o=r.responseId;return{...this.getBaseMetadata(),suggestionRanking:n.indexOf(t),partialQuery:a,partialQueries:r.partialQueries.length>0?r.partialQueries:"",suggestions:n.length>0?n:"",querySuggestResponseId:o}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(e){return{...this.getBaseMetadata(),...e}}getGeneratedAnswerMetadata(){let e=this.getState(),t={};return void 0!==e.generatedAnswer?.isVisible&&(t.showGeneratedAnswer=e.generatedAnswer.isVisible),t}get resultURIs(){return this.results?.map((e=>({documentUri:e.uri,documentUriHash:e.raw.urihash})))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||""}get responseTime(){return this.state.search?.duration||0}get numberOfResults(){return this.state.search?.response.totalCountFiltered||0}};Ma.fallbackPipelineName="default";var Fa=Ma,ja=()=>{let e=ua.getHistory().reverse().find((e=>"PageView"===e.name&&e.value));return e?e.value:""},Ua=async(e,t)=>{let r="next"===e.analyticsMode;return{analytics:{clientId:await sa(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},...ja()&&{pageId:ja()},...r&&e.trackingId&&{trackingId:e.trackingId},capture:r,...r&&{source:da(e)}}}},Pa=class extends Ta{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:"",responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||""}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let e=!!this.getSplitTestRunName(),t=this.state.recommendation?.pipeline||this.state.pipeline||"default";return e?t:void 0}get responseTime(){return this.state.recommendation?.duration||0}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map((e=>({documentUri:e.uri,documentUriHash:e.raw.urihash})))}get numberOfResults(){return this.state.recommendation?.recommendations.length||[].length}};var _a=/^(?:[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 $a(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,i=n.getItem(t),a=i&&function(e){return"string"==typeof e&&_a.test(e)}(i)?i:r.generateUUID();return n.setItem(t,a),a}}}var Qa="0.7.10";function La(e){return(e.source||[]).concat([`relay@${Qa}`])}function Va(e,t,r,n){let{getReferrer:i,getLocation:a,getUserAgent:o}=r,s=function(e){let{trackingId:t}=e;return{trackingId:t}}(t),u=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:La(t),clientId:u,userAgent:o(),referrer:i(),location:a()})}function Na(){let e=[];function t({type:t,callback:r}){return e.findIndex((e=>e.type===t&&e.callback===r))}function r(r,n){n?function(r){let n=t(r);n>=0&&e.splice(n,1)}({type:r,callback:n}):function(t){if("*"===t)e.length=0;else for(let r=e.length-1;r>=0;r--)e[r].type===t&&e.splice(r,1)}(r)}return{add:function(n){return t(n)<0&&e.push(n),()=>r(n.type,n.callback)},call:function(t){e.forEach((e=>{if(function(e,t){return"*"===e.type||t===e.type}(e,t.meta.type))try{e.callback(t)}catch(r){console.error(r)}}))},remove:r}}function za({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}})}var Ha=function(){let e="coveo_";return{getItem(t){let r=`${e}${t}=`,n=document.cookie.split(";");for(let e of n){let t=e.replace(/^\s+/,"");if(0===t.lastIndexOf(r,0))return t.substring(r.length,t.length)}return null},setItem(t,r,n){let i=(e=>{let t=e.split(".").slice(-2);return 2==t.length?t.join("."):""})(window.location.hostname),a=`;expires=${new Date((new Date).getTime()+n).toUTCString()}`,o=i?`;domain=${i}`:"";document.cookie=`${e}${t}=${r}${a}${o};path=/;SameSite=Lax`},removeItem(e){this.setItem(e,"",-1)}}}();function Ba(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(function(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>function(){let e=document.referrer;return""===e?null:e}(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:{getItem:e=>Ha.getItem(e)||localStorage.getItem(e),removeItem(e){Ha.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ha.setItem(e,t,31556952e3)}}}}function Ya(e){return"disabled"!==e.get().mode&&function(){try{return"object"==typeof window}catch{return!1}}()&&function(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name&&localStorage&&0!==localStorage.length}}()?Ba():{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:{getItem:()=>null,removeItem(){},setItem(){}}}}function Wa(e){let t=function(e){let t=za(e);return{get:()=>t,update:e=>{t=za({...t,...e})}}}(e),r=Na(),n=function(e){return{get:()=>Object.freeze(Ya(e))}}(t),i=$a(n);return{emit:(e,a)=>{let o=t.get(),s=n.get(),u=function(e,t,r,n,i){return{...t,meta:Va(e,r,n,i)}}(e,a,o,s,i);return function({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:a,mode:o}=e;"disabled"!==o&&(n.call(r),t.send(i,a,r))}({config:o,environment:s,event:u,listenerManager:r})},getMeta:e=>Va(e,t.get(),n.get(),i),on:(e,t)=>r.add({type:e,callback:t}),off:(e,t)=>r.remove(e,t),updateConfig:e=>t.update(e),version:Qa}}var Ga=Ht((e=>e.configuration.accessToken),(e=>e.configuration.analytics),(e=>da(e.configuration.analytics)),((e,{trackingId:t,nextApiBaseUrl:r,enabled:n},i)=>Wa({mode:n?"emit":"disabled",url:r,token:e,trackingId:t,source:i}))),Ka=class{constructor(e){this.state=e()}getSearchUID(){return null}getOriginLevel1(){return this.state.searchHub||"default"}},Ja=class extends Ta{constructor(){super(...arguments),this.initialState={url:"",clientId:"",additionalFields:[],advancedParameters:{debug:!1},products:[],facets:{results:[]},error:null,isLoading:!1,responseId:""}}getPipeline(){return""}getSearchEventRequestPayload(){return{queryText:"",responseTime:0,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}
1getSearchUID(){return this.getState().productListing?.responseId||this.initialState.responseId}mapResultsToAnalyticsDocument(){return this.state.productListing?.products.map((e=>({documentUri:e.documentUri,documentUriHash:e.documentUriHash,permanentid:e.permanentid})))}get numberOfResults(){return this.state.productListing.products.length}};function Za(e){let t=Xa(e),r=[e,...t].filter((e=>e.parentResult)).map((e=>e.parentResult));return function(e,t){return[...e.reduce(((e,r)=>{let n=t(r);return e.has(n)||e.set(n,r),e}),new Map).values()]}([e,...t,...r],(e=>e.uniqueId))}function Xa(e){return e.childResults?e.childResults.flatMap((e=>[e,...Xa(e)])):[]}function eo(e,t){let r=t=>function(e){return Object.assign(e,{instantlyCallable:!0})}(Ir(e,t)),n=r((async(e,{getState:r,extra:n})=>{let{analyticsClientMiddleware:i,preprocessRequest:a,logger:o}=n;return await(await t({getState:r,analyticsClientMiddleware:i,preprocessRequest:a,logger:o})).log({state:r(),extra:n})}));return Object.assign(n,{prepare:async({getState:e,analyticsClientMiddleware:n,preprocessRequest:i,logger:a})=>{let{description:o,log:s}=await t({getState:e,analyticsClientMiddleware:n,preprocessRequest:i,logger:a});return{description:o,action:r((async(e,{getState:t,extra:r})=>await s({state:t(),extra:r})))}}}),n}var to=(e,t,r)=>function(...n){let i=1===n.length?{...n[0],__legacy__getBuilder:t(n[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:n[0],__legacy__getBuilder:t(n[1]),__legacy__provider:n[2],analyticsConfigurator:e,providerClass:r};return ro(i)},ro=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:i,analyticsConfigurator:a,providerClass:o})=>(r??(r=e=>new o(e)),eo(e,(async({getState:e,analyticsClientMiddleware:o,preprocessRequest:s,logger:u})=>{let c=[],l={log:async({state:e})=>{for(let t of c)await t(e)}},d=e(),p=a({getState:e,logger:u,analyticsClientMiddleware:o,preprocessRequest:s,provider:r(e)}),h=await t(p,e());l.description=h?.description,c.push((async e=>{(e=>"legacy"===e.configuration.analytics.analyticsMode)(e)&&await async function(e,t,r,n,i){t((()=>r));let a=await(e?.log({searchUID:t((()=>r)).getSearchUID()}));n.info({client:i,response:a},"Analytics response")}(h,r,e,u,p.coveoAnalyticsClient)}));let{emit:f}=Ga(d);return c.push((async e=>{if((e=>"next"===e.configuration.analytics.analyticsMode)(e)&&i&&n){let t=n(e);await async function(e,t,r){await e(t,r)}(f,i,t)}})),l})));var no=to((({logger:e,getState:t,analyticsClientMiddleware:r=((e,t)=>t),preprocessRequest:n,provider:i=new Fa(t)})=>{let a=t(),o=a.configuration.accessToken,s=a.configuration.analytics.apiBaseUrl,u=a.configuration.analytics.runtimeEnvironment,c=a.configuration.analytics.enabled,l=new na({token:o,endpoint:s,runtimeEnvironment:u,preprocessRequest:ca(e,n),beforeSendHooks:[la(e,r),(t,r)=>(e.info({...r,type:t,endpoint:s,token:o},"Analytics request"),r)]},i);return c||l.disable(),l}),(e=>e),Fa),io=(to((({logger:e,getState:t,analyticsClientMiddleware:r=((e,t)=>t),preprocessRequest:n,provider:i=new Ka(t)})=>{let a=t(),o=a.configuration.accessToken,s=a.configuration.analytics.apiBaseUrl,u=a.configuration.analytics.runtimeEnvironment,c=a.configuration.analytics.enabled,l=new class{constructor(e,t){var r;this.options=e,this.provider=t;let n=(null===(r=e.enableAnalytics)||void 0===r||r)&&!zi();this.coveoAnalyticsClient=n?new Wi(e):new Ki,this.svc=new oa({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ki,this.svc=new oa({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Wi(this.options),this.svc=new oa({client:this.coveoAnalyticsClient})}logEnterInterface(e){return this.svc.setAction(ta.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()}logUpdateCaseField(e){return this.svc.setAction(ta.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logSelectFieldSuggestion(e){return this.svc.setAction(ta.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(e){return this.svc.setAction(ta.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()}logRateDocumentSuggestion(e){return this.svc.setAction(ta.suggestionRate,Object.assign({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()}
1logMoveToNextCaseStep(e){return this.svc.setAction(ta.nextCaseStep,{stage:e?.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logCaseCancelled(e){return this.svc.setAction(ta.caseCancelled,{reason:ra.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logCaseSolved(e){return this.svc.setAction(ta.caseSolved,{reason:ra.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()}logCaseCreated(e){return this.svc.setAction(ta.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",ea.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",ea.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}}({enableAnalytics:c,token:o,endpoint:s,runtimeEnvironment:u,preprocessRequest:ca(e,n),beforeSendHooks:[la(e,r),(t,r)=>(e.info({...r,type:t,endpoint:s,token:o},"Analytics request"),r)]},i);return c||l.disable(),l}),(e=>t=>(r,n)=>Promise.resolve({description:{actionCause:e},log:async e=>{t(r,n)}}))("caseAssist"),Ka),to((({logger:e,getState:t,analyticsClientMiddleware:r=((e,t)=>t),preprocessRequest:n,provider:i=new Ja(t)})=>{let a=t(),o=a.configuration.accessToken,s=a.configuration.analytics.apiBaseUrl,u=a.configuration.analytics.runtimeEnvironment,c=a.configuration.analytics.enabled,l=new na({token:o,endpoint:s,runtimeEnvironment:u,preprocessRequest:ca(e,n),beforeSendHooks:[la(e,r),(t,r)=>(e.info({...r,type:t,endpoint:s,token:o},"Analytics request"),r)]},i);return c||l.disable(),l}),(e=>e),Ja)),ao=(e,t)=>{let r=-1,n=t.search?.results;return r=go(e,n),r<0&&(r=function(e,t){for(let[r,n]of t.entries()){if(-1!==go(e,Za(n)))return r}return-1}(e,n)),r<0&&(r=0),oo(e,(e=>e+(t.pagination?.firstResult??0))(r),t)};function oo(e,t,r){let n=e.raw.collection;return{collectionName:"string"==typeof n?n:"default",documentAuthor:po(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:ho(e),queryPipeline:r.pipeline||""}}var so=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||""}),uo={urihash:new W,sourcetype:new W,permanentid:new W},co={uniqueId:_r,raw:new K({values:uo}),title:_r,uri:_r,clickUri:_r,rankingModifier:new W({required:!1,emptyAllowed:!0})};function lo(e){return Object.assign({},...Object.keys(uo).map((t=>({[t]:e[t]}))))}function po(e){let t=e.raw.author;return L(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function ho(e){let t=e.raw.source;return L(t)?"unknown":t}var fo=e=>new _(co).validate(function(e){return Object.assign({},...Object.keys(co).map((t=>({[t]:e[t]}))),{raw:lo(e.raw)})}(e));function go(e,t=[]){return t.findIndex((({uniqueId:t})=>t===e.uniqueId))}var mo=e=>no({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(fo(e),t.makeRecommendationOpen(((e,t)=>{let r=t.recommendation?.recommendations.findIndex((({uniqueId:t})=>e.uniqueId===t))||0;return oo(e,r,t)})(e,r),so(e))),__legacy__provider:e=>new Pa(e),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=ao(e,t),n=so(e);return{searchUid:t.search?.response.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),yo=Jt("recommendation/set",(e=>Hr(e,{id:_r}))),vo=Ir("recommendation/get",(async(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}})=>{let i=t(),a=(new Date).getTime(),o=await wo(i),s=await n.recommendations(o),u=(new Date).getTime()-a;return Te(s)?r(s.error):{recommendations:s.success.results,analyticsAction:no("analytics/recommendation/update",(e=>e.makeRecommendationInterfaceLoad()),(e=>new Pa(e))),duration:u,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}})),wo=async e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl,re
1commendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?ua.getHistory():[],...e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq},...e.pipeline&&{pipeline:e.pipeline},...e.searchHub&&{searchHub:e.searchHub},...e.context&&{context:e.context.contextValues},...e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues},...e.fields&&{fieldsToInclude:e.fields.fieldsToInclude},...e.configuration.analytics.enabled&&{visitorId:await sa(e.configuration.analytics)},...e.configuration.analytics.enabled&&await bo(e,{actionCause:"recommendationInterfaceLoad"}),...e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")},...e.pagination&&{numberOfResults:e.pagination.numberOfResults}}),bo=async(e,t)=>{let r="legacy"===e.configuration.analytics.analyticsMode?void 0:{actionCause:t.actionCause,type:t.actionCause};return await Ua(e.configuration.analytics,r)},So=ur({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""},(e=>{e.addCase(yo,((e,t)=>{e.id=t.payload.id})).addCase(vo.rejected,((e,t)=>{e.error=t.payload?t.payload:null,e.isLoading=!1})).addCase(vo.fulfilled,((e,t)=>{e.error=null,e.recommendations=t.payload.recommendations,e.duration=t.payload.duration,e.isLoading=!1,e.searchUid=t.payload.searchUid,e.splitTestRun=t.payload.splitTestRun,e.pipeline=t.payload.pipeline})).addCase(vo.pending,(e=>{e.isLoading=!0}))})),ko=Jt("searchHub/set",(e=>Hr(e,new W({required:!0,emptyAllowed:!0})))),Co=ur("default",(e=>{e.addCase(ko,((e,t)=>t.payload)).addCase(fn.fulfilled,((e,t)=>t.payload?.searchHub??e)).addCase(Jr,((e,t)=>t.payload.searchHub||e))}));function Io(e){let t,r,n,i=!1;return function(a){void 0===t?(t=a,r=0,n=-1):t=function(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(t,a);let o=t.length,s=0;for(;r<o;){i&&(10===t[r]&&(s=++r),i=!1);let a=-1;for(;r<o&&-1===a;++r)switch(t[r]){case 58:-1===n&&(n=r-s);break;case 13:i=!0;case 10:a=r}if(-1===a)break;e(t.subarray(s,a),n),s=r,n=-1}s===o?t=void 0:0!==s&&(t=t.subarray(s),r-=s)}}var Ao="text/event-stream",qo="last-event-id";function Oo(e,t){var{signal:r,headers:n,onopen:i,onmessage:a,onclose:o,onerror:s,openWhenHidden:u,fetch:c}=t,l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,u)=>{let d,p=Object.assign({},n);p.accept||(p.accept=Ao);let h=1e3,f=0;function g(){clearTimeout(f),d?.abort()}r?.addEventListener("abort",(()=>{g(),t()}));let m=c??m,y=i??Ro;async function v(){var r;d=typeof AbortController>"u"?null:new AbortController;try{let r=await m(e,Object.assign(Object.assign({},l),{headers:p,signal:d?.signal}));await y(r),await async function(e,t){let r,n=e.getReader();for(;!(r=await n.read()).done;)t(r.value)}(r.body,Io(function(e,t,r){let n={data:"",event:"",id:"",retry:void 0},i=new TextDecoder;return function(a,o){if(0===a.length)r?.(n),n={data:"",event:"",id:"",retry:void 0};else if(o>0){let r=i.decode(a.subarray(0,o)),s=o+(32===a[o+1]?2:1),u=i.decode(a.subarray(s));switch(r){case"data":n.data=n.data?n.data+"\n"+u:u;break;case"event":n.event=u;break;case"id":e(n.id=u);break;case"retry":let r=parseInt(u,10);isNaN(r)||t(n.retry=r)}
1}}}((e=>{e?p[qo]=e:delete p[qo]}),(e=>{h=e}),a))),o?.(),g(),t()}catch(n){if(!d?.signal.aborted)try{let e=null!==(r=s?.(n))&&void 0!==r?r:h;clearTimeout(f),f=setTimeout(v,e)}catch(i){g(),u(i)}}}v()}))}function Ro(e){let t=e.headers.get("content-type");if(!t?.startsWith(Ao))throw new Error(`Expected content-type to be ${Ao}, Actual: ${t}`)}var xo=Ht((e=>e.query),(e=>e)),Do=e=>"search"in e,Eo=e=>"answer"in e&&"generatedAnswer"in e&&!L(e.generatedAnswer?.answerConfigurationId),To=(Ht((e=>e.generatedAnswer?.citations),((e,t)=>t),((e,t)=>e?.find((e=>e.id===t)))),Ht((e=>xo(e)?.q),(e=>e.search.requestId),((e,t)=>({q:e,requestId:t}))),e=>no("analytics/generatedAnswer/streamEnd",((t,r)=>{let{id:n,answerAPIEnabled:i}=(e=>Eo(e)?{answerAPIEnabled:!0,id:Au(e).data?.answerId}:Do(e)?{answerAPIEnabled:!1,id:e.search.response.extendedResults.generativeQuestionAnsweringId}:{answerAPIEnabled:!1,id:void 0})(r),a=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({...i?{answerAPIStreamId:n}:{generativeQuestionAnsweringId:n},answerGenerated:e,answerTextIsEmpty:a}):null}))),Mo=["default","bullet","step","concise"],Fo=new W({required:!0}),jo=new W,Uo=new z({required:!0}),Po={id:Fo,title:Fo,uri:Fo,permanentid:Fo,clickUri:jo},_o=new W({required:!0,constrainTo:["text/plain","text/markdown"]}),$o=(Jt("generatedAnswer/setIsVisible",(e=>Hr(e,Uo))),Jt("generatedAnswer/updateMessage",(e=>Hr(e,{textDelta:Fo})))),Qo=Jt("generatedAnswer/updateCitations",(e=>Hr(e,{citations:new Z({required:!0,each:new K({values:Po})})}))),Lo=Jt("generatedAnswer/updateError",(e=>Hr(e,{message:jo,code:new V({min:0})}))),Vo=Jt("generatedAnswer/resetAnswer"),No=(Jt("generatedAnswer/like"),Jt("generatedAnswer/dislike"),Jt("generatedAnswer/feedbackModal/open"),Jt("generatedAnswer/expand"),Jt("generatedAnswer/collapse"),Jt("generatedAnswer/setId",(e=>Hr(e,{id:new W({required:!0})}))),Jt("generatedAnswer/feedbackModal/close"),Jt("generatedAnswer/sendFeedback"),Jt("generatedAnswer/setIsLoading",(e=>Hr(e,Uo)))),zo=Jt("generatedAnswer/setIsStreaming",(e=>Hr(e,Uo))),Ho=Jt("generatedAnswer/setAnswerContentFormat",(e=>Hr(e,_o))),Bo=(Jt("generatedAnswer/updateResponseFormat",(e=>Hr(e,{answerStyle:new W({required:!0,constrainTo:Mo}),contentFormat:new Z({each:_o,default:["text/plain"]})}))),Jt("knowledge/updateAnswerConfigurationId",(e=>Hr(e,Fo))),Jt("generatedAnswer/registerFieldsToIncludeInCitations",(e=>Hr(e,Lr))),Jt("generatedAnswer/setIsAnswerGenerated",(e=>Hr(e,Uo)))),Yo=(Ir("generatedAnswer/streamAnswer",(async(e,t)=>{let r=t.getState(),{dispatch:n,extra:i}=t,{setAbortControllerRef:a}=e,o=await(async e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.platformUrl,streamId:e.search.extendedResults?.generativeQuestionAnsweringId}))(r);n(No(!0));let s=e=>e.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,u=i.streamingClient?.streamGeneratedAnswer(o,{write:e=>{s(o)&&(n(No(!1)),e.payload&&e.payloadType&&((e,t)=>{switch(e){case"genqa.headerMessageType":{let e=JSON.parse(t);n(Ho(e.contentFormat));break}case"genqa.messageType":n($o(JSON.parse(t)));break;case"genqa.citationsType":n(Qo(JSON.parse(t)));break;case"genqa.endOfStreamType":{let e=JSON.parse(t).answerGenerated;n(zo(!1)),n(Bo(e)),n(To(e));break}default:r.debug&&i.logger.warn(`Unknown payloadType: "${e}"`)}})(e.payloadType,e.payload))},abort:e=>{s(o)&&n(Lo(e))},close:()=>{s(o)&&n(zo(!1))},resetAnswer:()=>{s(o)&&n(Vo())}});u?a(u):n(No(!1))})),Ht((e=>e.pipeline),(e=>e))),Wo=Ht((e=>e.searchHub),(e=>e)),Go=d(O()),Ko=d(R()),Jo=d(O()),Zo=d(x());Jo.default.extend(Zo.default);var Xo="YYYY/MM/DD@HH:mm:ss";function es(e,t){let r=(0,Jo.default)(e,t);return r.isValid()||t?r:(0,Jo.default)(e,Xo)}function ts(e){return e.format(Xo)}function rs(e){if(e.isBefore("1401-01-01"))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Go.default.extend(Ko.default);var ns=["past","now","next"],is=["minute","hour","day","week","month","quarter","year"];function as(e){if("string"==typeof e&&!cs(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t="string"==typeof e?ls(e):e;new _((e=>{let t="now"===e;return{amount:new V({required:!t,min:1}),unit:new W({required:!t,constrainTo:is}),period:new W({required:!0,constrainTo:ns})}})(t.period)).validate(t);let r=os(t),n=JSON.stringify(t);
1if(!r.isValid())throw new Error(`Date is invalid: ${n}`);rs(r)}function os(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Go.default)().subtract(r,n);case"next":return(0,Go.default)().add(r,n);case"now":return(0,Go.default)()}}function ss(e){return ts(os(ls(e)))}function us(e){return e.toLocaleLowerCase().split("-")}function cs(e){let[t,r,n]=us(e);if("now"===t)return!0;if(!ns.includes(t)||!is.includes(n))return!1;let i=parseInt(r);return!(isNaN(i)||i<=0)}function ls(e){let[t,r,n]=us(e);return"now"===t?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}function ds(e){return`start${e}`}function ps(e){return`end${e}`}function hs(e,t){if(function(e){return"dateRange"===e.type}(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map((e=>function(e,t,r){let n=e.start,i=e.end;return cs(n)&&(n=ss(n),r.dateFacetValueMap[t][ds(n)]=e.start),cs(i)&&(i=ss(i),r.dateFacetValueMap[t][ps(i)]=e.end),{...e,start:n,end:i}}(e,r,t)))}}return e}function fs(e){let t={dateFacetValueMap:{}};return{request:{...e,facets:e.facets?.map((e=>hs(e,t)))},mappings:t}}function gs(e,t){return function(e,t){return e.facetId in t.dateFacetValueMap}(e,t)?{...e,values:e.values.map((r=>function(e,t,r){return{...e,start:r.dateFacetValueMap[t][ds(e.start)]||e.start,end:r.dateFacetValueMap[t][ps(e.end)]||e.end}}(r,e.facetId,t)))}:e}function ms(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map((e=>gs(e,t)))}}:e}function ys(e){return Object.values(e).map((e=>e.request))}function vs(e,t){let r={};e.forEach((e=>r[e.facetId]=e));let n=[];t.forEach((e=>{e in r&&(n.push(r[e]),delete r[e])}));let i=Object.values(r);return[...n,...i]}function ws(e){return ys(e).map((e=>{let t=e.currentValues.some((({state:e})=>"idle"!==e));return e.generateAutomaticRanges&&!t?{...e,currentValues:[]}:e}))}function bs(e){return ys(e).map((e=>"alphanumericDescending"===e.sortCriteria?{...e,sortCriteria:{type:"alphanumeric",order:"descending"}}:e))}function Ss(e){return function(e){return[...bs(e.facetSet??{}),...ws(e.numericFacetSet??{}),...ws(e.dateFacetSet??{}),...ys(e.categoryFacetSet??{})]}(e).filter((({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0))}function ks(e){return vs(Ss(e),e.facetOrder??[])}function Cs(e){return{status:e,isUninitialized:"uninitialized"===e,isLoading:"pending"===e,isSuccess:"fulfilled"===e,isError:"rejected"===e}}var Is=Ve;function As(e,t){if(e===t||!(Is(e)&&Is(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),i=r.length===n.length,a=Array.isArray(t)?[]:{};for(let o of r)a[o]=As(e[o],t[o]),i&&(i=e[o]===a[o]);return i?e:a}function qs(e){let t=0;for(let r in e)t++;return t}var Os=e=>[].concat(...e);function Rs(e){return null!=e}function xs(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=(e=>e.replace(/\/$/,""))(e),t=(e=>e.replace(/^\//,""))(t),`${e}${r}${t}`}var Ds=(...e)=>fetch(...e),Es=e=>e.status>=200&&e.status<=299,Ts=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Ms(e){if(!Ve(e))return e;let t={...e};for(let[r,n]of Object.entries(t))void 0===n&&delete t[r];return t}function Fs({baseUrl:e,prepareHeaders:t=(e=>e),fetchFn:r=Ds,paramsSerializer:n,isJsonContentType:i=Ts,jsonContentType:a="application/json",jsonReplacer:o,timeout:s,responseHandler:u,validateStatus:c,...l}={}){return typeof fetch>"u"&&r===Ds&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(p,h)=>{let f,{signal:g,getState:m,extra:y,endpoint:v,forced:w,type:b}=h,{url:S,headers:k=new Headers(l.headers),params:C,responseHandler:I=u??"json",validateStatus:A=c??Es,timeout:q=s,...O}="string"==typeof p?{url:p}:p,R={...l,signal:g,...O};k=new Headers(Ms(k)),R.headers=await t(k,{getState:m,extra:y,endpoint:v,forced:w,type:b})||k;let x=e=>"object"==typeof e&&(Ve(e)||Array.isArray(e)||"function"==typeof e.toJSON);if(!R.headers.has("content-type")&&x(R.body)&&R.headers.set("content-type",a),x(R.body)&&i(R.headers)&&(R.body=JSON.stringify(R.body,o)),C){let e=~S.indexOf("?")?"&":"?";
1S+=e+(n?n(C):new URLSearchParams(Ms(C)))}S=xs(e,S);let D=new Request(S,R);f={request:new Request(S,R)};let E,T=!1,M=q&&setTimeout((()=>{T=!0,h.abort()}),q);try{E=await r(D)}catch(P){return{error:{status:T?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(P)},meta:f}}finally{M&&clearTimeout(M)}let F=E.clone();f.response=F;let j,U="";try{let e;if(await Promise.all([d(E,I).then((e=>j=e),(t=>e=t)),F.text().then((e=>U=e),(()=>{}))]),e)throw e}catch(P){return{error:{status:"PARSING_ERROR",originalStatus:E.status,data:U,error:String(P)},meta:f}}return A(E,j)?{data:j,meta:f}:{error:{status:E.status,data:j},meta:f}};async function d(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=i(e.headers)?"json":"text"),"json"===t){let t=await e.text();return t.length?JSON.parse(t):null}return e.text()}}var js=class{constructor(e,t){this.value=e,this.meta=t}};async function Us(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));await new Promise((e=>setTimeout((t=>e(t)),n)))}var Ps={},_s=Object.assign(((e,t)=>async(r,n,i)=>{let a=[5,(t||Ps).maxRetries,(i||Ps).maxRetries].filter((e=>void 0!==e)),[o]=a.slice(-1),s={maxRetries:o,backoff:Us,retryCondition:(e,t,{attempt:r})=>r<=o,...t,...i},u=0;for(;;)try{let t=await e(r,n,i);if(t.error)throw new js(t);return t}catch(c){if(u++,c.throwImmediately){if(c instanceof js)return c.value;throw c}if(c instanceof js&&!s.retryCondition(c.value.error,r,{attempt:u,baseQueryApi:n,extraOptions:i}))return c.value;await s.backoff(u,s.maxRetries)}}),{fail:function(e){throw Object.assign(new js({error:e}),{throwImmediately:!0})}}),$s=Jt("__rtkq/focused"),Qs=Jt("__rtkq/unfocused"),Ls=Jt("__rtkq/online"),Vs=Jt("__rtkq/offline");function Ns(e){return"query"===e.type}function zs(e,t,r,n,i,a){return function(e){return"function"==typeof e}(e)?e(t,r,n,i).map(Hs).map(a):Array.isArray(e)?e.map(Hs).map(a):[]}function Hs(e){return"string"==typeof e?{type:e}:e}var Bs=Symbol("forceQueryFn"),Ys=e=>"function"==typeof e[Bs];function Ws(e){return e}function Gs(e,t,r,n){return zs(r[e.meta.arg.endpointName][t],yr(e)?e.payload:void 0,mr(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Ks(e,t,r){let n=e[t];n&&r(n)}function Js(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Zs(e,t,r){let n=e[Js(t)];n&&r(n)}var Xs={};function eu({reducerPath:e,queryThunk:t,mutationThunk:r,context:{endpointDefinitions:n,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:o},assertTagType:s,config:u}){let c=Jt(`${e}/resetApiState`),l=xr({name:`${e}/queries`,initialState:Xs,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:rr()},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:r}}){Ks(e,t,(e=>{e.data=$t(e.data,r.concat())}))},prepare:rr()}},extraReducers(e){e.addCase(t.pending,((e,{meta:t,meta:{arg:r}})=>{var n;let i=Ys(r);e[n=r.queryCacheKey]??(e[n]={status:"uninitialized",endpointName:r.endpointName}),Ks(e,r.queryCacheKey,(e=>{e.status="pending",e.requestId=i&&e.requestId?e.requestId:t.requestId,void 0!==r.originalArgs&&(e.originalArgs=r.originalArgs),e.startedTimeStamp=t.startedTimeStamp}))})).addCase(t.fulfilled,((e,{meta:t,payload:r})=>{Ks(e,t.arg.queryCacheKey,(e=>{if(e.requestId!==t.requestId&&!Ys(t.arg))return;let{merge:i}=n[t.arg.endpointName];if(e.status="fulfilled",i)if(void 0!==e.data){let{fulfilledTimeStamp:n,arg:a,baseQueryMeta:o,requestId:s}=t,u=Pt(e.data,(e=>i(e,r,{arg:a.originalArgs,baseQueryMeta:o,fulfilledTimeStamp:n,requestId:s})));e.data=u}else e.data=r;else e.data=n[t.arg.endpointName].structuralSharing??1?As(Ze(e.data)?function(e){return Ze(e)||Ke(15),e[Ge].base_}(e.data):e.data,r):r;delete e.error,e.fulfilledTimeStamp=t.fulfilledTimeStamp}))})).addCase(t.rejected,((e,{meta:{condition:t,arg:r,requestId:n},error:i,payload:a})=>{Ks(e,r.queryCacheKey,(e=>{if(!t){if(e.requestId!==n)return;e.status="rejected",e.error=a??i}}))})).addMatcher(o,((e,t)=>{let{queries:r}=a(t);for(let[n,i]of Object.entries(r))("fulfilled"===i?.status||"rejected"===i?.status)&&(e[n]=i)}))}}),d=xr({name:`${e}/mutations`,initialState:Xs,reducers:{removeMutationResult:{reducer(e,{payload:t}){let r=Js(t);r in e&&delete e[r]},prepare:rr()}},extraReducers(e){e.addCase(r.pending,((e,{meta:t,meta:{requestId:r,arg:n,startedTimeStamp:i}})=>{n.track&&(e[Js(t)]={requestId:r,status:"pending",endpointName:n.endpointName,startedTimeStamp:i})})).addCase(r.fulfilled,((e,{payload:t,meta:r})=>{r.arg.track&&Zs(e,r,(e=>{e.requestId===r.requestId&&(e.status="fulfilled",e.data=t,e.fulfilledTimeStamp=r.fulfilledTimeStamp)}))})).addCase(r.rejected,((e,{payload:t,error:r,meta:n})=>{n.arg.track&&Zs(e,n,(e=>{e.requestId===n.requestId&&(e.status="rejected",e.error=t??r)}))})).addMatcher(o,((e,t)=>{let{mutations:r}=a(t);for(let[n,i]of Object.entries(r))("fulfilled"===i?.status||"rejected"===i?.status)&&n!==i?.requestId&&(e[n]=i)}))}}),p=xr({name:`${e}/invalidation`,initialState:Xs,reducers:{updateProvidedBy:{reducer(e,t){var r,n;let{queryCacheKey:i,providedTags:a}=t.payload;for(let o of Object.values(e))for(let e of Object.values(o)){let t=e.indexOf(i);-1!==t&&e.splice(t,1)}for(let{type:o,id:s}of a){let t=(r=e[o]??(e[o]={}))[n=s||"__internal_without_id"]??(r[n]=[]);t.includes(i)||t.push(i)}},prepare:rr()}},extraReducers(e){e.addCase(l.actions.removeQueryResult,((e,{payload:{queryCacheKey:t}})=>{for(let r of Object.values(e))for(let e of Object.values(r)){let r=e.indexOf(t);-1!==r&&e.splice(r,1)}})).addMatcher(o,((e,t)=>{var r,n;let{provided:i}=a(t);for(let[a,o]of Object.entries(i))for(let[t,i]of Object.entries(o)){let o=(r=e[a]??(e[a]={}))[n=t||"__internal_without_id"]??(r[n]=[]);for(let e of i)o.includes(e)||o.push(e)}})).addMatcher(lr(yr(t),mr(t)),((e,t)=>{let r=Gs(t,"providesTags",n,s),{queryCacheKey:i}=t.meta.arg;p.caseReducers.updateProvidedBy(e,p.actions.updateProvidedBy({queryCacheKey:i,providedTags:r}))}))}}),h=xr({name:`${e}/subscriptions`,initialState:Xs,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_getRTKQSubscriptions(){}}}),f=xr({name:`${e}/internalSubscriptions`,initialState:Xs,reducers:{subscriptionsUpdated:{reducer:(e,t)=>$t(e,t.payload),prepare:rr()}}}),g=xr({name:`${e}/config`,initialState:{online:typeof navigator>
1"u"||void 0===navigator.onLine||navigator.onLine,focused:typeof document>"u"||"hidden"!==document.visibilityState,middlewareRegistered:!1,...u},reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&i===t||"conflict"}},extraReducers:e=>{e.addCase(Ls,(e=>{e.online=!0})).addCase(Vs,(e=>{e.online=!1})).addCase($s,(e=>{e.focused=!0})).addCase(Qs,(e=>{e.focused=!1})).addMatcher(o,(e=>({...e})))}}),m=ze({queries:l.reducer,mutations:d.reducer,provided:p.reducer,subscriptions:f.reducer,config:g.reducer});return{reducer:(e,t)=>m(c.match(t)?void 0:e,t),actions:{...g.actions,...l.actions,...h.actions,...f.actions,...d.actions,...p.actions,resetApiState:c}}}var tu=Symbol.for("RTKQ/skipToken"),ru={status:"uninitialized"},nu=Pt(ru,(()=>{})),iu=Pt(ru,(()=>{}));var au=WeakMap?new WeakMap:void 0,ou=({endpointName:e,queryArgs:t})=>{let r="",n=au?.get(t);if("string"==typeof n)r=n;else{let e=JSON.stringify(t,((e,t)=>t=Ve(t="bigint"==typeof t?{$bigint:t.toString()}:t)?Object.keys(t).sort().reduce(((e,r)=>(e[r]=t[r],e)),{}):t));Ve(t)&&au?.set(t,e),r=e}return`${e}(${r})`};function su(e,...t){return Object.assign(e,...t)}var uu=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,i=null,a=null,{updateSubscriptionOptions:o,unsubscribeQueryResult:s}=e.internalActions,u=()=>r.currentSubscriptions,c={getSubscriptions:u,getSubscriptionCount:e=>qs(u()[e]??{}),isRequestSubscribed:(e,t)=>!!u()?.[e]?.[t]};return(u,l)=>{if(i||(i=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(u))return i=r.currentSubscriptions={},a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(u))return[!1,c];let d=((r,n)=>{var i,a;if(o.match(n)){let{queryCacheKey:e,requestId:t,options:i}=n.payload;return r?.[e]?.[t]&&(r[e][t]=i),!0}if(s.match(n)){let{queryCacheKey:e,requestId:t}=n.payload;return r[e]&&delete r[e][t],!0}if(e.internalActions.removeQueryResult.match(n))return delete r[n.payload.queryCacheKey],!0;if(t.pending.match(n)){let{meta:{arg:e,requestId:t}}=n,a=r[i=e.queryCacheKey]??(r[i]={});return a[`${t}_running`]={},e.subscribe&&(a[t]=e.subscriptionOptions??a[t]??{}),!0}let u=!1;if(t.fulfilled.match(n)||t.rejected.match(n)){let e=r[n.meta.arg.queryCacheKey]||{},t=`${n.meta.requestId}_running`;u||(u=!!e[t]),delete e[t]}if(t.rejected.match(n)){let{meta:{condition:e,arg:t,requestId:i}}=n;if(e&&t.subscribe){let e=r[a=t.queryCacheKey]??(r[a]={});e[i]=t.subscriptionOptions??e[i]??{},u=!0}}return u})(r.currentSubscriptions,u),p=!0;if(d){a||(a=setTimeout((()=>{let t=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,n]=_t(i,(()=>t));l.next(e.internalActions.subscriptionsUpdated(n)),i=t,a=null}),500));let o="string"==typeof u.type&&!!u.type.startsWith(n),s=t.rejected.match(u)&&u.meta.condition&&!!u.meta.arg.subscribe;p=!o&&!s}return[p,!1]}};var cu=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i})=>{let{removeQueryResult:a,unsubscribeQueryResult:o}=t.internalActions,s=lr(o.match,r.fulfilled,r.rejected);function u(e){let t=i.currentSubscriptions[e];return!!t&&!function(e){for(let t in e)return!1;return!0}(t)}let c={};function l(e,t,r,i){let o=n.endpointDefinitions[t]?.keepUnusedDataFor??i.keepUnusedDataFor;if(o===1/0)return;let s=Math.max(0,Math.min(o,2147482.647));if(!u(e)){let t=c[e];t&&clearTimeout(t),c[e]=setTimeout((()=>{u(e)||r.dispatch(a({queryCacheKey:e})),delete c[e]}),1e3*s)}}return(r,i,a)=>{if(s(r)){let t=i.getState()[e],{queryCacheKey:n}=o.match(r)?r.payload:r.meta.arg;l(n,t.queries[n]?.endpointName,i,t.config)}if(t.util.resetApiState.match(r))for(let[e,t]of Object.entries(c))t&&clearTimeout(t),delete c[e];if(n.hasRehydrationInfo(r)){let t=i.getState()[e],{queries:a}=n.extractRehydrationInfo(r);for(let[e,r]of Object.entries(a))l(e,r?.endpointName,i,t.config)}}},lu=new Error("Promise never resolved before cacheEntryRemoved."),du=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:a})=>{let o=vr(n),s=vr(i),u=yr(n,i),c={};function l(t,n,i,a,o){let s=r.endpointDefinitions[t],u=s?.onCacheEntryAdded;if(!u)return;let l={},d=new Promise((e=>{l.cacheEntryRemoved=e})),p=Promise.race([new Promise((e=>{l.valueResolved=e})),d.then((()=>{throw lu}))]);p.catch((()=>{})),c[i]=l;let h=e.endpoints[t].select("query"===s.type?n:i),f=a.dispatch(((e,t,r)=>r)),g={...a,getCacheEntry:()=>h(a.getState()),requestId:o,extra:f,updateCachedData:"query"===s.type?r=>a.dispatch(e.util.updateQueryData(t,n,r)):void 0,cacheDataLoaded:p,cacheEntryRemoved:d},m=u(n,g);
1Promise.resolve(m).catch((e=>{if(e!==lu)throw e}))}return(r,a,d)=>{let p=function(t){return o(t)?t.meta.arg.queryCacheKey:s(t)?t.meta.arg.fixedCacheKey??t.meta.requestId:e.internalActions.removeQueryResult.match(t)?t.payload.queryCacheKey:e.internalActions.removeMutationResult.match(t)?Js(t.payload):""}(r);if(n.pending.match(r)){let e=d[t].queries[p],n=a.getState()[t].queries[p];!e&&n&&l(r.meta.arg.endpointName,r.meta.arg.originalArgs,p,a,r.meta.requestId)}else if(i.pending.match(r))a.getState()[t].mutations[p]&&l(r.meta.arg.endpointName,r.meta.arg.originalArgs,p,a,r.meta.requestId);else if(u(r)){let e=c[p];e?.valueResolved&&(e.valueResolved({data:r.payload,meta:r.meta.baseQueryMeta}),delete e.valueResolved)}else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r)){let e=c[p];e&&(delete c[p],e.cacheEntryRemoved())}else if(e.util.resetApiState.match(r))for(let[e,t]of Object.entries(c))delete c[e],t.cacheEntryRemoved()}},pu=({api:e,context:{apiUid:t},reducerPath:r})=>(r,n)=>{e.util.resetApiState.match(r)&&n.dispatch(e.internalActions.middlewareRegistered(t))},hu=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:a,assertTagType:o,refetchQuery:s,internalState:u})=>{let{removeQueryResult:c}=a.internalActions,l=lr(yr(n),mr(n)),d=lr(yr(n,i),gr(n,i)),p=[];function h(r,n){let i=n.getState(),o=i[e];if(p.push(...r),"delayed"===o.config.invalidationBehavior&&function(e){for(let t in e.queries)if("pending"===e.queries[t]?.status)return!0;for(let t in e.mutations)if("pending"===e.mutations[t]?.status)return!0;return!1}(o))return;let l=p;if(p=[],0===l.length)return;let d=a.util.selectInvalidatedBy(i,l);t.batch((()=>{let e=Array.from(d.values());for(let{queryCacheKey:t}of e){let e=o.queries[t],r=u.currentSubscriptions[t]??{};e&&(0===qs(r)?n.dispatch(c({queryCacheKey:t})):"uninitialized"!==e.status&&n.dispatch(s(e,t)))}}))}return(e,t)=>{l(e)?h(Gs(e,"invalidatesTags",r,o),t):d(e)?h([],t):a.util.invalidateTags.match(e)&&h(zs(e.payload,void 0,void 0,void 0,void 0,o),t)}},fu=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{let a={};function o({queryCacheKey:t},r){let s=r.getState()[e],u=s.queries[t],l=i.currentSubscriptions[t];if(!u||"uninitialized"===u.status)return;let{lowestPollingInterval:d,skipPollingIfUnfocused:p}=c(l);if(!Number.isFinite(d))return;let h=a[t];h?.timeout&&(clearTimeout(h.timeout),h.timeout=void 0);
1let f=Date.now()+d;a[t]={nextPollTimestamp:f,pollingInterval:d,timeout:setTimeout((()=>{(s.config.focused||!p)&&r.dispatch(n(u,t)),o({queryCacheKey:t},r)}),d)}}function s({queryCacheKey:t},r){let n=r.getState()[e].queries[t],s=i.currentSubscriptions[t];if(!n||"uninitialized"===n.status)return;let{lowestPollingInterval:l}=c(s);if(!Number.isFinite(l))return void u(t);let d=a[t],p=Date.now()+l;(!d||p<d.nextPollTimestamp)&&o({queryCacheKey:t},r)}function u(e){let t=a[e];t?.timeout&&clearTimeout(t.timeout),delete a[e]}function c(e={}){let t=!1,r=Number.POSITIVE_INFINITY;for(let n in e)e[n].pollingInterval&&(r=Math.min(e[n].pollingInterval,r),t=e[n].skipPollingIfUnfocused||t);return{lowestPollingInterval:r,skipPollingIfUnfocused:t}}return(e,n)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&s(e.payload,n),(t.pending.match(e)||t.rejected.match(e)&&e.meta.condition)&&s(e.meta.arg,n),(t.fulfilled.match(e)||t.rejected.match(e)&&!e.meta.condition)&&o(e.meta.arg,n),r.util.resetApiState.match(e)&&function(){for(let e of Object.keys(a))u(e)}()}},gu=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let i=fr(r,n),a=gr(r,n),o=yr(r,n),s={};return(r,n)=>{if(i(r)){let{requestId:i,arg:{endpointName:a,originalArgs:o}}=r.meta,u=t.endpointDefinitions[a],c=u?.onQueryStarted;if(c){let t={},r=new Promise(((e,r)=>{t.resolve=e,t.reject=r}));r.catch((()=>{})),s[i]=t;let l=e.endpoints[a].select("query"===u.type?o:i),d=n.dispatch(((e,t,r)=>r)),p={...n,getCacheEntry:()=>l(n.getState()),requestId:i,extra:d,updateCachedData:"query"===u.type?t=>n.dispatch(e.util.updateQueryData(a,o,t)):void 0,queryFulfilled:r};c(o,p)}}else if(o(r)){let{requestId:e,baseQueryMeta:t}=r.meta;s[e]?.resolve({data:r.payload,meta:t}),delete s[e]}else if(a(r)){let{requestId:e,rejectedWithValue:t,baseQueryMeta:n}=r.meta;s[e]?.reject({error:r.payload??r.error,isUnhandledError:!t,meta:n}),delete s[e]}}};function mu(e){let{reducerPath:t,queryThunk:r,api:n,context:i}=e,{apiUid:a}=i,o={invalidateTags:Jt(`${t}/invalidateTags`)},s=e=>e.type.startsWith(`${t}/`),u=[pu,cu,hu,fu,du,gu];return{middleware:r=>{let o=!1,l={...e,internalState:{currentSubscriptions:{}},refetchQuery:c,isThisApiSliceAction:s},d=u.map((e=>e(l))),p=uu(l),h=(({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{let{removeQueryResult:a}=r.internalActions;function o(r,o){let s=r.getState()[e],u=s.queries,c=i.currentSubscriptions;t.batch((()=>{for(let e of Object.keys(c)){let t=u[e],i=c[e];i&&t&&(Object.values(i).some((e=>!0===e[o]))||Object.values(i).every((e=>void 0===e[o]))&&s.config[o])&&(0===qs(i)?r.dispatch(a({queryCacheKey:e})):"uninitialized"!==t.status&&r.dispatch(n(t,e)))}}))}return(e,t)=>{$s.match(e)&&o(t,"refetchOnFocus"),Ls.match(e)&&o(t,"refetchOnReconnect")}})(l);return e=>u=>{if(!Be(u))return e(u);o||(o=!0,r.dispatch(n.internalActions.middlewareRegistered(a)));let c,l={...r,next:e},f=r.getState(),[g,m]=p(u,l,f);if(c=g?e(u):m,r.getState()[t]&&(h(u,l,f),s(u)||i.hasRehydrationInfo(u)))for(let e of d)e(u,l,f);return c}},actions:o};function c(e,t,n={}){return r({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t,...n})}}var yu=Symbol(),vu=function(...e){return function(t){let r=zt((e=>t.extractRehydrationInfo?.(e,{reducerPath:t.reducerPath??"api"}))),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=ou;
1if("serializeQueryArgs"in e.endpointDefinition){let t=e.endpointDefinition.serializeQueryArgs;r=e=>{let r=t(e);return"string"==typeof r?r:ou({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},i={endpointDefinitions:{},batch(e){e()},apiUid:wr(),extractRehydrationInfo:r,hasRehydrationInfo:zt((e=>null!=r(e)))},a={injectEndpoints:function(e){let t=e.endpoints({query:e=>({...e,type:"query"}),mutation:e=>({...e,type:"mutation"})});for(let[r,n]of Object.entries(t))if(!0!==e.overrideExisting&&r in i.endpointDefinitions){if("throw"===e.overrideExisting)throw new Error(jr(39))}else{i.endpointDefinitions[r]=n;for(let e of o)e.injectEndpoint(r,n)}return a},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(let r of e)n.tagTypes.includes(r)||n.tagTypes.push(r);if(t)for(let[r,n]of Object.entries(t))"function"==typeof n?n(i.endpointDefinitions[r]):Object.assign(i.endpointDefinitions[r]||{},n);return a}},o=e.map((e=>e.init(a,n,i)));return a.injectEndpoints({endpoints:t.endpoints})}}((({createSelector:e=Ht}={})=>({name:yu,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:a,keepUnusedDataFor:o,refetchOnMountOrArgChange:s,refetchOnFocus:u,refetchOnReconnect:c,invalidationBehavior:l},d){jt();let p=e=>e;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Ls,onOffline:Vs,onFocus:$s,onFocusLost:Qs},util:{}});let{queryThunk:h,mutationThunk:f,patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,buildMatchThunkActions:w}=function({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:a}){let o=async(e,{signal:n,abort:i,rejectWithValue:a,fulfillWithValue:o,dispatch:u,getState:c,extra:l})=>{let d=r[e.endpointName];try{let r,a=Ws,p={signal:n,abort:i,dispatch:u,getState:c,extra:l,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?s(e,c()):void 0},h="query"===e.type?e[Bs]:void 0;if(h?r=h():d.query?(r=await t(d.query(e.originalArgs),p,d.extraOptions),d.transformResponse&&(a=d.transformResponse)):r=await d.queryFn(e.originalArgs,p,d.extraOptions,(e=>t(e,p,d.extraOptions))),r.error)throw new js(r.error,r.meta);return o(await a(r.data,r.meta,e.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta,[tr]:!0})}catch(O){let r=O;if(r instanceof js){let t=Ws;d.query&&d.transformErrorResponse&&(t=d.transformErrorResponse);try{return a(await t(r.value,r.meta,e.originalArgs),{baseQueryMeta:r.meta,[tr]:!0})}catch(D){r=D}}throw console.error(r),r}};function s(t,r){let n=r[e]?.queries?.[t.queryCacheKey],i=r[e]?.config.refetchOnMountOrArgChange,a=n?.fulfilledTimeStamp,o=t.forceRefetch??(t.subscribe&&i);return!!o&&(!0===o||(Number(new Date)-Number(a))/1e3>=o)}let u=Ir(`${e}/executeQuery`,o,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[tr]:!0}),condition(t,{getState:n}){let i=n(),a=i[e]?.queries?.[t.queryCacheKey],o=a?.fulfilledTimeStamp,u=t.originalArgs,c=a?.originalArgs,l=r[t.endpointName];return!!Ys(t)||"pending"!==a?.status&&(!!(s(t,i)||Ns(l)&&l?.forceRefetch?.({currentArg:u,previousArg:c,endpointState:a,state:i}))||!o)},dispatchConditionRejection:!0}),c=Ir(`${e}/executeMutation`,o,{getPendingMeta:()=>({startedTimeStamp:Date.now(),[tr]:!0})});function l(e){return t=>t?.meta?.arg?.endpointName===e}return{queryThunk:u,mutationThunk:c,prefetch:(e,t,r)=>(n,a)=>{let o=(e=>"force"in e)(r)&&r.force,s=(e=>"ifOlderThan"in e)(r)&&r.ifOlderThan,u=(r=!0)=>{let n={forceRefetch:r,isPrefetch:!0};return i.endpoints[e].initiate(t,n)},c=i.endpoints[e].select(t)(a());
1if(o)n(u());else if(s){let e=c?.fulfilledTimeStamp;if(!e)return void n(u());(Number(new Date)-Number(new Date(e)))/1e3>=s&&n(u())}else n(u(!1))},updateQueryData:(e,t,r,n=!0)=>(a,o)=>{let s,u=i.endpoints[e].select(t)(o()),c={patches:[],inversePatches:[],undo:()=>a(i.util.patchQueryData(e,t,c.inversePatches,n))};if("uninitialized"===u.status)return c;if("data"in u)if(Xe(u.data)){let[e,t,n]=_t(u.data,r);c.patches.push(...t),c.inversePatches.push(...n),s=e}else s=r(u.data),c.patches.push({op:"replace",path:[],value:s}),c.inversePatches.push({op:"replace",path:[],value:u.data});return 0===c.patches.length||a(i.util.patchQueryData(e,t,c.patches,n)),c},upsertQueryData:(e,t,r)=>n=>n(i.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[Bs]:()=>({data:r})})),patchQueryData:(e,t,o,s)=>(u,c)=>{let l=r[e],d=n({queryArgs:t,endpointDefinition:l,endpointName:e});if(u(i.internalActions.queryResultPatched({queryCacheKey:d,patches:o})),!s)return;let p=i.endpoints[e].select(t)(c()),h=zs(l.providesTags,p.data,void 0,t,{},a);u(i.internalActions.updateProvidedBy({queryCacheKey:d,providedTags:h}))},buildMatchThunkActions:function(e,t){return{matchPending:dr(fr(e),l(t)),matchFulfilled:dr(yr(e),l(t)),matchRejected:dr(gr(e),l(t))}}}}({baseQuery:r,reducerPath:i,context:d,api:t,serializeQueryArgs:a,assertTagType:p}),{reducer:b,actions:S}=eu({context:d,queryThunk:h,mutationThunk:f,reducerPath:i,assertTagType:p,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:s,keepUnusedDataFor:o,reducerPath:i,invalidationBehavior:l}});su(t.util,{patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,resetApiState:S.resetApiState}),su(t.internalActions,S);let{middleware:k,actions:C}=mu({reducerPath:i,context:d,queryThunk:h,mutationThunk:f,api:t,assertTagType:p});su(t.util,C),su(t,{reducer:b,middleware:k});let{buildQuerySelector:I,buildMutationSelector:A,selectInvalidatedBy:q,selectCachedArgsForQuery:O}=function({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=e=>nu,i=e=>iu;return{buildQuerySelector:function(t,i){return s=>{let u=e({queryArgs:s,endpointDefinition:i,endpointName:t});return r(s===tu?n:e=>o(e)?.queries?.[u]??nu,a)}},buildMutationSelector:function(){return e=>{let t;return t="object"==typeof e?Js(e)??tu:e,r(t===tu?i:e=>o(e)?.mutations?.[t]??iu,a)}},selectInvalidatedBy:function(e,r){let n=e[t],i=new Set;for(let t of r.map(Hs)){let e=n.provided[t.type];if(!e)continue;let r=(void 0!==t.id?e[t.id]:Os(Object.values(e)))??[];for(let t of r)i.add(t)}return Os(Array.from(i.values()).map((e=>{let t=n.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]})))},selectCachedArgsForQuery:function(e,r){return Object.values(e[t].queries).filter((e=>e?.endpointName===r&&"uninitialized"!==e.status)).map((e=>e.originalArgs))}};function a(e){return{...e,...Cs(e.status)}}function o(e){return e[t]}}({serializeQueryArgs:a,reducerPath:i,createSelector:e});su(t.util,{selectInvalidatedBy:q,selectCachedArgsForQuery:O});let{buildInitiateQuery:R,buildInitiateMutation:x,getRunningMutationThunk:D,getRunningMutationsThunk:E,getRunningQueriesThunk:T,getRunningQueryThunk:M}=function({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:n,context:i}){let a=new Map,o=new Map,{unsubscribeQueryResult:s,removeMutationResult:u,updateSubscriptionOptions:c}=n.internalActions;return{buildInitiateQuery:function(r,i){let o=(u,{subscribe:l=!0,forceRefetch:d,subscriptionOptions:p,[Bs]:h,...f}={})=>(g,m)=>{let y=e({queryArgs:u,endpointDefinition:i,endpointName:r}),v=t({...f,type:"query",subscribe:l,forceRefetch:d,subscriptionOptions:p,endpointName:r,originalArgs:u,queryCacheKey:y,[Bs]:h}),w=n.endpoints[r].select(u),b=g(v),S=w(m()),{requestId:k,abort:C}=b,I=S.requestId!==k,A=a.get(g)?.[y],q=()=>w(m()),O=Object.assign(h?b.then(q):I&&!A?Promise.resolve(S):Promise.all([A,b]).then(q),{arg:u,requestId:k,subscriptionOptions:p,queryCacheKey:y,abort:C,async unwrap(){let e=await O;if(e.isError)throw e.error;return e.data},refetch:()=>g(o(u,{subscribe:!1,forceRefetch:!0})),unsubscribe(){l&&g(s({queryCacheKey:y,requestId:k}))},updateSubscriptionOptions(e){O.subscriptionOptions=e,g(c({endpointName:r,requestId:k,queryCacheKey:y,options:e}))}});if(!A&&!I&&!h){let e=a.get(g)||{};
1e[y]=O,a.set(g,e),O.then((()=>{delete e[y],qs(e)||a.delete(g)}))}return O};return o},buildInitiateMutation:function(e){return(t,{track:n=!0,fixedCacheKey:i}={})=>(a,s)=>{let c=r({type:"mutation",endpointName:e,originalArgs:t,track:n,fixedCacheKey:i}),l=a(c),{requestId:d,abort:p,unwrap:h}=l,f=function(e,t){return e.catch(t)}(l.unwrap().then((e=>({data:e}))),(e=>({error:e}))),g=Object.assign(f,{arg:l.arg,requestId:d,abort:p,unwrap:h,reset:()=>{a(u({requestId:d,fixedCacheKey:i}))}}),m=o.get(a)||{};return o.set(a,m),m[d]=g,g.then((()=>{delete m[d],qs(m)||o.delete(a)})),i&&(m[i]=g,g.then((()=>{m[i]===g&&(delete m[i],qs(m)||o.delete(a))}))),g}},getRunningQueryThunk:function(t,r){return n=>{let o=i.endpointDefinitions[t],s=e({queryArgs:r,endpointDefinition:o,endpointName:t});return a.get(n)?.[s]}},getRunningMutationThunk:function(e,t){return e=>o.get(e)?.[t]},getRunningQueriesThunk:function(){return e=>Object.values(a.get(e)||{}).filter(Rs)},getRunningMutationsThunk:function(){return e=>Object.values(o.get(e)||{}).filter(Rs)}}}({queryThunk:h,mutationThunk:f,api:t,serializeQueryArgs:a,context:d});return su(t.util,{getRunningMutationThunk:D,getRunningMutationsThunk:E,getRunningQueryThunk:M,getRunningQueriesThunk:T}),{name:yu,injectEndpoint(e,r){var n;let i=t;(n=i.endpoints)[e]??(n[e]={}),Ns(r)?su(i.endpoints[e],{name:e,select:I(e,r),initiate:R(e,r)},w(h,e)):function(e){return"mutation"===e.type}(r)&&su(i.endpoints[e],{name:e,select:A(),initiate:x(e)},w(f,e))}}}}))()),wu=vu({reducerPath:"answer",baseQuery:_s((async(e,t,r)=>{let n=t.getState(),{accessToken:i,organizationId:a,platformUrl:o}=n.configuration,s=n.generatedAnswer.answerConfigurationId,u={...e,headers:{...e?.headers||{},Authorization:`Bearer ${i}`}};try{return{data:Fs({baseUrl:`${o}/rest/organizations/${a}/answer/v1/configs/${s}`})(u,t,r)}}catch(c){return{error:c}}}),{maxRetries:3}),endpoints:()=>({})}),bu=(e,t,r)=>{let n=JSON.parse(e.data);"ERROR"===n.finishReason&&n.errorMessage&&((e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)})(t,n);let i=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":i.answerStyle&&i.contentFormat&&(((e,t)=>{let{answerStyle:r,contentFormat:n}=t;e.answerStyle=r,e.contentFormat=n,e.isStreaming=!0,e.isLoading=!1})(t,i),r(Ho(i.contentFormat)));break;case"genqa.messageType":i.textDelta&&(((e,t)=>{void 0===e.answer?e.answer=t.textDelta:"string"==typeof t.textDelta&&(e.answer=e.answer.concat(t.textDelta))})(t,i),r($o({textDelta:i.textDelta})));break;case"genqa.citationsType":i.citations&&(((e,t)=>{e.citations=t.citations})(t,i),r(Qo({citations:i.citations})));break;case"genqa.endOfStreamType":((e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1})(t,i),r(To(i.answerGenerated??!1))}},Su=wu.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{answerStyle:void 0,contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),async onCacheEntryAdded(e,{getState:t,cacheDataLoaded:r,updateCachedData:n,dispatch:i}){await r;let{configuration:a,generatedAnswer:o}=t(),{platformUrl:s,organizationId:u,accessToken:c}=a;await Oo(`${s}/rest/organizations/${u}/answer/v1/configs/${o.answerConfigurationId}/generate`,{method:"POST",body:JSON.stringify(e),headers:{Authorization:`Bearer ${c}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:fetch,onopen:async e=>{let t=e.headers.get("x-answer-id");t&&n((e=>{e.answerId=t}))},onmessage:e=>{n((t=>{bu(e,t,i)}))},onerror:e=>{throw e}})}})})}),ku=(Ht((e=>xo(e)?.q),(e=>e.search.requestId),((e,t)=>({q:e,requestId:t}))),{}),Cu=e=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,Iu=(e,t)=>{let r=xo(e)?.q,n=Wo(e),i=Yo(e),a=(e=>e.generatedAnswer?.fieldsToIncludeInCitations)(e)??[];return r&&"fetch"===t&&(ku=((e,t)=>({...ku,[e]:ks(t)?.map((e=>hs(e,{dateFacetValueMap:{}}))).sort(((e,t)=>e.facetId>t.facetId?1:t.facetId>e.facetId?-1:0))}))(r,e)),{q:r,pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:a}},...n?.length&&{searchHub:n},...i?.length&&{pipeline:i},...ku[r]?.length&&{facets:ku[r]},...e.fields&&{fieldsToInclude:e.fields.fieldsToInclude},...e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&"next"===e.didYouMean.queryCorrectionMode,options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&"legacy"===e.didYouMean.queryCorrectionMode},...e.pagination&&{numberOfResults:Cu(e),firstResult:e.pagination.firstResult},tab:e.configuration.analytics.originLevel2}},Au=e=>Su.endpoints.getAnswer.select(Iu(e,"select"))(e),qu=ur(Yr,(e=>e));function Ou(){return typeof window<"u"&&typeof document<"u"}function Ru(e){return"type"in e}var xu=e=>t=>r=>{let n;(function(e){let t=e.payload?.analyticsAction;return Ru(e)&&!L(t)})(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let i=t(r);return Ru(r)&&("search/executeSearch/fullfilled"===r.type&&void 0===n&&console.error("No anal
1ytics action associated with search:",r),"recommendation/get/fullfilled"===r.type&&void 0===n&&console.error("No analytics action associated with recommendation:",r),"productRecommendations/get/fullfilled"===r.type&&void 0===n&&console.error("No analytics action associated with product recommendation:",r)),void 0!==n&&e.dispatch(n),i},Du=d(D()),Eu=Jt("commerce/configuration/updateBasicConfiguration",(e=>Hr(e,{accessToken:$r,organizationId:$r,platformUrl:$r}))),Tu=Jt("commerce/configuration/updateAnalyticsConfiguration",(e=>Hr(e,{enabled:Zr.enabled,source:Zr.source,trackingId:Zr.trackingId}))),Mu=Jt("commerce/configuration/analytics/disable"),Fu=Jt("commerce/configuration/analytics/enable"),ju=(Jt("tab/register",(e=>{let t=new K({values:{id:_r,expression:Qr}});return Hr(e,t)})),Jt("tab/updateActiveTab",(e=>Hr(e,_r)))),Uu=d(O()),Pu=d(E()),_u=d(T());Uu.default.extend(_u.default),Uu.default.extend(Pu.default);var $u="/rest/search/v2",Qu="/rest/ua";function Lu(e,t){if((e=>/^https:\/\/platform(dev|stg|hipaa)?(-)?(eu|au)?\.cloud\.coveo\.com/.test(e))(e))return e.replace(/^(https:\/\/)platform/,"$1analytics")+Qu;let r=((e,t)=>{let r=qe(e);return r&&r.organizationId===t?r:null})(e,t);return r?ke(t,r.environment).analytics:e}var Vu=ur({organizationId:"",accessToken:"",platformUrl:Ce(),search:{apiBaseUrl:`${Ce()}${$u}`,locale:"en-US",timezone:Uu.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,apiBaseUrl:`${Ie()}${Qu}`,nextApiBaseUrl:"",originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",trackingId:"",analyticsMode:"legacy",source:{}},knowledge:{answerConfigurationId:""}},(e=>e.addCase(Kr,((e,t)=>{Nu(e,t.payload)})).addCase(Eu,((e,t)=>{Nu(e,t.payload)})).addCase(Jr,((e,t)=>{t.payload.apiBaseUrl&&(e.search.apiBaseUrl=t.payload.apiBaseUrl),t.payload.locale&&(e.search.locale=t.payload.locale),t.payload.timezone&&(e.search.timezone=t.payload.timezone),t.payload.authenticationProviders&&(e.search.authenticationProviders=t.payload.authenticationProviders)})).addCase(Xr,((e,t)=>{L(t.payload.enabled)||(e.analytics.enabled=t.payload.enabled),L(t.payload.originContext)||(e.analytics.originContext=t.payload.originContext),L(t.payload.originLevel2)||(e.analytics.originLevel2=t.payload.originLevel2),L(t.payload.originLevel3)||(e.analytics.originLevel3=t.payload.originLevel3),L(t.payload.apiBaseUrl)||(e.analytics.apiBaseUrl=t.payload.apiBaseUrl),L(t.payload.nextApiBaseUrl)||(e.analytics.nextApiBaseUrl=t.payload.nextApiBaseUrl),L(t.payload.trackingId)||(e.analytics.trackingId=t.payload.trackingId),L(t.payload.analyticsMode)||(e.analytics.analyticsMode=t.payload.analyticsMode),L(t.payload.source)||(e.analytics.source=t.payload.source);let r=(0,Du.default)();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r),L(t.payload.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.payload.runtimeEnvironment),L(t.payload.anonymous)||(e.analytics.anonymous=t.payload.anonymous),L(t.payload.deviceId)||(e.analytics.deviceId=t.payload.deviceId),L(t.payload.userDisplayName)||(e.analytics.userDisplayName=t.payload.userDisplayName),L(t.payload.documentLocation)||(e.analytics.documentLocation=t.payload.documentLocation)})).addCase(Tu,((e,t)=>{L(t.payload.enabled)||(e.analytics.enabled=t.payload.enabled),L(t.payload.trackingId)||(e.analytics.trackingId=t.payload.trackingId),L(t.payload.source)||(e.analytics.source=t.payload.source)})).addCase(en,(e=>{e.analytics.enabled=!1})).addCase(Mu,(e=>{e.analytics.enabled=!1})).addCase(tn,(e=>{e.analytics.enabled=!0})).addCase(Fu,(e=>{e.analytics.enabled=!0})).addCase(rn,((e,t)=>{e.analytics.originLevel2=t.payload.originLevel2})).addCase(nn,((e,t)=>{e.analytics.originLevel3=t.payload.originLevel3})).addCase(ju,((e,t)=>{e.analytics.originLevel2=t.payload})).addCase(on,((e,t)=>{e.analytics.originLevel2=t.payload.tab||e.analytics.originLevel2}))));function Nu(e,t){t.accessToken&&(e.accessToken=t.accessToken),t.organizationId&&(e.organizationId=t.organizationId),t.platformUrl&&(e.platformUrl=t.platformUrl,e.search.apiBaseUrl=`${t.platformUrl}${$u}`,e.analytics.apiBaseUrl=Lu(t.platformUrl,e.organizationId))}var zu=Vu;var Hu=()=>e=>t=>e(function(e){return e.instantlyCallable}(t)?t():t),Bu=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let i=n.error;return n.payload?.ignored||e.error(i.stack||i.message||i.name||"Error",`Action dispatch error ${n.type}`,r),"SchemaValidationError"!==n.error.name?t(r):void 0},Yu=e=>({referrer:document.referrer,userAgent:navigator.userAgent,location:window.location.href,clientId:e});function Wu(e,t){let r,n={...e};return{get combinedReducer(){let e=function(e){let t={};for(let[r,n]of e)t[r]=n;return t}(Object.entries(t).filter((([e])=>!(e in n))).map((([e,t])=>[e,()=>t])));return(e=>(t,n)=>{let i=e(t,n);return r?r(i,n):i})(ze({...e,...n}))},containsAll:e=>Object.keys(e).every((e=>e in n)),add(e){Object.keys(e).filter((e=>
1!(e in n))).forEach((t=>n[t]=e[t]))},addCrossReducer(e){r=e}}}function Gu(e,t,r){var n,i,a;void 0===t&&(t=50),void 0===r&&(r={});var o=null!=(n=r.isImmediate)&&n,s=null!=(i=r.callback)&&i,u=r.maxWait,c=Date.now(),l=[];function d(){if(void 0!==u){var e=Date.now()-c;if(e+t>=u)return u-e}return t}var p=function(){var t=[].slice.call(arguments),r=this;return new Promise((function(n,i){var u=o&&void 0===a;if(void 0!==a&&clearTimeout(a),a=setTimeout((function(){if(a=void 0,c=Date.now(),!o){var n=e.apply(r,t);s&&s(n),l.forEach((function(e){return(0,e.resolve)(n)})),l=[]}}),d()),u){var p=e.apply(r,t);return s&&s(p),n(p)}l.push({resolve:n,reject:i})}))};return p.cancel=function(e){void 0!==a&&clearTimeout(a),l.forEach((function(t){return(0,t.reject)(e)})),l=[]},p}function Ku(e,t){let r=0,n=Gu((()=>r=0),500);return i=>a=>async o=>{if("function"!=typeof o)return a(o);let s=await a(o);if(!function(e){return e?.error?.name===(new me).name}(s))return s;if("function"!=typeof t)return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),s;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),s;r++,n();let u=await async function(e){try{return await e()}catch{return""}}(t);i.dispatch(Kr({accessToken:u})),i.dispatch(o)}}var Ju={configuration:zu,version:qu};function Zu(e,t){let r=e.organizationEndpoints?.analytics||void 0,{analyticsClientMiddleware:n,...i}=e.analytics??{},a={...i,nextApiBaseUrl:`${r}/rest/organizations/${e.organizationId}/events/v1`,apiBaseUrl:r};if("next"!==a.analyticsMode&&function(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some((e=>te.has(e)))}())return t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1};if("next"===a.analyticsMode&&!i.trackingId)throw new ec('analytics.trackingId is required when analytics.analyticsMode="next"');return a}function Xu(e,t){let r=function(e,t){let{reducers:r}=e,n=Wu({...Ju,...r},e.preloadedState??{});e.crossReducer&&n.addCrossReducer(e.crossReducer);let i=t.logger,a=()=>{let e="";try{e=Ga(u.state).getMeta("").clientId}catch(t){i.warn("Error while obtaining clientID from relay",t)}return e},o={...t,get relay(){return Ga(u.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():Ou()?Yu(a()):{referrer:null,userAgent:null,location:null,clientId:""}}},s=function(e,t,r){let{preloadedState:n,configuration:i}=e,a=i.name||"coveo-headless",o=function(e,t){let{renewAccessToken:r}=e.configuration,n=Ku(t,r);return[Hu,n,Bu(t),xu].concat(Su.middleware,e.middlewares||[])}(e,t.logger);return function({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:i}){return or({reducer:e,preloadedState:t,devTools:{stateSanitizer:e=>e.history?{...e,history:"<<OMIT>>"}:e,name:i,shouldHotReload:!1},middleware:e=>e({thunk:{extraArgument:n}}).prepend(...r).concat((e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n)))(n.logger))})}({preloadedState:n,reducer:r.combinedReducer,middlewares:o,thunkExtraArguments:t,name:a})}(e,o,n),u={addReducers(e){n.containsAll(e)||(n.add(e),s.replaceReducer(n.combinedReducer))},dispatch:s.dispatch,subscribe:s.subscribe,enableAnalytics(){s.dispatch(tn())},disableAnalytics(){s.dispatch(en())},get state(){return s.getState()},get relay(){return Ga(this.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():Ou()?Yu(a()):{referrer:null,userAgent:null,location:null,clientId:""}},logger:i,store:s};return u}(e,t),{accessToken:n,organizationId:i}=e.configuration,{organizationEndpoints:a}=e.configuration,o=a?.platform||e.configuration.platformUrl;(function(e){return!L(e.platformUrl)||L(e.organizationEndpoints?.platform)})(e.configuration)&&r.logger.warn(`The \`platformUrl\` (${e.configuration.platformUrl}
1) option will be deprecated in the next major version. Consider using the \`organizationEndpoints\` option instead. See [Organization endpoints](https://docs.coveo.com/en/mcc80216).`),function(e){return Q(e.organizationEndpoints)}(e.configuration)?r.logger.warn("The `organizationEndpoints` options was not explicitly set in the Headless engine configuration. Coveo recommends setting this option, as it has resiliency benefits and simplifies the overall configuration for multi-region deployments. See [Organization endpoints](https://docs.coveo.com/en/mcc80216)."):function(e){let{platform:t}=e.organizationEndpoints;if(Q(t))return!1;let r=qe(t);return r&&r.organizationId!==e.organizationId}(e.configuration)&&r.logger.warn(`There is a mismatch between the \`organizationId\` option (${e.configuration.organizationId}) and the organization configured in the \`organizationEndpoints\` option (${e.configuration.organizationEndpoints?.platform}). This could lead to issues that are complex to troubleshoot. Please make sure both values match.`),r.dispatch(Kr({accessToken:n,organizationId:i,platformUrl:o}));let s=Zu(e.configuration,r.logger);return s&&r.dispatch(Xr(s)),r}var ec=class extends Error{constructor(e){super(e),this.name="InvalidEngineConfiguration"}},tc=d(F());function rc(e,t){let r=function(e){let{analytics:t}=e,r=(e,t)=>t;return t?.analyticsClientMiddleware||r}(e),n=zr,i=function(e){return e.preprocessRequest||se}(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:i,logger:t}}var nc={organizationId:_r,accessToken:_r,platformUrl:new W({required:!1,emptyAllowed:!1}),name:new W({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new z({required:!1}),originContext:new W({required:!1}),originLevel2:new W({required:!1}),originLevel3:new W({required:!1}),analyticsMode:new W({constrainTo:["legacy","next"],required:!1})}})};var ic=new _({...nc,pipeline:new W({required:!1,emptyAllowed:!0}),searchHub:$r,locale:$r,timezone:$r});function ac(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457",organizationEndpoints:ke("searchuisamples"),searchHub:"default"}}var oc={debug:cn,pipeline:gn,searchHub:Co,recommendation:So};function sc(e){let t=function(e){return(0,tc.default)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}(e.loggerOptions);!function(e,t){try{ic.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}(e.configuration,t);let r=function(e,t){return new class{constructor(e){this.options=e,this.apiCallsQueues={unknown:new Ae,mainSearch:new Ae,facetValues:new Ae,foldingCollection:new Ae,instantResults:new Ae}}async plan(e){let t=await be.call({...Oe(e,"POST","application/json","/plan"),requestParams:ue(e),requestMetadata:{method:"plan"},...this.options});if(t instanceof Error)return De(t);let r=await t.json();return void 0!==r.preprocessingOutput?{success:r}:{error:ce({response:t,body:r})}}async querySuggest(e){let t=await be.call({...Oe(e,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ue(e),...this.options});if(t instanceof Error)return De(t);let r=await t.json(),n={response:t,body:r};return void 0!==r.completions?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(n)).body}:{error:ce(n)}}async search(e,t){let r=t?.origin??"unknown",n=await this.apiCallsQueues[r].enqueue((r=>be.call({...Oe(e,"POST","application/json",""),requestParams:ue(e),requestMetadata:{method:"search",origin:t?.origin},...this.options,signal:r??void 0})),{logger:this.options.logger,warnOnAbort:!t?.disableAbortWarning});if(n instanceof Error)return De(n,t?.disableAbortWarning);let i=await n.json(),a={response:n,body:i};return Me(i)?(a.body=Fe(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:ce(a)}}async facetSearch(e){let t=await be.call({...Oe(e,"POST","application/json","/facet"),requestParams:ue(e),requestMetadata:{method:"facetSearch"},...this.options});if(t instanceof Error)throw t;let r=await t.json(),n={response:t,body:r};return(await this.options.postprocessFacetSearchResponseMiddleware(n)).body}async recommendations(e){let t=await be.call({...Oe(e,"POST","application/json",""),requestParam
1s:ue(e),requestMetadata:{method:"recommendations"},...this.options});if(t instanceof Error)throw t;let r=await t.json();if(Me(r)){let e={response:t,body:r};return e.body=Fe(r),{success:(await this.options.postprocessSearchResponseMiddleware(e)).body}}return{error:ce({response:t,body:r})}}async html(e){return(async(e,t)=>{let r=await be.call({...Oe(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ue(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=function(e){return((e.headers.get("content-type")||"").split(";").find((e=>-1!==e.indexOf("charset=")))||"").split("=")[1]||"UTF-8"}(r),i=await r.arrayBuffer(),a=new TextDecoder(n).decode(i);return function(e){return"string"==typeof e}(a)?{success:a}:{error:ce({response:r,body:a})}})(e,{...this.options})}async productRecommendations(e){let t=await be.call({...Oe(e,"POST","application/json",""),requestParams:ue(e),requestMetadata:{method:"productRecommendations"},...this.options});if(t instanceof Error)throw t;let r=await t.json();return Me(r)?{success:r}:{error:ce({response:t,body:r})}}async fieldDescriptions(e){let t=await be.call({...Oe(e,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(t instanceof Error)throw t;let r=await t.json();return void 0!==r.fields?{success:r}:{error:ce({response:t,body:r})}}}({logger:t,preprocessRequest:e.preprocessRequest||se,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||je,postprocessFacetSearchResponseMiddleware:Ue,postprocessQuerySuggestResponseMiddleware:Pe})}(e.configuration,t),n={...rc(e.configuration,t),apiClient:r},i=Xu({...e,reducers:oc},n),{pipeline:a,searchHub:o,timezone:s,locale:u}=e.configuration;return i.dispatch(Jr({timezone:s,locale:u})),L(a)||i.dispatch(ln(a)),L(o)||i.dispatch(ko(o)),{...i,get state(){return i.state}}}function uc(e){return e.addReducers({configuration:zu}),{disableAnalytics:en,enableAnalytics:tn,setOriginLevel2:rn,setOriginLevel3:nn,updateAnalyticsConfiguration:Xr,updateBasicConfiguration:Kr}}function cc(e){return e.addReducers({configuration:zu,pipeline:gn,searchHub:Co}),{updateSearchConfiguration:Jr}}var lc=()=>new W({required:!1,emptyAllowed:!0}),dc=Jt("advancedSearchQueries/update",(e=>Hr(e,{aq:lc(),cq:lc(),lq:lc(),dq:lc()}))),pc=Jt("advancedSearchQueries/register",(e=>Hr(e,{aq:lc(),cq:lc(),lq:lc(),dq:lc()}))),hc=ur({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}},(e=>{e.addCase(dc,((e,t)=>{let{aq:r,cq:n,lq:i,dq:a}=t.payload;Q(r)||(e.aq=r,e.aqWasSet=!0),Q(n)||(e.cq=n,e.cqWasSet=!0),Q(i)||(e.lq=i,e.lqWasSet=!0),Q(a)||(e.dq=a,e.dqWasSet=!0)})).addCase(pc,((e,t)=>{let{aq:r,cq:n,lq:i,dq:a}=t.payload;Q(r)||(e.defaultFilters.aq=r,e.aqWasSet||(e.aq=r)),Q(n)||(e.defaultFilters.cq=n,e.cqWasSet||(e.cq=n)),Q(i)||(e.defaultFilters.lq=i,e.lqWasSet||(e.lq=i)),Q(a)||(e.defaultFilters.dq=a,e.dqWasSet||(e.dq=a))})).addCase(fn.fulfilled,((e,t)=>t.payload?.advancedSearchQueries??e)).addCase(on,((e,t)=>{let{aq:r,cq:n}=t.payload;Q(r)||(e.aq=r,e.aqWasSet=!0),Q(n)||(e.cq=n,e.cqWasSet=!0)}))}));function fc(e){return e.addReducers({advancedSearchQueries:hc}),{updateAdvancedSearchQueries:dc,registerAdvancedSearchQueries:pc}}var gc=new Z({each:_r,required:!0}),mc=(e,t)=>(Hr(e,_r),G(t)?Hr(t,_r):Hr(t,gc),{payload:{contextKey:e,contextValue:t}}),yc=Jt("context/set",(e=>{for(let[t,r]of Object.entries(e))mc(t,r);return{payload:e}})),vc=Jt("context/add",(e=>mc(e.contextKey,e.contextValue))),wc=Jt("context/remove",(e=>Hr(e,_r)));var bc=ur({contextValues:{}},(e=>{e.addCase(yc,((e,t)=>{e.contextValues=t.payload})).addCase(vc,((e,t)=>{e.contextValues[t.payload.contextKey]=t.payload.contextValue})).addCase(wc,((e,t)=>{delete e.contextValues[t.payload]})).addCase(fn.fulfilled,((e,t)=>{t.payload&&(e.contextValues=t.payload.context.contextValues)}))}));function Sc(e){return e.addReducers({context:bc}),{addContext:vc,removeContext:wc,setContext:yc}}var kc=Jt("dictionaryFieldContext/set",(e=>{let t=new K({options:{required:!0}}),r=Hr(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),i=new Z({each:Qr}),a=Hr(n,i).error;return a?{payload:e,error:a}:{payload:e}})),Cc=Jt("dictionaryFieldContext/add",(e=>{let t=new K({options:{required:!0},values:{field:Qr,key:Qr}});return Hr(e,t)})),Ic=Jt("dictionaryFieldContext/remove",(e=>Hr(e,Qr)));var Ac=ur({contextValues:{}},(e=>{e.addCase(kc,((e,t)=>{e.contextValues=t.payload})).addCase(Cc,((e,t)=>{let{field:r,key:n}=t.payload;e.contextValues[r]=n})).addCase(Ic,((e,t)=>{delete e.contextValues[t.payload]})).addCase(fn.fulfilled,((e,t)=>{t.payload&&(e.contextValues=t.payload.dictionaryFieldContext.contextValues)}))}));function qc(e){return e.addReducers({dictionaryFieldContext:Ac}),{addContext:Cc,removeContext:Ic,setContext:kc}}var Oc=async(e,t)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl,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&&{visitorId:await sa(e.configuration.analytics),actionsHistory:ua.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&&await Ua(e.configuration.analytics,t),...e.excerptLength&&!L(e.excerptLength.length)&&{excerptLength:e.excerptLength.length},...e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}}),Rc=(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:!0,source:da(e)}}),xc=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl,locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...e.configuration.analytics.enabled&&{visitorId:t.clientId},...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&&Rc(e.configuration.analytics,t,r),...e.excerptLength&&!L(e.excerptLength.length)&&{excerptLength:e.excerptLength.length},...e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}}),Dc={collectionField:new W({emptyAllowed:!1,required:!1}),parentField:new W({emptyAllowed:!1,required:!1}),childField:new W({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new V({min:0,required:!1})},Ec=Jt("folding/register",(e=>Hr(e,Dc)));Ir("folding/loadCollection",(async(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:i}})=>{let a=t(),o="legacy"===a.configuration.analytics.analyticsMode?await Oc(a):xc(a,i),s=await n.search({...o,q:Tc(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Te(s)?r(s.error):{collectionId:e,results:s.success.results,searchUid:s.success.searchUid,rootResult:a.folding.collections[e].result}}));function Tc(e){return""===e.query.q?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}var Mc=Jt("fields/registerFieldsToInclude",(e=>Hr(e,Lr))),Fc=Jt("fields/fetchall/enable"),jc=Jt("fields/fetchall/disable"),Uc=Ir("fields/fetchDescription",(async(e,{extra:t,getState:r,rejectWithValue:n})=>{let i=r(),{accessToken:a,organizationId:o}=i.configuration,{apiBaseUrl:s}=i.configuration.search,u=await t.apiClient.fieldDescriptions({accessToken:a,organizationId:o,url:s});return Te(u)?n(u.error):u.success.fields})),Pc=["author","language","urihash","objecttype","collection","source","permanentid"],_c=[...Pc,"date","filetype","parents"],$c=[..._c,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],Qc=ur({fieldsToInclude:Pc,fetchAllFields:!1,fieldsDescription:[]},(e=>e.addCase(Mc,((e,t)=>{e.fieldsToInclude=[...new Set(e.fieldsToInclude.concat(t.payload))]})).addCase(Fc,(e=>{e.fetchAllFields=!0})).addCase(jc,(e=>{e.fetchAllFields=!1})).addCase(Uc.fulfilled,((e,{payload:t})=>{e.fieldsDescription=t})).addCase(Ec,((e,{payload:t})=>{let r={collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"};e.fieldsToInclude.push(t.collectionField??r.collection,t.parentField??r.parent,t.childField??r.child)}))));function Lc(e){return e.addReducers({fields:Qc}),{registerFieldsToInclude:Mc,enableFetchAllFields:Fc,disableFetchAllFields:jc,fetchFieldsDescription:Uc}}function Vc(e){return e.addReducers({pipeline:gn}),{setPipeline:ln}}function Nc(e){return e.addReducers({searchHub:Co}),{setSearchHub:ko}}function zc(e){return e.addReducers({debug:cn}),{disableDebug:un,enableDebug:sn}}function Hc(e){return e.addReducers({recommendation:So}),{getRecommendations:vo,setRecommendationId:yo}}function Bc(e){return e.addReducers({}),{logRecommendationOpen:mo}}var Yc=Jt("breadcrumb/deselectAll"),Wc=Jt("breadcrumb/deselectAllNonBreadcrumbs"),Gc={value:_r,numberOfResults:new V({min:0}),state:_r},Kc=_r,Jc=new V({min:1,default:8,required:!1}),Zc={desiredCount:new V({min:1,max:20,default:5,required:!1}),numberOfValues:Jc},Xc=(Jt("automaticFacet/setOptions",(e=>Hr(e,Zc))),Jt("automaticFacet/deselectAll",(e=>Hr(e,Kc))),_r),el=Jt("automaticFacet/toggleSelectValue",(e=>Hr(e,{field:Xc,selection:new K({values:Gc})}))),tl={state:new $({required:!0}),numberOfResults:new V({required:!0,min:0}),value:new W({required:!0,emptyAllowed:!0}),path:new Z({required:!0,each:_r}),moreValuesAvailable:new z({required:!1})};
1function rl(e){e.children.forEach((e=>{rl(e)})),zr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},tl)}var nl={facetId:Kc,field:_r,delimitingCharacter:new W({required:!1,emptyAllowed:!0}),filterFacetCount:new z({required:!1}),injectionDepth:new V({required:!1,min:0}),numberOfValues:new V({required:!1,min:1}),sortCriteria:new $({required:!1}),basePath:new Z({required:!1,each:_r}),filterByBasePath:new z({required:!1})},il=(Jt("categoryFacet/register",(e=>Hr(e,nl))),Jt("categoryFacet/toggleSelectValue",(e=>{try{return zr(e.facetId,_r),rl(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:Nr(t)}}}))),al=Jt("categoryFacet/deselectAll",(e=>Hr(e,nl.facetId))),ol=(Jt("categoryFacet/updateNumberOfValues",(e=>Hr(e,{facetId:nl.facetId,numberOfValues:nl.numberOfValues}))),Jt("categoryFacet/updateSortCriterion",(e=>Hr(e,{facetId:nl.facetId,criterion:new $}))),Jt("categoryFacet/updateBasePath",(e=>Hr(e,{facetId:nl.facetId,basePath:new Z({each:_r})}))),{facetId:Kc,captions:new K({options:{required:!1}}),numberOfValues:new V({required:!1,min:1}),query:new W({required:!1,emptyAllowed:!0})}),sl={path:new Z({required:!0,each:_r}),displayValue:Qr,rawValue:Qr,count:new V({required:!0,min:0})},ul=Jt("categoryFacet/selectSearchResult",(e=>Hr(e,{facetId:Kc,value:new K({values:sl})}))),cl=(Jt("categoryFacetSearch/register",(e=>Hr(e,ol))),{facetId:Kc,value:new K({values:{displayValue:Qr,rawValue:Qr,count:new V({required:!0,min:0})}})}),ll=(Jt("facetSearch/register",(e=>Hr(e,ol))),Jt("facetSearch/update",(e=>Hr(e,ol))),Jt("facetSearch/toggleSelectValue",(e=>Hr(e,cl)))),dl=Jt("facetSearch/toggleExcludeValue",(e=>Hr(e,cl)));function pl(e,t){let{dateFormat:r}=t;return function(e){return!!e&&"object"==typeof e&&"period"in e}(e)?(as(e),function(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}(e)):"string"==typeof e&&cs(e)?(as(e),e):(function(e,t){let r=es(e,t);if(!r.isValid()){let r=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",n=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?n:r}`)}rs(r)}(e,r),ts(es(e,r)))}new W({regex:/^[a-zA-Z0-9-_]+$/}),new W({required:!0}),new Z({each:new W}),new W,new z,new z,new V({min:0});
1var hl=new V({min:1}),fl=(new z({required:!0}),new K),gl=new W,ml=(new K({values:{captions:fl,numberOfValues:hl,query:gl}}),new K({options:{required:!1},values:{type:new W({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new Z({required:!0,max:25,each:new W({emptyAllowed:!1,required:!0})})}})),yl=(new z,new Z({min:1,max:25,required:!1,each:new W({emptyAllowed:!1,required:!0})})),vl={facetId:Kc,field:new W({required:!0,emptyAllowed:!0}),filterFacetCount:new z({required:!1}),injectionDepth:new V({required:!1,min:0}),numberOfValues:new V({required:!1,min:1}),sortCriteria:new $({required:!1}),resultsMustMatch:new $({required:!1}),allowedValues:ml,customSort:yl},wl=(Jt("facet/register",(e=>Hr(e,vl))),Jt("facet/toggleSelectValue",(e=>Hr(e,{facetId:Kc,selection:new K({values:Gc})})))),bl=Jt("facet/toggleExcludeValue",(e=>Hr(e,{facetId:Kc,selection:new K({values:Gc})}))),Sl=Jt("facet/deselectAll",(e=>Hr(e,Kc))),kl=(Jt("facet/updateSortCriterion",(e=>Hr(e,{facetId:Kc,criterion:new $({required:!0})}))),Jt("facet/updateNumberOfValues",(e=>Hr(e,{facetId:Kc,numberOfValues:new V({required:!0,min:1})}))),Jt("facet/updateIsFieldExpanded",(e=>Hr(e,{facetId:Kc,isFieldExpanded:new z({required:!0})}))),Jt("facet/updateFreezeCurrentValues",(e=>Hr(e,{facetId:Kc,freezeCurrentValues:new z({required:!0})}))),Jt("rangeFacet/updateSortCriterion",(e=>Hr(e,{facetId:Kc,criterion:new $({required:!0})}))),{state:_r,start:new V({required:!0}),end:new V({required:!0}),endInclusive:new z({required:!0}),numberOfResults:new V({required:!0,min:0})}),Cl={start:_r,end:_r,endInclusive:new z({required:!0}),state:_r,numberOfResults:new V({required:!0,min:0})},Il={start:_r,end:_r,endInclusive:new z({required:!0}),state:_r},Al={facetId:Kc,field:_r,currentValues:new Z({required:!1,each:new K({values:Il})}),generateAutomaticRanges:new z({required:!0}),filterFacetCount:new z({required:!1}),injectionDepth:new V({required:!1,min:0}),numberOfValues:new V({required:!1,min:1}),sortCriteria:new $({required:!1}),rangeAlgorithm:new $({required:!1})};function ql(e){return cs(e)?ss(e):e}function Ol(e){e.currentValues&&e.currentValues.forEach((e=>{let{start:t,end:r}=function(e){return{start:pl(e.start,e),end:pl(e.end,e),endInclusive:e.endInclusive??!1,state:e.state??"idle"}}(e);if(es(ql(t)).isAfter(es(ql(r))))throw new Error(`The start value is greater than the end value for the date range ${e.start} to ${e.end}`)}))}Jt("dateFacet/register",(e=>{try{return zr(e,Al),Ol(e),{payload:e,error:null}}catch(t){return{payload:e,error:Nr(t)}}}));var Rl=Jt("dateFacet/toggleSelectValue",(e=>Hr(e,{facetId:Kc,selection:new K({values:Cl})}))),xl=Jt("dateFacet/toggleExcludeValue",(e=>Hr(e,{facetId:Kc,selection:new K({values:Cl})}))),Dl=Jt("dateFacet/updateFacetValues",(e=>{try{return zr(e,{facetId:Kc,values:new Z({each:new K({values:Cl})})}),Ol({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Nr(t)}}})),El={state:_r,start:new V({required:!0}),end:new V({required:!0}),endInclusive:new z({required:!0})},Tl={facetId:Kc,field:_r,currentValues:new Z({required:!1,each:new K({values:El})}),generateAutomaticRanges:new z({required:!0}),filterFacetCount:new z({required:!1}),injectionDepth:new V({required:!1,min:0}),numberOfValues:new V({required:!1,min:1}),sortCriteria:new $({required:!1}),rangeAlgorithm:new $({required:!1})};function Ml(e){e.currentValues&&e.currentValues.forEach((({start:e,end:t})=>{if(e>t)throw new Error(`The start value is greater than the end value for the numeric range ${e} to ${t}`)}))}Jt("numericFacet/register",(e=>{try{return Hr(e,Tl),Ml(e),{payload:e,error:null}}catch(t){return{payload:e,error:Nr(t)}}}));var Fl=Jt("numericFacet/toggleSelectValue",(e=>Hr(e,{facetId:Kc,selection:new K({values:kl})}))),jl=Jt("numericFacet/toggleExcludeValue",(e=>Hr(e,{facetId:Kc,selection:new K({values:kl})}))),Ul=Jt("numericFacet/updateFacetValues",(e=>{try{return zr(e,{facetId:Kc,values:new Z({each:new K({values:kl})})}),Ml({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Nr(t)}}})),Pl=()=>no("search/logFetchMoreResults",(e=>e.makeFetchMoreResults())),_l=e=>no("search/queryError",((t,r)=>t.makeQueryError({query:r.query?.q||"",aq:r.advancedSearchQueries?.aq||"",cq:r.advancedSearchQueries?.cq||"",dq:r.advancedSearchQueries?.dq||"",errorType:e.type,errorMessage:e.message}))),$l=(e=>(e.Relevance="relevance",e.Fields="fields",e))($l||{}),Ql=(e=>
1(e.Ascending="asc",e.Descending="desc",e))(Ql||{}),Ll=(new K({options:{required:!1},values:{by:new X({enum:$l,required:!0}),fields:new Z({each:new K({values:{name:new W,direction:new X({enum:Ql})}})})}}),Jt("productlisting/setUrl",(e=>Hr(e,{url:new W({required:!0,url:!0})}))),Jt("productlisting/setAdditionalFields",(e=>Hr(e,{additionalFields:new Z({required:!0,each:new W({required:!0,emptyAllowed:!1})})}))),Ir("productlisting/fetch",(async(e,{getState:t,dispatch:r,rejectWithValue:n,extra:i})=>{let a=t(),{apiClient:o}=i,s=await o.getProducts(await Vl(a));return(e=>void 0!==e.error)(s)?(r(_l(s.error)),n(s.error)):{response:s.success,analyticsAction:io("analytics/productListing/load",(e=>e.makeInterfaceLoad()),(e=>new Ja(e)))}}))),Vl=async e=>{let t=function(e){return vs(function(e){return[...ys(e.facetSet??{}),...ys(e.numericFacetSet??{}),...ys(e.dateFacetSet??{}),...ys(e.categoryFacetSet??{})]}(e),e.facetOrder??[])}(e),r=await sa(e.configuration.analytics);return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,platformUrl:e.configuration.platformUrl,url:e.productListing?.url,...e.configuration.analytics.enabled&&r?{clientId:r}:{},...e.productListing.additionalFields?.length?{additionalFields:e.productListing.additionalFields}:{},...e.productListing.advancedParameters&&Nl(e.productListing.advancedParameters)?{advancedParameters:e.productListing.advancedParameters||{}}:{},...t.length&&{facets:{requests:t}},...e.pagination&&{pagination:{numberOfValues:e.pagination.numberOfResults,page:Math.ceil(e.pagination.firstResult/(e.pagination.numberOfResults||1))+1}},..."relevance"!==(e.sort?.by||"relevance")&&{sort:e.sort},...e.context&&{userContext:e.context.contextValues}}};function Nl(e){return e.debug}var zl=Jt("facet/updateFacetAutoSelection",(e=>Hr(e,{allow:new z({required:!0})}))),Hl=class extends Fa{constructor(e){super(e),this.getState=e}get activeInstantResultQuery(){let e=this.getState().instantResults;for(let t in e)for(let r in e[t].cache)if(e[t].cache[r].isActive)return e[t].q;return null}get activeInstantResultCache(){let e=this.getState().instantResults;for(let t in e)for(let r in e[t].cache)if(e[t].cache[r].isActive)return e[t].cache[r];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??""}get responseTime(){return this.activeInstantResultCache?.duration??0}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??0}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}},Bl={id:_r},Yl={...Bl,q:Qr},Wl=(Jt("instantResults/register",(e=>Hr(e,Bl))),Jt("instantResults/updateQuery",(e=>Hr(e,Yl)))),Gl=(Jt("instantResults/clearExpired",(e=>Hr(e,Bl))),new V({required:!0,min:0})),Kl=Jt("pagination/registerNumberOfResults",(e=>Hr(e,Gl))),Jl=Jt("pagination/updateNumberOfResults",(e=>Hr(e,Gl))),Zl=Jt("pagination/registerPage",(e=>Hr(e,Gl))),Xl=Jt("pagination/updatePage",(e=>Hr(e,Gl))),ed=Jt("pagination/nextPage"),td=Jt("pagination/previousPage"),rd=Jt("query/updateQuery",(e=>Hr(e,{q:new W,enableQuerySyntax:new z}))),nd=(Jt("didYouMean/enable"),Jt("didYouMean/disable"),Jt("didYouMean/automaticCorrections/disable"),Jt("didYouMean/automaticCorrections/enable"),Jt("didYouMean/correction",(e=>Hr(e,_r)))),id=(Jt("didYouMean/automaticCorrections/mode",(e=>Hr(e,new W({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})))),()=>no("analytics/didyoumean/automatic",(e=>e.makeDidYouMeanAutomatic())));function ad(e){return{context:e.context||{contextValues:{}},dictionaryFieldContext:e.dictionaryFieldContext||{contextValues:{}},facetSet:e.facetSet||{},numericFacetSet:e.numericFacetSet||{},dateFacetSet:e.dateFacetSet||{},categoryFacetSet:e.categoryFacetSet||{},automaticFacetSet:e.automaticFacetSet??{desiredCount:5,numberOfValues:8,set:{}},pagination:e.pagination||{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0},query:e.query||{q:"",enableQuerySyntax:!1},tabSet:e.tabSet||{},advancedSearchQueries:e.advancedSearchQueries||{cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}},staticFilterSet:e.staticFilterSet||{},querySet:e.querySet||{},sortCriteria:e.sortCriteria||Ea(),pipeline:e.pipeline||"",searchHub:e.searchHub||"default",facetOptions:e.facetOptions||{freezeFacetOrder:!1,facets:{}},facetOrder:e.facetOrder??[],debug:e.debug??!1}}new K({values:{undoneQuery:Qr},options:{required:!0}});var od=Jt("trigger/query/ignore",(e=>Hr(e,new W({emptyAllowed:!0,required:!0})))),sd=Jt("trigger/query/modification",(e=>Hr(e,new K({values:{originalQuery:$r,modification:$r}})))),ud=async(e,t)=>{let r=function(e){let t=e.advancedSearchQueries?.cq.trim()||"",r=Object.values(e.tabSet||{}).find((e=>e.isActive))?.expression.trim()||"",n=function(e){return Object.values(e.staticFilterSet||{}).map((e=>{let t=e.values.filter((e=>"selected"===e.state&&!!e.expression.trim())),r=t.map((e=>e.expression)).join(" OR ");return t.length>1?`(${r})`:r}))}(e);return[t,r,...n].filter((e=>!!e)).join(" AND ")}(e),n=ks(e),i=function(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map((e=>e.response)).map(cd).filter((e=>e.currentValues.length>0)):void 0}(e);return fs({...await Oc(e,t),...e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&"next"===e.didYouMean.queryCorrectionMode,options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&"legacy"===e.didYouMean.queryCorrectionMode}
1,...r&&{cq:r},...n.length&&{facets:n},...e.pagination&&{numberOfResults:e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,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:i}},...e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}}})};function cd(e){let{field:t,label:r,values:n}=e,i=n.filter((e=>"selected"===e.state));return{field:t,label:r,currentValues:i}}var ld=class{constructor(e,t=(e=>{this.dispatch(rd({q:e}))})){this.config=e,this.onUpdateQueryForCorrection=t}async fetchFromAPI({mappings:e,request:t},r){let n=(new Date).getTime();return{response:ms(await this.extra.apiClient.search(t,r),e),duration:(new Date).getTime()-n,queryExecuted:this.getState().query?.q||"",requestExecuted:t}}async process(e){return this.processQueryErrorOrContinue(e)??await this.processQueryCorrectionsOrContinue(e)??await this.processQueryTriggersOrContinue(e)??this.processSuccessResponse(e)}processQueryErrorOrContinue(e){return Te(e.response)?(this.dispatch(_l(e.response.error)),this.rejectWithValue(e.response.error)):null}async processQueryCorrectionsOrContinue(e){let t=this.getState(),r=this.getSuccessResponse(e);if(!r||!t.didYouMean)return null;let{enableDidYouMean:n,automaticallyCorrectQuery:i}=t.didYouMean,{results:a,queryCorrections:o,queryCorrection:s}=r;if(!n||!i)return null;
1let u=0===a.length&&o&&0!==o.length,c=!L(s)&&!L(s.correctedQuery);if(!u&&!c)return null;let l=u?await this.processLegacyDidYouMeanAutoCorrection(e):this.processModernDidYouMeanAutoCorrection(e);return this.dispatch(hn(ad(this.getState()))),l}async processLegacyDidYouMeanAutoCorrection(e){let t=this.getCurrentQuery(),r=this.getSuccessResponse(e);if(!r.queryCorrections)return null;let{correctedQuery:n}=r.queryCorrections[0],i=await this.automaticallyRetryQueryWithCorrection(n);return Te(i.response)?(this.dispatch(_l(i.response.error)),this.rejectWithValue(i.response.error)):(this.logOriginalAnalyticsQueryBeforeAutoCorrection(e),this.dispatch(hn(ad(this.getState()))),{...i,response:{...i.response.success,queryCorrections:r.queryCorrections},automaticallyCorrected:!0,originalQuery:t,analyticsAction:id()})}processModernDidYouMeanAutoCorrection(e){let t=this.getSuccessResponse(e),{correctedQuery:r,originalQuery:n}=t.queryCorrection;return this.onUpdateQueryForCorrection(r),{...e,response:{...t},queryExecuted:r,automaticallyCorrected:!0,originalQuery:n,analyticsAction:id()}}logOriginalAnalyticsQueryBeforeAutoCorrection(e){let t=this.getState(),r=this.getSuccessResponse(e);this.analyticsAction&&this.analyticsAction()(this.dispatch,(()=>this.getStateAfterResponse(e.queryExecuted,e.duration,t,r)),this.extra)}async processQueryTriggersOrContinue(e){let t=this.getSuccessResponse(e);if(!t)return null;let r=t.triggers.find((e=>"query"===e.type))?.content||"";if(!r)return null;if(this.getState().triggers?.queryModification.queryToIgnore===r)return this.dispatch(od("")),null;this.analyticsAction&&await this.dispatch(this.analyticsAction);let n=this.getCurrentQuery(),i=await this.automaticallyRetryQueryWithTriggerModification(r);return Te(i.response)?(this.dispatch(_l(i.response.error)),this.rejectWithValue(i.response.error)):(this.dispatch(hn(ad(this.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:n,analyticsAction:no("analytics/trigger/query",((e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null))})}getStateAfterResponse(e,t,r,n){return{...r,query:{q:e,enableQuerySyntax:r.query?.enableQuerySyntax??!1},search:{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0},pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0},extendedResults:{},duration:t,response:n,results:n.results}}}processSuccessResponse(e){return this.dispatch(hn(ad(this.getState()))),{...e,response:this.getSuccessResponse(e),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(e){return Ee(e.response)?e.response.success:null}async automaticallyRetryQueryWithCorrection(e){this.onUpdateQueryForCorrection(e);let t=await this.fetchFromAPI(await ud(this.getState()),{origin:"mainSearch"});return this.dispatch(nd(e)),t}async automaticallyRetryQueryWithTriggerModification(e){return this.dispatch(sd({newQuery:e,originalQuery:this.getCurrentQuery()})),this.onUpdateQueryForCorrection(e),await this.fetchFromAPI(await ud(this.getState()),{origin:"mainSearch"})}getCurrentQuery(){let e=this.getState();return void 0!==e.query?.q?e.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}},dd=(Ir("search/prepareForSearchWithQuery",((e,t)=>{let{dispatch:r}=t;Hr(e,{q:new W,enableQuerySyntax:new z,clearFilters:new z}),e.clearFilters&&(r(Yc()),r(Wc())),r(zl({allow:!0})),r(rd({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Xl(1))})),Ir("search/executeSearch",(async(e,t)=>{let r=t.getState();return await gd(r,t,e)})),Ir("search/fetchPage",(async(e,t)=>{let r=t.getState();return await hd(r,t,e)})),Ir("search/fetchMoreResults",(async(e,t)=>{let r=t.getState();return await fd(t,r)})),Ir("search/fetchFacetValues",(async(e,t)=>{let r=t.getState();return await async function(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:i,logger:a}=e.extra,{description:o}=await t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:a}),s=new ld({...e,analyticsAction:t}),u=await(async(e,t)=>{let r=await ud(e,t);return r.request.numberOfResults=0,r})(r,o),c=await s.fetchFromAPI(u,{origin:"facetValues"});return await s.process(c)}(t,e,r)}
1)),Ir("search/fetchInstantResults",(async(e,t)=>pd(e,t))),e=>{e.configuration.analytics.enabled&&ua.addElement({name:"Query",...e.query?.q&&{value:e.query.q},time:JSON.stringify(new Date)})});async function pd(e,t){Hr(e,{id:_r,q:_r,maxResultsPerQuery:new V({required:!0,min:1}),cacheTimeout:new V});let{q:r,maxResultsPerQuery:n}=e,i=t.getState(),a=new ld({...t,analyticsAction:no("analytics/instantResult/searchboxAsYouType",(e=>e.makeSearchboxAsYouType()),(e=>new Hl(e)))},(r=>{t.dispatch(Wl({q:r,id:e.id}))})),o=await(async(e,t,r)=>fs({...await Oc(e),...e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean},numberOfResults:r,q:t}))(i,r,n),s=await a.fetchFromAPI(o,{origin:"instantResults",disableAbortWarning:!0}),u=await a.process(s);return"response"in u?{results:u.response.results,searchUid:u.response.searchUid,analyticsAction:u.analyticsAction,totalCountFiltered:u.response.totalCountFiltered,duration:u.duration}:u}async function hd(e,t,r){dd(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:a}=t.extra,{description:o}=await r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:a}),s=new ld({...t,analyticsAction:r}),u=await ud(e,o),c=await s.fetchFromAPI(u,{origin:"mainSearch"});return await s.process(c)}async function fd(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:i}=e.extra,{description:a}=await Pl().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:i}),o=new ld({...e,analyticsAction:Pl()}),s=await(async(e,t)=>{let r=await ud(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r})(t,a),u=await o.fetchFromAPI(s,{origin:"mainSearch"});return await o.process(u)}async function gd(e,t,r){dd(e);let{analyticsClientMiddleware:n,preprocessRequest:i,logger:a}=t.extra,{description:o}=await r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:i,logger:a}),s=await ud(e,o),u=new ld({...t,analyticsAction:r}),c=await u.fetchFromAPI(s,{origin:"mainSearch"});return await u.process(c)}var md=async(e,t,r)=>{let n=function(e){let t=e.advancedSearchQueries?.cq.trim()||"",r=Object.values(e.tabSet||{}).find((e=>e.isActive))?.expression.trim()||"",n=function(e){return Object.values(e.staticFilterSet||{}).map((e=>{let t=e.values.filter((e=>"selected"===e.state&&!!e.expression.trim())),r=t.map((e=>e.expression)).join(" OR ");return t.length>1?`(${r})`:r}))}(e);return[t,r,...n].filter((e=>!!e)).join(" AND ")}(e),i=function(e){return vs(function(e){return function(e){return[...vd(e.facetSet??{}),...wd(e.numericFacetSet??{}),...wd(e.dateFacetSet??{}),...ys(e.categoryFacetSet??{})]}(e).filter((({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0))}(e),e.facetOrder??[])}(e),a=function(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map((e=>e.response)).map(yd).filter((e=>e.currentValues.length>0)):void 0}(e);return fs({..."legacy"===e.configuration.analytics.analyticsMode?await Oc(e,r):xc(e,t,r),...e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&"next"===e.didYouMean.queryCorrectionMode,options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&"legacy"===e.didYouMean.queryCorrectionMode},...n&&{cq:n},...i.length&&{facets:i},...e.pagination&&{numberOfResults:e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,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}}}})};function yd(e){let{field:t,label:r,values:n}=e,i=n.filter((e=>"selected"===e.state));return{field:t,label:r,currentValues:i}}function vd(e){return ys(e).map((e=>"alphanumericDescending"===e.sortCriteria?{...e,sortCriteria:{type:"alphanumeric",order:"descending"}}:e))}function wd(e){return ys(e).map((e=>{let t=e.currentValues.some((({state:e})=>"idle"!==e));return e.generateAutomaticRanges&&!t?{...e,currentValues:[]}:e}))}
1var bd=class{constructor(e,t=(e=>{this.dispatch(rd({q:e}))})){this.config=e,this.onUpdateQueryForCorrection=t}async fetchFromAPI({mappings:e,request:t},r){let n=(new Date).getTime();return{response:ms(await this.extra.apiClient.search(t,r),e),duration:(new Date).getTime()-n,queryExecuted:this.getState().query?.q||"",requestExecuted:t}}async process(e){return this.processQueryErrorOrContinue(e)??await this.processQueryCorrectionsOrContinue(e)??await this.processQueryTriggersOrContinue(e)??this.processSuccessResponse(e)}processQueryErrorOrContinue(e){return Te(e.response)?(this.dispatch(_l(e.response.error)),this.rejectWithValue(e.response.error)):null}async processQueryCorrectionsOrContinue(e){let t=this.getState(),r=this.getSuccessResponse(e);if(!r||!t.didYouMean)return null;let{enableDidYouMean:n,automaticallyCorrectQuery:i}=t.didYouMean,{results:a,queryCorrections:o,queryCorrection:s}=r;if(!n||!i)return null;let u=0===a.length&&o&&0!==o.length,c=!L(s)&&!L(s.correctedQuery);if(!u&&!c)return null;let l=u?await this.processLegacyDidYouMeanAutoCorrection(e):this.processModernDidYouMeanAutoCorrection(e);return this.dispatch(hn(ad(this.getState()))),l}async processLegacyDidYouMeanAutoCorrection(e){let t=this.getCurrentQuery(),r=this.getSuccessResponse(e);if(!r.queryCorrections)return null;let{correctedQuery:n}=r.queryCorrections[0],i=await this.automaticallyRetryQueryWithCorrection(n);return Te(i.response)?(this.dispatch(_l(i.response.error)),this.rejectWithValue(i.response.error)):(this.dispatch(hn(ad(this.getState()))),{...i,response:{...i.response.success,queryCorrections:r.queryCorrections},automaticallyCorrected:!0,originalQuery:t})}processModernDidYouMeanAutoCorrection(e){let t=this.getSuccessResponse(e),{correctedQuery:r,originalQuery:n}=t.queryCorrection;return this.onUpdateQueryForCorrection(r),{...e,response:{...t},queryExecuted:r,automaticallyCorrected:!0,originalQuery:n}}async processQueryTriggersOrContinue(e){let t=this.getSuccessResponse(e);if(!t)return null;let r=t.triggers.find((e=>"query"===e.type))?.content||"";if(!r)return null;if(this.getState().triggers?.queryModification.queryToIgnore===r)return this.dispatch(od("")),null;let n=this.getCurrentQuery(),i=await this.automaticallyRetryQueryWithTriggerModification(r);return Te(i.response)?(this.dispatch(_l(i.response.error)),this.rejectWithValue(i.response.error)):(this.dispatch(hn(ad(this.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:n})}processSuccessResponse(e){return this.dispatch(hn(ad(this.getState()))),{...e,response:this.getSuccessResponse(e),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(e){return Ee(e.response)?e.response.success:null}async automaticallyRetryQueryWithCorrection(e){this.onUpdateQueryForCorrection(e);let t=this.getState(),{actionCause:r}={actionCause:"didYouMeanAutomatic"},n=await this.fetchFromAPI(await md(t,this.extra.navigatorContext,{actionCause:r}),{origin:"mainSearch"});return this.dispatch(nd(e)),n}async automaticallyRetryQueryWithTriggerModification(e){return this.dispatch(sd({newQuery:e,originalQuery:this.getCurrentQuery()})),this.onUpdateQueryForCorrection(e),await this.fetchFromAPI(await md(this.getState(),this.extra.navigatorContext),{origin:"mainSearch"})}getCurrentQuery(){let e=this.getState();return void 0!==e.query?.q?e.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}},Sd=(Ir("search/prepareForSearchWithQuery",((e,t)=>{let{dispatch:r}=t;Hr(e,{q:new W,enableQuerySyntax:new z,clearFilters:new z}),e.clearFilters&&(r(Yc()),r(Wc())),r(zl({allow:!0})),r(rd({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Xl(1))})),Ir("search/executeSearch",(async(e,t)=>{let r=t.getState();if("legacy"===r.configuration.analytics.analyticsMode)return gd(r,t,e.legacy);Ad(r);let n=e.next?qd(e.next):void 0,i=await md(r,t.extra.navigatorContext,n),a=new bd({...t,analyticsAction:n??{}}),o=await a.fetchFromAPI(i,{origin:"mainSearch"});return await a.process(o)}))),kd=(Ir("search/fetchPage",(async(e,t)=>{let r=t.getState();if(Ad(r),"legacy"===r.configuration.analytics.analyticsMode||!e.next)return hd(r,t,e.legacy);
1let n=new bd({...t,analyticsAction:e.next}),i=await md(r,t.extra.navigatorContext,e.next),a=await n.fetchFromAPI(i,{origin:"mainSearch"});return await n.process(a)})),Ir("search/fetchMoreResults",(async(e,t)=>{let r=t.getState();if("legacy"===r.configuration.analytics.analyticsMode)return fd(t,r);let n=function(e,t){return{...new Fa(t).getBaseMetadata(),actionCause:e,type:e}}("browseResults",t.getState),i=new bd({...t,analyticsAction:n}),a=await kd(r,t.extra.navigatorContext,n),o=await i.fetchFromAPI(a,{origin:"mainSearch"});return await i.process(o)})),Ir("search/fetchFacetValues",(async(e,t)=>{let r=t.getState();if("legacy"===r.configuration.analytics.analyticsMode)return gd(r,t,e.legacy);let n=new bd({...t,analyticsAction:{}}),i=await Id(r,t.extra.navigatorContext),a=await n.fetchFromAPI(i,{origin:"facetValues"});return await n.process(a)})),Ir("search/fetchInstantResults",(async(e,t)=>{let r=t.getState();if("legacy"===r.configuration.analytics.analyticsMode)return pd(e,t);Hr(e,{id:_r,q:_r,maxResultsPerQuery:new V({required:!0,min:1}),cacheTimeout:new V});let{q:n,maxResultsPerQuery:i}=e,a=qd({actionCause:"searchboxAsYouType"}),o=await Cd(r,t.extra.navigatorContext,n,i,a),s=new bd({...t,analyticsAction:a},(r=>{t.dispatch(Wl({q:r,id:e.id}))})),u=await s.fetchFromAPI(o,{origin:"instantResults",disableAbortWarning:!0}),c=await s.process(u);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c})),async(e,t,r)=>{let n=await md(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n}),Cd=async(e,t,r,n,i)=>fs({...xc(e,t,i),...e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean},numberOfResults:n,q:r}),Id=async(e,t,r)=>{let n=await md(e,t,r);return n.request.numberOfResults=0,n},Ad=e=>{e.configuration.analytics.enabled&&ua.addElement({name:"Query",...e.query?.q&&{value:e.query.q},time:JSON.stringify(new Date)})},qd=e=>({actionCause:e.actionCause,type:e.actionCause}),Od=ur({firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0},(e=>{e.addCase(Kl,((e,t)=>{let r=xd(e),n=t.payload;e.defaultNumberOfResults=e.numberOfResults=n,e.firstResult=Dd(r,n)})).addCase(Jl,((e,t)=>{e.numberOfResults=t.payload,e.firstResult=0})).addCase(ju,(e=>{e.firstResult=0})).addCase(Zl,((e,t)=>{let r=t.payload;e.firstResult=Dd(r,e.numberOfResults)})).addCase(Xl,((e,t)=>{let r=t.payload;e.firstResult=Dd(r,e.numberOfResults)})).addCase(td,(e=>{let t=xd(e),r=Math.max(t-1,1);e.firstResult=Dd(r,e.numberOfResults)})).addCase(ed,(e=>{let t=xd(e),r=function(e){let{totalCountFiltered:t,numberOfResults:r}=e;return function(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}(t,r)}(e),n=Math.min(t+1,r);e.firstResult=Dd(n,e.numberOfResults)})).addCase(fn.fulfilled,((e,t)=>{t.payload&&(e.numberOfResults=t.payload.pagination.numberOfResults,e.firstResult=t.payload.pagination.firstResult)})).addCase(on,((e,t)=>{e.firstResult=t.payload.firstResult??e.firstResult,e.numberOfResults=t.payload.numberOfResults??e.defaultNumberOfResults})).addCase(Sd.fulfilled,((e,t)=>{let{response:r}=t.payload;e.totalCountFiltered=r.totalCountFiltered})).addCase(Ll.fulfilled,((e,t)=>{let{response:r}=t.payload;e.totalCountFiltered=r.pagination.totalCount})).addCase(Sl,(e=>{Rd(e)})).addCase(xl,(e=>{Rd(e)})).addCase(bl,(e=>{Rd(e)})).addCase(jl,(e=>{Rd(e)})).addCase(dl,(e=>{Rd(e)})).addCase(wl,(e=>{Rd(e)})).addCase(al,(e=>{Rd(e)})).addCase(il,(e=>{Rd(e)})).addCase(ul,(e=>{Rd(e)})).addCase(Rl,(e=>{Rd(e)})).addCase(Fl,(e=>{Rd(e)})).addCase(Yc,(e=>{Rd(e)})).addCase(Dl,(e=>{Rd(e)})).addCase(Ul,(e=>{Rd(e)})).addCase(ll,(e=>{Rd(e)})).addCase(el,(e=>{Rd(e)}))}));function Rd(e){e.firstResult=0}function xd(e){let{firstResult:t,numberOfResults:r}=e;return function(e,t){return Math.round(e/t)+1}(t,r)}function Dd(e,t){return(e-1)*t}function Ed(e){return e.addReducers({pagination:Od}),{nextPage:ed,previousPage:td,registerNumberOfResults:Kl,registerPage:Zl,updateNumberOfResults:Jl,updatePage:Xl}}function Td(e){let t,r=new Map,n=()=>
10===r.size;return{subscribe(i){i();let a,o=Symbol();return n()&&(t=JSON.stringify(this.state),a=e.subscribe((()=>{(e=>{try{let r=JSON.stringify(e),n=t!==r;return t=r,n}catch(o){return console.warn('Could not detect if state has changed, check the controller "get state method"',o),!0}})(this.state)&&r.forEach((e=>e()))}))),r.set(o,i),()=>{r.delete(o),n()&&a&&a()}},get state(){return{}}}}var Md=new _({id:new W({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new V({min:0})});function Fd(e,t={}){if(!function(e){return e.addReducers({recommendation:So,configuration:zu}),!0}(e))throw ge;let r=Td(e),{dispatch:n}=e,i=((e,t,r,n)=>Br(e,t,r,`Check the options of ${n}`,"Controller initialization error"))(e,Md,t.options,"buildRecommendationList");return""!==i.id&&n(yo({id:i.id})),i.numberOfRecommendations&&n(Ed(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(vo())},get state(){let t=e.state;return{recommendations:t.recommendation.recommendations,error:t.recommendation.error,isLoading:t.recommendation.isLoading,searchResponseId:t.recommendation.searchUid}}}}function jd(e,t,r){if(!function(e){return e.addReducers({configuration:zu}),!0}(e))throw ge;let n,i={selectionDelay:1e3,debounceWait:1e3,...t.options};return{select:Gu(r,i.debounceWait,{isImmediate:!0}),beginDelayedSelect(){n=setTimeout(r,i.selectionDelay)},cancelPendingSelect(){n&&clearTimeout(n)}}}function Ud(e,t){let r=!1;return jd(e,t,(()=>{r||(r=!0,e.dispatch(mo(t.options.result)))}))}var Pd=["caseId","caseNumber"],_d={caseId:"caseContext",caseNumber:"caseContext"},$d=class extends Error{constructor(e){super(`The key "${e}" is reserved for internal use. Use ${_d[e]} to set this value.}`)}};function Qd(e){return Pd.includes(e)}var Ld=new _({values:new K({options:{required:!1}})});function Vd(e,t={}){if(!function(e){return e.addReducers({context:bc}),!0}(e))throw ge;let r=Td(e),{dispatch:n}=e,i=()=>e.state,a=((e,t,r,n)=>Br(e,t,r,`Check the initialState of ${n}`,"Controller initialization error"))(e,Ld,t.initialState,"buildContext");return a.values&&n(yc(a.values)),{...r,get state(){return{values:i().context.contextValues}},set(e){n(yc(e))},..."legacy"===i().configuration.analytics.analyticsMode?Nd(n):zd(n)}}var Nd=e=>({add(t,r){e(vc({contextKey:t,contextValue:r}))},remove(t){e(wc(t))}}),zd=e=>({add(t,r){if(Qd(t))throw new $d(t);e(vc({contextKey:t,contextValue:r}))},remove(t){if(Qd(t))throw new $d(t);e(wc(t))}});function Hd(e,t){return Vd(e,t)}function Bd(e){if(!function(e){return e.addReducers({dictionaryFieldContext:Ac}),!0}(e))throw ge;let t=Td(e),{dispatch:r}=e;return{...t,get state(){return{values:e.state.dictionaryFieldContext.contextValues}},set(e){r(kc(e))},add(e,t){r(Cc({field:e,key:t}))},remove(e){r(Ic(e))}}}var Yd=new _({content:new $({required:!0}),conditions:new $({required:!0}),priority:new V({required:!1,default:0,min:0}),fields:new Z({required:!1,each:_r})});function Wd(e){if(!function(e){return e.addReducers({fields:Qc}),!0}(e))throw ge;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=function(){let e=[],t=e=>{let t=Yd.validate(e);if(!e.conditions.every((e=>e instanceof Function)))throw new P("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return t};return{registerTemplates(...r){r.forEach((r=>{let n={...t(r),fields:r.fields||[]};e.push(n)})),e.sort(((e,t)=>t.priority-e.priority))},selectTemplate(t){let r=e.find((e=>e.conditions.every((e=>e(t)))));return r?r.content:null},selectLinkTemplate(t){let r=e.find((e=>e.conditions.every((e=>e(t)))));return r?r.linkContent:null}}}();return{registerTemplates:(...r)=>{t(...r);let n=[];r.forEach((e=>{e.fields&&n.push(...e.fields)})),e.dispatch(Mc(n))},selectTemplate:r,selectLinkTemplate:n}}var Gd=(e,t)=>{let r=e;return L(r[t])?L(e.raw[t])?null:e.raw[t]:r[t]},Kd=(e,t)=>{let r=Gd(t,e);return function(e){return Array.isArray(e)}(r)?r:[r]},Jd={getResultProperty:Gd,fieldsMustBeDefined:e=>t=>e.every((e=>!L(Gd(t,e)))),fieldsMustNotBeDefined:e=>t=>e.every((e=>L(Gd(t,e)))),fieldMustMatch:(e,t)=>r=>{let n=Kd(e,r);return t.some((e=>n.some((t=>`${t}`.toLowerCase()===e.toLowerCase()))))},fieldMustNotMatch:(e,t)=>r=>{let n=Kd(e,r);return t.every((e=>n.every((t=>`${t}`.toLowerCase()!==e.toLowerCase()))))}};typeof window<"u"||(j()||(r.g.crypto=c("crypto")),!j().getRandomValues&&j().webcrypto&&(r.g.crypto.getRandomValues=j().webcrypto.getRandomValues.bind(j().webcrypto)))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.