@coveo/headless 3.19.0-pre.afe9f4e635 → 3.19.0-pre.d54cb5306e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/browser/case-assist/headless.esm.js +1 -1
  2. package/dist/browser/case-assist/headless.js +1 -1
  3. package/dist/browser/commerce/headless.esm.js +1 -1
  4. package/dist/browser/commerce/headless.js +1 -1
  5. package/dist/browser/headless.esm.js +1 -1
  6. package/dist/browser/headless.js +1 -1
  7. package/dist/browser/insight/headless.esm.js +1 -1
  8. package/dist/browser/insight/headless.js +1 -1
  9. package/dist/browser/recommendation/headless.esm.js +1 -1
  10. package/dist/browser/recommendation/headless.js +1 -1
  11. package/dist/browser/ssr/headless.esm.js +1 -1
  12. package/dist/browser/ssr/headless.js +1 -1
  13. package/dist/browser/ssr-commerce/headless.esm.js +1 -1
  14. package/dist/browser/ssr-commerce/headless.js +1 -1
  15. package/dist/case-assist/headless.cjs +1 -1
  16. package/dist/case-assist/headless.esm.js +1 -1
  17. package/dist/commerce/headless.cjs +1 -1
  18. package/dist/commerce/headless.esm.js +1 -1
  19. package/dist/headless.cjs +1 -1
  20. package/dist/headless.esm.js +1 -1
  21. package/dist/insight/headless.cjs +1 -1
  22. package/dist/insight/headless.esm.js +1 -1
  23. package/dist/quantic/case-assist/headless.js +1 -1
  24. package/dist/quantic/commerce/headless.js +1 -1
  25. package/dist/quantic/headless.js +1 -1
  26. package/dist/quantic/insight/headless.js +1 -1
  27. package/dist/quantic/recommendation/headless.js +1 -1
  28. package/dist/recommendation/headless.cjs +1 -1
  29. package/dist/recommendation/headless.esm.js +1 -1
  30. package/dist/ssr/headless.cjs +1 -1
  31. package/dist/ssr/headless.esm.js +1 -1
  32. package/dist/ssr-commerce/headless.cjs +1 -1
  33. package/dist/ssr-commerce/headless.esm.js +1 -1
  34. package/package.json +1 -1
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  var Qb=Object.create;var hc=Object.defineProperty;var Bb=Object.getOwnPropertyDescriptor;var Ub=Object.getOwnPropertyNames;var _b=Object.getPrototypeOf,jb=Object.prototype.hasOwnProperty;var $b=(e,t,r)=>t in e?hc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ee=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Gb=(e,t)=>{for(var r in t)hc(e,r,{get:t[r],enumerable:!0})},Wb=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ub(t))!jb.call(e,o)&&o!==r&&hc(e,o,{get:()=>t[o],enumerable:!(n=Bb(t,o))||n.enumerable});return e};var Ot=(e,t,r)=>(r=e!=null?Qb(_b(e)):{},Wb(t||!e||!e.__esModule?hc(r,"default",{value:e,enumerable:!0}):r,e));var pe=(e,t,r)=>$b(e,typeof t!="symbol"?t+"":t,r);var tS=Ee($i=>{"use strict";var Rc=$i&&$i.__assign||function(){return Rc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Rc.apply(this,arguments)};Object.defineProperty($i,"__esModule",{value:!0});var ov={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function av(e){var t=Rc(Rc({},ov),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}$i.getSanitizedOptions=av});var rS=Ee(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});function iv(e){var t=Math.random()*e;return Math.round(t)}Ep.fullJitter=iv});var nS=Ee(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});function sv(e){return e}Tp.noJitter=sv});var oS=Ee(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});var cv=rS(),uv=nS();function lv(e){switch(e.jitter){case"full":return cv.fullJitter;case"none":default:return uv.noJitter}}kp.JitterFactory=lv});var qp=Ee(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var dv=oS(),pv=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=dv.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Op.Delay=pv});var aS=Ee(xr=>{"use strict";var mv=xr&&xr.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),fv=xr&&xr.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},gv=xr&&xr.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=u[0]&2?o.return:u[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;switch(o=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(xr,"__esModule",{value:!0});var Sv=qp(),hv=function(e){mv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return fv(this,void 0,void 0,function(){return gv(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(Sv.Delay);xr.SkipFirstDelay=hv});var iS=Ee(Gi=>{"use strict";var yv=Gi&&Gi.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Gi,"__esModule",{value:!0});var Cv=qp(),xv=function(e){yv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Cv.Delay);Gi.AlwaysDelay=xv});var sS=Ee(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});var Av=aS(),Fv=iS();function Rv(e,t){var r=bv(e);return r.setAttemptNumber(t),r}Dp.DelayFactory=Rv;function bv(e){return e.delayFirstAttempt?new Fv.AlwaysDelay(e):new Av.SkipFirstDelay(e)}});var cS=Ee(_n=>{"use strict";var Vp=_n&&_n.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Np=_n&&_n.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=u[0]&2?o.return:u[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;switch(o=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(_n,"__esModule",{value:!0});var vv=tS(),Pv=sS();function wv(e,t){return t===void 0&&(t={}),Vp(this,void 0,void 0,function(){var r,n;return Np(this,function(o){switch(o.label){case 0:return r=vv.getSanitizedOptions(t),n=new Iv(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}_n.backOff=wv;var Iv=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Vp(this,void 0,void 0,function(){var t,r;return Np(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;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 Vp(this,void 0,void 0,function(){var t;return Np(this,function(r){switch(r.label){case 0:return t=Pv.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var pu=Ee((Qm,Bm)=>{"use strict";(function(e,t){typeof Qm=="object"&&typeof Bm<"u"?Bm.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Qm,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",s="day",c="week",u="month",l="quarter",m="year",d="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,S={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(q){var O=["th","st","nd","rd"],k=q%100;return"["+q+(O[(k-20)%10]||O[k]||O[0])+"]"}},h=function(q,O,k){var Q=String(q);return!Q||Q.length>=O?q:""+Array(O+1-Q.length).join(k)+q},g={s:h,z:function(q){var O=-q.utcOffset(),k=Math.abs(O),Q=Math.floor(k/60),L=k%60;return(O<=0?"+":"-")+h(Q,2,"0")+":"+h(L,2,"0")},m:function q(O,k){if(O.date()<k.date())return-q(k,O);var Q=12*(k.year()-O.year())+(k.month()-O.month()),L=O.clone().add(Q,u),W=k-L<0,j=O.clone().add(Q+(W?-1:1),u);return+(-(Q+(k-L)/(W?L-j:j-L))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:u,y:m,w:c,d:s,D:d,h:i,m:a,s:o,ms:n,Q:l}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},x="en",F={};F[x]=S;var I="$isDayjsObject",b=function(q){return q instanceof T||!(!q||!q[I])},R=function q(O,k,Q){var L;if(!O)return x;if(typeof O=="string"){var W=O.toLowerCase();F[W]&&(L=W),k&&(F[W]=k,L=W);var j=O.split("-");if(!L&&j.length>1)return q(j[0])}else{var K=O.name;F[K]=O,L=K}return!Q&&L&&(x=L),L||!Q&&x},E=function(q,O){if(b(q))return q.clone();var k=typeof O=="object"?O:{};return k.date=q,k.args=arguments,new T(k)},w=g;w.l=R,w.i=b,w.w=function(q,O){return E(q,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var T=function(){function q(k){this.$L=R(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[I]=!0}var O=q.prototype;return O.parse=function(k){this.$d=function(Q){var L=Q.date,W=Q.utc;if(L===null)return new Date(NaN);if(w.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var j=L.match(f);if(j){var K=j[2]-1||0,Z=(j[7]||"0").substring(0,3);return W?new Date(Date.UTC(j[1],K,j[3]||1,j[4]||0,j[5]||0,j[6]||0,Z)):new Date(j[1],K,j[3]||1,j[4]||0,j[5]||0,j[6]||0,Z)}}return new Date(L)}(k),this.init()},O.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},O.$utils=function(){return w},O.isValid=function(){return this.$d.toString()!==p},O.isSame=function(k,Q){var L=E(k);return this.startOf(Q)<=L&&L<=this.endOf(Q)},O.isAfter=function(k,Q){return E(k)<this.startOf(Q)},O.isBefore=function(k,Q){return this.endOf(Q)<E(k)},O.$g=function(k,Q,L){return w.u(k)?this[Q]:this.set(L,k)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(k,Q){var L=this,W=!!w.u(Q)||Q,j=w.p(k),K=function(kt,Ie){var rt=w.w(L.$u?Date.UTC(L.$y,Ie,kt):new Date(L.$y,Ie,kt),L);return W?rt:rt.endOf(s)},Z=function(kt,Ie){return w.w(L.toDate()[kt].apply(L.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(Ie)),L)},re=this.$W,oe=this.$M,ae=this.$D,de="set"+(this.$u?"UTC":"");switch(j){case m:return W?K(1,0):K(31,11);case u:return W?K(1,oe):K(0,oe+1);case c:var we=this.$locale().weekStart||0,Un=(re<we?re+7:re)-we;return K(W?ae-Un:ae+(6-Un),oe);case s:case d:return Z(de+"Hours",0);case i:return Z(de+"Minutes",1);case a:return Z(de+"Seconds",2);case o:return Z(de+"Milliseconds",3);default:return this.clone()}},O.endOf=function(k){return this.startOf(k,!1)},O.$set=function(k,Q){var L,W=w.p(k),j="set"+(this.$u?"UTC":""),K=(L={},L[s]=j+"Date",L[d]=j+"Date",L[u]=j+"Month",L[m]=j+"FullYear",L[i]=j+"Hours",L[a]=j+"Minutes",L[o]=j+"Seconds",L[n]=j+"Milliseconds",L)[W],Z=W===s?this.$D+(Q-this.$W):Q;if(W===u||W===m){var re=this.clone().set(d,1);re.$d[K](Z),re.init(),this.$d=re.set(d,Math.min(this.$D,re.daysInMonth())).$d}else K&&this.$d[K](Z);return this.init(),this},O.set=function(k,Q){return this.clone().$set(k,Q)},O.get=function(k){return this[w.p(k)]()},O.add=function(k,Q){var L,W=this;k=Number(k);var j=w.p(Q),K=function(oe){var ae=E(W);return w.w(ae.date(ae.date()+Math.round(oe*k)),W)};if(j===u)return this.set(u,this.$M+k);if(j===m)return this.set(m,this.$y+k);if(j===s)return K(1);if(j===c)return K(7);var Z=(L={},L[a]=t,L[i]=r,L[o]=e,L)[j]||1,re=this.$d.getTime()+k*Z;return w.w(re,this)},O.subtract=function(k,Q){return this.add(-1*k,Q)},O.format=function(k){var Q=this,L=this.$locale();if(!this.isValid())return L.invalidDate||p;var W=k||"YYYY-MM-DDTHH:mm:ssZ",j=w.z(this),K=this.$H,Z=this.$m,re=this.$M,oe=L.weekdays,ae=L.months,de=L.meridiem,we=function(Ie,rt,Cr,Qr){return Ie&&(Ie[rt]||Ie(Q,W))||Cr[rt].slice(0,Qr)},Un=function(Ie){return w.s(K%12||12,Ie,"0")},kt=de||function(Ie,rt,Cr){var Qr=Ie<12?"AM":"PM";return Cr?Qr.toLowerCase():Qr};return W.replace(y,function(Ie,rt){return rt||function(Cr){switch(Cr){case"YY":return String(Q.$y).slice(-2);case"YYYY":return w.s(Q.$y,4,"0");case"M":return re+1;case"MM":return w.s(re+1,2,"0");case"MMM":return we(L.monthsShort,re,ae,3);case"MMMM":return we(ae,re);case"D":return Q.$D;case"DD":return w.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return we(L.weekdaysMin,Q.$W,oe,2);case"ddd":return we(L.weekdaysShort,Q.$W,oe,3);case"dddd":return oe[Q.$W];case"H":return String(K);case"HH":return w.s(K,2,"0");case"h":return Un(1);case"hh":return Un(2);case"a":return kt(K,Z,!0);case"A":return kt(K,Z,!1);case"m":return String(Z);case"mm":return w.s(Z,2,"0");case"s":return String(Q.$s);case"ss":return w.s(Q.$s,2,"0");case"SSS":return w.s(Q.$ms,3,"0");case"Z":return j}return null}(Ie)||j.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(k,Q,L){var W,j=this,K=w.p(Q),Z=E(k),re=(Z.utcOffset()-this.utcOffset())*t,oe=this-Z,ae=function(){return w.m(j,Z)};switch(K){case m:W=ae()/12;break;case u:W=ae();break;case l:W=ae()/3;break;case c:W=(oe-re)/6048e5;break;case s:W=(oe-re)/864e5;break;case i:W=oe/r;break;case a:W=oe/t;break;case o:W=oe/e;break;default:W=oe}return L?W:w.a(W)},O.daysInMonth=function(){return this.endOf(u).$D},O.$locale=function(){return F[this.$L]},O.locale=function(k,Q){if(!k)return this.$L;var L=this.clone(),W=R(k,Q,!0);return W&&(L.$L=W),L},O.clone=function(){return w.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},q}(),U=T.prototype;return E.prototype=U,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",s],["$M",u],["$y",m],["$D",d]].forEach(function(q){U[q[1]]=function(O){return this.$g(O,q[0],q[1])}}),E.extend=function(q,O){return q.$i||(q(O,T,E),q.$i=!0),E},E.locale=R,E.isDayjs=b,E.unix=function(q){return E(1e3*q)},E.en=F[x],E.Ls=F,E.p={},E})});var Sy=Ee((Um,_m)=>{"use strict";(function(e,t){typeof Um=="object"&&typeof _m<"u"?_m.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_quarterOfYear=t()})(Um,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(s){return this.$utils().u(s)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(s-1))};var a=o.add;o.add=function(s,c){return s=Number(s),this.$utils().p(c)===t?this.add(3*s,e):a.bind(this)(s,c)};var i=o.startOf;o.startOf=function(s,c){var u=this.$utils(),l=!!u.u(c)||c;if(u.p(s)===t){var m=this.quarter()-1;return l?this.month(3*m).startOf(e).startOf("day"):this.month(3*m+2).endOf(e).endOf("day")}return i.bind(this)(s,c)}}})});var hy=Ee((jm,$m)=>{"use strict";(function(e,t){typeof jm=="object"&&typeof $m<"u"?$m.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_customParseFormat=t()})(jm,function(){"use strict";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|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},s=function(f){return(f=+f)+(f>68?1900:2e3)},c=function(f){return function(y){this[f]=+y}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(f){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var S=y.match(/([+-]|\d\d)/g),h=60*S[1]+(+S[2]||0);return h===0?0:S[0]==="+"?-h:h}(f)}],l=function(f){var y=i[f];return y&&(y.indexOf?y:y.s.concat(y.f))},m=function(f,y){var S,h=i.meridiem;if(h){for(var g=1;g<=24;g+=1)if(f.indexOf(h(g,0,y))>-1){S=g>12;break}}else S=f===(y?"pm":"PM");return S},d={A:[a,function(f){this.afternoon=m(f,!1)}],a:[a,function(f){this.afternoon=m(f,!0)}],Q:[r,function(f){this.month=3*(f-1)+1}],S:[r,function(f){this.milliseconds=100*+f}],SS:[n,function(f){this.milliseconds=10*+f}],SSS:[/\d{3}/,function(f){this.milliseconds=+f}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[n,c("day")],Do:[a,function(f){var y=i.ordinal,S=f.match(/\d+/);if(this.day=S[0],y)for(var h=1;h<=31;h+=1)y(h).replace(/\[|\]/g,"")===f&&(this.day=h)}],w:[o,c("week")],ww:[n,c("week")],M:[o,c("month")],MM:[n,c("month")],MMM:[a,function(f){var y=l("months"),S=(l("monthsShort")||y.map(function(h){return h.slice(0,3)})).indexOf(f)+1;if(S<1)throw new Error;this.month=S%12||S}],MMMM:[a,function(f){var y=l("months").indexOf(f)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(f){this.year=s(f)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function p(f){var y,S;y=f,S=i&&i.formats;for(var h=(f=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(E,w,T){var U=T&&T.toUpperCase();return w||S[T]||e[T]||S[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(q,O,k){return O||k.slice(1)})})).match(t),g=h.length,x=0;x<g;x+=1){var F=h[x],I=d[F],b=I&&I[0],R=I&&I[1];h[x]=R?{regex:b,parser:R}:F.replace(/^\[|\]$/g,"")}return function(E){for(var w={},T=0,U=0;T<g;T+=1){var q=h[T];if(typeof q=="string")U+=q.length;else{var O=q.regex,k=q.parser,Q=E.slice(U),L=O.exec(Q)[0];k.call(w,L),E=E.replace(L,"")}}return function(W){var j=W.afternoon;if(j!==void 0){var K=W.hours;j?K<12&&(W.hours+=12):K===12&&(W.hours=0),delete W.afternoon}}(w),w}}return function(f,y,S){S.p.customParseFormat=!0,f&&f.parseTwoDigitYear&&(s=f.parseTwoDigitYear);var h=y.prototype,g=h.parse;h.parse=function(x){var F=x.date,I=x.utc,b=x.args;this.$u=I;var R=b[1];if(typeof R=="string"){var E=b[2]===!0,w=b[3]===!0,T=E||w,U=b[2];w&&(U=b[2]),i=this.$locale(),!E&&U&&(i=S.Ls[U]),this.$d=function(Q,L,W,j){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*Q);var K=p(L)(Q),Z=K.year,re=K.month,oe=K.day,ae=K.hours,de=K.minutes,we=K.seconds,Un=K.milliseconds,kt=K.zone,Ie=K.week,rt=new Date,Cr=oe||(Z||re?1:rt.getDate()),Qr=Z||rt.getFullYear(),gc=0;Z&&!re||(gc=re>0?re-1:rt.getMonth());var Sc,Cp=ae||0,xp=de||0,Ap=we||0,Fp=Un||0;return kt?new Date(Date.UTC(Qr,gc,Cr,Cp,xp,Ap,Fp+60*kt.offset*1e3)):W?new Date(Date.UTC(Qr,gc,Cr,Cp,xp,Ap,Fp)):(Sc=new Date(Qr,gc,Cr,Cp,xp,Ap,Fp),Ie&&(Sc=j(Sc).week(Ie).toDate()),Sc)}catch{return new Date("")}}(F,R,I,S),this.init(),U&&U!==!0&&(this.$L=this.locale(U).$L),T&&F!=this.format(R)&&(this.$d=new Date("")),i={}}else if(R instanceof Array)for(var q=R.length,O=1;O<=q;O+=1){b[1]=R[O-1];var k=S.apply(this,b);if(k.isValid()){this.$d=k.$d,this.$L=k.$L,this.init();break}O===q&&(this.$d=new Date(""))}else g.call(this,x)}}})});var kC=Ee((JH,TC)=>{"use strict";var xk=/(^|; )Coveo-Pendragon=([^;]*)/;TC.exports=()=>xk.exec(document.cookie)?.pop()||null});var OC=Ee((gf,Sf)=>{"use strict";(function(e,t){typeof gf=="object"&&typeof Sf<"u"?Sf.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_timezone=t()})(gf,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(l,m,d){d===void 0&&(d={});var p=new Date(l),f=function(y,S){S===void 0&&(S={});var h=S.timeZoneName||"short",g=y+"|"+h,x=t[g];return x||(x=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:y,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:h}),t[g]=x),x}(m,d);return f.formatToParts(p)},s=function(l,m){for(var d=i(l,m),p=[],f=0;f<d.length;f+=1){var y=d[f],S=y.type,h=y.value,g=e[S];g>=0&&(p[g]=parseInt(h,10))}var x=p[3],F=x===24?0:x,I=p[0]+"-"+p[1]+"-"+p[2]+" "+F+":"+p[4]+":"+p[5]+":000",b=+l;return(o.utc(I).valueOf()-(b-=b%1e3))/6e4},c=n.prototype;c.tz=function(l,m){l===void 0&&(l=a);var d,p=this.utcOffset(),f=this.toDate(),y=f.toLocaleString("en-US",{timeZone:l}),S=Math.round((f-new Date(y))/1e3/60),h=15*-Math.round(f.getTimezoneOffset()/15)-S;if(!Number(h))d=this.utcOffset(0,m);else if(d=o(y,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(h,!0),m){var g=d.utcOffset();d=d.add(p-g,"minute")}return d.$x.$timezone=l,d},c.offsetName=function(l){var m=this.$x.$timezone||o.tz.guess(),d=i(this.valueOf(),m,{timeZoneName:l}).find(function(p){return p.type.toLowerCase()==="timezonename"});return d&&d.value};var u=c.startOf;c.startOf=function(l,m){if(!this.$x||!this.$x.$timezone)return u.call(this,l,m);var d=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(d,l,m).tz(this.$x.$timezone,!0)},o.tz=function(l,m,d){var p=d&&m,f=d||m||a,y=s(+o(),f);if(typeof l!="string")return o(l).tz(f);var S=function(F,I,b){var R=F-60*I*1e3,E=s(R,b);if(I===E)return[R,I];var w=s(R-=60*(E-I)*1e3,b);return E===w?[R,E]:[F-60*Math.min(E,w)*1e3,Math.max(E,w)]}(o.utc(l,p).valueOf(),y,f),h=S[0],g=S[1],x=o(h).utcOffset(g);return x.$x.$timezone=f,x},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(l){a=l}}})});var qC=Ee((hf,yf)=>{"use strict";(function(e,t){typeof hf=="object"&&typeof yf<"u"?yf.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_utc=t()})(hf,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(p){var f={date:p,utc:!0,args:arguments};return new o(f)},i.utc=function(p){var f=a(this.toDate(),{locale:this.$L,utc:!0});return p?f.add(this.utcOffset(),e):f},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=i.parse;i.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),s.call(this,p)};var c=i.init;i.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else c.call(this)};var u=i.utcOffset;i.utcOffset=function(p,f){var y=this.$utils().u;if(y(p))return this.$u?0:y(this.$offset)?u.call(this):this.$offset;if(typeof p=="string"&&(p=function(x){x===void 0&&(x="");var F=x.match(t);if(!F)return null;var I=(""+F[0]).match(r)||["-",0,0],b=I[0],R=60*+I[1]+ +I[2];return R===0?0:b==="+"?R:-R}(p),p===null))return this;var S=Math.abs(p)<=16?60*p:p,h=this;if(f)return h.$offset=S,h.$u=p===0,h;if(p!==0){var g=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(h=this.local().add(S+g,e)).$offset=S,h.$x.$localOffset=g}else h=this.utc();return h};var l=i.format;i.format=function(p){var f=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,f)},i.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var m=i.toDate;i.toDate=function(p){return p==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var d=i.diff;i.diff=function(p,f,y){if(p&&this.$u===p.$u)return d.call(this,p,f,y);var S=this.local(),h=a(p).local();return d.call(S,h,f,y)}}})});var GC=Ee((aK,$C)=>{"use strict";function Ok(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}$C.exports=qk;function qk(e,t,r){var n=r&&r.stringify||Ok,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var s=1;s<a;s++)i[s]=n(t[s]);return i.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",l=1-o,m=-1,d=e&&e.length||0,p=0;p<d;){if(e.charCodeAt(p)===37&&p+1<d){switch(m=m>-1?m:0,e.charCodeAt(p+1)){case 100:case 102:if(l>=c||t[l]==null)break;m<p&&(u+=e.slice(m,p)),u+=Number(t[l]),m=p+2,p++;break;case 105:if(l>=c||t[l]==null)break;m<p&&(u+=e.slice(m,p)),u+=Math.floor(Number(t[l])),m=p+2,p++;break;case 79:case 111:case 106:if(l>=c||t[l]===void 0)break;m<p&&(u+=e.slice(m,p));var f=typeof t[l];if(f==="string"){u+="'"+t[l]+"'",m=p+2,p++;break}if(f==="function"){u+=t[l].name||"<anonymous>",m=p+2,p++;break}u+=n(t[l]),m=p+2,p++;break;case 115:if(l>=c)break;m<p&&(u+=e.slice(m,p)),u+=String(t[l]),m=p+2,p++;break;case 37:m<p&&(u+=e.slice(m,p)),u+="%",m=p+2,p++,l--;break}++l}++p}return m===-1?e:(m<d&&(u+=e.slice(m)),u)}});var JC=Ee((iK,el)=>{"use strict";var WC=GC();el.exports=Tr;var Qs=zk().console||{},Dk={mapHttpRequest:Zu,mapHttpResponse:Zu,wrapRequestSerializer:Ff,wrapResponseSerializer:Ff,wrapErrorSerializer:Ff,req:Zu,res:Zu,err:zC,errWithCause:zC};function pn(e,t){return e==="silent"?1/0:t.levels.values[e]}var vf=Symbol("pino.logFuncs"),Rf=Symbol("pino.hierarchy"),Vk={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function HC(e,t){let r={logger:t,parent:e[Rf]};t[Rf]=r}function Nk(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Qs[o]||Qs[Vk[o]||"log"]||ka}),e[vf]=n}function Mk(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function Tr(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Qs;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=Mk(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&s.forEach(function(y){r[y]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",u=Object.create(r);u.log||(u.log=ka),Nk(u,s,r),HC({},u),Object.defineProperty(u,"levelVal",{get:m}),Object.defineProperty(u,"level",{get:d,set:p});let l={transmit:t,serialize:o,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:s,timestamp:Gk(e),messageKey:e.messageKey||"msg",onChild:e.onChild||ka};u.levels=Lk(e),u.level=c,u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=ka,u.serializers=n,u._serialize=o,u._stdErrSerialize=a,u.child=function(...y){return f.call(this,l,...y)},t&&(u._logEvent=bf());function m(){return pn(this.level,this)}function d(){return this._level}function p(y){if(y!=="silent"&&!this.levels.values[y])throw Error("unknown level "+y);this._level=y,no(this,l,u,"error"),no(this,l,u,"fatal"),no(this,l,u,"warn"),no(this,l,u,"info"),no(this,l,u,"debug"),no(this,l,u,"trace"),i.forEach(S=>{no(this,l,u,S)})}function f(y,S,h){if(!S)throw new Error("missing bindings for child Pino");h=h||{},o&&S.serializers&&(h.serializers=S.serializers);let g=h.serializers;if(o&&g){var x=Object.assign({},n,g),F=e.browser.serialize===!0?Object.keys(x):o;delete S.serializers,Pf([S],F,x,this._stdErrSerialize)}function I(R){this._childLevel=(R._childLevel|0)+1,this.bindings=S,x&&(this.serializers=x,this._serialize=F),t&&(this._logEvent=bf([].concat(R._logEvent.bindings,S)))}I.prototype=this;let b=new I(this);return HC(this,b),b.child=function(...R){return f.call(this,y,...R)},b.level=h.level||this.level,y.onChild(b),b}return u}function Lk(e){let t=e.customLevels||{},r=Object.assign({},Tr.levels.values,t),n=Object.assign({},Tr.levels.labels,Qk(t));return{values:r,labels:n}}function Qk(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}Tr.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"}};Tr.stdSerializers=Dk;Tr.stdTimeFunctions=Object.assign({},{nullTime:KC,epochTime:YC,unixTime:Wk,isoTime:Hk});function Bk(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Rf];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function no(e,t,r,n){if(Object.defineProperty(e,n,{value:pn(e.level,r)>pn(n,r)?ka:r[vf][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===ka){if(!t.transmit)return;let a=t.transmit.level||e.level,i=pn(a,r);if(pn(n,r)<i)return}e[n]=_k(e,t,r,n);let o=Bk(e);o.length!==0&&(e[n]=Uk(o,e[n]))}function Uk(e,t){return function(){return t.apply(this,[...e,...arguments])}}function _k(e,t,r,n){return function(o){return function(){let i=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Qs?Qs:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var l=!1;if(t.serialize&&(Pf(s,this._serialize,this.serializers,this._stdErrSerialize),l=!0),t.asObject||t.formatters?o.call(c,jk(this,n,s,i,t)):o.apply(c,s),t.transmit){let m=t.transmit.level||e._level,d=pn(m,r),p=pn(n,r);if(p<d)return;$k(this,{ts:i,methodLevel:n,methodValue:p,transmitLevel:m,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:pn(e._level,r)},s,l)}}}(e[vf][n])}function jk(e,t,r,n,o){let{level:a,log:i=d=>d}=o.formatters||{},s=r.slice(),c=s[0],u={};if(n&&(u.time=n),a){let d=a(t,e.levels.values[t]);Object.assign(u,d)}else u.level=e.levels.values[t];let l=(e._childLevel|0)+1;if(l<1&&(l=1),c!==null&&typeof c=="object"){for(;l--&&typeof s[0]=="object";)Object.assign(u,s.shift());c=s.length?WC(s.shift(),s):void 0}else typeof c=="string"&&(c=WC(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),i(u)}function Pf(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=Tr.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function $k(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;n||Pf(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(l){return u.indexOf(l)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=s,o(i,e._logEvent,c),e._logEvent=bf(u)}function bf(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function zC(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function Gk(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?KC:YC}function Zu(){return{}}function Ff(e){return e}function ka(){}function KC(){return!1}function YC(){return Date.now()}function Wk(){return Math.round(Date.now()/1e3)}function Hk(){return new Date(Date.now()).toISOString()}function zk(){function e(t){return typeof t<"u"&&t}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)||{}}}el.exports.default=Tr;el.exports.pino=Tr});var Hg={};Gb(Hg,{escape:()=>wo,getHighlightedSuggestion:()=>bp,highlightString:()=>Yb});import{isNullOrUndefined as Kb}from"@coveo/bueno";var Br=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function yc(e){return Array.isArray(e)}function Cc(e){return e.trim()===""}function jg(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function Hb(e){return btoa(encodeURI(e))}function xc(e,t){let{[e]:r,...n}=t;return n}function Po(e){return Hb(JSON.stringify(e))}var zb=new Set(["1",1,"yes",!0]);function $g(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>zb.has(r))}function Gg(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Wg(e,t,r){return clearTimeout(t),setTimeout(e,r)}function _i(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Yb(e){if(Cc(e.openingDelimiter)||Cc(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(Kb(e.content)||Cc(e.content))return e.content;if(e.highlights.length===0)return wo(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,s=i+a.length;if(s>t)break;r+=wo(e.content.slice(n,i)),r+=e.openingDelimiter,r+=wo(e.content.slice(i,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=wo(e.content.slice(n))),r}function bp(e,t){return e=wo(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Rp(n,t.notMatchDelimiters):o?Rp(o,t.exactMatchDelimiters):a?Rp(a,t.correctionDelimiters):r)}function Rp(e,t){return t?t.open+e+t.close:e}function wo(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}async function Kg(e,t){let r=e.getReader(),n;for(;!(n=await r.read()).done;)t(n.value)}function Yg(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=Xb(t,i);let s=t.length,c=0;for(;r<s;){o&&(t[r]===10&&(c=++r),o=!1);let u=-1;for(;r<s&&u===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:o=!0,u=r;break;case 10:u=r;break}if(u===-1)break;e(t.subarray(c,u),n),c=r,n=-1}c===s?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function Jg(e,t,r){let n=zg(),o=new TextDecoder;return function(i,s){if(i.length===0)r?.(n),n=zg();else if(s>0){let c=o.decode(i.subarray(0,s)),u=s+(i[s+1]===32?2:1),l=o.decode(i.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
19
- `+l:l;break;case"event":n.event=l;break;case"id":e(n.id=l);break;case"retry":Jb(l,n,t);break}}}}function Jb(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function Xb(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function zg(){return{data:"",event:"",id:"",retry:void 0}}var vp="text/event-stream",Zb=1e3,Xg="last-event-id";function Zg(){return typeof window<"u"}function Ac(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:s,fetch:c,...u}){return new Promise((l,m)=>{let d={...r};d.accept||(d.accept=vp);let p;function f(){p?.abort(),document.hidden||F()}!s&&Zg()&&document.addEventListener("visibilitychange",f);let y=Zb,S;function h(){Zg()&&document.removeEventListener("visibilitychange",f),clearTimeout(S),p?.abort()}t?.addEventListener("abort",()=>{h(),l()});let g=c??fetch,x=n??ev;async function F(){p=AbortController?new AbortController:null;try{let I=await g(e,{...u,headers:d,signal:p?.signal});await x(I),await Kg(I.body,Yg(Jg(b=>{b?d[Xg]=b:delete d[Xg]},b=>{y=b},o))),a?.(),h(),l()}catch(I){if(!p?.signal?.aborted)try{let b=i?.(I)??y;clearTimeout(S),S=setTimeout(F,b)}catch(b){h(),m(b)}}}F()})}function ev(e){let t=e.headers.get("content-type");if(!t?.startsWith(vp))throw new Error(`Expected content-type to be ${vp}, Actual: ${t}`)}var Ur=class{constructor(t){pe(this,"_basePath");pe(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var tv=(e,t,r)=>new Ur(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,eS=3,rv=5e3,nv="text/event-stream",Ip=1,Pp=class extends Error{},ji=class extends Error{constructor(r){super(r.message);this.payload=r}},wp=class{constructor(){pe(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Fc=class{constructor(t){pe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:s,abort:c,close:u,resetAnswer:l}=r,m=new wp;if(!a){this.logger.error("No stream ID found");return}let d=0,p,f=()=>{p&&!m.isActive(p)&&(S?.abort(),l(),h())},y=()=>{m.remove(p),p=Wg(f,p,rv),m.add(p)},S=new AbortController,h=()=>Ac(tv(n,o,a),{method:"GET",fetch,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:S?.signal,async onopen(g){if(g.ok&&g.headers.get("content-type")===nv)return;throw g.status>=400&&g.status<500&&g.status!==429?new ji({message:"Error opening stream",code:g.status}):new Pp},onmessage:g=>{if(S?.signal.aborted)return;let x=JSON.parse(g.data);if(x.finishReason==="ERROR"){m.remove(p),S?.abort(),c({message:x.errorMessage,code:x.statusCode});return}s(x),d=0,x.finishReason==="COMPLETED"?(m.remove(p),u()):y()},onerror:g=>{if(!S?.signal.aborted){if(m.remove(p),g instanceof ji)throw S?.abort(),c(g),g;if(++d>eS){this.logger.info("Maximum retry exceeded.");let x={message:"Failed to complete stream.",code:Ip};throw S?.abort(),c(x),new ji(x)}this.logger.info(`Retrying...(${d}/${eS})`),l()}}});return h(),S}};var pS=Ot(cS(),1);var Ev="recommendation-internal-options",v0=Symbol.for(Ev);var N=new Error("Failed to load reducers."),Io=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var jn=class extends Error{constructor(r,n){super();pe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};function uS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function lS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Tv)}function Tv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function dS(e){return e===429}var nt=class e{static async call(t){let r=kv(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,s=async()=>{let c=await fetch(a,i);if(dS(c.status))throw c;return c};try{let c=await(0,pS.backOff)(s,{retry:u=>{let l=u&&dS(u.status);return l&&n.info("Platform retrying request"),l}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Io;case 404:throw new jn(a,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new jn(a):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:s,...c}=t,u=_i(c);try{let l=await o(t,n,i);return{...t,...l}}catch(l){a.error(l,"Platform request preprocessing failed. Returning default request options.")}return u}};function De(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function xe(e,t="prod"){return`${De(e,t)}/rest/search/v2`}function Mp(e,t="prod"){return`${De(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function kv(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,s=e.method==="POST"||e.method==="PUT",c=Ov(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:c},signal:i}}function Ov(e,t){return t==="application/x-www-form-urlencoded"?lS(e)?uS(e):"":JSON.stringify(e)}var bc=e=>e;var mS=e=>e,fS=e=>e,gS=e=>e;import{isNullOrUndefined as Uv}from"@coveo/bueno";function Eo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ye(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Eo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Eo(),extendedResults:{}}}function _r(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var jr=e=>{let{response:t}=e;return t.body?qv(e):Dv(t)},qv=e=>Nv(e)?Mv(e):Vv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Dv=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Vv(e){return e.body.statusCode!==void 0}function Nv(e){return e.body.exception!==void 0}var Mv=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});var $r=class{constructor(){pe(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController,o=this.currentAbortController=new AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};function SS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}var Ar=(e,t,r,n)=>{let o=new Ur(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var hS=(e,t)=>{let r=new Ur(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},yS=async(e,t)=>{let r=await nt.call({...Ar(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:_r(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=SS(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return Lv(i)?{success:i}:{error:jr({response:r,body:i})}};function Lv(e){return typeof e=="string"}function Qv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Bv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Wi(e,t){if(t&&e.name==="AbortError")return{error:Bv(e)};if(e instanceof jn)return{error:Qv(e)};throw e}var vc=class{constructor(t){this.options=t;pe(this,"apiCallsQueues",{unknown:new $r,mainSearch:new $r,facetValues:new $r,foldingCollection:new $r,instantResults:new $r})}async plan(t){let r=await nt.call({...Ar(t,"POST","application/json","/plan"),requestParams:_r(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Wi(r);let n=await r.json();return jv(n)?{success:n}:{error:jr({response:r,body:n})}}async querySuggest(t){let r=await nt.call({...Ar(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:_r(t),...this.options});if(r instanceof Error)return Wi(r);let n=await r.json(),o={response:r,body:n};return _v(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:jr(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(s=>nt.call({...Ar(t,"POST","application/json",""),requestParams:_r(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:s??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Wi(o,r?.disableAbortWarning);let a=await o.json(),i={response:o,body:a};return CS(a)?(i.body=xS(a),{success:(await this.options.postprocessSearchResponseMiddleware(i)).body}):{error:jr(i)}}async facetSearch(t){let r=await nt.call({...Ar(t,"POST","application/json","/facet"),requestParams:_r(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await nt.call({...Ar(t,"POST","application/json",""),requestParams:_r(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(CS(n)){let o={response:r,body:n};return o.body=xS(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:jr({response:r,body:n})}}async html(t){return yS(t,{...this.options})}async fieldDescriptions(t){let r=await nt.call({...Ar(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return $v(n)?{success:n}:{error:jr({response:r,body:n})}}},Pc=e=>e.success!==void 0,Fe=e=>e.error!==void 0;function CS(e){return e.results!==void 0}function xS(e){let t=Eo();return Uv(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function _v(e){return e.completions!==void 0}function jv(e){return e.preprocessingOutput!==void 0}function $v(e){return e.fields!==void 0}import{Schema as Gv,SchemaValidationError as Wv,StringValue as Hi,RecordValue as Hv,ArrayValue as zv}from"@coveo/bueno";var D=new Hi({required:!0,emptyAllowed:!1}),ce=new Hi({required:!1,emptyAllowed:!1}),ne=new Hi({required:!0,emptyAllowed:!0}),AS=new Hi({required:!1,emptyAllowed:!0}),wc=new zv({each:D,required:!0}),FS=new Hi({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Fr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),ot=(e,t)=>{if("required"in t)return{payload:new Gv({value:t}).validate({value:e}).value};let o=new Hv({options:{required:!0},values:t}).validate(e);if(o)throw new Wv(o);return{payload:e}},A=(e,t)=>{try{return ot(e,t)}catch(r){return{payload:e,error:Fr(r)}}},Se=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return RS(e,t,r,o,"Controller initialization error")},ie=(e,t,r,n)=>{let o=`Check the options of ${n}`;return RS(e,t,r,o,"Controller initialization error")},RS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};import{isNullOrUndefined as Om,RecordValue as WI,Schema as HI,StringValue as ru}from"@coveo/bueno";function Te(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 Kv=typeof Symbol=="function"&&Symbol.observable||"@@observable",bS=Kv,Lp=()=>Math.random().toString(36).substring(7).split("").join("."),Yv={INIT:`@@redux/INIT${Lp()}`,REPLACE:`@@redux/REPLACE${Lp()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Lp()}`},Ic=Yv;function qt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Qp(e,t,r){if(typeof e!="function")throw new Error(Te(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Te(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Te(1));return r(Qp)(e,t)}let n=e,o=t,a=new Map,i=a,s=0,c=!1;function u(){i===a&&(i=new Map,a.forEach((S,h)=>{i.set(h,S)}))}function l(){if(c)throw new Error(Te(3));return o}function m(S){if(typeof S!="function")throw new Error(Te(4));if(c)throw new Error(Te(5));let h=!0;u();let g=s++;return i.set(g,S),function(){if(h){if(c)throw new Error(Te(6));h=!1,u(),i.delete(g),a=null}}}function d(S){if(!qt(S))throw new Error(Te(7));if(typeof S.type>"u")throw new Error(Te(8));if(typeof S.type!="string")throw new Error(Te(17));if(c)throw new Error(Te(9));try{c=!0,o=n(o,S)}finally{c=!1}return(a=i).forEach(g=>{g()}),S}function p(S){if(typeof S!="function")throw new Error(Te(10));n=S,d({type:Ic.REPLACE})}function f(){let S=m;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Te(11));function g(){let F=h;F.next&&F.next(l())}return g(),{unsubscribe:S(g)}},[bS](){return this}}}return d({type:Ic.INIT}),{dispatch:d,subscribe:m,getState:l,replaceReducer:p,[bS]:f}}function Jv(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ic.INIT})>"u")throw new Error(Te(12));if(typeof r(void 0,{type:Ic.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Te(13))})}function To(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let s=t[i];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,a;try{Jv(r)}catch(i){a=i}return function(s={},c){if(a)throw a;let u=!1,l={};for(let m=0;m<n.length;m++){let d=n[m],p=r[d],f=s[d],y=p(f,c);if(typeof y>"u"){let S=c&&c.type;throw new Error(Te(14))}l[d]=y,u=u||y!==f}return u=u||n.length!==Object.keys(s).length,u?l:s}}function ko(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function vS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Te(15))},i={getState:o.getState,dispatch:(c,...u)=>a(c,...u)},s=e.map(c=>c(i));return a=ko(...s)(o.dispatch),{...o,dispatch:a}}}function Ec(e){return qt(e)&&"type"in e&&typeof e.type=="string"}var Kp=Symbol.for("immer-nothing"),zi=Symbol.for("immer-draftable"),_e=Symbol.for("immer-state");function ke(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gn=Object.getPrototypeOf;function Je(e){return!!e&&!!e[_e]}function je(e){return e?TS(e)||Array.isArray(e)||!!e[zi]||!!e.constructor?.[zi]||Zi(e)||es(e):!1}var Xv=Object.prototype.constructor.toString();function TS(e){if(!e||typeof e!="object")return!1;let t=Gn(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Xv}function Yp(e){return Je(e)||ke(15,e),e[_e].base_}function Ki(e,t){Wn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Wn(e){let t=e[_e];return t?t.type_:Array.isArray(e)?1:Zi(e)?2:es(e)?3:0}function Yi(e,t){return Wn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Bp(e,t){return Wn(e)===2?e.get(t):e[t]}function kS(e,t,r){let n=Wn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Zv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Zi(e){return e instanceof Map}function es(e){return e instanceof Set}function $n(e){return e.copy_||e.base_}function jp(e,t){if(Zi(e))return new Map(e);if(es(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=TS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[_e];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Gn(e),n)}else{let n=Gn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Oc(e,t=!1){return qc(e)||Je(e)||!je(e)||(Wn(e)>1&&(e.set=e.add=e.clear=e.delete=eP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Oc(n,!0))),e}function eP(){ke(2)}function qc(e){return Object.isFrozen(e)}var $p={};function Hn(e){let t=$p[e];return t||ke(0,e),t}function tP(e,t){$p[e]||($p[e]=t)}var Ji;function OS(){return Ji}function rP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function PS(e,t){t&&(Hn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Gp(e){Wp(e),e.drafts_.forEach(nP),e.drafts_=null}function Wp(e){e===Ji&&(Ji=e.parent_)}function wS(e){return Ji=rP(Ji,e)}function nP(e){let t=e[_e];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function IS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[_e].modified_&&(Gp(t),ke(4)),je(e)&&(e=Tc(t,e),t.parent_||kc(t,e)),t.patches_&&Hn("Patches").generateReplacementPatches_(r[_e].base_,e,t.patches_,t.inversePatches_)):e=Tc(t,r,[]),Gp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Kp?e:void 0}function Tc(e,t,r){if(qc(t))return t;let n=t[_e];if(!n)return Ki(t,(o,a)=>ES(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return kc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,i=!1;n.type_===3&&(a=new Set(o),o.clear(),i=!0),Ki(a,(s,c)=>ES(e,n,o,s,c,r,i)),kc(e,o,!1),r&&e.patches_&&Hn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function ES(e,t,r,n,o,a,i){if(Je(o)){let s=a&&t&&t.type_!==3&&!Yi(t.assigned_,n)?a.concat(n):void 0,c=Tc(e,o,s);if(kS(r,n,c),Je(c))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(je(o)&&!qc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Tc(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&kc(e,o)}}function kc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Oc(t,r)}function oP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:OS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Jp;r&&(o=[n],a=Xi);let{revoke:i,proxy:s}=Proxy.revocable(o,a);return n.draft_=s,n.revoke_=i,s}var Jp={get(e,t){if(t===_e)return e;let r=$n(e);if(!Yi(r,t))return aP(e,r,t);let n=r[t];return e.finalized_||!je(n)?n:n===Up(e.base_,t)?(_p(e),e.copy_[t]=zp(n,e)):n},has(e,t){return t in $n(e)},ownKeys(e){return Reflect.ownKeys($n(e))},set(e,t,r){let n=qS($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Up($n(e),t),a=o?.[_e];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Zv(r,o)&&(r!==void 0||Yi(e.base_,t)))return!0;_p(e),Hp(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Up(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,_p(e),Hp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$n(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ke(11)},getPrototypeOf(e){return Gn(e.base_)},setPrototypeOf(){ke(12)}},Xi={};Ki(Jp,(e,t)=>{Xi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xi.deleteProperty=function(e,t){return Xi.set.call(this,e,t,void 0)};Xi.set=function(e,t,r){return Jp.set.call(this,e[0],t,r,e[0])};function Up(e,t){let r=e[_e];return(r?$n(r):e)[t]}function aP(e,t,r){let n=qS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function qS(e,t){if(!(t in e))return;let r=Gn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Gn(r)}}function Hp(e){e.modified_||(e.modified_=!0,e.parent_&&Hp(e.parent_))}function _p(e){e.copy_||(e.copy_=jp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let i=this;return function(c=a,...u){return i.produce(c,l=>r.call(this,l,...u))}}typeof r!="function"&&ke(6),n!==void 0&&typeof n!="function"&&ke(7);let o;if(je(t)){let a=wS(this),i=zp(t,void 0),s=!0;try{o=r(i),s=!1}finally{s?Gp(a):Wp(a)}return PS(a,n),IS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Kp&&(o=void 0),this.autoFreeze_&&Oc(o,!0),n){let a=[],i=[];Hn("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else ke(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...s)=>this.produceWithPatches(i,c=>t(c,...s));let n,o;return[this.produce(t,r,(i,s)=>{n=i,o=s}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){je(e)||ke(8),Je(e)&&(e=DS(e));let t=wS(this),r=zp(e,void 0);return r[_e].isManual_=!0,Wp(t),r}finishDraft(e,t){let r=e&&e[_e];(!r||!r.isManual_)&&ke(9);let{scope_:n}=r;return PS(n,t),IS(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Hn("Patches").applyPatches_;return Je(e)?n(e,t):this.produce(e,o=>n(o,t))}};function zp(e,t){let r=Zi(e)?Hn("MapSet").proxyMap_(e,t):es(e)?Hn("MapSet").proxySet_(e,t):oP(e,t);return(t?t.scope_:OS()).drafts_.push(r),r}function DS(e){return Je(e)||ke(10,e),VS(e)}function VS(e){if(!je(e)||qc(e))return e;let t=e[_e],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=jp(e,t.scope_.immer_.useStrictShallowCopy_)}else r=jp(e,!0);return Ki(r,(n,o)=>{kS(r,n,VS(o))}),t&&(t.finalized_=!1),r}function NS(){let t="replace",r="add",n="remove";function o(d,p,f,y){switch(d.type_){case 0:case 2:return i(d,p,f,y);case 1:return a(d,p,f,y);case 3:return s(d,p,f,y)}}function a(d,p,f,y){let{base_:S,assigned_:h}=d,g=d.copy_;g.length<S.length&&([S,g]=[g,S],[f,y]=[y,f]);for(let x=0;x<S.length;x++)if(h[x]&&g[x]!==S[x]){let F=p.concat([x]);f.push({op:t,path:F,value:m(g[x])}),y.push({op:t,path:F,value:m(S[x])})}for(let x=S.length;x<g.length;x++){let F=p.concat([x]);f.push({op:r,path:F,value:m(g[x])})}for(let x=g.length-1;S.length<=x;--x){let F=p.concat([x]);y.push({op:n,path:F})}}function i(d,p,f,y){let{base_:S,copy_:h}=d;Ki(d.assigned_,(g,x)=>{let F=Bp(S,g),I=Bp(h,g),b=x?Yi(S,g)?t:r:n;if(F===I&&b===t)return;let R=p.concat(g);f.push(b===n?{op:b,path:R}:{op:b,path:R,value:I}),y.push(b===r?{op:n,path:R}:b===n?{op:r,path:R,value:m(F)}:{op:t,path:R,value:m(F)})})}function s(d,p,f,y){let{base_:S,copy_:h}=d,g=0;S.forEach(x=>{if(!h.has(x)){let F=p.concat([g]);f.push({op:n,path:F,value:x}),y.unshift({op:r,path:F,value:x})}g++}),g=0,h.forEach(x=>{if(!S.has(x)){let F=p.concat([g]);f.push({op:r,path:F,value:x}),y.unshift({op:n,path:F,value:x})}g++})}function c(d,p,f,y){f.push({op:t,path:[],value:p===Kp?void 0:p}),y.push({op:t,path:[],value:d})}function u(d,p){return p.forEach(f=>{let{path:y,op:S}=f,h=d;for(let I=0;I<y.length-1;I++){let b=Wn(h),R=y[I];typeof R!="string"&&typeof R!="number"&&(R=""+R),(b===0||b===1)&&(R==="__proto__"||R==="constructor")&&ke(19),typeof h=="function"&&R==="prototype"&&ke(19),h=Bp(h,R),typeof h!="object"&&ke(18,y.join("/"))}let g=Wn(h),x=l(f.value),F=y[y.length-1];switch(S){case t:switch(g){case 2:return h.set(F,x);case 3:ke(16);default:return h[F]=x}case r:switch(g){case 1:return F==="-"?h.push(x):h.splice(F,0,x);case 2:return h.set(F,x);case 3:return h.add(x);default:return h[F]=x}case n:switch(g){case 1:return h.splice(F,1);case 2:return h.delete(F);case 3:return h.delete(f.value);default:return delete h[F]}default:ke(17,S)}}),d}function l(d){if(!je(d))return d;if(Array.isArray(d))return d.map(l);if(Zi(d))return new Map(Array.from(d.entries()).map(([f,y])=>[f,l(y)]));if(es(d))return new Set(Array.from(d).map(l));let p=Object.create(Gn(d));for(let f in d)p[f]=l(d[f]);return Yi(d,zi)&&(p[zi]=d[zi]),p}function m(d){return Je(d)?l(d):d}tP("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var Xe=new iP,Rr=Xe.produce,Dc=Xe.produceWithPatches.bind(Xe),SB=Xe.setAutoFreeze.bind(Xe),hB=Xe.setUseStrictShallowCopy.bind(Xe),Xp=Xe.applyPatches.bind(Xe),yB=Xe.createDraft.bind(Xe),CB=Xe.finishDraft.bind(Xe);function sP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function cP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function uP(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var MS=e=>Array.isArray(e)?e:[e];function lP(e){let t=Array.isArray(e[0])?e[0]:e;return uP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function dP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var FB=Symbol();var RB=Object.getPrototypeOf({});var pP=class{constructor(e){this.value=e}deref(){return this.value}},mP=typeof WeakRef<"u"?WeakRef:pP,fP=0,LS=1;function Vc(){return{s:fP,v:void 0,o:null,p:null}}function Oo(e,t={}){let r=Vc(),{resultEqualityCheck:n}=t,o,a=0;function i(){let s=r,{length:c}=arguments;for(let m=0,d=c;m<d;m++){let p=arguments[m];if(typeof p=="function"||typeof p=="object"&&p!==null){let f=s.o;f===null&&(s.o=f=new WeakMap);let y=f.get(p);y===void 0?(s=Vc(),f.set(p,s)):s=y}else{let f=s.p;f===null&&(s.p=f=new Map);let y=f.get(p);y===void 0?(s=Vc(),f.set(p,s)):s=y}}let u=s,l;if(s.s===LS)l=s.v;else if(l=e.apply(null,arguments),a++,n){let m=o?.deref?.()??o;m!=null&&n(m,l)&&(l=m,a!==0&&a--),o=typeof l=="object"&&l!==null||typeof l=="function"?new mP(l):l}return u.s=LS,u.v=l,l}return i.clearCache=()=>{r=Vc(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function QS(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),sP(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let l={...r,...c},{memoize:m,memoizeOptions:d=[],argsMemoize:p=Oo,argsMemoizeOptions:f=[],devModeChecks:y={}}=l,S=MS(d),h=MS(f),g=lP(o),x=m(function(){return a++,u.apply(null,arguments)},...S),F=!0,I=p(function(){i++;let R=dP(g,arguments);return s=x.apply(null,R),s},...h);return Object.assign(I,{resultFunc:u,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var Y=QS(Oo),gP=Object.assign((e,t=Y)=>{cP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((i,s,c)=>(i[r[c]]=s,i),{}))},{withTypes:()=>gP});function BS(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var US=BS(),_S=BS;var SP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ko:ko.apply(null,arguments)},qB=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},hP=e=>e&&typeof e.match=="function";function C(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(At(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Ec(n)&&n.type===e,r}var HS=class ts extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ts.prototype)}static get[Symbol.species](){return ts}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ts(...t[0].concat(this)):new ts(...t.concat(this))}};function jS(e){return je(e)?Rr(e,()=>{}):e}function $S(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function yP(e){return typeof e=="boolean"}var CP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new HS;return r&&(yP(r)?i.push(US):i.push(_S(r.extraArgument))),i},Gr="RTK_autoBatch",Do=()=>e=>({payload:e,meta:{[Gr]:!0}}),GS=e=>t=>{setTimeout(t,e)},xP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:GS(10):e.type==="callback"?e.queueNotification:GS(e.timeout),u=()=>{i=!1,a&&(a=!1,s.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){let m=()=>o&&l(),d=n.subscribe(m);return s.add(l),()=>{d(),s.delete(l)}},dispatch(l){try{return o=!l?.meta?.[Gr],a=!o,a&&(i||(i=!0,c(u))),n.dispatch(l)}finally{o=!0}}})},AP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new HS(e);return n&&o.push(xP(typeof n=="object"?n:void 0)),o};function zS(e){let t=CP(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:i=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=To(r);else throw new Error(At(1));let c;typeof n=="function"?c=n(t):c=t();let u=ko;o&&(u=SP({trace:!1,...typeof o=="object"&&o}));let l=vS(...c),m=AP(l),d=typeof i=="function"?i(m):m(),p=u(...d);return Qp(s,a,p)}function KS(e){let t={},r=[],n,o={addCase(a,i){let s=typeof a=="string"?a:a.type;if(!s)throw new Error(At(28));if(s in t)throw new Error(At(29));return t[s]=i,o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function FP(e){return typeof e=="function"}function _(e,t){let[r,n,o]=KS(t),a;if(FP(e))a=()=>jS(e());else{let s=jS(e);a=()=>s}function i(s=a(),c){let u=[r[c.type],...n.filter(({matcher:l})=>l(c)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[o]),u.reduce((l,m)=>{if(m)if(Je(l)){let p=m(l,c);return p===void 0?l:p}else{if(je(l))return Rr(l,d=>m(d,c));{let d=m(l,c);if(d===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return l},s)}return i.getInitialState=a,i}var YS=(e,t)=>hP(e)?e.match(t):e(t);function Dt(...e){return t=>e.some(r=>YS(r,t))}function qo(...e){return t=>e.every(r=>YS(r,t))}function Mc(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function rs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Lc(...e){return e.length===0?t=>Mc(t,["pending"]):rs(e)?Dt(...e.map(t=>t.pending)):Lc()(e[0])}function zn(...e){return e.length===0?t=>Mc(t,["rejected"]):rs(e)?Dt(...e.map(t=>t.rejected)):zn()(e[0])}function ns(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?qo(zn(...e),t):rs(e)?qo(zn(...e),t):ns()(e[0])}function br(...e){return e.length===0?t=>Mc(t,["fulfilled"]):rs(e)?Dt(...e.map(t=>t.fulfilled)):br()(e[0])}function Qc(...e){return e.length===0?t=>Mc(t,["pending","fulfilled","rejected"]):rs(e)?Dt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Qc()(e[0])}var RP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Bc=(e=21)=>{let t="",r=e;for(;r--;)t+=RP[Math.random()*64|0];return t},bP=["name","message","stack","code"],Zp=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},WS=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},vP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of bP)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},G=(()=>{function e(t,r,n){let o=C(t+"/fulfilled",(c,u,l,m)=>({payload:c,meta:{...m||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),a=C(t+"/pending",(c,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:c,requestStatus:"pending"}})),i=C(t+"/rejected",(c,u,l,m,d)=>({payload:m,error:(n&&n.serializeError||vP)(c||"Rejected"),meta:{...d||{},arg:l,requestId:u,rejectedWithValue:!!m,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,l,m)=>{let d=n?.idGenerator?n.idGenerator(c):Bc(),p=new AbortController,f,y;function S(g){y=g,p.abort()}let h=async function(){let g;try{let F=n?.condition?.(c,{getState:l,extra:m});if(wP(F)&&(F=await F),F===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let I=new Promise((b,R)=>{f=()=>{R({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",f)});u(a(d,c,n?.getPendingMeta?.({requestId:d,arg:c},{getState:l,extra:m}))),g=await Promise.race([I,Promise.resolve(r(c,{dispatch:u,getState:l,extra:m,requestId:d,signal:p.signal,abort:S,rejectWithValue:(b,R)=>new Zp(b,R),fulfillWithValue:(b,R)=>new WS(b,R)})).then(b=>{if(b instanceof Zp)throw b;return b instanceof WS?o(b.payload,d,c,b.meta):o(b,d,c)})])}catch(F){g=F instanceof Zp?i(null,d,c,F.payload,F.meta):i(F,d,c)}finally{f&&p.signal.removeEventListener("abort",f)}return n&&!n.dispatchConditionRejection&&i.match(g)&&g.meta.condition||u(g),g}();return Object.assign(h,{abort:S,requestId:d,arg:c,unwrap(){return h.then(PP)}})}}return Object.assign(s,{pending:a,rejected:i,fulfilled:o,settled:Dt(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function PP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function wP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var JS=Symbol.for("rtk-slice-createasyncthunk"),LB={[JS]:G};function IP(e,t){return`${e}/${t}`}function EP({creators:e}={}){let t=e?.asyncThunk?.[JS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(At(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(kP()):n.reducers)||{},s=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(g,x){let F=typeof g=="string"?g:g.type;if(!F)throw new Error(At(12));if(F in c.sliceCaseReducersByType)throw new Error(At(13));return c.sliceCaseReducersByType[F]=x,u},addMatcher(g,x){return c.sliceMatchers.push({matcher:g,reducer:x}),u},exposeAction(g,x){return c.actionCreators[g]=x,u},exposeCaseReducer(g,x){return c.sliceCaseReducersByName[g]=x,u}};s.forEach(g=>{let x=i[g],F={reducerName:g,type:IP(o,g),createNotation:typeof n.reducers=="function"};qP(x)?VP(F,x,u,t):OP(F,x,u)});function l(){let[g={},x=[],F=void 0]=typeof n.extraReducers=="function"?KS(n.extraReducers):[n.extraReducers],I={...g,...c.sliceCaseReducersByType};return _(n.initialState,b=>{for(let R in I)b.addCase(R,I[R]);for(let R of c.sliceMatchers)b.addMatcher(R.matcher,R.reducer);for(let R of x)b.addMatcher(R.matcher,R.reducer);F&&b.addDefaultCase(F)})}let m=g=>g,d=new Map,p;function f(g,x){return p||(p=l()),p(g,x)}function y(){return p||(p=l()),p.getInitialState()}function S(g,x=!1){function F(b){let R=b[g];return typeof R>"u"&&x&&(R=y()),R}function I(b=m){let R=$S(d,x,()=>new WeakMap);return $S(R,b,()=>{let E={};for(let[w,T]of Object.entries(n.selectors??{}))E[w]=TP(T,b,y,x);return E})}return{reducerPath:g,getSelectors:I,get selectors(){return I(F)},selectSlice:F}}let h={name:o,reducer:f,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...S(a),injectInto(g,{reducerPath:x,...F}={}){let I=x??a;return g.inject({reducerPath:I,reducer:f},F),{...h,...S(I,!0)}}};return h}}function TP(e,t,r,n){function o(a,...i){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...i)}return o.unwrapped=e,o}var Kn=EP();function kP(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function OP({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!DP(n))throw new Error(At(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?C(e,i):C(e))}function qP(e){return e._reducerDefinitionType==="asyncThunk"}function DP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function VP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(At(18));let{payloadCreator:a,fulfilled:i,pending:s,rejected:c,settled:u,options:l}=r,m=o(e,a,l);n.exposeAction(t,m),i&&n.addCase(m.fulfilled,i),s&&n.addCase(m.pending,s),c&&n.addCase(m.rejected,c),u&&n.addMatcher(m.settled,u),n.exposeCaseReducer(t,{fulfilled:i||Nc,pending:s||Nc,rejected:c||Nc,settled:u||Nc})}function Nc(){}var XS="listener",ZS="completed",eh="cancelled",QB=`task-${eh}`,BB=`task-${ZS}`,UB=`${XS}-${eh}`,_B=`${XS}-${ZS}`;var{assign:th}=Object;var em="listenerMiddleware";var NP=th(C(`${em}/add`),{withTypes:()=>NP}),jB=C(`${em}/removeAll`),MP=th(C(`${em}/remove`),{withTypes:()=>MP});var $B=Symbol.for("rtk-state-proxy-original");function At(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. `}function LP({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;i!=="disabled"&&(n.call(r),t.send(o,a,r))}var QP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function BP(e){return typeof e=="string"&&QP.test(e)}var Oe=[];for(let e=0;e<256;++e)Oe.push((e+256).toString(16).slice(1));function UP(e,t=0){return(Oe[e[t+0]]+Oe[e[t+1]]+Oe[e[t+2]]+Oe[e[t+3]]+"-"+Oe[e[t+4]]+Oe[e[t+5]]+"-"+Oe[e[t+6]]+Oe[e[t+7]]+"-"+Oe[e[t+8]]+Oe[e[t+9]]+"-"+Oe[e[t+10]]+Oe[e[t+11]]+Oe[e[t+12]]+Oe[e[t+13]]+Oe[e[t+14]]+Oe[e[t+15]]).toLowerCase()}var tm,_P=new Uint8Array(16);function jP(){if(!tm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tm=crypto.getRandomValues.bind(crypto)}return tm(_P)}var $P=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rh={randomUUID:$P};function GP(e,t,r){if(rh.randomUUID&&!e)return rh.randomUUID();e=e||{};let n=e.random??e.rng?.()??jP();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,UP(n)}function WP(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&BP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var oh="1.0.0";function HP(e){let{trackingId:t}=e;return{trackingId:t}}function zP(e){return(e.source||[]).concat([`relay@${oh}`])}function ah(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:i}=r,s=HP(t),c=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:zP(t),clientId:c,userAgent:i(),referrer:o(),location:a()})}function KP(e,t,r,n,o){return{...t,meta:ah(e,r,n,o)}}var YP="*";function JP(){let e=[];function t({type:c,callback:u}){return e.findIndex(l=>l.type===c&&l.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(l){console.error(l)}})}function a(c){if(c===YP)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function i(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?i({type:c,callback:u}):a(c)}return{add:n,call:o,remove:s}}function nh({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...!!n.mode&&{mode:n.mode},...!!n.source&&{source:n.source}})}function XP(e){let t=nh(e);return{get:()=>t,update:r=>{t=nh({...t,...r})}}}function ZP(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var rm=ew();function ew(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function tw(){return{getItem(e){return rm.getItem(e)||localStorage.getItem(e)},removeItem(e){rm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),rm.setItem(e,t,31556952e3)}}}function rw(){let e=document.referrer;return e===""?null:e}function nw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(ZP().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:()=>rw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>GP(),storage:tw()}}function ow(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function aw(){return{getItem(){return null},removeItem(){},setItem(){}}}function iw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:aw()}}function sw(e){return e.get().mode!=="disabled"&&cw()&&ow()?nw():iw()}function cw(){try{return typeof window=="object"}catch{return!1}}function uw(e){return{get:()=>Object.freeze(sw(e))}}function ih(e){let t=XP(e),r=JP(),n=uw(t),o=WP(n);return{emit:(a,i)=>{let s=t.get(),c=n.get(),u=KP(a,i,s,c,o);return LP({config:s,environment:c,event:u,listenerManager:r})},getMeta:a=>ah(a,t.get(),n.get(),o),on:(a,i)=>r.add({type:a,callback:i}),off:(a,i)=>r.remove(a,i),updateConfig:a=>t.update(a),version:oh}}var Yn="3.19.0-pre.afe9f4e635",sh=["@coveo/atomic","@coveo/quantic"];var Wr=Y(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Yn}`));var Vo=Y(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Wr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i)=>ih({mode:a?"emit":"disabled",url:o??Mp(e,t),token:r,trackingId:n,source:i}));function vr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function v(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var X;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(X||(X={}));function am(){return typeof window<"u"}function ym(){return typeof navigator<"u"}function No(){return typeof document<"u"}function im(){try{return typeof localStorage<"u"}catch{return!1}}function lw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Ah(){return ym()&&navigator.cookieEnabled}var dw=[X.click,X.custom,X.search,X.view],pw=(e,t)=>dw.indexOf(e)!==-1?Object.assign({language:No()?document.documentElement.lang:"unknown",userAgent:ym()?navigator.userAgent:"unknown"},t):t,is=class e{static set(t,r,n){var o,a,i,s;n&&(a=new Date,a.setTime(a.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?ch(t,r,a):(i=s.split("."),o=i[i.length-2]+"."+i[i.length-1],ch(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function ch(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function mw(){return im()?localStorage:Ah()?new ss:lw()?sessionStorage:new Lo}var ss=class e{getItem(t){return is.get(`${e.prefix}${t}`)}removeItem(t){is.erase(`${e.prefix}${t}`)}setItem(t,r,n){is.set(`${e.prefix}${t}`,r,n)}};ss.prefix="coveo_";var sm=class{constructor(){this.cookieStorage=new ss}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Lo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},os="__coveo.analytics.history",Fh=20,Rh=1e3*60,bh=75,Qo=class{constructor(t){this.store=t||mw()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return v(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return v(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(os);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return v(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(os);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(os,JSON.stringify(t.slice(0,Fh)))}catch{}}clear(){try{this.store.removeItem(os)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,bh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Rh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},vh=Object.freeze({__proto__:null,HistoryStore:Qo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Fh,MAX_VALUE_SIZE:bh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:Rh,STORE_KEY:os,default:Qo}),fw=(e,t)=>v(void 0,void 0,void 0,function*(){return e===X.view?(yield gw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),gw=e=>v(void 0,void 0,void 0,function*(){let t=new Qo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Uc,Sw=new Uint8Array(16);function hw(){if(!Uc&&(Uc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Uc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Uc(Sw)}var yw=/^(?:[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 jc(e){return typeof e=="string"&&yw.test(e)}var qe=[];for(let e=0;e<256;++e)qe.push((e+256).toString(16).slice(1));function Ph(e,t=0){return(qe[e[t+0]]+qe[e[t+1]]+qe[e[t+2]]+qe[e[t+3]]+"-"+qe[e[t+4]]+qe[e[t+5]]+"-"+qe[e[t+6]]+qe[e[t+7]]+"-"+qe[e[t+8]]+qe[e[t+9]]+"-"+qe[e[t+10]]+qe[e[t+11]]+qe[e[t+12]]+qe[e[t+13]]+qe[e[t+14]]+qe[e[t+15]]).toLowerCase()}function Cw(e){if(!jc(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function xw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Aw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Fw="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Rw(e,t,r){function n(o,a,i,s){var c;if(typeof o=="string"&&(o=xw(o)),typeof a=="string"&&(a=Cw(a)),((c=a)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(a),u.set(o,a.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,i){s=s||0;for(let l=0;l<16;++l)i[s+l]=u[l];return i}return Ph(u)}try{n.name=e}catch{}return n.DNS=Aw,n.URL=Fw,n}var bw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),uh={randomUUID:bw};function Jn(e,t,r){if(uh.randomUUID&&!t&&!e)return uh.randomUUID();e=e||{};let n=e.random||(e.rng||hw)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Ph(n)}function vw(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function nm(e,t){return e<<t|e>>>32-t}function Pw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let s=0;s<i.length;++s)e.push(i.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[i*64+c*4]<<24|e[i*64+c*4+1]<<16|e[i*64+c*4+2]<<8|e[i*64+c*4+3];a[i]=s}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let s=new Uint32Array(80);for(let p=0;p<16;++p)s[p]=a[i][p];for(let p=16;p<80;++p)s[p]=nm(s[p-3]^s[p-8]^s[p-14]^s[p-16],1);let c=r[0],u=r[1],l=r[2],m=r[3],d=r[4];for(let p=0;p<80;++p){let f=Math.floor(p/20),y=nm(c,5)+vw(f,u,l,m)+d+t[f]+s[p]>>>0;d=m,m=l,l=nm(u,30)>>>0,u=c,c=y}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+d>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var ww=Rw("v5",80,Pw),lh=ww,wh="2.30.43",dh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,as={pageview:"pageview",event:"event"},$c=class{constructor({client:t,uuidGenerator:r=Jn}){this.client=t,this.uuidGenerator=r}},cm=class extends $c{constructor({client:t,uuidGenerator:r=Jn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=dh(window.location),this.lastReferrer=No()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:No()?document.title:"",encoding:No()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===as.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===as.pageview?this.nextPageViewId:this.pageViewId,referrer:t===as.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===as.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return dh(window.location)}},Hr=class e{constructor(t,r){if(!jc(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return jc(a)?new e(a,Number.parseInt(o)*1e3):null}};Hr.cvo_cid="cvo_cid";Hr.expirationTime=120;var um=class extends $c{constructor({client:t,uuidGenerator:r=Jn}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return v(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Hr.cvo_cid,new Hr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};um.Id="link";var at=Object.keys;function _c(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var om=128,Ih=192,ph=224,mh=240;function Iw(e){return(e&248)===mh?4:(e&mh)===ph?3:(e&ph)===Ih?2:1}function Ew(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&om)!=om)break;if(r-=3,(n&Ih)!=om){t-r>=Iw(n)*3&&(r=t);break}}return e.substring(0,r)}var lm={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"},Tw=at(lm).map(e=>lm[e]),kw=[...Tw].join("|"),Ow=new RegExp(`^(${kw}$)`),qw={svcAction:"svc_action",svcActionData:"svc_action_data"},Dw=e=>at(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=lm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Vw=e=>Ow.test(e),Nw=[Vw],fh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ve={action:"pa",list:"pal",listSource:"pls"},Gc={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Mw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],dm={id:"quoteId",affiliation:"quoteAffiliation"},pm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Lw={add:Ve,bookmark_add:Ve,bookmark_remove:Ve,click:Ve,checkout:Ve,checkout_option:Ve,detail:Ve,impression:Ve,remove:Ve,refund:Object.assign(Object.assign({},Ve),Gc),purchase:Object.assign(Object.assign({},Ve),Gc),quickview:Ve,quote:Object.assign(Object.assign({},Ve),dm),review:Object.assign(Object.assign({},Ve),pm)},Qw=at(fh).map(e=>fh[e]),Bw=at(gh).map(e=>gh[e]),Uw=at(Ve).map(e=>Ve[e]),_w=at(Gc).map(e=>Gc[e]),jw=at(pm).map(e=>pm[e]),$w=at(dm).map(e=>dm[e]),Gw=[...Qw,"custom"].join("|"),Ww=[...Bw,"custom"].join("|"),Eh="(pr[0-9]+)",Th="(il[0-9]+pi[0-9]+)",Hw=new RegExp(`^${Eh}(${Gw})$`),zw=new RegExp(`^(${Th}(${Ww}))|(il[0-9]+nm)$`),Kw=new RegExp(`^(${Uw.join("|")})$`),Yw=new RegExp(`^(${_w.join("|")})$`),Jw=new RegExp(`^${Eh}custom$`),Xw=new RegExp(`^${Th}custom$`),Zw=new RegExp(`^(${[...Mw,...jw,...$w].join("|")})$`),eI=e=>Hw.test(e),tI=e=>zw.test(e),rI=e=>Kw.test(e),nI=e=>Yw.test(e),oI=e=>Zw.test(e),aI=[tI,eI,rI,nI,oI],iI=[Jw,Xw],sI={anonymizeIp:"aip"},cI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},uI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},lI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],dI=Object.assign(Object.assign(Object.assign(Object.assign({},sI),cI),uI),lI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),mm=Object.assign(Object.assign({},dI),qw),pI=e=>{let t=!!e.action&&Lw[e.action]||{};return at(e).reduce((r,n)=>{let o=t[n]||mm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},mI=at(mm).map(e=>mm[e]),fI=e=>mI.indexOf(e)!==-1,gI=e=>e==="custom",SI=e=>[...aI,...Nw,fI,gI].some(t=>t(e)),hI=e=>at(e).reduce((t,r)=>{let n=yI(r);return n?Object.assign(Object.assign({},t),CI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),yI=e=>{let t;return[...iI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},CI=(e,t)=>at(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),fm=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return v(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=i;o=s||t;try{a=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return v(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},gm=class{sendEvent(t,r){return v(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){return Promise.resolve()})}},Sh=globalThis.fetch,Wc=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),a?yield a(s,"analyticsFetch"):{}),{url:u}=c,l=vr(c,["url"]),m;try{m=yield Sh(u,l)}catch(d){console.error("An error has occured when sending the event.",d);return}if(m.ok){let d=yield m.json();return d.visitorId&&o.setCurrentVisitorId(d.visitorId),d}else{try{m.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,m,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Sh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return v(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Sm=class{constructor(t,r){im()&&Ah()?this.storage=new sm:im()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Lo),this.client=new Wc(t),this.beaconClient=new fm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},hm=class{constructor(t,r){this.storage=r||new Lo,this.client=new Wc(t)}getClientDependingOnEventType(t){return this.client}},Hc=class{constructor(){this.storage=new Lo,this.client=new gm}getClientDependingOnEventType(t){return this.client}},xI="xx",AI=e=>e?.startsWith(xI)||!1,FI=`
19
+ `+l:l;break;case"event":n.event=l;break;case"id":e(n.id=l);break;case"retry":Jb(l,n,t);break}}}}function Jb(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function Xb(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function zg(){return{data:"",event:"",id:"",retry:void 0}}var vp="text/event-stream",Zb=1e3,Xg="last-event-id";function Zg(){return typeof window<"u"}function Ac(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:s,fetch:c,...u}){return new Promise((l,m)=>{let d={...r};d.accept||(d.accept=vp);let p;function f(){p?.abort(),document.hidden||F()}!s&&Zg()&&document.addEventListener("visibilitychange",f);let y=Zb,S;function h(){Zg()&&document.removeEventListener("visibilitychange",f),clearTimeout(S),p?.abort()}t?.addEventListener("abort",()=>{h(),l()});let g=c??fetch,x=n??ev;async function F(){p=AbortController?new AbortController:null;try{let I=await g(e,{...u,headers:d,signal:p?.signal});await x(I),await Kg(I.body,Yg(Jg(b=>{b?d[Xg]=b:delete d[Xg]},b=>{y=b},o))),a?.(),h(),l()}catch(I){if(!p?.signal?.aborted)try{let b=i?.(I)??y;clearTimeout(S),S=setTimeout(F,b)}catch(b){h(),m(b)}}}F()})}function ev(e){let t=e.headers.get("content-type");if(!t?.startsWith(vp))throw new Error(`Expected content-type to be ${vp}, Actual: ${t}`)}var Ur=class{constructor(t){pe(this,"_basePath");pe(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var tv=(e,t,r)=>new Ur(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,eS=3,rv=5e3,nv="text/event-stream",Ip=1,Pp=class extends Error{},ji=class extends Error{constructor(r){super(r.message);this.payload=r}},wp=class{constructor(){pe(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Fc=class{constructor(t){pe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:s,abort:c,close:u,resetAnswer:l}=r,m=new wp;if(!a){this.logger.error("No stream ID found");return}let d=0,p,f=()=>{p&&!m.isActive(p)&&(S?.abort(),l(),h())},y=()=>{m.remove(p),p=Wg(f,p,rv),m.add(p)},S=new AbortController,h=()=>Ac(tv(n,o,a),{method:"GET",fetch,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:S?.signal,async onopen(g){if(g.ok&&g.headers.get("content-type")===nv)return;throw g.status>=400&&g.status<500&&g.status!==429?new ji({message:"Error opening stream",code:g.status}):new Pp},onmessage:g=>{if(S?.signal.aborted)return;let x=JSON.parse(g.data);if(x.finishReason==="ERROR"){m.remove(p),S?.abort(),c({message:x.errorMessage,code:x.statusCode});return}s(x),d=0,x.finishReason==="COMPLETED"?(m.remove(p),u()):y()},onerror:g=>{if(!S?.signal.aborted){if(m.remove(p),g instanceof ji)throw S?.abort(),c(g),g;if(++d>eS){this.logger.info("Maximum retry exceeded.");let x={message:"Failed to complete stream.",code:Ip};throw S?.abort(),c(x),new ji(x)}this.logger.info(`Retrying...(${d}/${eS})`),l()}}});return h(),S}};var pS=Ot(cS(),1);var Ev="recommendation-internal-options",v0=Symbol.for(Ev);var N=new Error("Failed to load reducers."),Io=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var jn=class extends Error{constructor(r,n){super();pe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};function uS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function lS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Tv)}function Tv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function dS(e){return e===429}var nt=class e{static async call(t){let r=kv(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,s=async()=>{let c=await fetch(a,i);if(dS(c.status))throw c;return c};try{let c=await(0,pS.backOff)(s,{retry:u=>{let l=u&&dS(u.status);return l&&n.info("Platform retrying request"),l}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Io;case 404:throw new jn(a,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new jn(a):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:s,...c}=t,u=_i(c);try{let l=await o(t,n,i);return{...t,...l}}catch(l){a.error(l,"Platform request preprocessing failed. Returning default request options.")}return u}};function De(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function xe(e,t="prod"){return`${De(e,t)}/rest/search/v2`}function Mp(e,t="prod"){return`${De(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function kv(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,s=e.method==="POST"||e.method==="PUT",c=Ov(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:c},signal:i}}function Ov(e,t){return t==="application/x-www-form-urlencoded"?lS(e)?uS(e):"":JSON.stringify(e)}var bc=e=>e;var mS=e=>e,fS=e=>e,gS=e=>e;import{isNullOrUndefined as Uv}from"@coveo/bueno";function Eo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ye(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Eo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Eo(),extendedResults:{}}}function _r(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var jr=e=>{let{response:t}=e;return t.body?qv(e):Dv(t)},qv=e=>Nv(e)?Mv(e):Vv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Dv=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Vv(e){return e.body.statusCode!==void 0}function Nv(e){return e.body.exception!==void 0}var Mv=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});var $r=class{constructor(){pe(this,"currentAbortController",null)}async enqueue(t,r){let n=this.currentAbortController,o=this.currentAbortController=new AbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return await t(o?.signal??null)}finally{this.currentAbortController===o&&(this.currentAbortController=null)}}};function SS(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}var Ar=(e,t,r,n)=>{let o=new Ur(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var hS=(e,t)=>{let r=new Ur(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},yS=async(e,t)=>{let r=await nt.call({...Ar(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:_r(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=SS(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return Lv(i)?{success:i}:{error:jr({response:r,body:i})}};function Lv(e){return typeof e=="string"}function Qv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Bv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Wi(e,t){if(t&&e.name==="AbortError")return{error:Bv(e)};if(e instanceof jn)return{error:Qv(e)};throw e}var vc=class{constructor(t){this.options=t;pe(this,"apiCallsQueues",{unknown:new $r,mainSearch:new $r,facetValues:new $r,foldingCollection:new $r,instantResults:new $r})}async plan(t){let r=await nt.call({...Ar(t,"POST","application/json","/plan"),requestParams:_r(t),requestMetadata:{method:"plan"},...this.options});if(r instanceof Error)return Wi(r);let n=await r.json();return jv(n)?{success:n}:{error:jr({response:r,body:n})}}async querySuggest(t){let r=await nt.call({...Ar(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:_r(t),...this.options});if(r instanceof Error)return Wi(r);let n=await r.json(),o={response:r,body:n};return _v(n)?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:jr(o)}}async search(t,r){let n=r?.origin??"unknown",o=await this.apiCallsQueues[n].enqueue(s=>nt.call({...Ar(t,"POST","application/json",""),requestParams:_r(t),requestMetadata:{method:"search",origin:r?.origin},...this.options,signal:s??void 0}),{logger:this.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Wi(o,r?.disableAbortWarning);let a=await o.json(),i={response:o,body:a};return CS(a)?(i.body=xS(a),{success:(await this.options.postprocessSearchResponseMiddleware(i)).body}):{error:jr(i)}}async facetSearch(t){let r=await nt.call({...Ar(t,"POST","application/json","/facet"),requestParams:_r(t),requestMetadata:{method:"facetSearch"},...this.options});if(r instanceof Error)throw r;let n=await r.json(),o={response:r,body:n};return(await this.options.postprocessFacetSearchResponseMiddleware(o)).body}async recommendations(t){let r=await nt.call({...Ar(t,"POST","application/json",""),requestParams:_r(t),requestMetadata:{method:"recommendations"},...this.options});if(r instanceof Error)throw r;let n=await r.json();if(CS(n)){let o={response:r,body:n};return o.body=xS(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:jr({response:r,body:n})}}async html(t){return yS(t,{...this.options})}async fieldDescriptions(t){let r=await nt.call({...Ar(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(r instanceof Error)throw r;let n=await r.json();return $v(n)?{success:n}:{error:jr({response:r,body:n})}}},Pc=e=>e.success!==void 0,Fe=e=>e.error!==void 0;function CS(e){return e.results!==void 0}function xS(e){let t=Eo();return Uv(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function _v(e){return e.completions!==void 0}function jv(e){return e.preprocessingOutput!==void 0}function $v(e){return e.fields!==void 0}import{Schema as Gv,SchemaValidationError as Wv,StringValue as Hi,RecordValue as Hv,ArrayValue as zv}from"@coveo/bueno";var D=new Hi({required:!0,emptyAllowed:!1}),ce=new Hi({required:!1,emptyAllowed:!1}),ne=new Hi({required:!0,emptyAllowed:!0}),AS=new Hi({required:!1,emptyAllowed:!0}),wc=new zv({each:D,required:!0}),FS=new Hi({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Fr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),ot=(e,t)=>{if("required"in t)return{payload:new Gv({value:t}).validate({value:e}).value};let o=new Hv({options:{required:!0},values:t}).validate(e);if(o)throw new Wv(o);return{payload:e}},A=(e,t)=>{try{return ot(e,t)}catch(r){return{payload:e,error:Fr(r)}}},Se=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return RS(e,t,r,o,"Controller initialization error")},ie=(e,t,r,n)=>{let o=`Check the options of ${n}`;return RS(e,t,r,o,"Controller initialization error")},RS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};import{isNullOrUndefined as Om,RecordValue as WI,Schema as HI,StringValue as ru}from"@coveo/bueno";function Te(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 Kv=typeof Symbol=="function"&&Symbol.observable||"@@observable",bS=Kv,Lp=()=>Math.random().toString(36).substring(7).split("").join("."),Yv={INIT:`@@redux/INIT${Lp()}`,REPLACE:`@@redux/REPLACE${Lp()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Lp()}`},Ic=Yv;function qt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Qp(e,t,r){if(typeof e!="function")throw new Error(Te(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Te(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Te(1));return r(Qp)(e,t)}let n=e,o=t,a=new Map,i=a,s=0,c=!1;function u(){i===a&&(i=new Map,a.forEach((S,h)=>{i.set(h,S)}))}function l(){if(c)throw new Error(Te(3));return o}function m(S){if(typeof S!="function")throw new Error(Te(4));if(c)throw new Error(Te(5));let h=!0;u();let g=s++;return i.set(g,S),function(){if(h){if(c)throw new Error(Te(6));h=!1,u(),i.delete(g),a=null}}}function d(S){if(!qt(S))throw new Error(Te(7));if(typeof S.type>"u")throw new Error(Te(8));if(typeof S.type!="string")throw new Error(Te(17));if(c)throw new Error(Te(9));try{c=!0,o=n(o,S)}finally{c=!1}return(a=i).forEach(g=>{g()}),S}function p(S){if(typeof S!="function")throw new Error(Te(10));n=S,d({type:Ic.REPLACE})}function f(){let S=m;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Te(11));function g(){let F=h;F.next&&F.next(l())}return g(),{unsubscribe:S(g)}},[bS](){return this}}}return d({type:Ic.INIT}),{dispatch:d,subscribe:m,getState:l,replaceReducer:p,[bS]:f}}function Jv(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ic.INIT})>"u")throw new Error(Te(12));if(typeof r(void 0,{type:Ic.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Te(13))})}function To(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let s=t[i];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,a;try{Jv(r)}catch(i){a=i}return function(s={},c){if(a)throw a;let u=!1,l={};for(let m=0;m<n.length;m++){let d=n[m],p=r[d],f=s[d],y=p(f,c);if(typeof y>"u"){let S=c&&c.type;throw new Error(Te(14))}l[d]=y,u=u||y!==f}return u=u||n.length!==Object.keys(s).length,u?l:s}}function ko(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function vS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Te(15))},i={getState:o.getState,dispatch:(c,...u)=>a(c,...u)},s=e.map(c=>c(i));return a=ko(...s)(o.dispatch),{...o,dispatch:a}}}function Ec(e){return qt(e)&&"type"in e&&typeof e.type=="string"}var Kp=Symbol.for("immer-nothing"),zi=Symbol.for("immer-draftable"),_e=Symbol.for("immer-state");function ke(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gn=Object.getPrototypeOf;function Je(e){return!!e&&!!e[_e]}function je(e){return e?TS(e)||Array.isArray(e)||!!e[zi]||!!e.constructor?.[zi]||Zi(e)||es(e):!1}var Xv=Object.prototype.constructor.toString();function TS(e){if(!e||typeof e!="object")return!1;let t=Gn(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Xv}function Yp(e){return Je(e)||ke(15,e),e[_e].base_}function Ki(e,t){Wn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Wn(e){let t=e[_e];return t?t.type_:Array.isArray(e)?1:Zi(e)?2:es(e)?3:0}function Yi(e,t){return Wn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Bp(e,t){return Wn(e)===2?e.get(t):e[t]}function kS(e,t,r){let n=Wn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Zv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Zi(e){return e instanceof Map}function es(e){return e instanceof Set}function $n(e){return e.copy_||e.base_}function jp(e,t){if(Zi(e))return new Map(e);if(es(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=TS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[_e];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Gn(e),n)}else{let n=Gn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Oc(e,t=!1){return qc(e)||Je(e)||!je(e)||(Wn(e)>1&&(e.set=e.add=e.clear=e.delete=eP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Oc(n,!0))),e}function eP(){ke(2)}function qc(e){return Object.isFrozen(e)}var $p={};function Hn(e){let t=$p[e];return t||ke(0,e),t}function tP(e,t){$p[e]||($p[e]=t)}var Ji;function OS(){return Ji}function rP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function PS(e,t){t&&(Hn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Gp(e){Wp(e),e.drafts_.forEach(nP),e.drafts_=null}function Wp(e){e===Ji&&(Ji=e.parent_)}function wS(e){return Ji=rP(Ji,e)}function nP(e){let t=e[_e];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function IS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[_e].modified_&&(Gp(t),ke(4)),je(e)&&(e=Tc(t,e),t.parent_||kc(t,e)),t.patches_&&Hn("Patches").generateReplacementPatches_(r[_e].base_,e,t.patches_,t.inversePatches_)):e=Tc(t,r,[]),Gp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Kp?e:void 0}function Tc(e,t,r){if(qc(t))return t;let n=t[_e];if(!n)return Ki(t,(o,a)=>ES(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return kc(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,i=!1;n.type_===3&&(a=new Set(o),o.clear(),i=!0),Ki(a,(s,c)=>ES(e,n,o,s,c,r,i)),kc(e,o,!1),r&&e.patches_&&Hn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function ES(e,t,r,n,o,a,i){if(Je(o)){let s=a&&t&&t.type_!==3&&!Yi(t.assigned_,n)?a.concat(n):void 0,c=Tc(e,o,s);if(kS(r,n,c),Je(c))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(je(o)&&!qc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Tc(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&kc(e,o)}}function kc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Oc(t,r)}function oP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:OS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Jp;r&&(o=[n],a=Xi);let{revoke:i,proxy:s}=Proxy.revocable(o,a);return n.draft_=s,n.revoke_=i,s}var Jp={get(e,t){if(t===_e)return e;let r=$n(e);if(!Yi(r,t))return aP(e,r,t);let n=r[t];return e.finalized_||!je(n)?n:n===Up(e.base_,t)?(_p(e),e.copy_[t]=zp(n,e)):n},has(e,t){return t in $n(e)},ownKeys(e){return Reflect.ownKeys($n(e))},set(e,t,r){let n=qS($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Up($n(e),t),a=o?.[_e];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Zv(r,o)&&(r!==void 0||Yi(e.base_,t)))return!0;_p(e),Hp(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Up(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,_p(e),Hp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$n(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ke(11)},getPrototypeOf(e){return Gn(e.base_)},setPrototypeOf(){ke(12)}},Xi={};Ki(Jp,(e,t)=>{Xi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xi.deleteProperty=function(e,t){return Xi.set.call(this,e,t,void 0)};Xi.set=function(e,t,r){return Jp.set.call(this,e[0],t,r,e[0])};function Up(e,t){let r=e[_e];return(r?$n(r):e)[t]}function aP(e,t,r){let n=qS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function qS(e,t){if(!(t in e))return;let r=Gn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Gn(r)}}function Hp(e){e.modified_||(e.modified_=!0,e.parent_&&Hp(e.parent_))}function _p(e){e.copy_||(e.copy_=jp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let i=this;return function(c=a,...u){return i.produce(c,l=>r.call(this,l,...u))}}typeof r!="function"&&ke(6),n!==void 0&&typeof n!="function"&&ke(7);let o;if(je(t)){let a=wS(this),i=zp(t,void 0),s=!0;try{o=r(i),s=!1}finally{s?Gp(a):Wp(a)}return PS(a,n),IS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Kp&&(o=void 0),this.autoFreeze_&&Oc(o,!0),n){let a=[],i=[];Hn("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else ke(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...s)=>this.produceWithPatches(i,c=>t(c,...s));let n,o;return[this.produce(t,r,(i,s)=>{n=i,o=s}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){je(e)||ke(8),Je(e)&&(e=DS(e));let t=wS(this),r=zp(e,void 0);return r[_e].isManual_=!0,Wp(t),r}finishDraft(e,t){let r=e&&e[_e];(!r||!r.isManual_)&&ke(9);let{scope_:n}=r;return PS(n,t),IS(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Hn("Patches").applyPatches_;return Je(e)?n(e,t):this.produce(e,o=>n(o,t))}};function zp(e,t){let r=Zi(e)?Hn("MapSet").proxyMap_(e,t):es(e)?Hn("MapSet").proxySet_(e,t):oP(e,t);return(t?t.scope_:OS()).drafts_.push(r),r}function DS(e){return Je(e)||ke(10,e),VS(e)}function VS(e){if(!je(e)||qc(e))return e;let t=e[_e],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=jp(e,t.scope_.immer_.useStrictShallowCopy_)}else r=jp(e,!0);return Ki(r,(n,o)=>{kS(r,n,VS(o))}),t&&(t.finalized_=!1),r}function NS(){let t="replace",r="add",n="remove";function o(d,p,f,y){switch(d.type_){case 0:case 2:return i(d,p,f,y);case 1:return a(d,p,f,y);case 3:return s(d,p,f,y)}}function a(d,p,f,y){let{base_:S,assigned_:h}=d,g=d.copy_;g.length<S.length&&([S,g]=[g,S],[f,y]=[y,f]);for(let x=0;x<S.length;x++)if(h[x]&&g[x]!==S[x]){let F=p.concat([x]);f.push({op:t,path:F,value:m(g[x])}),y.push({op:t,path:F,value:m(S[x])})}for(let x=S.length;x<g.length;x++){let F=p.concat([x]);f.push({op:r,path:F,value:m(g[x])})}for(let x=g.length-1;S.length<=x;--x){let F=p.concat([x]);y.push({op:n,path:F})}}function i(d,p,f,y){let{base_:S,copy_:h}=d;Ki(d.assigned_,(g,x)=>{let F=Bp(S,g),I=Bp(h,g),b=x?Yi(S,g)?t:r:n;if(F===I&&b===t)return;let R=p.concat(g);f.push(b===n?{op:b,path:R}:{op:b,path:R,value:I}),y.push(b===r?{op:n,path:R}:b===n?{op:r,path:R,value:m(F)}:{op:t,path:R,value:m(F)})})}function s(d,p,f,y){let{base_:S,copy_:h}=d,g=0;S.forEach(x=>{if(!h.has(x)){let F=p.concat([g]);f.push({op:n,path:F,value:x}),y.unshift({op:r,path:F,value:x})}g++}),g=0,h.forEach(x=>{if(!S.has(x)){let F=p.concat([g]);f.push({op:r,path:F,value:x}),y.unshift({op:n,path:F,value:x})}g++})}function c(d,p,f,y){f.push({op:t,path:[],value:p===Kp?void 0:p}),y.push({op:t,path:[],value:d})}function u(d,p){return p.forEach(f=>{let{path:y,op:S}=f,h=d;for(let I=0;I<y.length-1;I++){let b=Wn(h),R=y[I];typeof R!="string"&&typeof R!="number"&&(R=""+R),(b===0||b===1)&&(R==="__proto__"||R==="constructor")&&ke(19),typeof h=="function"&&R==="prototype"&&ke(19),h=Bp(h,R),typeof h!="object"&&ke(18,y.join("/"))}let g=Wn(h),x=l(f.value),F=y[y.length-1];switch(S){case t:switch(g){case 2:return h.set(F,x);case 3:ke(16);default:return h[F]=x}case r:switch(g){case 1:return F==="-"?h.push(x):h.splice(F,0,x);case 2:return h.set(F,x);case 3:return h.add(x);default:return h[F]=x}case n:switch(g){case 1:return h.splice(F,1);case 2:return h.delete(F);case 3:return h.delete(f.value);default:return delete h[F]}default:ke(17,S)}}),d}function l(d){if(!je(d))return d;if(Array.isArray(d))return d.map(l);if(Zi(d))return new Map(Array.from(d.entries()).map(([f,y])=>[f,l(y)]));if(es(d))return new Set(Array.from(d).map(l));let p=Object.create(Gn(d));for(let f in d)p[f]=l(d[f]);return Yi(d,zi)&&(p[zi]=d[zi]),p}function m(d){return Je(d)?l(d):d}tP("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var Xe=new iP,Rr=Xe.produce,Dc=Xe.produceWithPatches.bind(Xe),SB=Xe.setAutoFreeze.bind(Xe),hB=Xe.setUseStrictShallowCopy.bind(Xe),Xp=Xe.applyPatches.bind(Xe),yB=Xe.createDraft.bind(Xe),CB=Xe.finishDraft.bind(Xe);function sP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function cP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function uP(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var MS=e=>Array.isArray(e)?e:[e];function lP(e){let t=Array.isArray(e[0])?e[0]:e;return uP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function dP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var FB=Symbol();var RB=Object.getPrototypeOf({});var pP=class{constructor(e){this.value=e}deref(){return this.value}},mP=typeof WeakRef<"u"?WeakRef:pP,fP=0,LS=1;function Vc(){return{s:fP,v:void 0,o:null,p:null}}function Oo(e,t={}){let r=Vc(),{resultEqualityCheck:n}=t,o,a=0;function i(){let s=r,{length:c}=arguments;for(let m=0,d=c;m<d;m++){let p=arguments[m];if(typeof p=="function"||typeof p=="object"&&p!==null){let f=s.o;f===null&&(s.o=f=new WeakMap);let y=f.get(p);y===void 0?(s=Vc(),f.set(p,s)):s=y}else{let f=s.p;f===null&&(s.p=f=new Map);let y=f.get(p);y===void 0?(s=Vc(),f.set(p,s)):s=y}}let u=s,l;if(s.s===LS)l=s.v;else if(l=e.apply(null,arguments),a++,n){let m=o?.deref?.()??o;m!=null&&n(m,l)&&(l=m,a!==0&&a--),o=typeof l=="object"&&l!==null||typeof l=="function"?new mP(l):l}return u.s=LS,u.v=l,l}return i.clearCache=()=>{r=Vc(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function QS(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),sP(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let l={...r,...c},{memoize:m,memoizeOptions:d=[],argsMemoize:p=Oo,argsMemoizeOptions:f=[],devModeChecks:y={}}=l,S=MS(d),h=MS(f),g=lP(o),x=m(function(){return a++,u.apply(null,arguments)},...S),F=!0,I=p(function(){i++;let R=dP(g,arguments);return s=x.apply(null,R),s},...h);return Object.assign(I,{resultFunc:u,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var Y=QS(Oo),gP=Object.assign((e,t=Y)=>{cP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((i,s,c)=>(i[r[c]]=s,i),{}))},{withTypes:()=>gP});function BS(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var US=BS(),_S=BS;var SP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ko:ko.apply(null,arguments)},qB=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},hP=e=>e&&typeof e.match=="function";function C(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(At(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Ec(n)&&n.type===e,r}var HS=class ts extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ts.prototype)}static get[Symbol.species](){return ts}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ts(...t[0].concat(this)):new ts(...t.concat(this))}};function jS(e){return je(e)?Rr(e,()=>{}):e}function $S(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function yP(e){return typeof e=="boolean"}var CP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new HS;return r&&(yP(r)?i.push(US):i.push(_S(r.extraArgument))),i},Gr="RTK_autoBatch",Do=()=>e=>({payload:e,meta:{[Gr]:!0}}),GS=e=>t=>{setTimeout(t,e)},xP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:GS(10):e.type==="callback"?e.queueNotification:GS(e.timeout),u=()=>{i=!1,a&&(a=!1,s.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){let m=()=>o&&l(),d=n.subscribe(m);return s.add(l),()=>{d(),s.delete(l)}},dispatch(l){try{return o=!l?.meta?.[Gr],a=!o,a&&(i||(i=!0,c(u))),n.dispatch(l)}finally{o=!0}}})},AP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new HS(e);return n&&o.push(xP(typeof n=="object"?n:void 0)),o};function zS(e){let t=CP(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:i=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=To(r);else throw new Error(At(1));let c;typeof n=="function"?c=n(t):c=t();let u=ko;o&&(u=SP({trace:!1,...typeof o=="object"&&o}));let l=vS(...c),m=AP(l),d=typeof i=="function"?i(m):m(),p=u(...d);return Qp(s,a,p)}function KS(e){let t={},r=[],n,o={addCase(a,i){let s=typeof a=="string"?a:a.type;if(!s)throw new Error(At(28));if(s in t)throw new Error(At(29));return t[s]=i,o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function FP(e){return typeof e=="function"}function _(e,t){let[r,n,o]=KS(t),a;if(FP(e))a=()=>jS(e());else{let s=jS(e);a=()=>s}function i(s=a(),c){let u=[r[c.type],...n.filter(({matcher:l})=>l(c)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[o]),u.reduce((l,m)=>{if(m)if(Je(l)){let p=m(l,c);return p===void 0?l:p}else{if(je(l))return Rr(l,d=>m(d,c));{let d=m(l,c);if(d===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return l},s)}return i.getInitialState=a,i}var YS=(e,t)=>hP(e)?e.match(t):e(t);function Dt(...e){return t=>e.some(r=>YS(r,t))}function qo(...e){return t=>e.every(r=>YS(r,t))}function Mc(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function rs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Lc(...e){return e.length===0?t=>Mc(t,["pending"]):rs(e)?Dt(...e.map(t=>t.pending)):Lc()(e[0])}function zn(...e){return e.length===0?t=>Mc(t,["rejected"]):rs(e)?Dt(...e.map(t=>t.rejected)):zn()(e[0])}function ns(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?qo(zn(...e),t):rs(e)?qo(zn(...e),t):ns()(e[0])}function br(...e){return e.length===0?t=>Mc(t,["fulfilled"]):rs(e)?Dt(...e.map(t=>t.fulfilled)):br()(e[0])}function Qc(...e){return e.length===0?t=>Mc(t,["pending","fulfilled","rejected"]):rs(e)?Dt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Qc()(e[0])}var RP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Bc=(e=21)=>{let t="",r=e;for(;r--;)t+=RP[Math.random()*64|0];return t},bP=["name","message","stack","code"],Zp=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},WS=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},vP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of bP)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},G=(()=>{function e(t,r,n){let o=C(t+"/fulfilled",(c,u,l,m)=>({payload:c,meta:{...m||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),a=C(t+"/pending",(c,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:c,requestStatus:"pending"}})),i=C(t+"/rejected",(c,u,l,m,d)=>({payload:m,error:(n&&n.serializeError||vP)(c||"Rejected"),meta:{...d||{},arg:l,requestId:u,rejectedWithValue:!!m,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,l,m)=>{let d=n?.idGenerator?n.idGenerator(c):Bc(),p=new AbortController,f,y;function S(g){y=g,p.abort()}let h=async function(){let g;try{let F=n?.condition?.(c,{getState:l,extra:m});if(wP(F)&&(F=await F),F===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let I=new Promise((b,R)=>{f=()=>{R({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",f)});u(a(d,c,n?.getPendingMeta?.({requestId:d,arg:c},{getState:l,extra:m}))),g=await Promise.race([I,Promise.resolve(r(c,{dispatch:u,getState:l,extra:m,requestId:d,signal:p.signal,abort:S,rejectWithValue:(b,R)=>new Zp(b,R),fulfillWithValue:(b,R)=>new WS(b,R)})).then(b=>{if(b instanceof Zp)throw b;return b instanceof WS?o(b.payload,d,c,b.meta):o(b,d,c)})])}catch(F){g=F instanceof Zp?i(null,d,c,F.payload,F.meta):i(F,d,c)}finally{f&&p.signal.removeEventListener("abort",f)}return n&&!n.dispatchConditionRejection&&i.match(g)&&g.meta.condition||u(g),g}();return Object.assign(h,{abort:S,requestId:d,arg:c,unwrap(){return h.then(PP)}})}}return Object.assign(s,{pending:a,rejected:i,fulfilled:o,settled:Dt(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function PP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function wP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var JS=Symbol.for("rtk-slice-createasyncthunk"),LB={[JS]:G};function IP(e,t){return`${e}/${t}`}function EP({creators:e}={}){let t=e?.asyncThunk?.[JS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(At(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(kP()):n.reducers)||{},s=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(g,x){let F=typeof g=="string"?g:g.type;if(!F)throw new Error(At(12));if(F in c.sliceCaseReducersByType)throw new Error(At(13));return c.sliceCaseReducersByType[F]=x,u},addMatcher(g,x){return c.sliceMatchers.push({matcher:g,reducer:x}),u},exposeAction(g,x){return c.actionCreators[g]=x,u},exposeCaseReducer(g,x){return c.sliceCaseReducersByName[g]=x,u}};s.forEach(g=>{let x=i[g],F={reducerName:g,type:IP(o,g),createNotation:typeof n.reducers=="function"};qP(x)?VP(F,x,u,t):OP(F,x,u)});function l(){let[g={},x=[],F=void 0]=typeof n.extraReducers=="function"?KS(n.extraReducers):[n.extraReducers],I={...g,...c.sliceCaseReducersByType};return _(n.initialState,b=>{for(let R in I)b.addCase(R,I[R]);for(let R of c.sliceMatchers)b.addMatcher(R.matcher,R.reducer);for(let R of x)b.addMatcher(R.matcher,R.reducer);F&&b.addDefaultCase(F)})}let m=g=>g,d=new Map,p;function f(g,x){return p||(p=l()),p(g,x)}function y(){return p||(p=l()),p.getInitialState()}function S(g,x=!1){function F(b){let R=b[g];return typeof R>"u"&&x&&(R=y()),R}function I(b=m){let R=$S(d,x,()=>new WeakMap);return $S(R,b,()=>{let E={};for(let[w,T]of Object.entries(n.selectors??{}))E[w]=TP(T,b,y,x);return E})}return{reducerPath:g,getSelectors:I,get selectors(){return I(F)},selectSlice:F}}let h={name:o,reducer:f,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...S(a),injectInto(g,{reducerPath:x,...F}={}){let I=x??a;return g.inject({reducerPath:I,reducer:f},F),{...h,...S(I,!0)}}};return h}}function TP(e,t,r,n){function o(a,...i){let s=t(a);return typeof s>"u"&&n&&(s=r()),e(s,...i)}return o.unwrapped=e,o}var Kn=EP();function kP(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function OP({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!DP(n))throw new Error(At(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?C(e,i):C(e))}function qP(e){return e._reducerDefinitionType==="asyncThunk"}function DP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function VP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(At(18));let{payloadCreator:a,fulfilled:i,pending:s,rejected:c,settled:u,options:l}=r,m=o(e,a,l);n.exposeAction(t,m),i&&n.addCase(m.fulfilled,i),s&&n.addCase(m.pending,s),c&&n.addCase(m.rejected,c),u&&n.addMatcher(m.settled,u),n.exposeCaseReducer(t,{fulfilled:i||Nc,pending:s||Nc,rejected:c||Nc,settled:u||Nc})}function Nc(){}var XS="listener",ZS="completed",eh="cancelled",QB=`task-${eh}`,BB=`task-${ZS}`,UB=`${XS}-${eh}`,_B=`${XS}-${ZS}`;var{assign:th}=Object;var em="listenerMiddleware";var NP=th(C(`${em}/add`),{withTypes:()=>NP}),jB=C(`${em}/removeAll`),MP=th(C(`${em}/remove`),{withTypes:()=>MP});var $B=Symbol.for("rtk-state-proxy-original");function At(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. `}function LP({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;i!=="disabled"&&(n.call(r),t.send(o,a,r))}var QP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function BP(e){return typeof e=="string"&&QP.test(e)}var Oe=[];for(let e=0;e<256;++e)Oe.push((e+256).toString(16).slice(1));function UP(e,t=0){return(Oe[e[t+0]]+Oe[e[t+1]]+Oe[e[t+2]]+Oe[e[t+3]]+"-"+Oe[e[t+4]]+Oe[e[t+5]]+"-"+Oe[e[t+6]]+Oe[e[t+7]]+"-"+Oe[e[t+8]]+Oe[e[t+9]]+"-"+Oe[e[t+10]]+Oe[e[t+11]]+Oe[e[t+12]]+Oe[e[t+13]]+Oe[e[t+14]]+Oe[e[t+15]]).toLowerCase()}var tm,_P=new Uint8Array(16);function jP(){if(!tm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tm=crypto.getRandomValues.bind(crypto)}return tm(_P)}var $P=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rh={randomUUID:$P};function GP(e,t,r){if(rh.randomUUID&&!e)return rh.randomUUID();e=e||{};let n=e.random??e.rng?.()??jP();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,UP(n)}function WP(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&BP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var oh="1.0.0";function HP(e){let{trackingId:t}=e;return{trackingId:t}}function zP(e){return(e.source||[]).concat([`relay@${oh}`])}function ah(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:i}=r,s=HP(t),c=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:zP(t),clientId:c,userAgent:i(),referrer:o(),location:a()})}function KP(e,t,r,n,o){return{...t,meta:ah(e,r,n,o)}}var YP="*";function JP(){let e=[];function t({type:c,callback:u}){return e.findIndex(l=>l.type===c&&l.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(l){console.error(l)}})}function a(c){if(c===YP)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function i(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?i({type:c,callback:u}):a(c)}return{add:n,call:o,remove:s}}function nh({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...!!n.mode&&{mode:n.mode},...!!n.source&&{source:n.source}})}function XP(e){let t=nh(e);return{get:()=>t,update:r=>{t=nh({...t,...r})}}}function ZP(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var rm=ew();function ew(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function tw(){return{getItem(e){return rm.getItem(e)||localStorage.getItem(e)},removeItem(e){rm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),rm.setItem(e,t,31556952e3)}}}function rw(){let e=document.referrer;return e===""?null:e}function nw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(ZP().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:()=>rw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>GP(),storage:tw()}}function ow(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function aw(){return{getItem(){return null},removeItem(){},setItem(){}}}function iw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:aw()}}function sw(e){return e.get().mode!=="disabled"&&cw()&&ow()?nw():iw()}function cw(){try{return typeof window=="object"}catch{return!1}}function uw(e){return{get:()=>Object.freeze(sw(e))}}function ih(e){let t=XP(e),r=JP(),n=uw(t),o=WP(n);return{emit:(a,i)=>{let s=t.get(),c=n.get(),u=KP(a,i,s,c,o);return LP({config:s,environment:c,event:u,listenerManager:r})},getMeta:a=>ah(a,t.get(),n.get(),o),on:(a,i)=>r.add({type:a,callback:i}),off:(a,i)=>r.remove(a,i),updateConfig:a=>t.update(a),version:oh}}var Yn="3.19.0-pre.d54cb5306e",sh=["@coveo/atomic","@coveo/quantic"];var Wr=Y(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Yn}`));var Vo=Y(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Wr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i)=>ih({mode:a?"emit":"disabled",url:o??Mp(e,t),token:r,trackingId:n,source:i}));function vr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function v(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function s(l){try{u(n.next(l))}catch(m){i(m)}}function c(l){try{u(n.throw(l))}catch(m){i(m)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var X;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(X||(X={}));function am(){return typeof window<"u"}function ym(){return typeof navigator<"u"}function No(){return typeof document<"u"}function im(){try{return typeof localStorage<"u"}catch{return!1}}function lw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Ah(){return ym()&&navigator.cookieEnabled}var dw=[X.click,X.custom,X.search,X.view],pw=(e,t)=>dw.indexOf(e)!==-1?Object.assign({language:No()?document.documentElement.lang:"unknown",userAgent:ym()?navigator.userAgent:"unknown"},t):t,is=class e{static set(t,r,n){var o,a,i,s;n&&(a=new Date,a.setTime(a.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?ch(t,r,a):(i=s.split("."),o=i[i.length-2]+"."+i[i.length-1],ch(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function ch(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function mw(){return im()?localStorage:Ah()?new ss:lw()?sessionStorage:new Lo}var ss=class e{getItem(t){return is.get(`${e.prefix}${t}`)}removeItem(t){is.erase(`${e.prefix}${t}`)}setItem(t,r,n){is.set(`${e.prefix}${t}`,r,n)}};ss.prefix="coveo_";var sm=class{constructor(){this.cookieStorage=new ss}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Lo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},os="__coveo.analytics.history",Fh=20,Rh=1e3*60,bh=75,Qo=class{constructor(t){this.store=t||mw()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return v(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return v(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(os);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return v(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(os);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(os,JSON.stringify(t.slice(0,Fh)))}catch{}}clear(){try{this.store.removeItem(os)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,bh)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Rh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},vh=Object.freeze({__proto__:null,HistoryStore:Qo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Fh,MAX_VALUE_SIZE:bh,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:Rh,STORE_KEY:os,default:Qo}),fw=(e,t)=>v(void 0,void 0,void 0,function*(){return e===X.view?(yield gw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),gw=e=>v(void 0,void 0,void 0,function*(){let t=new Qo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Uc,Sw=new Uint8Array(16);function hw(){if(!Uc&&(Uc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Uc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Uc(Sw)}var yw=/^(?:[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 jc(e){return typeof e=="string"&&yw.test(e)}var qe=[];for(let e=0;e<256;++e)qe.push((e+256).toString(16).slice(1));function Ph(e,t=0){return(qe[e[t+0]]+qe[e[t+1]]+qe[e[t+2]]+qe[e[t+3]]+"-"+qe[e[t+4]]+qe[e[t+5]]+"-"+qe[e[t+6]]+qe[e[t+7]]+"-"+qe[e[t+8]]+qe[e[t+9]]+"-"+qe[e[t+10]]+qe[e[t+11]]+qe[e[t+12]]+qe[e[t+13]]+qe[e[t+14]]+qe[e[t+15]]).toLowerCase()}function Cw(e){if(!jc(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function xw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Aw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Fw="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Rw(e,t,r){function n(o,a,i,s){var c;if(typeof o=="string"&&(o=xw(o)),typeof a=="string"&&(a=Cw(a)),((c=a)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(a),u.set(o,a.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,i){s=s||0;for(let l=0;l<16;++l)i[s+l]=u[l];return i}return Ph(u)}try{n.name=e}catch{}return n.DNS=Aw,n.URL=Fw,n}var bw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),uh={randomUUID:bw};function Jn(e,t,r){if(uh.randomUUID&&!t&&!e)return uh.randomUUID();e=e||{};let n=e.random||(e.rng||hw)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Ph(n)}function vw(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function nm(e,t){return e<<t|e>>>32-t}function Pw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let s=0;s<i.length;++s)e.push(i.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[i*64+c*4]<<24|e[i*64+c*4+1]<<16|e[i*64+c*4+2]<<8|e[i*64+c*4+3];a[i]=s}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let s=new Uint32Array(80);for(let p=0;p<16;++p)s[p]=a[i][p];for(let p=16;p<80;++p)s[p]=nm(s[p-3]^s[p-8]^s[p-14]^s[p-16],1);let c=r[0],u=r[1],l=r[2],m=r[3],d=r[4];for(let p=0;p<80;++p){let f=Math.floor(p/20),y=nm(c,5)+vw(f,u,l,m)+d+t[f]+s[p]>>>0;d=m,m=l,l=nm(u,30)>>>0,u=c,c=y}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+d>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var ww=Rw("v5",80,Pw),lh=ww,wh="2.30.43",dh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,as={pageview:"pageview",event:"event"},$c=class{constructor({client:t,uuidGenerator:r=Jn}){this.client=t,this.uuidGenerator=r}},cm=class extends $c{constructor({client:t,uuidGenerator:r=Jn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=dh(window.location),this.lastReferrer=No()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:No()?document.title:"",encoding:No()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===as.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===as.pageview?this.nextPageViewId:this.pageViewId,referrer:t===as.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===as.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return dh(window.location)}},Hr=class e{constructor(t,r){if(!jc(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return jc(a)?new e(a,Number.parseInt(o)*1e3):null}};Hr.cvo_cid="cvo_cid";Hr.expirationTime=120;var um=class extends $c{constructor({client:t,uuidGenerator:r=Jn}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return v(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Hr.cvo_cid,new Hr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};um.Id="link";var at=Object.keys;function _c(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var om=128,Ih=192,ph=224,mh=240;function Iw(e){return(e&248)===mh?4:(e&mh)===ph?3:(e&ph)===Ih?2:1}function Ew(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&om)!=om)break;if(r-=3,(n&Ih)!=om){t-r>=Iw(n)*3&&(r=t);break}}return e.substring(0,r)}var lm={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"},Tw=at(lm).map(e=>lm[e]),kw=[...Tw].join("|"),Ow=new RegExp(`^(${kw}$)`),qw={svcAction:"svc_action",svcActionData:"svc_action_data"},Dw=e=>at(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=lm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Vw=e=>Ow.test(e),Nw=[Vw],fh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ve={action:"pa",list:"pal",listSource:"pls"},Gc={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Mw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],dm={id:"quoteId",affiliation:"quoteAffiliation"},pm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Lw={add:Ve,bookmark_add:Ve,bookmark_remove:Ve,click:Ve,checkout:Ve,checkout_option:Ve,detail:Ve,impression:Ve,remove:Ve,refund:Object.assign(Object.assign({},Ve),Gc),purchase:Object.assign(Object.assign({},Ve),Gc),quickview:Ve,quote:Object.assign(Object.assign({},Ve),dm),review:Object.assign(Object.assign({},Ve),pm)},Qw=at(fh).map(e=>fh[e]),Bw=at(gh).map(e=>gh[e]),Uw=at(Ve).map(e=>Ve[e]),_w=at(Gc).map(e=>Gc[e]),jw=at(pm).map(e=>pm[e]),$w=at(dm).map(e=>dm[e]),Gw=[...Qw,"custom"].join("|"),Ww=[...Bw,"custom"].join("|"),Eh="(pr[0-9]+)",Th="(il[0-9]+pi[0-9]+)",Hw=new RegExp(`^${Eh}(${Gw})$`),zw=new RegExp(`^(${Th}(${Ww}))|(il[0-9]+nm)$`),Kw=new RegExp(`^(${Uw.join("|")})$`),Yw=new RegExp(`^(${_w.join("|")})$`),Jw=new RegExp(`^${Eh}custom$`),Xw=new RegExp(`^${Th}custom$`),Zw=new RegExp(`^(${[...Mw,...jw,...$w].join("|")})$`),eI=e=>Hw.test(e),tI=e=>zw.test(e),rI=e=>Kw.test(e),nI=e=>Yw.test(e),oI=e=>Zw.test(e),aI=[tI,eI,rI,nI,oI],iI=[Jw,Xw],sI={anonymizeIp:"aip"},cI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},uI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},lI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],dI=Object.assign(Object.assign(Object.assign(Object.assign({},sI),cI),uI),lI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),mm=Object.assign(Object.assign({},dI),qw),pI=e=>{let t=!!e.action&&Lw[e.action]||{};return at(e).reduce((r,n)=>{let o=t[n]||mm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},mI=at(mm).map(e=>mm[e]),fI=e=>mI.indexOf(e)!==-1,gI=e=>e==="custom",SI=e=>[...aI,...Nw,fI,gI].some(t=>t(e)),hI=e=>at(e).reduce((t,r)=>{let n=yI(r);return n?Object.assign(Object.assign({},t),CI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),yI=e=>{let t;return[...iI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},CI=(e,t)=>at(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),fm=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return v(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=i;o=s||t;try{a=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return v(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},gm=class{sendEvent(t,r){return v(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){return Promise.resolve()})}},Sh=globalThis.fetch,Wc=class{constructor(t){this.opts=t}sendEvent(t,r){return v(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),a?yield a(s,"analyticsFetch"):{}),{url:u}=c,l=vr(c,["url"]),m;try{m=yield Sh(u,l)}catch(d){console.error("An error has occured when sending the event.",d);return}if(m.ok){let d=yield m.json();return d.visitorId&&o.setCurrentVisitorId(d.visitorId),d}else{try{m.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,m,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return v(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Sh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return v(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Sm=class{constructor(t,r){im()&&Ah()?this.storage=new sm:im()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Lo),this.client=new Wc(t),this.beaconClient=new fm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},hm=class{constructor(t,r){this.storage=r||new Lo,this.client=new Wc(t)}getClientDependingOnEventType(t){return this.client}},Hc=class{constructor(){this.storage=new Lo,this.client=new gm}getClientDependingOnEventType(t){return this.client}},xI="xx",AI=e=>e?.startsWith(xI)||!1,FI=`
20
20
  We've detected you're using React Native but have not provided the corresponding runtime,
21
21
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
22
22
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native