@coveo/headless 3.13.1-pre.cf8bb8919d → 3.13.1-pre.db77dd01fb

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 (35) 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/parsed_doc.json +136 -136
  24. package/dist/quantic/case-assist/headless.js +1 -1
  25. package/dist/quantic/commerce/headless.js +1 -1
  26. package/dist/quantic/headless.js +1 -1
  27. package/dist/quantic/insight/headless.js +1 -1
  28. package/dist/quantic/recommendation/headless.js +1 -1
  29. package/dist/recommendation/headless.cjs +1 -1
  30. package/dist/recommendation/headless.esm.js +1 -1
  31. package/dist/ssr/headless.cjs +1 -1
  32. package/dist/ssr/headless.esm.js +1 -1
  33. package/dist/ssr-commerce/headless.cjs +1 -1
  34. package/dist/ssr-commerce/headless.esm.js +1 -1
  35. package/package.json +1 -1
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  var kb=Object.create;var gc=Object.defineProperty;var qb=Object.getOwnPropertyDescriptor;var Db=Object.getOwnPropertyNames;var Vb=Object.getPrototypeOf,Nb=Object.prototype.hasOwnProperty;var Mb=(e,t,r)=>t in e?gc(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),Lb=(e,t)=>{for(var r in t)gc(e,r,{get:t[r],enumerable:!0})},Qb=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Db(t))!Nb.call(e,o)&&o!==r&&gc(e,o,{get:()=>t[o],enumerable:!(n=qb(t,o))||n.enumerable});return e};var Ot=(e,t,r)=>(r=e!=null?kb(Vb(e)):{},Qb(t||!e||!e.__esModule?gc(r,"default",{value:e,enumerable:!0}):r,e));var pe=(e,t,r)=>Mb(e,typeof t!="symbol"?t+"":t,r);var Zg=Ee(Ui=>{"use strict";var Ac=Ui&&Ui.__assign||function(){return Ac=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},Ac.apply(this,arguments)};Object.defineProperty(Ui,"__esModule",{value:!0});var Jb={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Xb(e){var t=Ac(Ac({},Jb),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Ui.getSanitizedOptions=Xb});var eS=Ee(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});function Zb(e){var t=Math.random()*e;return Math.round(t)}Ip.fullJitter=Zb});var tS=Ee(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});function ev(e){return e}Ep.noJitter=ev});var rS=Ee(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});var tv=eS(),rv=tS();function nv(e){switch(e.jitter){case"full":return tv.fullJitter;case"none":default:return rv.noJitter}}Tp.JitterFactory=nv});var kp=Ee(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var ov=rS(),av=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=ov.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=av});var nS=Ee(xr=>{"use strict";var iv=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)}}(),sv=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(p){i(p)}}function c(l){try{u(n.throw(l))}catch(p){i(p)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},cv=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 uv=kp(),lv=function(e){iv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return sv(this,void 0,void 0,function(){return cv(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}(uv.Delay);xr.SkipFirstDelay=lv});var oS=Ee(_i=>{"use strict";var dv=_i&&_i.__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(_i,"__esModule",{value:!0});var pv=kp(),mv=function(e){dv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(pv.Delay);_i.AlwaysDelay=mv});var aS=Ee(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});var fv=nS(),gv=oS();function Sv(e,t){var r=hv(e);return r.setAttemptNumber(t),r}qp.DelayFactory=Sv;function hv(e){return e.delayFirstAttempt?new gv.AlwaysDelay(e):new fv.SkipFirstDelay(e)}});var iS=Ee(Bn=>{"use strict";var Dp=Bn&&Bn.__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(p){i(p)}}function c(l){try{u(n.throw(l))}catch(p){i(p)}}function u(l){l.done?a(l.value):o(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Vp=Bn&&Bn.__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(Bn,"__esModule",{value:!0});var yv=Zg(),Cv=aS();function xv(e,t){return t===void 0&&(t={}),Dp(this,void 0,void 0,function(){var r,n;return Vp(this,function(o){switch(o.label){case 0:return r=yv.getSanitizedOptions(t),n=new Av(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Bn.backOff=xv;var Av=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Dp(this,void 0,void 0,function(){var t,r;return Vp(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 Dp(this,void 0,void 0,function(){var t;return Vp(this,function(r){switch(r.label){case 0:return t=Cv.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var lu=Ee((Mm,Lm)=>{"use strict";(function(e,t){typeof Mm=="object"&&typeof Lm<"u"?Lm.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Mm,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",p="year",d="date",m="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(k){var O=["th","st","nd","rd"],T=k%100;return"["+k+(O[(T-20)%10]||O[T]||O[0])+"]"}},h=function(k,O,T){var Q=String(k);return!Q||Q.length>=O?k:""+Array(O+1-Q.length).join(T)+k},g={s:h,z:function(k){var O=-k.utcOffset(),T=Math.abs(O),Q=Math.floor(T/60),L=T%60;return(O<=0?"+":"-")+h(Q,2,"0")+":"+h(L,2,"0")},m:function k(O,T){if(O.date()<T.date())return-k(T,O);var Q=12*(T.year()-O.year())+(T.month()-O.month()),L=O.clone().add(Q,u),W=T-L<0,j=O.clone().add(Q+(W?-1:1),u);return+(-(Q+(T-L)/(W?L-j:j-L))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:u,y:p,w:c,d:s,D:d,h:i,m:a,s:o,ms:n,Q:l}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},x="en",R={};R[x]=S;var E="$isDayjsObject",b=function(k){return k instanceof N||!(!k||!k[E])},F=function k(O,T,Q){var L;if(!O)return x;if(typeof O=="string"){var W=O.toLowerCase();R[W]&&(L=W),T&&(R[W]=T,L=W);var j=O.split("-");if(!L&&j.length>1)return k(j[0])}else{var K=O.name;R[K]=O,L=K}return!Q&&L&&(x=L),L||!Q&&x},I=function(k,O){if(b(k))return k.clone();var T=typeof O=="object"?O:{};return T.date=k,T.args=arguments,new N(T)},v=g;v.l=F,v.i=b,v.w=function(k,O){return I(k,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var N=function(){function k(T){this.$L=F(T.locale,null,!0),this.parse(T),this.$x=this.$x||T.x||{},this[E]=!0}var O=k.prototype;return O.parse=function(T){this.$d=function(Q){var L=Q.date,W=Q.utc;if(L===null)return new Date(NaN);if(v.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)}(T),this.init()},O.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},O.$utils=function(){return v},O.isValid=function(){return this.$d.toString()!==m},O.isSame=function(T,Q){var L=I(T);return this.startOf(Q)<=L&&L<=this.endOf(Q)},O.isAfter=function(T,Q){return I(T)<this.startOf(Q)},O.isBefore=function(T,Q){return this.endOf(Q)<I(T)},O.$g=function(T,Q,L){return v.u(T)?this[Q]:this.set(L,T)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(T,Q){var L=this,W=!!v.u(Q)||Q,j=v.p(T),K=function(Tt,Ie){var rt=v.w(L.$u?Date.UTC(L.$y,Ie,Tt):new Date(L.$y,Ie,Tt),L);return W?rt:rt.endOf(s)},Z=function(Tt,Ie){return v.w(L.toDate()[Tt].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 p: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,Qn=(re<we?re+7:re)-we;return K(W?ae-Qn:ae+(6-Qn),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(T){return this.startOf(T,!1)},O.$set=function(T,Q){var L,W=v.p(T),j="set"+(this.$u?"UTC":""),K=(L={},L[s]=j+"Date",L[d]=j+"Date",L[u]=j+"Month",L[p]=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===p){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(T,Q){return this.clone().$set(T,Q)},O.get=function(T){return this[v.p(T)]()},O.add=function(T,Q){var L,W=this;T=Number(T);var j=v.p(Q),K=function(oe){var ae=I(W);return v.w(ae.date(ae.date()+Math.round(oe*T)),W)};if(j===u)return this.set(u,this.$M+T);if(j===p)return this.set(p,this.$y+T);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()+T*Z;return v.w(re,this)},O.subtract=function(T,Q){return this.add(-1*T,Q)},O.format=function(T){var Q=this,L=this.$locale();if(!this.isValid())return L.invalidDate||m;var W=T||"YYYY-MM-DDTHH:mm:ssZ",j=v.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)},Qn=function(Ie){return v.s(K%12||12,Ie,"0")},Tt=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 v.s(Q.$y,4,"0");case"M":return re+1;case"MM":return v.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 v.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 v.s(K,2,"0");case"h":return Qn(1);case"hh":return Qn(2);case"a":return Tt(K,Z,!0);case"A":return Tt(K,Z,!1);case"m":return String(Z);case"mm":return v.s(Z,2,"0");case"s":return String(Q.$s);case"ss":return v.s(Q.$s,2,"0");case"SSS":return v.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(T,Q,L){var W,j=this,K=v.p(Q),Z=I(T),re=(Z.utcOffset()-this.utcOffset())*t,oe=this-Z,ae=function(){return v.m(j,Z)};switch(K){case p: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:v.a(W)},O.daysInMonth=function(){return this.endOf(u).$D},O.$locale=function(){return R[this.$L]},O.locale=function(T,Q){if(!T)return this.$L;var L=this.clone(),W=F(T,Q,!0);return W&&(L.$L=W),L},O.clone=function(){return v.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()},k}(),_=N.prototype;return I.prototype=_,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",s],["$M",u],["$y",p],["$D",d]].forEach(function(k){_[k[1]]=function(O){return this.$g(O,k[0],k[1])}}),I.extend=function(k,O){return k.$i||(k(O,N,I),k.$i=!0),I},I.locale=F,I.isDayjs=b,I.unix=function(k){return I(1e3*k)},I.en=R[x],I.Ls=R,I.p={},I})});var my=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_plugin_quarterOfYear=t()})(Qm,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 p=this.quarter()-1;return l?this.month(3*p).startOf(e).startOf("day"):this.month(3*p+2).endOf(e).endOf("day")}return i.bind(this)(s,c)}}})});var fy=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_customParseFormat=t()})(Um,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))},p=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=p(f,!1)}],a:[a,function(f){this.afternoon=p(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 m(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(I,v,N){var _=N&&N.toUpperCase();return v||S[N]||e[N]||S[_].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(k,O,T){return O||T.slice(1)})})).match(t),g=h.length,x=0;x<g;x+=1){var R=h[x],E=d[R],b=E&&E[0],F=E&&E[1];h[x]=F?{regex:b,parser:F}:R.replace(/^\[|\]$/g,"")}return function(I){for(var v={},N=0,_=0;N<g;N+=1){var k=h[N];if(typeof k=="string")_+=k.length;else{var O=k.regex,T=k.parser,Q=I.slice(_),L=O.exec(Q)[0];T.call(v,L),I=I.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}}(v),v}}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 R=x.date,E=x.utc,b=x.args;this.$u=E;var F=b[1];if(typeof F=="string"){var I=b[2]===!0,v=b[3]===!0,N=I||v,_=b[2];v&&(_=b[2]),i=this.$locale(),!I&&_&&(i=S.Ls[_]),this.$d=function(Q,L,W,j){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*Q);var K=m(L)(Q),Z=K.year,re=K.month,oe=K.day,ae=K.hours,de=K.minutes,we=K.seconds,Qn=K.milliseconds,Tt=K.zone,Ie=K.week,rt=new Date,Cr=oe||(Z||re?1:rt.getDate()),Qr=Z||rt.getFullYear(),mc=0;Z&&!re||(mc=re>0?re-1:rt.getMonth());var fc,Cp=ae||0,xp=de||0,Ap=we||0,Fp=Qn||0;return Tt?new Date(Date.UTC(Qr,mc,Cr,Cp,xp,Ap,Fp+60*Tt.offset*1e3)):W?new Date(Date.UTC(Qr,mc,Cr,Cp,xp,Ap,Fp)):(fc=new Date(Qr,mc,Cr,Cp,xp,Ap,Fp),Ie&&(fc=j(fc).week(Ie).toDate()),fc)}catch{return new Date("")}}(R,F,E,S),this.init(),_&&_!==!0&&(this.$L=this.locale(_).$L),N&&R!=this.format(F)&&(this.$d=new Date("")),i={}}else if(F instanceof Array)for(var k=F.length,O=1;O<=k;O+=1){b[1]=F[O-1];var T=S.apply(this,b);if(T.isValid()){this.$d=T.$d,this.$L=T.$L,this.init();break}O===k&&(this.$d=new Date(""))}else g.call(this,x)}}})});var IC=Ee((jH,wC)=>{"use strict";var cO=/(^|; )Coveo-Pendragon=([^;]*)/;wC.exports=()=>cO.exec(document.cookie)?.pop()||null});var EC=Ee((mf,ff)=>{"use strict";(function(e,t){typeof mf=="object"&&typeof ff<"u"?ff.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_timezone=t()})(mf,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,p,d){d===void 0&&(d={});var m=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}(p,d);return f.formatToParts(m)},s=function(l,p){for(var d=i(l,p),m=[],f=0;f<d.length;f+=1){var y=d[f],S=y.type,h=y.value,g=e[S];g>=0&&(m[g]=parseInt(h,10))}var x=m[3],R=x===24?0:x,E=m[0]+"-"+m[1]+"-"+m[2]+" "+R+":"+m[4]+":"+m[5]+":000",b=+l;return(o.utc(E).valueOf()-(b-=b%1e3))/6e4},c=n.prototype;c.tz=function(l,p){l===void 0&&(l=a);var d,m=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,p);else if(d=o(y,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(h,!0),p){var g=d.utcOffset();d=d.add(m-g,"minute")}return d.$x.$timezone=l,d},c.offsetName=function(l){var p=this.$x.$timezone||o.tz.guess(),d=i(this.valueOf(),p,{timeZoneName:l}).find(function(m){return m.type.toLowerCase()==="timezonename"});return d&&d.value};var u=c.startOf;c.startOf=function(l,p){if(!this.$x||!this.$x.$timezone)return u.call(this,l,p);var d=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(d,l,p).tz(this.$x.$timezone,!0)},o.tz=function(l,p,d){var m=d&&p,f=d||p||a,y=s(+o(),f);if(typeof l!="string")return o(l).tz(f);var S=function(R,E,b){var F=R-60*E*1e3,I=s(F,b);if(E===I)return[F,E];var v=s(F-=60*(I-E)*1e3,b);return I===v?[F,I]:[R-60*Math.min(I,v)*1e3,Math.max(I,v)]}(o.utc(l,m).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 TC=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_utc=t()})(gf,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(m){var f={date:m,utc:!0,args:arguments};return new o(f)},i.utc=function(m){var f=a(this.toDate(),{locale:this.$L,utc:!0});return m?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(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),s.call(this,m)};var c=i.init;i.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else c.call(this)};var u=i.utcOffset;i.utcOffset=function(m,f){var y=this.$utils().u;if(y(m))return this.$u?0:y(this.$offset)?u.call(this):this.$offset;if(typeof m=="string"&&(m=function(x){x===void 0&&(x="");var R=x.match(t);if(!R)return null;var E=(""+R[0]).match(r)||["-",0,0],b=E[0],F=60*+E[1]+ +E[2];return F===0?0:b==="+"?F:-F}(m),m===null))return this;var S=Math.abs(m)<=16?60*m:m,h=this;if(f)return h.$offset=S,h.$u=m===0,h;if(m!==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(m){var f=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,f)},i.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var p=i.toDate;i.toDate=function(m){return m==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var d=i.diff;i.diff=function(m,f,y){if(m&&this.$u===m.$u)return d.call(this,m,f,y);var S=this.local(),h=a(m).local();return d.call(S,h,f,y)}}})});var _C=Ee((Jz,UC)=>{"use strict";function xO(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}UC.exports=AO;function AO(e,t,r){var n=r&&r.stringify||xO,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,p=-1,d=e&&e.length||0,m=0;m<d;){if(e.charCodeAt(m)===37&&m+1<d){switch(p=p>-1?p:0,e.charCodeAt(m+1)){case 100:case 102:if(l>=c||t[l]==null)break;p<m&&(u+=e.slice(p,m)),u+=Number(t[l]),p=m+2,m++;break;case 105:if(l>=c||t[l]==null)break;p<m&&(u+=e.slice(p,m)),u+=Math.floor(Number(t[l])),p=m+2,m++;break;case 79:case 111:case 106:if(l>=c||t[l]===void 0)break;p<m&&(u+=e.slice(p,m));var f=typeof t[l];if(f==="string"){u+="'"+t[l]+"'",p=m+2,m++;break}if(f==="function"){u+=t[l].name||"<anonymous>",p=m+2,m++;break}u+=n(t[l]),p=m+2,m++;break;case 115:if(l>=c)break;p<m&&(u+=e.slice(p,m)),u+=String(t[l]),p=m+2,m++;break;case 37:p<m&&(u+=e.slice(p,m)),u+="%",p=m+2,m++,l--;break}++l}++m}return p===-1?e:(p<d&&(u+=e.slice(p)),u)}});var zC=Ee((Xz,Xu)=>{"use strict";var jC=_C();Xu.exports=Tr;var Ms=NO().console||{},FO={mapHttpRequest:Ju,mapHttpResponse:Ju,wrapRequestSerializer:xf,wrapResponseSerializer:xf,wrapErrorSerializer:xf,req:Ju,res:Ju,err:GC,errWithCause:GC};function dn(e,t){return e==="silent"?1/0:t.levels.values[e]}var Rf=Symbol("pino.logFuncs"),Af=Symbol("pino.hierarchy"),RO={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function $C(e,t){let r={logger:t,parent:e[Af]};t[Af]=r}function bO(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Ms[o]||Ms[RO[o]||"log"]||Ia}),e[Rf]=n}function vO(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||Ms;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=vO(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=Ia),bO(u,s,r),$C({},u),Object.defineProperty(u,"levelVal",{get:p}),Object.defineProperty(u,"level",{get:d,set:m});let l={transmit:t,serialize:o,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:s,timestamp:qO(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Ia};u.levels=PO(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=Ia,u.serializers=n,u._serialize=o,u._stdErrSerialize=a,u.child=function(...y){return f.call(this,l,...y)},t&&(u._logEvent=Ff());function p(){return dn(this.level,this)}function d(){return this._level}function m(y){if(y!=="silent"&&!this.levels.values[y])throw Error("unknown level "+y);this._level=y,eo(this,l,u,"error"),eo(this,l,u,"fatal"),eo(this,l,u,"warn"),eo(this,l,u,"info"),eo(this,l,u,"debug"),eo(this,l,u,"trace"),i.forEach(S=>{eo(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),R=e.browser.serialize===!0?Object.keys(x):o;delete S.serializers,bf([S],R,x,this._stdErrSerialize)}function E(F){this._childLevel=(F._childLevel|0)+1,this.bindings=S,x&&(this.serializers=x,this._serialize=R),t&&(this._logEvent=Ff([].concat(F._logEvent.bindings,S)))}E.prototype=this;let b=new E(this);return $C(this,b),b.child=function(...F){return f.call(this,y,...F)},b.level=h.level||this.level,y.onChild(b),b}return u}function PO(e){let t=e.customLevels||{},r=Object.assign({},Tr.levels.values,t),n=Object.assign({},Tr.levels.labels,wO(t));return{values:r,labels:n}}function wO(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=FO;Tr.stdTimeFunctions=Object.assign({},{nullTime:WC,epochTime:HC,unixTime:DO,isoTime:VO});function IO(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Af];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function eo(e,t,r,n){if(Object.defineProperty(e,n,{value:dn(e.level,r)>dn(n,r)?Ia:r[Rf][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Ia){if(!t.transmit)return;let a=t.transmit.level||e.level,i=dn(a,r);if(dn(n,r)<i)return}e[n]=TO(e,t,r,n);let o=IO(e);o.length!==0&&(e[n]=EO(o,e[n]))}function EO(e,t){return function(){return t.apply(this,[...e,...arguments])}}function TO(e,t,r,n){return function(o){return function(){let i=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ms?Ms:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var l=!1;if(t.serialize&&(bf(s,this._serialize,this.serializers,this._stdErrSerialize),l=!0),t.asObject||t.formatters?o.call(c,OO(this,n,s,i,t)):o.apply(c,s),t.transmit){let p=t.transmit.level||e._level,d=dn(p,r),m=dn(n,r);if(m<d)return;kO(this,{ts:i,methodLevel:n,methodValue:m,transmitLevel:p,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:dn(e._level,r)},s,l)}}}(e[Rf][n])}function OO(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?jC(s.shift(),s):void 0}else typeof c=="string"&&(c=jC(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),i(u)}function bf(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 kO(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||bf(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=Ff(u)}function Ff(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function GC(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 qO(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?WC:HC}function Ju(){return{}}function xf(e){return e}function Ia(){}function WC(){return!1}function HC(){return Date.now()}function DO(){return Math.round(Date.now()/1e3)}function VO(){return new Date(Date.now()).toISOString()}function NO(){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)||{}}}Xu.exports.default=Tr;Xu.exports.pino=Tr});var Gg={};Lb(Gg,{escape:()=>vo,getHighlightedSuggestion:()=>bp,highlightString:()=>jb});import{isNullOrUndefined as _b}from"@coveo/bueno";var Br=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Sc(e){return Array.isArray(e)}function hc(e){return e.trim()===""}function Ug(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function Bb(e){return btoa(encodeURI(e))}function yc(e,t){let{[e]:r,...n}=t;return n}function bo(e){return Bb(JSON.stringify(e))}var Ub=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=>Ub.has(r))}function jg(e){let t={};for(let[r,n]of e)t[r]=n;return t}function $g(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Li(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function jb(e){if(hc(e.openingDelimiter)||hc(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(_b(e.content)||hc(e.content))return e.content;if(e.highlights.length===0)return vo(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+=vo(e.content.slice(n,i)),r+=e.openingDelimiter,r+=vo(e.content.slice(i,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=vo(e.content.slice(n))),r}function bp(e,t){return e=vo(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 vo(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 Hg(e,t){let r=e.getReader(),n;for(;!(n=await r.read()).done;)t(n.value)}function zg(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=$b(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;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 Kg(e,t,r){let n=Wg(),o=new TextDecoder;return function(i,s){if(i.length===0)r?.(n),n=Wg();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":let p=parseInt(l,10);isNaN(p)||t(n.retry=p);break}}}}function $b(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Wg(){return{data:"",event:"",id:"",retry:void 0}}var Gb=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(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},Cc="text/event-stream",Wb=1e3,Yg="last-event-id";function Jg(){typeof window<"u"}function Qi(e,t){var{signal:r,headers:n,onopen:o,onmessage:a,onclose:i,onerror:s,openWhenHidden:c,fetch:u}=t,l=Gb(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,d)=>{let m=Object.assign({},n);m.accept||(m.accept=Cc);let f;function y(){f?.abort(),document.hidden||E()}!c&&Jg()&&document.addEventListener("visibilitychange",y);let S=Wb,h=0;function g(){Jg()&&document.removeEventListener("visibilitychange",y),clearTimeout(h),f?.abort()}r?.addEventListener("abort",()=>{g(),p()});let x=u??x,R=o??Hb;async function E(){var b;f=typeof AbortController>"u"?null:new AbortController;try{let F=await x(e,Object.assign(Object.assign({},l),{headers:m,signal:f?.signal}));await R(F),await Hg(F.body,zg(Kg(I=>{I?m[Yg]=I:delete m[Yg]},I=>{S=I},a))),i?.(),g(),p()}catch(F){if(!f?.signal.aborted)try{let I=(b=s?.(F))!==null&&b!==void 0?b:S;clearTimeout(h),h=setTimeout(E,I)}catch(I){g(),d(I)}}}E()})}function Hb(e){let t=e.headers.get("content-type");if(!t?.startsWith(Cc))throw new Error(`Expected content-type to be ${Cc}, 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 zb=(e,t,r)=>new Ur(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Xg=3,Kb=5e3,Yb="text/event-stream",wp=1,vp=class extends Error{},Bi=class extends Error{constructor(r){super(r.message);this.payload=r}},Pp=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)}},xc=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,p=new Pp;if(!a){this.logger.error("No stream ID found");return}let d=0,m,f=()=>{m&&!p.isActive(m)&&(S?.abort(),l(),h())},y=()=>{p.remove(m),m=$g(f,m,Kb),p.add(m)},S=new AbortController,h=()=>Qi(zb(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")===Yb)return;throw g.status>=400&&g.status<500&&g.status!==429?new Bi({message:"Error opening stream",code:g.status}):new vp},onmessage:g=>{if(S?.signal.aborted)return;let x=JSON.parse(g.data);if(x.finishReason==="ERROR"){p.remove(m),S?.abort(),c({message:x.errorMessage,code:x.statusCode});return}s(x),d=0,x.finishReason==="COMPLETED"?(p.remove(m),u()):y()},onerror:g=>{if(!S?.signal.aborted){if(p.remove(m),g instanceof Bi)throw S?.abort(),c(g),g;if(++d>Xg){this.logger.info("Maximum retry exceeded.");let x={message:"Failed to complete stream.",code:wp};throw S?.abort(),c(x),new Bi(x)}this.logger.info(`Retrying...(${d}/${Xg})`),l()}}});return h(),S}};var lS=Ot(iS(),1);var Fv="recommendation-internal-options",S0=Symbol.for(Fv);var V=new Error("Failed to load reducers."),Po=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var Un=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 sS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function cS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Rv)}function Rv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function uS(e){return e===429}var nt=class e{static async call(t){let r=bv(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(uS(c.status))throw c;return c};try{let c=await(0,lS.backOff)(s,{retry:u=>{let l=u&&uS(u.status);return l&&n.info("Platform retrying request"),l}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Po;case 404:throw new Un(a,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Un(a):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:s,...c}=t,u=Li(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 qe(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`${qe(e,t)}/rest/search/v2`}function Np(e,t="prod"){return`${qe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function bv(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,s=e.method==="POST"||e.method==="PUT",c=vv(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:c},signal:i}}function vv(e,t){return t==="application/x-www-form-urlencoded"?cS(e)?sS(e):"":JSON.stringify(e)}var Fc=e=>e;var dS=e=>e,pS=e=>e,mS=e=>e;import{isNullOrUndefined as Dv}from"@coveo/bueno";function wo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ke(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:wo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:wo(),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?Pv(e):wv(t)},Pv=e=>Ev(e)?Tv(e):Iv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},wv=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Iv(e){return e.body.statusCode!==void 0}function Ev(e){return e.body.exception!==void 0}var Tv=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 fS(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 gS=(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.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},SS=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=fS(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return Ov(i)?{success:i}:{error:jr({response:r,body:i})}};function Ov(e){return typeof e=="string"}function kv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function qv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ji(e,t){if(t&&e.name==="AbortError")return{error:qv(e)};if(e instanceof Un)return{error:kv(e)};throw e}var Rc=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 ji(r);let n=await r.json();return Nv(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 ji(r);let n=await r.json(),o={response:r,body:n};return Vv(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 ji(o,r?.disableAbortWarning);let a=await o.json(),i={response:o,body:a};return hS(a)?(i.body=yS(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(hS(n)){let o={response:r,body:n};return o.body=yS(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:jr({response:r,body:n})}}async html(t){return SS(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 Mv(n)?{success:n}:{error:jr({response:r,body:n})}}},bc=e=>e.success!==void 0,Fe=e=>e.error!==void 0;function hS(e){return e.results!==void 0}function yS(e){let t=wo();return Dv(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Vv(e){return e.completions!==void 0}function Nv(e){return e.preprocessingOutput!==void 0}function Mv(e){return e.fields!==void 0}import{Schema as Lv,SchemaValidationError as Qv,StringValue as $i,RecordValue as Bv,ArrayValue as Uv}from"@coveo/bueno";var q=new $i({required:!0,emptyAllowed:!1}),ce=new $i({required:!1,emptyAllowed:!1}),ne=new $i({required:!0,emptyAllowed:!0}),CS=new $i({required:!1,emptyAllowed:!0}),vc=new Uv({each:q,required:!0}),xS=new $i({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 Lv({value:t}).validate({value:e}).value};let o=new Bv({options:{required:!0},values:t}).validate(e);if(o)throw new Qv(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 AS(e,t,r,o,"Controller initialization error")},ie=(e,t,r,n)=>{let o=`Check the options of ${n}`;return AS(e,t,r,o,"Controller initialization error")},AS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};import{isNullOrUndefined as Tm,RecordValue as DI,Schema as VI,StringValue as eu}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 _v=typeof Symbol=="function"&&Symbol.observable||"@@observable",FS=_v,Mp=()=>Math.random().toString(36).substring(7).split("").join("."),jv={INIT:`@@redux/INIT${Mp()}`,REPLACE:`@@redux/REPLACE${Mp()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Mp()}`},Pc=jv;function kt(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 Lp(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(Lp)(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 p(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(!kt(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 m(S){if(typeof S!="function")throw new Error(Te(10));n=S,d({type:Pc.REPLACE})}function f(){let S=p;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Te(11));function g(){let R=h;R.next&&R.next(l())}return g(),{unsubscribe:S(g)}},[FS](){return this}}}return d({type:Pc.INIT}),{dispatch:d,subscribe:p,getState:l,replaceReducer:m,[FS]:f}}function $v(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Pc.INIT})>"u")throw new Error(Te(12));if(typeof r(void 0,{type:Pc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Te(13))})}function Io(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{$v(r)}catch(i){a=i}return function(s={},c){if(a)throw a;let u=!1,l={};for(let p=0;p<n.length;p++){let d=n[p],m=r[d],f=s[d],y=m(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 Eo(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function RS(...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=Eo(...s)(o.dispatch),{...o,dispatch:a}}}function wc(e){return kt(e)&&"type"in e&&typeof e.type=="string"}var zp=Symbol.for("immer-nothing"),Gi=Symbol.for("immer-draftable"),Ue=Symbol.for("immer-state");function Oe(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var jn=Object.getPrototypeOf;function Ye(e){return!!e&&!!e[Ue]}function _e(e){return e?IS(e)||Array.isArray(e)||!!e[Gi]||!!e.constructor?.[Gi]||Yi(e)||Ji(e):!1}var Gv=Object.prototype.constructor.toString();function IS(e){if(!e||typeof e!="object")return!1;let t=jn(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)===Gv}function Kp(e){return Ye(e)||Oe(15,e),e[Ue].base_}function Wi(e,t){$n(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function $n(e){let t=e[Ue];return t?t.type_:Array.isArray(e)?1:Yi(e)?2:Ji(e)?3:0}function Hi(e,t){return $n(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Qp(e,t){return $n(e)===2?e.get(t):e[t]}function ES(e,t,r){let n=$n(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Wv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Yi(e){return e instanceof Map}function Ji(e){return e instanceof Set}function _n(e){return e.copy_||e.base_}function _p(e,t){if(Yi(e))return new Map(e);if(Ji(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=IS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ue];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(jn(e),n)}else{let n=jn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Tc(e,t=!1){return Oc(e)||Ye(e)||!_e(e)||($n(e)>1&&(e.set=e.add=e.clear=e.delete=Hv),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Tc(n,!0))),e}function Hv(){Oe(2)}function Oc(e){return Object.isFrozen(e)}var jp={};function Gn(e){let t=jp[e];return t||Oe(0,e),t}function zv(e,t){jp[e]||(jp[e]=t)}var zi;function TS(){return zi}function Kv(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function bS(e,t){t&&(Gn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function $p(e){Gp(e),e.drafts_.forEach(Yv),e.drafts_=null}function Gp(e){e===zi&&(zi=e.parent_)}function vS(e){return zi=Kv(zi,e)}function Yv(e){let t=e[Ue];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function PS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ue].modified_&&($p(t),Oe(4)),_e(e)&&(e=Ic(t,e),t.parent_||Ec(t,e)),t.patches_&&Gn("Patches").generateReplacementPatches_(r[Ue].base_,e,t.patches_,t.inversePatches_)):e=Ic(t,r,[]),$p(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==zp?e:void 0}function Ic(e,t,r){if(Oc(t))return t;let n=t[Ue];if(!n)return Wi(t,(o,a)=>wS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Ec(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),Wi(a,(s,c)=>wS(e,n,o,s,c,r,i)),Ec(e,o,!1),r&&e.patches_&&Gn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function wS(e,t,r,n,o,a,i){if(Ye(o)){let s=a&&t&&t.type_!==3&&!Hi(t.assigned_,n)?a.concat(n):void 0,c=Ic(e,o,s);if(ES(r,n,c),Ye(c))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(_e(o)&&!Oc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ic(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Ec(e,o)}}function Ec(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tc(t,r)}function Jv(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:TS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Yp;r&&(o=[n],a=Ki);let{revoke:i,proxy:s}=Proxy.revocable(o,a);return n.draft_=s,n.revoke_=i,s}var Yp={get(e,t){if(t===Ue)return e;let r=_n(e);if(!Hi(r,t))return Xv(e,r,t);let n=r[t];return e.finalized_||!_e(n)?n:n===Bp(e.base_,t)?(Up(e),e.copy_[t]=Hp(n,e)):n},has(e,t){return t in _n(e)},ownKeys(e){return Reflect.ownKeys(_n(e))},set(e,t,r){let n=OS(_n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Bp(_n(e),t),a=o?.[Ue];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Wv(r,o)&&(r!==void 0||Hi(e.base_,t)))return!0;Up(e),Wp(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 Bp(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Up(e),Wp(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(){Oe(11)},getPrototypeOf(e){return jn(e.base_)},setPrototypeOf(){Oe(12)}},Ki={};Wi(Yp,(e,t)=>{Ki[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ki.deleteProperty=function(e,t){return Ki.set.call(this,e,t,void 0)};Ki.set=function(e,t,r){return Yp.set.call(this,e[0],t,r,e[0])};function Bp(e,t){let r=e[Ue];return(r?_n(r):e)[t]}function Xv(e,t,r){let n=OS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function OS(e,t){if(!(t in e))return;let r=jn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=jn(r)}}function Wp(e){e.modified_||(e.modified_=!0,e.parent_&&Wp(e.parent_))}function Up(e){e.copy_||(e.copy_=_p(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Zv=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"&&Oe(6),n!==void 0&&typeof n!="function"&&Oe(7);let o;if(_e(t)){let a=vS(this),i=Hp(t,void 0),s=!0;try{o=r(i),s=!1}finally{s?$p(a):Gp(a)}return bS(a,n),PS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===zp&&(o=void 0),this.autoFreeze_&&Tc(o,!0),n){let a=[],i=[];Gn("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else Oe(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){_e(e)||Oe(8),Ye(e)&&(e=kS(e));let t=vS(this),r=Hp(e,void 0);return r[Ue].isManual_=!0,Gp(t),r}finishDraft(e,t){let r=e&&e[Ue];(!r||!r.isManual_)&&Oe(9);let{scope_:n}=r;return bS(n,t),PS(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=Gn("Patches").applyPatches_;return Ye(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Hp(e,t){let r=Yi(e)?Gn("MapSet").proxyMap_(e,t):Ji(e)?Gn("MapSet").proxySet_(e,t):Jv(e,t);return(t?t.scope_:TS()).drafts_.push(r),r}function kS(e){return Ye(e)||Oe(10,e),qS(e)}function qS(e){if(!_e(e)||Oc(e))return e;let t=e[Ue],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=_p(e,t.scope_.immer_.useStrictShallowCopy_)}else r=_p(e,!0);return Wi(r,(n,o)=>{ES(r,n,qS(o))}),t&&(t.finalized_=!1),r}function DS(){let t="replace",r="add",n="remove";function o(d,m,f,y){switch(d.type_){case 0:case 2:return i(d,m,f,y);case 1:return a(d,m,f,y);case 3:return s(d,m,f,y)}}function a(d,m,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 R=m.concat([x]);f.push({op:t,path:R,value:p(g[x])}),y.push({op:t,path:R,value:p(S[x])})}for(let x=S.length;x<g.length;x++){let R=m.concat([x]);f.push({op:r,path:R,value:p(g[x])})}for(let x=g.length-1;S.length<=x;--x){let R=m.concat([x]);y.push({op:n,path:R})}}function i(d,m,f,y){let{base_:S,copy_:h}=d;Wi(d.assigned_,(g,x)=>{let R=Qp(S,g),E=Qp(h,g),b=x?Hi(S,g)?t:r:n;if(R===E&&b===t)return;let F=m.concat(g);f.push(b===n?{op:b,path:F}:{op:b,path:F,value:E}),y.push(b===r?{op:n,path:F}:b===n?{op:r,path:F,value:p(R)}:{op:t,path:F,value:p(R)})})}function s(d,m,f,y){let{base_:S,copy_:h}=d,g=0;S.forEach(x=>{if(!h.has(x)){let R=m.concat([g]);f.push({op:n,path:R,value:x}),y.unshift({op:r,path:R,value:x})}g++}),g=0,h.forEach(x=>{if(!S.has(x)){let R=m.concat([g]);f.push({op:r,path:R,value:x}),y.unshift({op:n,path:R,value:x})}g++})}function c(d,m,f,y){f.push({op:t,path:[],value:m===zp?void 0:m}),y.push({op:t,path:[],value:d})}function u(d,m){return m.forEach(f=>{let{path:y,op:S}=f,h=d;for(let E=0;E<y.length-1;E++){let b=$n(h),F=y[E];typeof F!="string"&&typeof F!="number"&&(F=""+F),(b===0||b===1)&&(F==="__proto__"||F==="constructor")&&Oe(19),typeof h=="function"&&F==="prototype"&&Oe(19),h=Qp(h,F),typeof h!="object"&&Oe(18,y.join("/"))}let g=$n(h),x=l(f.value),R=y[y.length-1];switch(S){case t:switch(g){case 2:return h.set(R,x);case 3:Oe(16);default:return h[R]=x}case r:switch(g){case 1:return R==="-"?h.push(x):h.splice(R,0,x);case 2:return h.set(R,x);case 3:return h.add(x);default:return h[R]=x}case n:switch(g){case 1:return h.splice(R,1);case 2:return h.delete(R);case 3:return h.delete(f.value);default:return delete h[R]}default:Oe(17,S)}}),d}function l(d){if(!_e(d))return d;if(Array.isArray(d))return d.map(l);if(Yi(d))return new Map(Array.from(d.entries()).map(([f,y])=>[f,l(y)]));if(Ji(d))return new Set(Array.from(d).map(l));let m=Object.create(jn(d));for(let f in d)m[f]=l(d[f]);return Hi(d,Gi)&&(m[Gi]=d[Gi]),m}function p(d){return Ye(d)?l(d):d}zv("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var Je=new Zv,Rr=Je.produce,kc=Je.produceWithPatches.bind(Je),sB=Je.setAutoFreeze.bind(Je),cB=Je.setUseStrictShallowCopy.bind(Je),Jp=Je.applyPatches.bind(Je),uB=Je.createDraft.bind(Je),lB=Je.finishDraft.bind(Je);function eP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function tP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function rP(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 VS=e=>Array.isArray(e)?e:[e];function nP(e){let t=Array.isArray(e[0])?e[0]:e;return rP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function oP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var mB=Symbol();var fB=Object.getPrototypeOf({});var aP=class{constructor(e){this.value=e}deref(){return this.value}},iP=typeof WeakRef<"u"?WeakRef:aP,sP=0,NS=1;function qc(){return{s:sP,v:void 0,o:null,p:null}}function To(e,t={}){let r=qc(),{resultEqualityCheck:n}=t,o,a=0;function i(){let s=r,{length:c}=arguments;for(let p=0,d=c;p<d;p++){let m=arguments[p];if(typeof m=="function"||typeof m=="object"&&m!==null){let f=s.o;f===null&&(s.o=f=new WeakMap);let y=f.get(m);y===void 0?(s=qc(),f.set(m,s)):s=y}else{let f=s.p;f===null&&(s.p=f=new Map);let y=f.get(m);y===void 0?(s=qc(),f.set(m,s)):s=y}}let u=s,l;if(s.s===NS)l=s.v;else if(l=e.apply(null,arguments),a++,n){let p=o?.deref?.()??o;p!=null&&n(p,l)&&(l=p,a!==0&&a--),o=typeof l=="object"&&l!==null||typeof l=="function"?new iP(l):l}return u.s=NS,u.v=l,l}return i.clearCache=()=>{r=qc(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function MS(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()),eP(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let l={...r,...c},{memoize:p,memoizeOptions:d=[],argsMemoize:m=To,argsMemoizeOptions:f=[],devModeChecks:y={}}=l,S=VS(d),h=VS(f),g=nP(o),x=p(function(){return a++,u.apply(null,arguments)},...S),R=!0,E=m(function(){i++;let F=oP(g,arguments);return s=x.apply(null,F),s},...h);return Object.assign(E,{resultFunc:u,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:p,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var Y=MS(To),cP=Object.assign((e,t=Y)=>{tP(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:()=>cP});function LS(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var QS=LS(),BS=LS;var uP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Eo:Eo.apply(null,arguments)},bB=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},lP=e=>e&&typeof e.match=="function";function C(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(xt(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=>wc(n)&&n.type===e,r}var GS=class Xi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Xi.prototype)}static get[Symbol.species](){return Xi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Xi(...t[0].concat(this)):new Xi(...t.concat(this))}};function US(e){return _e(e)?Rr(e,()=>{}):e}function _S(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function dP(e){return typeof e=="boolean"}var pP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new GS;return r&&(dP(r)?i.push(QS):i.push(BS(r.extraArgument))),i},Gr="RTK_autoBatch",ko=()=>e=>({payload:e,meta:{[Gr]:!0}}),jS=e=>t=>{setTimeout(t,e)},mP=(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:jS(10):e.type==="callback"?e.queueNotification:jS(e.timeout),u=()=>{i=!1,a&&(a=!1,s.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){let p=()=>o&&l(),d=n.subscribe(p);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}}})},fP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new GS(e);return n&&o.push(mP(typeof n=="object"?n:void 0)),o};function WS(e){let t=pP(),{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(kt(r))s=Io(r);else throw new Error(xt(1));let c;typeof n=="function"?c=n(t):c=t();let u=Eo;o&&(u=uP({trace:!1,...typeof o=="object"&&o}));let l=RS(...c),p=fP(l),d=typeof i=="function"?i(p):p(),m=u(...d);return Lp(s,a,m)}function HS(e){let t={},r=[],n,o={addCase(a,i){let s=typeof a=="string"?a:a.type;if(!s)throw new Error(xt(28));if(s in t)throw new Error(xt(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 gP(e){return typeof e=="function"}function U(e,t){let[r,n,o]=HS(t),a;if(gP(e))a=()=>US(e());else{let s=US(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,p)=>{if(p)if(Ye(l)){let m=p(l,c);return m===void 0?l:m}else{if(_e(l))return Rr(l,d=>p(d,c));{let d=p(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 zS=(e,t)=>lP(e)?e.match(t):e(t);function qt(...e){return t=>e.some(r=>zS(r,t))}function Oo(...e){return t=>e.every(r=>zS(r,t))}function Vc(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 Zi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Nc(...e){return e.length===0?t=>Vc(t,["pending"]):Zi(e)?qt(...e.map(t=>t.pending)):Nc()(e[0])}function Wn(...e){return e.length===0?t=>Vc(t,["rejected"]):Zi(e)?qt(...e.map(t=>t.rejected)):Wn()(e[0])}function es(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Oo(Wn(...e),t):Zi(e)?Oo(Wn(...e),t):es()(e[0])}function br(...e){return e.length===0?t=>Vc(t,["fulfilled"]):Zi(e)?qt(...e.map(t=>t.fulfilled)):br()(e[0])}function Mc(...e){return e.length===0?t=>Vc(t,["pending","fulfilled","rejected"]):Zi(e)?qt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Mc()(e[0])}var SP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Lc=(e=21)=>{let t="",r=e;for(;r--;)t+=SP[Math.random()*64|0];return t},hP=["name","message","stack","code"],Xp=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},$S=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},yP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of hP)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,p)=>({payload:c,meta:{...p||{},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,p,d)=>({payload:p,error:(n&&n.serializeError||yP)(c||"Rejected"),meta:{...d||{},arg:l,requestId:u,rejectedWithValue:!!p,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,l,p)=>{let d=n?.idGenerator?n.idGenerator(c):Lc(),m=new AbortController,f,y;function S(g){y=g,m.abort()}let h=async function(){let g;try{let R=n?.condition?.(c,{getState:l,extra:p});if(xP(R)&&(R=await R),R===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let E=new Promise((b,F)=>{f=()=>{F({name:"AbortError",message:y||"Aborted"})},m.signal.addEventListener("abort",f)});u(a(d,c,n?.getPendingMeta?.({requestId:d,arg:c},{getState:l,extra:p}))),g=await Promise.race([E,Promise.resolve(r(c,{dispatch:u,getState:l,extra:p,requestId:d,signal:m.signal,abort:S,rejectWithValue:(b,F)=>new Xp(b,F),fulfillWithValue:(b,F)=>new $S(b,F)})).then(b=>{if(b instanceof Xp)throw b;return b instanceof $S?o(b.payload,d,c,b.meta):o(b,d,c)})])}catch(R){g=R instanceof Xp?i(null,d,c,R.payload,R.meta):i(R,d,c)}finally{f&&m.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(CP)}})}}return Object.assign(s,{pending:a,rejected:i,fulfilled:o,settled:qt(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function CP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function xP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var KS=Symbol.for("rtk-slice-createasyncthunk"),EB={[KS]:G};function AP(e,t){return`${e}/${t}`}function FP({creators:e}={}){let t=e?.asyncThunk?.[KS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(xt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(bP()):n.reducers)||{},s=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(g,x){let R=typeof g=="string"?g:g.type;if(!R)throw new Error(xt(12));if(R in c.sliceCaseReducersByType)throw new Error(xt(13));return c.sliceCaseReducersByType[R]=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],R={reducerName:g,type:AP(o,g),createNotation:typeof n.reducers=="function"};PP(x)?IP(R,x,u,t):vP(R,x,u)});function l(){let[g={},x=[],R=void 0]=typeof n.extraReducers=="function"?HS(n.extraReducers):[n.extraReducers],E={...g,...c.sliceCaseReducersByType};return U(n.initialState,b=>{for(let F in E)b.addCase(F,E[F]);for(let F of c.sliceMatchers)b.addMatcher(F.matcher,F.reducer);for(let F of x)b.addMatcher(F.matcher,F.reducer);R&&b.addDefaultCase(R)})}let p=g=>g,d=new Map,m;function f(g,x){return m||(m=l()),m(g,x)}function y(){return m||(m=l()),m.getInitialState()}function S(g,x=!1){function R(b){let F=b[g];return typeof F>"u"&&x&&(F=y()),F}function E(b=p){let F=_S(d,x,()=>new WeakMap);return _S(F,b,()=>{let I={};for(let[v,N]of Object.entries(n.selectors??{}))I[v]=RP(N,b,y,x);return I})}return{reducerPath:g,getSelectors:E,get selectors(){return E(R)},selectSlice:R}}let h={name:o,reducer:f,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...S(a),injectInto(g,{reducerPath:x,...R}={}){let E=x??a;return g.inject({reducerPath:E,reducer:f},R),{...h,...S(E,!0)}}};return h}}function RP(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 Hn=FP();function bP(){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 vP({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!wP(n))throw new Error(xt(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 PP(e){return e._reducerDefinitionType==="asyncThunk"}function wP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function IP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(xt(18));let{payloadCreator:a,fulfilled:i,pending:s,rejected:c,settled:u,options:l}=r,p=o(e,a,l);n.exposeAction(t,p),i&&n.addCase(p.fulfilled,i),s&&n.addCase(p.pending,s),c&&n.addCase(p.rejected,c),u&&n.addMatcher(p.settled,u),n.exposeCaseReducer(t,{fulfilled:i||Dc,pending:s||Dc,rejected:c||Dc,settled:u||Dc})}function Dc(){}var YS="listener",JS="completed",XS="cancelled",TB=`task-${XS}`,OB=`task-${JS}`,kB=`${YS}-${XS}`,qB=`${YS}-${JS}`;var{assign:ZS}=Object;var Zp="listenerMiddleware";var EP=ZS(C(`${Zp}/add`),{withTypes:()=>EP}),DB=C(`${Zp}/removeAll`),TP=ZS(C(`${Zp}/remove`),{withTypes:()=>TP});var VB=Symbol.for("rtk-state-proxy-original");function xt(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 OP({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 kP=/^(?:[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 qP(e){return typeof e=="string"&&kP.test(e)}function DP(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&qP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var th="0.7.10";function VP(e){let{trackingId:t}=e;return{trackingId:t}}function NP(e){return(e.source||[]).concat([`relay@${th}`])}function rh(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:i}=r,s=VP(t),c=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:NP(t),clientId:c,userAgent:i(),referrer:o(),location:a()})}function MP(e,t,r,n,o){return{...t,meta:rh(e,r,n,o)}}var LP="*";function QP(){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===LP)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 eh({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 BP(e){let t=eh(e);return{get:()=>t,update:r=>{t=eh({...t,...r})}}}function UP(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var em=_P();function _P(){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 jP(){return{getItem(e){return em.getItem(e)||localStorage.getItem(e)},removeItem(e){em.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),em.setItem(e,t,31556952e3)}}}function $P(){let e=document.referrer;return e===""?null:e}function GP(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(UP().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:()=>$P(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:jP()}}function WP(){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 HP(){return{getItem(){return null},removeItem(){},setItem(){}}}function zP(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:HP()}}function KP(e){return e.get().mode!=="disabled"&&YP()&&WP()?GP():zP()}function YP(){try{return typeof window=="object"}catch{return!1}}function JP(e){return{get:()=>Object.freeze(KP(e))}}function nh(e){let t=BP(e),r=QP(),n=JP(t),o=DP(n);return{emit:(a,i)=>{let s=t.get(),c=n.get(),u=MP(a,i,s,c,o);return OP({config:s,environment:c,event:u,listenerManager:r})},getMeta:a=>rh(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:th}}var zn="3.13.1-pre.cf8bb8919d",oh=["@coveo/atomic","@coveo/quantic"];var Dt=Y(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${zn}`));var qo=Y(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Dt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i)=>nh({mode:a?"emit":"disabled",url:o??Np(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 P(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(p){i(p)}}function c(l){try{u(n.throw(l))}catch(p){i(p)}}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 nm(){return typeof window<"u"}function Sm(){return typeof navigator<"u"}function Do(){return typeof document<"u"}function om(){try{return typeof localStorage<"u"}catch{return!1}}function XP(){try{return typeof sessionStorage<"u"}catch{return!1}}function yh(){return Sm()&&navigator.cookieEnabled}var ZP=[X.click,X.custom,X.search,X.view],ew=(e,t)=>ZP.indexOf(e)!==-1?Object.assign({language:Do()?document.documentElement.lang:"unknown",userAgent:Sm()?navigator.userAgent:"unknown"},t):t,ns=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?ah(t,r,a):(i=s.split("."),o=i[i.length-2]+"."+i[i.length-1],ah(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 ah(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function tw(){return om()?localStorage:yh()?new os:XP()?sessionStorage:new No}var os=class e{getItem(t){return ns.get(`${e.prefix}${t}`)}removeItem(t){ns.erase(`${e.prefix}${t}`)}setItem(t,r,n){ns.set(`${e.prefix}${t}`,r,n)}};os.prefix="coveo_";var am=class{constructor(){this.cookieStorage=new os}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)}},No=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},ts="__coveo.analytics.history",Ch=20,xh=1e3*60,Ah=75,Mo=class{constructor(t){this.store=t||tw()}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 P(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 P(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(ts);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return P(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(ts);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(ts,JSON.stringify(t.slice(0,Ch)))}catch{}}clear(){try{this.store.removeItem(ts)}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,Ah)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>xh:!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))}},Fh=Object.freeze({__proto__:null,HistoryStore:Mo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Ch,MAX_VALUE_SIZE:Ah,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:xh,STORE_KEY:ts,default:Mo}),rw=(e,t)=>P(void 0,void 0,void 0,function*(){return e===X.view?(yield nw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),nw=e=>P(void 0,void 0,void 0,function*(){let t=new Mo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Qc,ow=new Uint8Array(16);function aw(){if(!Qc&&(Qc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qc(ow)}var iw=/^(?:[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 Uc(e){return typeof e=="string"&&iw.test(e)}var ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));function Rh(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}function sw(e){if(!Uc(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 cw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var uw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",lw="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function dw(e,t,r){function n(o,a,i,s){var c;if(typeof o=="string"&&(o=cw(o)),typeof a=="string"&&(a=sw(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 Rh(u)}try{n.name=e}catch{}return n.DNS=uw,n.URL=lw,n}var pw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ih={randomUUID:pw};function Kn(e,t,r){if(ih.randomUUID&&!t&&!e)return ih.randomUUID();e=e||{};let n=e.random||(e.rng||aw)();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 Rh(n)}function mw(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 tm(e,t){return e<<t|e>>>32-t}function fw(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 m=0;m<16;++m)s[m]=a[i][m];for(let m=16;m<80;++m)s[m]=tm(s[m-3]^s[m-8]^s[m-14]^s[m-16],1);let c=r[0],u=r[1],l=r[2],p=r[3],d=r[4];for(let m=0;m<80;++m){let f=Math.floor(m/20),y=tm(c,5)+mw(f,u,l,p)+d+t[f]+s[m]>>>0;d=p,p=l,l=tm(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]+p>>>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 gw=dw("v5",80,fw),sh=gw,bh="2.30.42",ch=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,rs={pageview:"pageview",event:"event"},_c=class{constructor({client:t,uuidGenerator:r=Kn}){this.client=t,this.uuidGenerator=r}},im=class extends _c{constructor({client:t,uuidGenerator:r=Kn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ch(window.location),this.lastReferrer=Do()?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:Do()?document.title:"",encoding:Do()?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===rs.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===rs.pageview?this.nextPageViewId:this.pageViewId,referrer:t===rs.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===rs.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 ch(window.location)}},Wr=class e{constructor(t,r){if(!Uc(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 Uc(a)?new e(a,Number.parseInt(o)*1e3):null}};Wr.cvo_cid="cvo_cid";Wr.expirationTime=120;var sm=class extends _c{constructor({client:t,uuidGenerator:r=Kn}){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 P(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(Wr.cvo_cid,new Wr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};sm.Id="link";var at=Object.keys;function Bc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var rm=128,vh=192,uh=224,lh=240;function Sw(e){return(e&248)===lh?4:(e&lh)===uh?3:(e&uh)===vh?2:1}function hw(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&rm)!=rm)break;if(r-=3,(n&vh)!=rm){t-r>=Sw(n)*3&&(r=t);break}}return e.substring(0,r)}var cm={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"},yw=at(cm).map(e=>cm[e]),Cw=[...yw].join("|"),xw=new RegExp(`^(${Cw}$)`),Aw={svcAction:"svc_action",svcActionData:"svc_action_data"},Fw=e=>at(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=cm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Rw=e=>xw.test(e),bw=[Rw],dh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ph={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},De={action:"pa",list:"pal",listSource:"pls"},jc={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},vw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],um={id:"quoteId",affiliation:"quoteAffiliation"},lm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Pw={add:De,bookmark_add:De,bookmark_remove:De,click:De,checkout:De,checkout_option:De,detail:De,impression:De,remove:De,refund:Object.assign(Object.assign({},De),jc),purchase:Object.assign(Object.assign({},De),jc),quickview:De,quote:Object.assign(Object.assign({},De),um),review:Object.assign(Object.assign({},De),lm)},ww=at(dh).map(e=>dh[e]),Iw=at(ph).map(e=>ph[e]),Ew=at(De).map(e=>De[e]),Tw=at(jc).map(e=>jc[e]),Ow=at(lm).map(e=>lm[e]),kw=at(um).map(e=>um[e]),qw=[...ww,"custom"].join("|"),Dw=[...Iw,"custom"].join("|"),Ph="(pr[0-9]+)",wh="(il[0-9]+pi[0-9]+)",Vw=new RegExp(`^${Ph}(${qw})$`),Nw=new RegExp(`^(${wh}(${Dw}))|(il[0-9]+nm)$`),Mw=new RegExp(`^(${Ew.join("|")})$`),Lw=new RegExp(`^(${Tw.join("|")})$`),Qw=new RegExp(`^${Ph}custom$`),Bw=new RegExp(`^${wh}custom$`),Uw=new RegExp(`^(${[...vw,...Ow,...kw].join("|")})$`),_w=e=>Vw.test(e),jw=e=>Nw.test(e),$w=e=>Mw.test(e),Gw=e=>Lw.test(e),Ww=e=>Uw.test(e),Hw=[jw,_w,$w,Gw,Ww],zw=[Qw,Bw],Kw={anonymizeIp:"aip"},Yw={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Jw={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Xw=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Zw=Object.assign(Object.assign(Object.assign(Object.assign({},Kw),Yw),Jw),Xw.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),dm=Object.assign(Object.assign({},Zw),Aw),eI=e=>{let t=!!e.action&&Pw[e.action]||{};return at(e).reduce((r,n)=>{let o=t[n]||dm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},tI=at(dm).map(e=>dm[e]),rI=e=>tI.indexOf(e)!==-1,nI=e=>e==="custom",oI=e=>[...Hw,...bw,rI,nI].some(t=>t(e)),aI=e=>at(e).reduce((t,r)=>{let n=iI(r);return n?Object.assign(Object.assign({},t),sI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),iI=e=>{let t;return[...zw].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},sI=(e,t)=>at(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),pm=class{constructor(t){this.opts=t}sendEvent(t,r){return P(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 P(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 P(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}},mm=class{sendEvent(t,r){return P(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return P(this,void 0,void 0,function*(){return Promise.resolve()})}},mh=globalThis.fetch,$c=class{constructor(t){this.opts=t}sendEvent(t,r){return P(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"]),p;try{p=yield mh(u,l)}catch(d){console.error("An error has occured when sending the event.",d);return}if(p.ok){let d=yield p.json();return d.visitorId&&o.setCurrentVisitorId(d.visitorId),d}else{try{p.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,p,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return P(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield mh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return P(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"})}},fm=class{constructor(t,r){om()&&yh()?this.storage=new am:om()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new No),this.client=new $c(t),this.beaconClient=new pm(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}},gm=class{constructor(t,r){this.storage=r||new No,this.client=new $c(t)}getClientDependingOnEventType(t){return this.client}},Gc=class{constructor(){this.storage=new No,this.client=new mm}getClientDependingOnEventType(t){return this.client}},cI="xx",uI=e=>e?.startsWith(cI)||!1,lI=`
19
+ `+l:l;break;case"event":n.event=l;break;case"id":e(n.id=l);break;case"retry":let p=parseInt(l,10);isNaN(p)||t(n.retry=p);break}}}}function $b(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Wg(){return{data:"",event:"",id:"",retry:void 0}}var Gb=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(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},Cc="text/event-stream",Wb=1e3,Yg="last-event-id";function Jg(){typeof window<"u"}function Qi(e,t){var{signal:r,headers:n,onopen:o,onmessage:a,onclose:i,onerror:s,openWhenHidden:c,fetch:u}=t,l=Gb(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,d)=>{let m=Object.assign({},n);m.accept||(m.accept=Cc);let f;function y(){f?.abort(),document.hidden||E()}!c&&Jg()&&document.addEventListener("visibilitychange",y);let S=Wb,h=0;function g(){Jg()&&document.removeEventListener("visibilitychange",y),clearTimeout(h),f?.abort()}r?.addEventListener("abort",()=>{g(),p()});let x=u??x,R=o??Hb;async function E(){var b;f=typeof AbortController>"u"?null:new AbortController;try{let F=await x(e,Object.assign(Object.assign({},l),{headers:m,signal:f?.signal}));await R(F),await Hg(F.body,zg(Kg(I=>{I?m[Yg]=I:delete m[Yg]},I=>{S=I},a))),i?.(),g(),p()}catch(F){if(!f?.signal.aborted)try{let I=(b=s?.(F))!==null&&b!==void 0?b:S;clearTimeout(h),h=setTimeout(E,I)}catch(I){g(),d(I)}}}E()})}function Hb(e){let t=e.headers.get("content-type");if(!t?.startsWith(Cc))throw new Error(`Expected content-type to be ${Cc}, 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 zb=(e,t,r)=>new Ur(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Xg=3,Kb=5e3,Yb="text/event-stream",wp=1,vp=class extends Error{},Bi=class extends Error{constructor(r){super(r.message);this.payload=r}},Pp=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)}},xc=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,p=new Pp;if(!a){this.logger.error("No stream ID found");return}let d=0,m,f=()=>{m&&!p.isActive(m)&&(S?.abort(),l(),h())},y=()=>{p.remove(m),m=$g(f,m,Kb),p.add(m)},S=new AbortController,h=()=>Qi(zb(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")===Yb)return;throw g.status>=400&&g.status<500&&g.status!==429?new Bi({message:"Error opening stream",code:g.status}):new vp},onmessage:g=>{if(S?.signal.aborted)return;let x=JSON.parse(g.data);if(x.finishReason==="ERROR"){p.remove(m),S?.abort(),c({message:x.errorMessage,code:x.statusCode});return}s(x),d=0,x.finishReason==="COMPLETED"?(p.remove(m),u()):y()},onerror:g=>{if(!S?.signal.aborted){if(p.remove(m),g instanceof Bi)throw S?.abort(),c(g),g;if(++d>Xg){this.logger.info("Maximum retry exceeded.");let x={message:"Failed to complete stream.",code:wp};throw S?.abort(),c(x),new Bi(x)}this.logger.info(`Retrying...(${d}/${Xg})`),l()}}});return h(),S}};var lS=Ot(iS(),1);var Fv="recommendation-internal-options",S0=Symbol.for(Fv);var V=new Error("Failed to load reducers."),Po=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var Un=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 sS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function cS(e){return typeof e!="object"||!e?!1:Object.values(e).every(Rv)}function Rv(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function uS(e){return e===429}var nt=class e{static async call(t){let r=bv(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(uS(c.status))throw c;return c};try{let c=await(0,lS.backOff)(s,{retry:u=>{let l=u&&uS(u.status);return l&&n.info("Platform retrying request"),l}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Po;case 404:throw new Un(a,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Un(a):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:s,...c}=t,u=Li(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 qe(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`${qe(e,t)}/rest/search/v2`}function Np(e,t="prod"){return`${qe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function bv(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,s=e.method==="POST"||e.method==="PUT",c=vv(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:c},signal:i}}function vv(e,t){return t==="application/x-www-form-urlencoded"?cS(e)?sS(e):"":JSON.stringify(e)}var Fc=e=>e;var dS=e=>e,pS=e=>e,mS=e=>e;import{isNullOrUndefined as Dv}from"@coveo/bueno";function wo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ke(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:wo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:wo(),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?Pv(e):wv(t)},Pv=e=>Ev(e)?Tv(e):Iv(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},wv=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Iv(e){return e.body.statusCode!==void 0}function Ev(e){return e.body.exception!==void 0}var Tv=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 fS(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 gS=(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.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},SS=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=fS(r),o=await r.arrayBuffer(),i=new TextDecoder(n).decode(o);return Ov(i)?{success:i}:{error:jr({response:r,body:i})}};function Ov(e){return typeof e=="string"}function kv(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function qv(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ji(e,t){if(t&&e.name==="AbortError")return{error:qv(e)};if(e instanceof Un)return{error:kv(e)};throw e}var Rc=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 ji(r);let n=await r.json();return Nv(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 ji(r);let n=await r.json(),o={response:r,body:n};return Vv(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 ji(o,r?.disableAbortWarning);let a=await o.json(),i={response:o,body:a};return hS(a)?(i.body=yS(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(hS(n)){let o={response:r,body:n};return o.body=yS(n),{success:(await this.options.postprocessSearchResponseMiddleware(o)).body}}return{error:jr({response:r,body:n})}}async html(t){return SS(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 Mv(n)?{success:n}:{error:jr({response:r,body:n})}}},bc=e=>e.success!==void 0,Fe=e=>e.error!==void 0;function hS(e){return e.results!==void 0}function yS(e){let t=wo();return Dv(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Vv(e){return e.completions!==void 0}function Nv(e){return e.preprocessingOutput!==void 0}function Mv(e){return e.fields!==void 0}import{Schema as Lv,SchemaValidationError as Qv,StringValue as $i,RecordValue as Bv,ArrayValue as Uv}from"@coveo/bueno";var q=new $i({required:!0,emptyAllowed:!1}),ce=new $i({required:!1,emptyAllowed:!1}),ne=new $i({required:!0,emptyAllowed:!0}),CS=new $i({required:!1,emptyAllowed:!0}),vc=new Uv({each:q,required:!0}),xS=new $i({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 Lv({value:t}).validate({value:e}).value};let o=new Bv({options:{required:!0},values:t}).validate(e);if(o)throw new Qv(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 AS(e,t,r,o,"Controller initialization error")},ie=(e,t,r,n)=>{let o=`Check the options of ${n}`;return AS(e,t,r,o,"Controller initialization error")},AS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};import{isNullOrUndefined as Tm,RecordValue as DI,Schema as VI,StringValue as eu}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 _v=typeof Symbol=="function"&&Symbol.observable||"@@observable",FS=_v,Mp=()=>Math.random().toString(36).substring(7).split("").join("."),jv={INIT:`@@redux/INIT${Mp()}`,REPLACE:`@@redux/REPLACE${Mp()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Mp()}`},Pc=jv;function kt(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 Lp(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(Lp)(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 p(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(!kt(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 m(S){if(typeof S!="function")throw new Error(Te(10));n=S,d({type:Pc.REPLACE})}function f(){let S=p;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Te(11));function g(){let R=h;R.next&&R.next(l())}return g(),{unsubscribe:S(g)}},[FS](){return this}}}return d({type:Pc.INIT}),{dispatch:d,subscribe:p,getState:l,replaceReducer:m,[FS]:f}}function $v(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Pc.INIT})>"u")throw new Error(Te(12));if(typeof r(void 0,{type:Pc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Te(13))})}function Io(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{$v(r)}catch(i){a=i}return function(s={},c){if(a)throw a;let u=!1,l={};for(let p=0;p<n.length;p++){let d=n[p],m=r[d],f=s[d],y=m(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 Eo(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function RS(...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=Eo(...s)(o.dispatch),{...o,dispatch:a}}}function wc(e){return kt(e)&&"type"in e&&typeof e.type=="string"}var zp=Symbol.for("immer-nothing"),Gi=Symbol.for("immer-draftable"),Ue=Symbol.for("immer-state");function Oe(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var jn=Object.getPrototypeOf;function Ye(e){return!!e&&!!e[Ue]}function _e(e){return e?IS(e)||Array.isArray(e)||!!e[Gi]||!!e.constructor?.[Gi]||Yi(e)||Ji(e):!1}var Gv=Object.prototype.constructor.toString();function IS(e){if(!e||typeof e!="object")return!1;let t=jn(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)===Gv}function Kp(e){return Ye(e)||Oe(15,e),e[Ue].base_}function Wi(e,t){$n(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function $n(e){let t=e[Ue];return t?t.type_:Array.isArray(e)?1:Yi(e)?2:Ji(e)?3:0}function Hi(e,t){return $n(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Qp(e,t){return $n(e)===2?e.get(t):e[t]}function ES(e,t,r){let n=$n(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Wv(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Yi(e){return e instanceof Map}function Ji(e){return e instanceof Set}function _n(e){return e.copy_||e.base_}function _p(e,t){if(Yi(e))return new Map(e);if(Ji(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=IS(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ue];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(jn(e),n)}else{let n=jn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Tc(e,t=!1){return Oc(e)||Ye(e)||!_e(e)||($n(e)>1&&(e.set=e.add=e.clear=e.delete=Hv),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>Tc(n,!0))),e}function Hv(){Oe(2)}function Oc(e){return Object.isFrozen(e)}var jp={};function Gn(e){let t=jp[e];return t||Oe(0,e),t}function zv(e,t){jp[e]||(jp[e]=t)}var zi;function TS(){return zi}function Kv(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function bS(e,t){t&&(Gn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function $p(e){Gp(e),e.drafts_.forEach(Yv),e.drafts_=null}function Gp(e){e===zi&&(zi=e.parent_)}function vS(e){return zi=Kv(zi,e)}function Yv(e){let t=e[Ue];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function PS(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ue].modified_&&($p(t),Oe(4)),_e(e)&&(e=Ic(t,e),t.parent_||Ec(t,e)),t.patches_&&Gn("Patches").generateReplacementPatches_(r[Ue].base_,e,t.patches_,t.inversePatches_)):e=Ic(t,r,[]),$p(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==zp?e:void 0}function Ic(e,t,r){if(Oc(t))return t;let n=t[Ue];if(!n)return Wi(t,(o,a)=>wS(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Ec(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),Wi(a,(s,c)=>wS(e,n,o,s,c,r,i)),Ec(e,o,!1),r&&e.patches_&&Gn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function wS(e,t,r,n,o,a,i){if(Ye(o)){let s=a&&t&&t.type_!==3&&!Hi(t.assigned_,n)?a.concat(n):void 0,c=Ic(e,o,s);if(ES(r,n,c),Ye(c))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(_e(o)&&!Oc(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ic(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&Ec(e,o)}}function Ec(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tc(t,r)}function Jv(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:TS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Yp;r&&(o=[n],a=Ki);let{revoke:i,proxy:s}=Proxy.revocable(o,a);return n.draft_=s,n.revoke_=i,s}var Yp={get(e,t){if(t===Ue)return e;let r=_n(e);if(!Hi(r,t))return Xv(e,r,t);let n=r[t];return e.finalized_||!_e(n)?n:n===Bp(e.base_,t)?(Up(e),e.copy_[t]=Hp(n,e)):n},has(e,t){return t in _n(e)},ownKeys(e){return Reflect.ownKeys(_n(e))},set(e,t,r){let n=OS(_n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Bp(_n(e),t),a=o?.[Ue];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Wv(r,o)&&(r!==void 0||Hi(e.base_,t)))return!0;Up(e),Wp(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 Bp(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Up(e),Wp(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(){Oe(11)},getPrototypeOf(e){return jn(e.base_)},setPrototypeOf(){Oe(12)}},Ki={};Wi(Yp,(e,t)=>{Ki[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ki.deleteProperty=function(e,t){return Ki.set.call(this,e,t,void 0)};Ki.set=function(e,t,r){return Yp.set.call(this,e[0],t,r,e[0])};function Bp(e,t){let r=e[Ue];return(r?_n(r):e)[t]}function Xv(e,t,r){let n=OS(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function OS(e,t){if(!(t in e))return;let r=jn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=jn(r)}}function Wp(e){e.modified_||(e.modified_=!0,e.parent_&&Wp(e.parent_))}function Up(e){e.copy_||(e.copy_=_p(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Zv=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"&&Oe(6),n!==void 0&&typeof n!="function"&&Oe(7);let o;if(_e(t)){let a=vS(this),i=Hp(t,void 0),s=!0;try{o=r(i),s=!1}finally{s?$p(a):Gp(a)}return bS(a,n),PS(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===zp&&(o=void 0),this.autoFreeze_&&Tc(o,!0),n){let a=[],i=[];Gn("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else Oe(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){_e(e)||Oe(8),Ye(e)&&(e=kS(e));let t=vS(this),r=Hp(e,void 0);return r[Ue].isManual_=!0,Gp(t),r}finishDraft(e,t){let r=e&&e[Ue];(!r||!r.isManual_)&&Oe(9);let{scope_:n}=r;return bS(n,t),PS(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=Gn("Patches").applyPatches_;return Ye(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Hp(e,t){let r=Yi(e)?Gn("MapSet").proxyMap_(e,t):Ji(e)?Gn("MapSet").proxySet_(e,t):Jv(e,t);return(t?t.scope_:TS()).drafts_.push(r),r}function kS(e){return Ye(e)||Oe(10,e),qS(e)}function qS(e){if(!_e(e)||Oc(e))return e;let t=e[Ue],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=_p(e,t.scope_.immer_.useStrictShallowCopy_)}else r=_p(e,!0);return Wi(r,(n,o)=>{ES(r,n,qS(o))}),t&&(t.finalized_=!1),r}function DS(){let t="replace",r="add",n="remove";function o(d,m,f,y){switch(d.type_){case 0:case 2:return i(d,m,f,y);case 1:return a(d,m,f,y);case 3:return s(d,m,f,y)}}function a(d,m,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 R=m.concat([x]);f.push({op:t,path:R,value:p(g[x])}),y.push({op:t,path:R,value:p(S[x])})}for(let x=S.length;x<g.length;x++){let R=m.concat([x]);f.push({op:r,path:R,value:p(g[x])})}for(let x=g.length-1;S.length<=x;--x){let R=m.concat([x]);y.push({op:n,path:R})}}function i(d,m,f,y){let{base_:S,copy_:h}=d;Wi(d.assigned_,(g,x)=>{let R=Qp(S,g),E=Qp(h,g),b=x?Hi(S,g)?t:r:n;if(R===E&&b===t)return;let F=m.concat(g);f.push(b===n?{op:b,path:F}:{op:b,path:F,value:E}),y.push(b===r?{op:n,path:F}:b===n?{op:r,path:F,value:p(R)}:{op:t,path:F,value:p(R)})})}function s(d,m,f,y){let{base_:S,copy_:h}=d,g=0;S.forEach(x=>{if(!h.has(x)){let R=m.concat([g]);f.push({op:n,path:R,value:x}),y.unshift({op:r,path:R,value:x})}g++}),g=0,h.forEach(x=>{if(!S.has(x)){let R=m.concat([g]);f.push({op:r,path:R,value:x}),y.unshift({op:n,path:R,value:x})}g++})}function c(d,m,f,y){f.push({op:t,path:[],value:m===zp?void 0:m}),y.push({op:t,path:[],value:d})}function u(d,m){return m.forEach(f=>{let{path:y,op:S}=f,h=d;for(let E=0;E<y.length-1;E++){let b=$n(h),F=y[E];typeof F!="string"&&typeof F!="number"&&(F=""+F),(b===0||b===1)&&(F==="__proto__"||F==="constructor")&&Oe(19),typeof h=="function"&&F==="prototype"&&Oe(19),h=Qp(h,F),typeof h!="object"&&Oe(18,y.join("/"))}let g=$n(h),x=l(f.value),R=y[y.length-1];switch(S){case t:switch(g){case 2:return h.set(R,x);case 3:Oe(16);default:return h[R]=x}case r:switch(g){case 1:return R==="-"?h.push(x):h.splice(R,0,x);case 2:return h.set(R,x);case 3:return h.add(x);default:return h[R]=x}case n:switch(g){case 1:return h.splice(R,1);case 2:return h.delete(R);case 3:return h.delete(f.value);default:return delete h[R]}default:Oe(17,S)}}),d}function l(d){if(!_e(d))return d;if(Array.isArray(d))return d.map(l);if(Yi(d))return new Map(Array.from(d.entries()).map(([f,y])=>[f,l(y)]));if(Ji(d))return new Set(Array.from(d).map(l));let m=Object.create(jn(d));for(let f in d)m[f]=l(d[f]);return Hi(d,Gi)&&(m[Gi]=d[Gi]),m}function p(d){return Ye(d)?l(d):d}zv("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var Je=new Zv,Rr=Je.produce,kc=Je.produceWithPatches.bind(Je),sB=Je.setAutoFreeze.bind(Je),cB=Je.setUseStrictShallowCopy.bind(Je),Jp=Je.applyPatches.bind(Je),uB=Je.createDraft.bind(Je),lB=Je.finishDraft.bind(Je);function eP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function tP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function rP(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 VS=e=>Array.isArray(e)?e:[e];function nP(e){let t=Array.isArray(e[0])?e[0]:e;return rP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function oP(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var mB=Symbol();var fB=Object.getPrototypeOf({});var aP=class{constructor(e){this.value=e}deref(){return this.value}},iP=typeof WeakRef<"u"?WeakRef:aP,sP=0,NS=1;function qc(){return{s:sP,v:void 0,o:null,p:null}}function To(e,t={}){let r=qc(),{resultEqualityCheck:n}=t,o,a=0;function i(){let s=r,{length:c}=arguments;for(let p=0,d=c;p<d;p++){let m=arguments[p];if(typeof m=="function"||typeof m=="object"&&m!==null){let f=s.o;f===null&&(s.o=f=new WeakMap);let y=f.get(m);y===void 0?(s=qc(),f.set(m,s)):s=y}else{let f=s.p;f===null&&(s.p=f=new Map);let y=f.get(m);y===void 0?(s=qc(),f.set(m,s)):s=y}}let u=s,l;if(s.s===NS)l=s.v;else if(l=e.apply(null,arguments),a++,n){let p=o?.deref?.()??o;p!=null&&n(p,l)&&(l=p,a!==0&&a--),o=typeof l=="object"&&l!==null||typeof l=="function"?new iP(l):l}return u.s=NS,u.v=l,l}return i.clearCache=()=>{r=qc(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function MS(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()),eP(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let l={...r,...c},{memoize:p,memoizeOptions:d=[],argsMemoize:m=To,argsMemoizeOptions:f=[],devModeChecks:y={}}=l,S=VS(d),h=VS(f),g=nP(o),x=p(function(){return a++,u.apply(null,arguments)},...S),R=!0,E=m(function(){i++;let F=oP(g,arguments);return s=x.apply(null,F),s},...h);return Object.assign(E,{resultFunc:u,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:p,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var Y=MS(To),cP=Object.assign((e,t=Y)=>{tP(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:()=>cP});function LS(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var QS=LS(),BS=LS;var uP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Eo:Eo.apply(null,arguments)},bB=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},lP=e=>e&&typeof e.match=="function";function C(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(xt(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=>wc(n)&&n.type===e,r}var GS=class Xi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Xi.prototype)}static get[Symbol.species](){return Xi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Xi(...t[0].concat(this)):new Xi(...t.concat(this))}};function US(e){return _e(e)?Rr(e,()=>{}):e}function _S(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function dP(e){return typeof e=="boolean"}var pP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new GS;return r&&(dP(r)?i.push(QS):i.push(BS(r.extraArgument))),i},Gr="RTK_autoBatch",ko=()=>e=>({payload:e,meta:{[Gr]:!0}}),jS=e=>t=>{setTimeout(t,e)},mP=(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:jS(10):e.type==="callback"?e.queueNotification:jS(e.timeout),u=()=>{i=!1,a&&(a=!1,s.forEach(l=>l()))};return Object.assign({},n,{subscribe(l){let p=()=>o&&l(),d=n.subscribe(p);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}}})},fP=e=>function(r){let{autoBatch:n=!0}=r??{},o=new GS(e);return n&&o.push(mP(typeof n=="object"?n:void 0)),o};function WS(e){let t=pP(),{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(kt(r))s=Io(r);else throw new Error(xt(1));let c;typeof n=="function"?c=n(t):c=t();let u=Eo;o&&(u=uP({trace:!1,...typeof o=="object"&&o}));let l=RS(...c),p=fP(l),d=typeof i=="function"?i(p):p(),m=u(...d);return Lp(s,a,m)}function HS(e){let t={},r=[],n,o={addCase(a,i){let s=typeof a=="string"?a:a.type;if(!s)throw new Error(xt(28));if(s in t)throw new Error(xt(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 gP(e){return typeof e=="function"}function U(e,t){let[r,n,o]=HS(t),a;if(gP(e))a=()=>US(e());else{let s=US(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,p)=>{if(p)if(Ye(l)){let m=p(l,c);return m===void 0?l:m}else{if(_e(l))return Rr(l,d=>p(d,c));{let d=p(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 zS=(e,t)=>lP(e)?e.match(t):e(t);function qt(...e){return t=>e.some(r=>zS(r,t))}function Oo(...e){return t=>e.every(r=>zS(r,t))}function Vc(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 Zi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Nc(...e){return e.length===0?t=>Vc(t,["pending"]):Zi(e)?qt(...e.map(t=>t.pending)):Nc()(e[0])}function Wn(...e){return e.length===0?t=>Vc(t,["rejected"]):Zi(e)?qt(...e.map(t=>t.rejected)):Wn()(e[0])}function es(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Oo(Wn(...e),t):Zi(e)?Oo(Wn(...e),t):es()(e[0])}function br(...e){return e.length===0?t=>Vc(t,["fulfilled"]):Zi(e)?qt(...e.map(t=>t.fulfilled)):br()(e[0])}function Mc(...e){return e.length===0?t=>Vc(t,["pending","fulfilled","rejected"]):Zi(e)?qt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Mc()(e[0])}var SP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Lc=(e=21)=>{let t="",r=e;for(;r--;)t+=SP[Math.random()*64|0];return t},hP=["name","message","stack","code"],Xp=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},$S=class{constructor(e,t){pe(this,"_type");this.payload=e,this.meta=t}},yP=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of hP)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,p)=>({payload:c,meta:{...p||{},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,p,d)=>({payload:p,error:(n&&n.serializeError||yP)(c||"Rejected"),meta:{...d||{},arg:l,requestId:u,rejectedWithValue:!!p,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,l,p)=>{let d=n?.idGenerator?n.idGenerator(c):Lc(),m=new AbortController,f,y;function S(g){y=g,m.abort()}let h=async function(){let g;try{let R=n?.condition?.(c,{getState:l,extra:p});if(xP(R)&&(R=await R),R===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let E=new Promise((b,F)=>{f=()=>{F({name:"AbortError",message:y||"Aborted"})},m.signal.addEventListener("abort",f)});u(a(d,c,n?.getPendingMeta?.({requestId:d,arg:c},{getState:l,extra:p}))),g=await Promise.race([E,Promise.resolve(r(c,{dispatch:u,getState:l,extra:p,requestId:d,signal:m.signal,abort:S,rejectWithValue:(b,F)=>new Xp(b,F),fulfillWithValue:(b,F)=>new $S(b,F)})).then(b=>{if(b instanceof Xp)throw b;return b instanceof $S?o(b.payload,d,c,b.meta):o(b,d,c)})])}catch(R){g=R instanceof Xp?i(null,d,c,R.payload,R.meta):i(R,d,c)}finally{f&&m.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(CP)}})}}return Object.assign(s,{pending:a,rejected:i,fulfilled:o,settled:qt(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function CP(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function xP(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var KS=Symbol.for("rtk-slice-createasyncthunk"),EB={[KS]:G};function AP(e,t){return`${e}/${t}`}function FP({creators:e}={}){let t=e?.asyncThunk?.[KS];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(xt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(bP()):n.reducers)||{},s=Object.keys(i),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(g,x){let R=typeof g=="string"?g:g.type;if(!R)throw new Error(xt(12));if(R in c.sliceCaseReducersByType)throw new Error(xt(13));return c.sliceCaseReducersByType[R]=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],R={reducerName:g,type:AP(o,g),createNotation:typeof n.reducers=="function"};PP(x)?IP(R,x,u,t):vP(R,x,u)});function l(){let[g={},x=[],R=void 0]=typeof n.extraReducers=="function"?HS(n.extraReducers):[n.extraReducers],E={...g,...c.sliceCaseReducersByType};return U(n.initialState,b=>{for(let F in E)b.addCase(F,E[F]);for(let F of c.sliceMatchers)b.addMatcher(F.matcher,F.reducer);for(let F of x)b.addMatcher(F.matcher,F.reducer);R&&b.addDefaultCase(R)})}let p=g=>g,d=new Map,m;function f(g,x){return m||(m=l()),m(g,x)}function y(){return m||(m=l()),m.getInitialState()}function S(g,x=!1){function R(b){let F=b[g];return typeof F>"u"&&x&&(F=y()),F}function E(b=p){let F=_S(d,x,()=>new WeakMap);return _S(F,b,()=>{let I={};for(let[v,N]of Object.entries(n.selectors??{}))I[v]=RP(N,b,y,x);return I})}return{reducerPath:g,getSelectors:E,get selectors(){return E(R)},selectSlice:R}}let h={name:o,reducer:f,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...S(a),injectInto(g,{reducerPath:x,...R}={}){let E=x??a;return g.inject({reducerPath:E,reducer:f},R),{...h,...S(E,!0)}}};return h}}function RP(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 Hn=FP();function bP(){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 vP({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!wP(n))throw new Error(xt(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 PP(e){return e._reducerDefinitionType==="asyncThunk"}function wP(e){return e._reducerDefinitionType==="reducerWithPrepare"}function IP({type:e,reducerName:t},r,n,o){if(!o)throw new Error(xt(18));let{payloadCreator:a,fulfilled:i,pending:s,rejected:c,settled:u,options:l}=r,p=o(e,a,l);n.exposeAction(t,p),i&&n.addCase(p.fulfilled,i),s&&n.addCase(p.pending,s),c&&n.addCase(p.rejected,c),u&&n.addMatcher(p.settled,u),n.exposeCaseReducer(t,{fulfilled:i||Dc,pending:s||Dc,rejected:c||Dc,settled:u||Dc})}function Dc(){}var YS="listener",JS="completed",XS="cancelled",TB=`task-${XS}`,OB=`task-${JS}`,kB=`${YS}-${XS}`,qB=`${YS}-${JS}`;var{assign:ZS}=Object;var Zp="listenerMiddleware";var EP=ZS(C(`${Zp}/add`),{withTypes:()=>EP}),DB=C(`${Zp}/removeAll`),TP=ZS(C(`${Zp}/remove`),{withTypes:()=>TP});var VB=Symbol.for("rtk-state-proxy-original");function xt(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 OP({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 kP=/^(?:[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 qP(e){return typeof e=="string"&&kP.test(e)}function DP(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&qP(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var th="0.7.10";function VP(e){let{trackingId:t}=e;return{trackingId:t}}function NP(e){return(e.source||[]).concat([`relay@${th}`])}function rh(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:i}=r,s=VP(t),c=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:NP(t),clientId:c,userAgent:i(),referrer:o(),location:a()})}function MP(e,t,r,n,o){return{...t,meta:rh(e,r,n,o)}}var LP="*";function QP(){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===LP)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 eh({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 BP(e){let t=eh(e);return{get:()=>t,update:r=>{t=eh({...t,...r})}}}function UP(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}var em=_P();function _P(){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 jP(){return{getItem(e){return em.getItem(e)||localStorage.getItem(e)},removeItem(e){em.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),em.setItem(e,t,31556952e3)}}}function $P(){let e=document.referrer;return e===""?null:e}function GP(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(UP().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:()=>$P(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:jP()}}function WP(){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 HP(){return{getItem(){return null},removeItem(){},setItem(){}}}function zP(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:HP()}}function KP(e){return e.get().mode!=="disabled"&&YP()&&WP()?GP():zP()}function YP(){try{return typeof window=="object"}catch{return!1}}function JP(e){return{get:()=>Object.freeze(KP(e))}}function nh(e){let t=BP(e),r=QP(),n=JP(t),o=DP(n);return{emit:(a,i)=>{let s=t.get(),c=n.get(),u=MP(a,i,s,c,o);return OP({config:s,environment:c,event:u,listenerManager:r})},getMeta:a=>rh(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:th}}var zn="3.13.1-pre.db77dd01fb",oh=["@coveo/atomic","@coveo/quantic"];var Dt=Y(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${zn}`));var qo=Y(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Dt(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i)=>nh({mode:a?"emit":"disabled",url:o??Np(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 P(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(p){i(p)}}function c(l){try{u(n.throw(l))}catch(p){i(p)}}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 nm(){return typeof window<"u"}function Sm(){return typeof navigator<"u"}function Do(){return typeof document<"u"}function om(){try{return typeof localStorage<"u"}catch{return!1}}function XP(){try{return typeof sessionStorage<"u"}catch{return!1}}function yh(){return Sm()&&navigator.cookieEnabled}var ZP=[X.click,X.custom,X.search,X.view],ew=(e,t)=>ZP.indexOf(e)!==-1?Object.assign({language:Do()?document.documentElement.lang:"unknown",userAgent:Sm()?navigator.userAgent:"unknown"},t):t,ns=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?ah(t,r,a):(i=s.split("."),o=i[i.length-2]+"."+i[i.length-1],ah(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 ah(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function tw(){return om()?localStorage:yh()?new os:XP()?sessionStorage:new No}var os=class e{getItem(t){return ns.get(`${e.prefix}${t}`)}removeItem(t){ns.erase(`${e.prefix}${t}`)}setItem(t,r,n){ns.set(`${e.prefix}${t}`,r,n)}};os.prefix="coveo_";var am=class{constructor(){this.cookieStorage=new os}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)}},No=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},ts="__coveo.analytics.history",Ch=20,xh=1e3*60,Ah=75,Mo=class{constructor(t){this.store=t||tw()}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 P(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 P(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(ts);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return P(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(ts);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(ts,JSON.stringify(t.slice(0,Ch)))}catch{}}clear(){try{this.store.removeItem(ts)}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,Ah)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>xh:!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))}},Fh=Object.freeze({__proto__:null,HistoryStore:Mo,MAX_NUMBER_OF_HISTORY_ELEMENTS:Ch,MAX_VALUE_SIZE:Ah,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:xh,STORE_KEY:ts,default:Mo}),rw=(e,t)=>P(void 0,void 0,void 0,function*(){return e===X.view?(yield nw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),nw=e=>P(void 0,void 0,void 0,function*(){let t=new Mo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Qc,ow=new Uint8Array(16);function aw(){if(!Qc&&(Qc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qc(ow)}var iw=/^(?:[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 Uc(e){return typeof e=="string"&&iw.test(e)}var ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));function Rh(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}function sw(e){if(!Uc(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 cw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var uw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",lw="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function dw(e,t,r){function n(o,a,i,s){var c;if(typeof o=="string"&&(o=cw(o)),typeof a=="string"&&(a=sw(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 Rh(u)}try{n.name=e}catch{}return n.DNS=uw,n.URL=lw,n}var pw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ih={randomUUID:pw};function Kn(e,t,r){if(ih.randomUUID&&!t&&!e)return ih.randomUUID();e=e||{};let n=e.random||(e.rng||aw)();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 Rh(n)}function mw(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 tm(e,t){return e<<t|e>>>32-t}function fw(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 m=0;m<16;++m)s[m]=a[i][m];for(let m=16;m<80;++m)s[m]=tm(s[m-3]^s[m-8]^s[m-14]^s[m-16],1);let c=r[0],u=r[1],l=r[2],p=r[3],d=r[4];for(let m=0;m<80;++m){let f=Math.floor(m/20),y=tm(c,5)+mw(f,u,l,p)+d+t[f]+s[m]>>>0;d=p,p=l,l=tm(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]+p>>>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 gw=dw("v5",80,fw),sh=gw,bh="2.30.42",ch=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,rs={pageview:"pageview",event:"event"},_c=class{constructor({client:t,uuidGenerator:r=Kn}){this.client=t,this.uuidGenerator=r}},im=class extends _c{constructor({client:t,uuidGenerator:r=Kn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ch(window.location),this.lastReferrer=Do()?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:Do()?document.title:"",encoding:Do()?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===rs.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===rs.pageview?this.nextPageViewId:this.pageViewId,referrer:t===rs.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===rs.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 ch(window.location)}},Wr=class e{constructor(t,r){if(!Uc(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 Uc(a)?new e(a,Number.parseInt(o)*1e3):null}};Wr.cvo_cid="cvo_cid";Wr.expirationTime=120;var sm=class extends _c{constructor({client:t,uuidGenerator:r=Kn}){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 P(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(Wr.cvo_cid,new Wr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};sm.Id="link";var at=Object.keys;function Bc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var rm=128,vh=192,uh=224,lh=240;function Sw(e){return(e&248)===lh?4:(e&lh)===uh?3:(e&uh)===vh?2:1}function hw(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&rm)!=rm)break;if(r-=3,(n&vh)!=rm){t-r>=Sw(n)*3&&(r=t);break}}return e.substring(0,r)}var cm={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"},yw=at(cm).map(e=>cm[e]),Cw=[...yw].join("|"),xw=new RegExp(`^(${Cw}$)`),Aw={svcAction:"svc_action",svcActionData:"svc_action_data"},Fw=e=>at(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=cm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),Rw=e=>xw.test(e),bw=[Rw],dh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ph={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},De={action:"pa",list:"pal",listSource:"pls"},jc={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},vw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],um={id:"quoteId",affiliation:"quoteAffiliation"},lm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Pw={add:De,bookmark_add:De,bookmark_remove:De,click:De,checkout:De,checkout_option:De,detail:De,impression:De,remove:De,refund:Object.assign(Object.assign({},De),jc),purchase:Object.assign(Object.assign({},De),jc),quickview:De,quote:Object.assign(Object.assign({},De),um),review:Object.assign(Object.assign({},De),lm)},ww=at(dh).map(e=>dh[e]),Iw=at(ph).map(e=>ph[e]),Ew=at(De).map(e=>De[e]),Tw=at(jc).map(e=>jc[e]),Ow=at(lm).map(e=>lm[e]),kw=at(um).map(e=>um[e]),qw=[...ww,"custom"].join("|"),Dw=[...Iw,"custom"].join("|"),Ph="(pr[0-9]+)",wh="(il[0-9]+pi[0-9]+)",Vw=new RegExp(`^${Ph}(${qw})$`),Nw=new RegExp(`^(${wh}(${Dw}))|(il[0-9]+nm)$`),Mw=new RegExp(`^(${Ew.join("|")})$`),Lw=new RegExp(`^(${Tw.join("|")})$`),Qw=new RegExp(`^${Ph}custom$`),Bw=new RegExp(`^${wh}custom$`),Uw=new RegExp(`^(${[...vw,...Ow,...kw].join("|")})$`),_w=e=>Vw.test(e),jw=e=>Nw.test(e),$w=e=>Mw.test(e),Gw=e=>Lw.test(e),Ww=e=>Uw.test(e),Hw=[jw,_w,$w,Gw,Ww],zw=[Qw,Bw],Kw={anonymizeIp:"aip"},Yw={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Jw={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Xw=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Zw=Object.assign(Object.assign(Object.assign(Object.assign({},Kw),Yw),Jw),Xw.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),dm=Object.assign(Object.assign({},Zw),Aw),eI=e=>{let t=!!e.action&&Pw[e.action]||{};return at(e).reduce((r,n)=>{let o=t[n]||dm[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},tI=at(dm).map(e=>dm[e]),rI=e=>tI.indexOf(e)!==-1,nI=e=>e==="custom",oI=e=>[...Hw,...bw,rI,nI].some(t=>t(e)),aI=e=>at(e).reduce((t,r)=>{let n=iI(r);return n?Object.assign(Object.assign({},t),sI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),iI=e=>{let t;return[...zw].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},sI=(e,t)=>at(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),pm=class{constructor(t){this.opts=t}sendEvent(t,r){return P(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 P(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 P(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}},mm=class{sendEvent(t,r){return P(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return P(this,void 0,void 0,function*(){return Promise.resolve()})}},mh=globalThis.fetch,$c=class{constructor(t){this.opts=t}sendEvent(t,r){return P(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"]),p;try{p=yield mh(u,l)}catch(d){console.error("An error has occured when sending the event.",d);return}if(p.ok){let d=yield p.json();return d.visitorId&&o.setCurrentVisitorId(d.visitorId),d}else{try{p.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,p,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return P(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield mh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[X.click,X.custom,X.search,X.view].indexOf(t)!==-1}getVisitorIdParam(){return P(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"})}},fm=class{constructor(t,r){om()&&yh()?this.storage=new am:om()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new No),this.client=new $c(t),this.beaconClient=new pm(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}},gm=class{constructor(t,r){this.storage=r||new No,this.client=new $c(t)}getClientDependingOnEventType(t){return this.client}},Gc=class{constructor(){this.storage=new No,this.client=new mm}getClientDependingOnEventType(t){return this.client}},cI="xx",uI=e=>e?.startsWith(cI)||!1,lI=`
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